/* ==========================================================================
   transactology.dev // cyberpunk aquarium terminal
   Palette: #0A0B12 #0F1A2E #00FFCC #FF0066 #C0E8FF #FFD700 #1A1A2E #FFFFFF
   Fonts:   Orbitron (display) // Rajdhani (sub) // Share Tech Mono (data)
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --void: #0A0B12;
    --panel: #0F1A2E;
    --panel-deep: #1A1A2E;
    --mint: #00FFCC;
    --mag: #FF0066;
    --ice: #C0E8FF;
    --gold: #FFD700;
    --white: #FFFFFF;

    --frame-inset: 16px;
    --bracket-size: 60px;

    --display: 'Orbitron', 'Inter', system-ui, sans-serif;
    --sub: 'Rajdhani', 'Lora', system-ui, sans-serif;
    --mono: 'Share Tech Mono', 'Space Mono', ui-monospace, monospace;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--void);
    color: var(--ice);
    font-family: var(--mono);
    font-size: clamp(0.75rem, 1.05vw, 1rem);
    line-height: 1.6;
    position: relative;

    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(0, 255, 204, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 70%, rgba(255, 0, 102, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(192, 232, 255, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, var(--void) 0%, #050912 100%);
    background-color: var(--void);
}

/* ==========================================================================
   SCAN LINE OVERLAY
   ========================================================================== */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 255, 204, 0.035) 2px,
        rgba(0, 255, 204, 0.035) 4px
    );
    opacity: 0;
    animation: fadeIn 600ms ease 200ms forwards;
    mix-blend-mode: screen;
}

.scanlines::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 255, 204, 0.05) 50%,
        transparent 100%);
    height: 80px;
    animation: crtSweep 7s linear infinite;
}

@keyframes crtSweep {
    0%   { transform: translateY(-10vh); }
    100% { transform: translateY(110vh); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   GLITCH LAYER
   ========================================================================== */
.glitch-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: screen;
}

body.glitch-active {
    animation: glitchShift 50ms steps(2);
    filter: hue-rotate(8deg);
}

@keyframes glitchShift {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(3px, -1px); }
    100% { transform: translate(0, 0); }
}

body.glitch-active .observation-zone,
body.glitch-active .right-ticker,
body.glitch-active .left-cluster {
    text-shadow: 2px 0 #FF0066, -2px 0 #00FFCC;
}

/* ==========================================================================
   HUD FRAME / CHROME
   ========================================================================== */
.hud-frame {
    position: fixed;
    inset: var(--frame-inset);
    pointer-events: none;
    z-index: 50;
    color: var(--mint);
    border: 3px solid var(--mint);
    animation: framePulse 4s ease-in-out infinite;
    opacity: 0;
}

body.booted .hud-frame {
    animation: framePulse 4s ease-in-out infinite, fadeIn 800ms cubic-bezier(0.4, 0, 0.2, 1) 400ms forwards;
}

@keyframes framePulse {
    0%, 100% { border-color: var(--mint); box-shadow: 0 0 0 1px rgba(0, 255, 204, 0.3) inset, 0 0 20px rgba(0, 255, 204, 0.15); }
    50%      { border-color: var(--mag);  box-shadow: 0 0 0 1px rgba(255, 0, 102, 0.3) inset, 0 0 20px rgba(255, 0, 102, 0.15); }
}

.corner {
    position: absolute;
    width: var(--bracket-size);
    height: var(--bracket-size);
    color: var(--mint);
}
.corner-tl { top: -3px; left: -3px; }
.corner-tr { top: -3px; right: -3px; }
.corner-bl { bottom: -3px; left: -3px; }
.corner-br { bottom: -3px; right: -3px; }

.tick-rail {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
}
.tick-top    { top: -3px; left: 80px; right: 80px; height: 12px; }
.tick-bottom { bottom: -3px; left: 80px; right: 80px; height: 12px; }
.tick-left   { left: -3px; top: 80px; bottom: 80px; width: 12px; }
.tick-right  { right: -3px; top: 80px; bottom: 80px; width: 12px; }

.tick-track {
    height: 100%;
    width: 200%;
    display: flex;
    gap: 14px;
    align-items: center;
    color: rgba(0, 255, 204, 0.55);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    animation: tickScroll 28s linear infinite;
}

.tick-track.tick-vert {
    width: 100%;
    height: 200%;
    flex-direction: column;
    gap: 14px;
    animation: tickScrollV 28s linear infinite;
}

@keyframes tickScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes tickScrollV {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.tick {
    display: inline-block;
    border-left: 1px solid rgba(0, 255, 204, 0.6);
    height: 8px;
    padding-left: 4px;
}
.tick.major {
    height: 12px;
    color: var(--mint);
    border-color: var(--mint);
}

.frame-readout {
    position: absolute;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--mint);
    background: var(--void);
    padding: 2px 8px;
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(0, 255, 204, 0.6);
}
.readout-top-left     { top: -8px; left: 32px; }
.readout-top-right    { top: -8px; right: 32px; }
.readout-bottom-left  { bottom: -8px; left: 32px; color: var(--ice); text-shadow: 0 0 6px rgba(192,232,255,0.4); }
.readout-bottom-right { bottom: -8px; right: 32px; color: var(--gold); text-shadow: 0 0 6px rgba(255,215,0,0.5); }

/* ==========================================================================
   CORAL CIRCUIT BACKGROUND
   ========================================================================== */
.coral-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.16;
}
.coral {
    position: absolute;
    width: 28vw;
    height: auto;
    animation: coralDrift 120s linear infinite;
}
.coral-1 {
    left: 3vw;
    bottom: -10vh;
}
.coral-2 {
    right: 4vw;
    bottom: -12vh;
    animation-delay: -42s;
    animation-duration: 140s;
}
@keyframes coralDrift {
    from { transform: translateY(0); }
    to   { transform: translateY(-50px); }
}

/* ==========================================================================
   BUBBLES
   ========================================================================== */
.bubbles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0,255,204,0.5), rgba(0,255,204,0.05));
    border: 1px solid rgba(0, 255, 204, 0.25);
    animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
    0%   { transform: translate(0, 0); opacity: 0; }
    8%   { opacity: 1; }
    50%  { transform: translate(15px, -50vh); }
    92%  { opacity: 1; }
    100% { transform: translate(-15px, -110vh); opacity: 0; }
}

/* ==========================================================================
   CJK SIGNAGE
   ========================================================================== */
.cjk-sign {
    position: fixed;
    z-index: 3;
    pointer-events: none;
    font-family: var(--display);
    font-weight: 700;
    color: var(--mag);
    text-shadow: 0 0 12px rgba(255, 0, 102, 0.5);
    opacity: 0.18;
    animation: cjkFlicker 4s steps(8) infinite;
}
.cjk-1 { top: 12vh;  left: 22vw; font-size: 4rem; transform: rotate(-6deg); animation-delay: 0s; }
.cjk-2 { top: 60vh;  right: 24vw; font-size: 3rem; color: var(--gold); animation-delay: -1.6s; }
.cjk-3 { bottom: 22vh; left: 30vw; font-size: 3.5rem; animation-delay: -2.4s; }

@keyframes cjkFlicker {
    0%, 90%, 100% { opacity: 0.18; }
    91% { opacity: 0.04; }
    92% { opacity: 0.22; }
    93% { opacity: 0.05; }
    95% { opacity: 0.2; }
}

/* ==========================================================================
   LEFT INSTRUMENT CLUSTER
   ========================================================================== */
.left-cluster {
    position: fixed;
    top: calc(var(--frame-inset) + 40px);
    bottom: calc(var(--frame-inset) + 8vh + 24px);
    left: calc(var(--frame-inset) + 24px);
    width: 14vw;
    min-width: 180px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transition: opacity 400ms ease;
}

body.booted .left-cluster {
    transition: opacity 400ms ease;
    opacity: 1;
    transition-delay: 1500ms;
}

.widget {
    background: linear-gradient(180deg, rgba(15, 26, 46, 0.6), rgba(10, 11, 18, 0.7));
    border: 1px solid rgba(0, 255, 204, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 10px 12px;
    flex: 1;
    position: relative;
    overflow: hidden;
}
.widget::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,255,204,0.04) 2px, rgba(0,255,204,0.04) 3px);
    pointer-events: none;
}
.widget::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--mint);
    border-left: 2px solid var(--mint);
}

.widget-label {
    font-family: var(--sub);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--mag);
    font-size: 0.6rem;
    margin-bottom: 4px;
}

.depth-arc {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.depth-arc svg { width: 100%; height: auto; max-height: 90px; }
.depth-arc-fill {
    animation: depthSweep 6s ease-in-out infinite alternate;
}
@keyframes depthSweep {
    from { stroke-dasharray: 180 314; }
    to   { stroke-dasharray: 240 314; }
}
.depth-needle {
    transform-origin: 60px 60px;
    animation: needleSwing 6s ease-in-out infinite alternate;
}
@keyframes needleSwing {
    from { transform: rotate(15deg); }
    to   { transform: rotate(35deg); }
}
.depth-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    color: var(--mint);
    font-size: 0.85rem;
    text-shadow: 0 0 8px rgba(0,255,204,0.5);
}
.depth-value .unit {
    color: var(--ice);
    font-size: 0.65rem;
    margin-left: 2px;
    opacity: 0.7;
}

.sparkline {
    width: 100%;
    height: 50px;
    display: block;
    margin-top: 4px;
}
.velocity-value {
    margin-top: 4px;
    font-family: var(--mono);
    color: var(--gold);
    font-size: 0.95rem;
    text-shadow: 0 0 6px rgba(255,215,0,0.4);
}

.species-counter {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    color: var(--mint);
    text-shadow: 0 0 14px rgba(0,255,204,0.6);
    letter-spacing: 0.05em;
    line-height: 1.1;
}
.species-bar {
    height: 4px;
    background: rgba(0, 255, 204, 0.1);
    margin-top: 6px;
    position: relative;
    overflow: hidden;
}
.species-bar-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--mint), var(--gold));
    width: 71%;
    box-shadow: 0 0 8px rgba(0,255,204,0.5);
    animation: speciesBarPulse 3s ease-in-out infinite alternate;
}
@keyframes speciesBarPulse {
    from { width: 65%; }
    to   { width: 78%; }
}

.compass {
    width: 100%;
    height: auto;
    max-height: 90px;
    display: block;
    margin: 0 auto;
}
.compass-needle {
    transform-origin: 60px 60px;
    animation: compassRotate 24s linear infinite;
}
@keyframes compassRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.bearing-value {
    text-align: center;
    color: var(--ice);
    font-size: 0.75rem;
    margin-top: 2px;
}
.bearing-value .div { color: var(--mag); margin: 0 4px; }

/* ==========================================================================
   CENTRAL OBSERVATION ZONE
   ========================================================================== */
.observation-zone {
    position: fixed;
    top: calc(var(--frame-inset) + 30px);
    bottom: calc(var(--frame-inset) + 8vh + 24px);
    left: calc(var(--frame-inset) + 14vw + 40px);
    right: calc(var(--frame-inset) + 14vw + 40px);
    z-index: 20;
    overflow: hidden;
    transition: filter 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms ease;
}

.zone-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 255, 204, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 204, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero-block {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
    pointer-events: none;
    width: 92%;
}

.hero-prefix {
    font-family: var(--mono);
    color: var(--ice);
    opacity: 0.6;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.hero-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(2.5rem, 8.6vw, 7rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mint);
    text-shadow:
        0 0 20px rgba(0, 255, 204, 0.6),
        0 0 40px rgba(0, 255, 204, 0.3),
        0 0 80px rgba(0, 255, 204, 0.15);
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
    position: relative;
}

.hero-title::after {
    content: "_";
    color: var(--mint);
    animation: caretBlink 1s steps(2) infinite;
    margin-left: 0.05em;
}

@keyframes caretBlink {
    50% { opacity: 0; }
}

.hero-subtitle {
    margin-top: 14px;
    font-family: var(--sub);
    font-weight: 600;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mag);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sub-pill {
    border: 1px solid rgba(255, 0, 102, 0.5);
    padding: 4px 10px;
    background: rgba(255, 0, 102, 0.06);
}
.sub-pill.alt {
    border-color: rgba(192, 232, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(192, 232, 255, 0.04);
}
.sub-divider {
    color: var(--mint);
}

.hero-meta {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 28px;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ice);
    opacity: 0.85;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.hero-meta em {
    font-style: normal;
    color: var(--mint);
    margin-left: 4px;
}
.hero-meta em.gold {
    color: var(--gold);
}

/* ==========================================================================
   SPECIMENS / FISH
   ========================================================================== */
.specimen-field {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.specimen {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    width: clamp(110px, 14vw, 200px);
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transition:
        transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 320ms ease,
        opacity 400ms ease;
    will-change: transform, opacity;
}

body.booted .specimen { opacity: 1; }

.specimen:nth-child(1) { transition-delay: 0ms,    0ms,    3000ms; animation: floatA 9s ease-in-out infinite; }
.specimen:nth-child(2) { transition-delay: 0ms,    0ms,    3300ms; animation: floatB 11s ease-in-out infinite; }
.specimen:nth-child(3) { transition-delay: 0ms,    0ms,    3600ms; animation: floatA 13s ease-in-out infinite reverse; }
.specimen:nth-child(4) { transition-delay: 0ms,    0ms,    3900ms; animation: floatB 10s ease-in-out infinite reverse; }
.specimen:nth-child(5) { transition-delay: 0ms,    0ms,    4200ms; animation: floatA 14s ease-in-out infinite; }

@keyframes floatA {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
    25%      { transform: translate(-50%, -50%) translate(8px, -6px); }
    50%      { transform: translate(-50%, -50%) translate(-4px, -10px); }
    75%      { transform: translate(-50%, -50%) translate(-10px, 4px); }
}
@keyframes floatB {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
    33%      { transform: translate(-50%, -50%) translate(-12px, -4px); }
    66%      { transform: translate(-50%, -50%) translate(10px, 6px); }
}

.specimen:hover {
    z-index: 6;
    filter: drop-shadow(0 0 10px rgba(0, 255, 204, 0.7));
}

.fish-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 6px rgba(0, 255, 204, 0.35));
    transition: filter 280ms ease;
}
.specimen:hover .fish-svg {
    filter: drop-shadow(0 0 14px rgba(0, 255, 204, 0.7));
}

.specimen.rare .fish-svg {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}
.specimen.rare:hover .fish-svg {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.85));
}

.reticle {
    position: absolute;
    inset: -16px;
    pointer-events: none;
    opacity: 0.7;
}
.reticle svg {
    width: 100%;
    height: 100%;
    animation: reticleSpin 28s linear infinite;
}
.specimen:hover .reticle svg {
    animation: reticleSpin 14s linear infinite;
}
.specimen:hover .ret-ring {
    stroke-dasharray: 0;
    stroke: var(--mint);
    stroke-width: 1.5;
}
.specimen.rare:hover .ret-ring {
    stroke: var(--gold);
}
@keyframes reticleSpin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

.callout {
    position: absolute;
    left: 100%;
    top: 8%;
    width: 130px;
    margin-left: 8px;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 200ms ease;
}
.callout-line {
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--mint), transparent);
    position: absolute;
    left: -24px;
    top: 14px;
    transition: width 200ms ease;
}
.specimen:hover .callout-line {
    width: 36px;
    left: -36px;
}
.callout-panel {
    border: 1px solid rgba(0, 255, 204, 0.4);
    background: rgba(15, 26, 46, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 8px;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--ice);
    transition: border-color 220ms ease, box-shadow 220ms ease;
}
.specimen:hover .callout-panel {
    border-color: var(--mint);
    box-shadow: 0 0 14px rgba(0, 255, 204, 0.4);
}
.specimen.rare .callout-panel.rare-panel {
    border-color: rgba(255, 215, 0, 0.6);
}
.specimen.rare:hover .callout-panel.rare-panel {
    border-color: var(--gold);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
}
.cp-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    line-height: 1.4;
}
.cp-key {
    color: var(--mag);
    opacity: 0.85;
}
.cp-val {
    color: var(--ice);
}
.cp-val.price { color: var(--mint); }
.cp-val.gold  { color: var(--gold); }
.cp-val.mag   { color: var(--mag); }

.rare-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--void);
    font-family: var(--display);
    font-weight: 800;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    padding: 2px 8px;
    border-radius: 1px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
    animation: rarePulse 2.4s ease-in-out infinite;
}
@keyframes rarePulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.7); }
    50%      { box-shadow: 0 0 22px rgba(255, 215, 0, 1); }
}

/* ==========================================================================
   ZOOM-FOCUS DETAIL PANEL
   ========================================================================== */
body.zoomed .observation-zone .specimen-field { filter: blur(6px) opacity(0.35); }
body.zoomed .hero-block,
body.zoomed .left-cluster,
body.zoomed .right-ticker,
body.zoomed .telemetry-bar,
body.zoomed .coral-layer,
body.zoomed .cjk-sign { opacity: 0.2 !important; transition: opacity 500ms ease; }

.detail-panel {
    position: absolute;
    inset: 4% 4%;
    z-index: 60;
    background: linear-gradient(180deg, rgba(15, 26, 46, 0.92), rgba(10, 11, 18, 0.96));
    border: 1px solid rgba(0, 255, 204, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 28px 32px;
    color: var(--ice);
    transform: scale(0.85);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
        opacity 400ms ease;
    overflow: hidden;
}
.detail-panel[hidden] { display: none; }
body.zoomed .detail-panel {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.detail-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,255,204,0.03) 2px, rgba(0,255,204,0.03) 3px);
    pointer-events: none;
}

.detail-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--mint);
}
.bracket-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.bracket-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.bracket-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.bracket-br { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.detail-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--mag);
    color: var(--mag);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 180ms ease;
    z-index: 5;
}
.detail-close:hover {
    background: var(--mag);
    color: var(--void);
    box-shadow: 0 0 14px rgba(255,0,102,0.7);
}

.detail-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    height: 100%;
    align-items: center;
    position: relative;
    z-index: 1;
}

.detail-left {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}
.detail-fish {
    width: 100%;
    max-width: 480px;
    filter: drop-shadow(0 0 24px rgba(0, 255, 204, 0.5));
    animation: detailHover 4s ease-in-out infinite alternate;
}
.detail-fish svg {
    width: 100%;
    height: auto;
}
@keyframes detailHover {
    from { transform: translateY(-8px) rotate(-1deg); }
    to   { transform: translateY(8px) rotate(1deg); }
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: rgba(192, 232, 255, 0.6);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.meta-line { display: flex; justify-content: space-between; gap: 12px; }
.meta-k { color: var(--mag); }

.detail-name {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 3rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mint);
    text-shadow: 0 0 18px rgba(0,255,204,0.5);
    line-height: 1;
}
.detail-latin {
    font-family: var(--sub);
    font-style: italic;
    color: var(--ice);
    font-size: 1rem;
    opacity: 0.8;
    letter-spacing: 0.08em;
    margin-top: -2px;
}
.detail-latin em { font-style: italic; }

.market-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(0, 255, 204, 0.25);
    border: 1px solid rgba(0, 255, 204, 0.25);
}
.mg-cell {
    background: rgba(15, 26, 46, 0.85);
    padding: 8px 10px;
}
.mg-k {
    font-family: var(--sub);
    font-weight: 600;
    color: var(--mag);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.mg-v {
    font-family: var(--mono);
    color: var(--mint);
    font-size: 1rem;
    margin-top: 2px;
}
.mg-v.gold { color: var(--gold); }

.chart-block {
    margin-top: 6px;
}
.chart-label {
    font-family: var(--sub);
    font-weight: 600;
    color: var(--mag);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.chart-svg {
    width: 100%;
    height: 90px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 204, 0.2);
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.btn-transact {
    flex: 1;
    background: rgba(255, 0, 102, 0.12);
    border: 1px solid var(--mag);
    color: var(--mag);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    padding: 12px 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 200ms ease;
    text-shadow: 0 0 6px rgba(255,0,102,0.5);
}
.btn-transact:hover {
    background: var(--mag);
    color: var(--void);
    box-shadow: 0 0 24px rgba(255, 0, 102, 0.8), inset 0 0 12px rgba(255, 255, 255, 0.2);
    text-shadow: none;
}
.btn-watch {
    background: transparent;
    border: 1px solid rgba(0, 255, 204, 0.5);
    color: var(--mint);
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    padding: 12px 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 200ms ease;
}
.btn-watch:hover {
    border-color: var(--mint);
    box-shadow: 0 0 14px rgba(0, 255, 204, 0.5);
}

/* ==========================================================================
   RIGHT TICKER COLUMN
   ========================================================================== */
.right-ticker {
    position: fixed;
    top: calc(var(--frame-inset) + 40px);
    bottom: calc(var(--frame-inset) + 8vh + 24px);
    right: calc(var(--frame-inset) + 24px);
    width: 14vw;
    min-width: 200px;
    z-index: 30;
    background: linear-gradient(180deg, rgba(15, 26, 46, 0.7), rgba(10, 11, 18, 0.8));
    border: 1px solid rgba(0, 255, 204, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 400ms ease;
}
body.booted .right-ticker {
    opacity: 1;
    transition-delay: 1800ms;
}
.right-ticker::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,255,204,0.04) 2px, rgba(0,255,204,0.04) 3px);
    pointer-events: none;
}

.ticker-head {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.ticker-title {
    font-family: var(--sub);
    font-weight: 600;
    color: var(--mag);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.ticker-pulse {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--mint);
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 6px var(--mint);
    animation: pulseDot 1.2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.ticker-window {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(180deg, transparent 0, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, black 8%, black 92%, transparent 100%);
}

.ticker-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    animation: tickerScroll 32s linear infinite;
}

@keyframes tickerScroll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.tx-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 1px 6px;
    padding: 7px 10px;
    border-bottom: 1px dashed rgba(0, 255, 204, 0.12);
    font-family: var(--mono);
    font-size: 0.7rem;
    align-items: center;
    transition: background 220ms ease;
}
.tx-row:hover {
    background: rgba(0, 255, 204, 0.05);
}
.tx-row.rare {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
    border-bottom-color: rgba(255, 215, 0, 0.3);
}
.tx-id {
    color: var(--ice);
    opacity: 0.75;
    font-size: 0.6rem;
    grid-row: 1;
    grid-column: 1 / 3;
}
.tx-name {
    color: var(--mint);
    grid-row: 2;
    grid-column: 1;
    font-weight: bold;
}
.tx-row.rare .tx-name { color: var(--gold); }
.tx-price {
    color: var(--ice);
    grid-row: 2;
    grid-column: 2;
    text-align: right;
    font-size: 0.66rem;
}
.tx-delta {
    grid-row: 1 / 3;
    grid-column: 3;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: right;
    min-width: 38px;
}
.tx-delta.up   { color: var(--mint); text-shadow: 0 0 6px rgba(0,255,204,0.4); }
.tx-delta.down { color: var(--mag);  text-shadow: 0 0 6px rgba(255,0,102,0.4); }
.tx-row.rare .tx-delta.up { color: var(--gold); text-shadow: 0 0 8px rgba(255,215,0,0.6); }

.ticker-foot {
    padding: 6px 10px;
    border-top: 1px solid rgba(0, 255, 204, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--ice);
    opacity: 0.85;
    flex-shrink: 0;
}
.status.ok {
    color: var(--mint);
    border: 1px solid rgba(0, 255, 204, 0.5);
    padding: 1px 6px;
    text-shadow: 0 0 6px rgba(0,255,204,0.5);
}

/* ==========================================================================
   BOTTOM TELEMETRY BAR
   ========================================================================== */
.telemetry-bar {
    position: fixed;
    bottom: calc(var(--frame-inset) + 4px);
    left: calc(var(--frame-inset) + 24px);
    right: calc(var(--frame-inset) + 24px);
    height: 8vh;
    min-height: 64px;
    z-index: 30;
    background: linear-gradient(180deg, rgba(15, 26, 46, 0.85), rgba(10, 11, 18, 0.95));
    border: 1px solid rgba(0, 255, 204, 0.4);
    border-top-width: 2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    transform: translateY(calc(100% + 32px));
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
body.booted .telemetry-bar {
    transform: translateY(0);
    transition-delay: 1200ms;
}

.tele-block {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    position: relative;
}
.tele-block + .tele-block::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: rgba(0, 255, 204, 0.2);
}

.tele-status {
    gap: 6px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}
.status-green { background: var(--mint); color: var(--mint); animation: dotBlink 2s ease-in-out infinite; }
.status-amber { background: var(--gold); color: var(--gold); animation: dotBlink 1.6s ease-in-out infinite; }
.status-red   { background: var(--mag);  color: var(--mag);  animation: dotBlink 0.8s ease-in-out infinite; }

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

.tele-label {
    font-family: var(--sub);
    font-weight: 600;
    color: var(--mag);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tele-wave {
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1;
}
.waveform {
    width: 100%;
    height: 60%;
    display: block;
}
#wavePath { animation: waveFlow 3s ease-in-out infinite alternate; }
#wavePathAlt { animation: waveFlow 4.6s ease-in-out infinite alternate-reverse; }

@keyframes waveFlow {
    from { transform: translateX(0) scaleY(1); }
    to   { transform: translateX(-30px) scaleY(1.4); }
}

.tele-prompt {
    flex-shrink: 0;
    min-width: 320px;
    font-family: var(--mono);
    color: var(--mint);
    font-size: 0.85rem;
    align-items: center;
    height: 100%;
    background: rgba(0, 255, 204, 0.04);
    border: 1px solid rgba(0, 255, 204, 0.3);
    padding: 0 10px;
}
.prompt-glyph {
    color: var(--mag);
    font-weight: bold;
    margin-right: 4px;
}
.prompt-text {
    color: var(--mint);
    text-shadow: 0 0 6px rgba(0, 255, 204, 0.5);
    white-space: nowrap;
    overflow: hidden;
    max-width: 60vw;
    text-overflow: ellipsis;
}
.prompt-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--mint);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: caretBlink 0.9s steps(2) infinite;
    box-shadow: 0 0 6px var(--mint);
}

.cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--mint);
    font-family: var(--mono);
    font-size: 0.85rem;
    width: 0;
    height: 0;
    position: absolute;
    left: -9999px;
}

.tele-clock {
    font-family: var(--mono);
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px rgba(255,215,0,0.5);
    min-width: 90px;
    text-align: right;
}

/* ==========================================================================
   BOOT SEQUENCE
   ========================================================================== */
body:not(.booted) .observation-zone .hero-block,
body:not(.booted) .observation-zone .specimen-field {
    opacity: 0;
}
body.booted .observation-zone .hero-block {
    transition: opacity 600ms ease;
    opacity: 1;
    transition-delay: 2200ms;
}

/* Boot bar overlay */
.boot-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
    transition: opacity 600ms ease 200ms;
}
body.booted .boot-loader {
    opacity: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    .observation-zone {
        left: calc(var(--frame-inset) + 12vw + 18px);
        right: calc(var(--frame-inset) + 12vw + 18px);
    }
    .left-cluster, .right-ticker { width: 11vw; min-width: 150px; }
    .hero-title { font-size: clamp(2rem, 7vw, 5rem); }
}

@media (max-width: 820px) {
    .left-cluster, .right-ticker { display: none; }
    .observation-zone { left: calc(var(--frame-inset) + 18px); right: calc(var(--frame-inset) + 18px); }
    .tele-prompt { min-width: 0; flex: 1; }
    .tele-clock { display: none; }
    .specimen { width: 28vw; }
    .callout { display: none; }
}

/* ==========================================================================
   DETAIL FISH SVG STYLE OVERRIDES
   ========================================================================== */
.detail-fish svg { max-height: 60vh; }

/* ensure detail panel transactions look good on small */
@media (max-height: 700px) {
    .detail-body { gap: 18px; }
    .market-grid { grid-template-columns: repeat(3, 1fr); }
    .chart-svg { height: 60px; }
}
