/* Fonts are self-hosted (frontend/fonts/) — the old Google Fonts @import
   hung Safari's CSSOM behind a third-party request and is a GDPR liability. */
@import url('/frontend/fonts/fonts.css');

/* =========================================================
   PALETTE — neon purple / blue
   ========================================================= */
:root {
    --neon:            #AB20FD;                  /* signature dvb purple */
    --neon-bright:     #C77DFF;                  /* light purple — content text */
    --neon-blue:       #00BFFF;                  /* deep sky blue — secondary accent */
    --neon-cyan:       #00E5FF;                  /* cyan — countdown highlight */
    --bg-deep:         #000010;                  /* page base */
    --panel-bg:        rgba(14, 0, 26, 0.78);    /* purple-black panel tint */
    --panel-bg-strong: rgba(10, 0, 20, 0.88);    /* bars */
    --btn-bg:          rgba(20, 0, 36, 0.85);
    --btn-bg-hover:    rgba(40, 0, 70, 0.9);
    --btn-bg-active:   rgba(30, 0, 56, 0.9);
    --glow-20:         rgba(171, 32, 253, 0.2);
    --glow-30:         rgba(171, 32, 253, 0.3);
    --glow-45:         rgba(171, 32, 253, 0.45);
    --glow-60:         rgba(171, 32, 253, 0.6);
    --glow-80:         rgba(171, 32, 253, 0.8);

    /* Glitch trio — from the dvb.digital homepage effect + brand palette */
    --glitch-pink:     #ff00ff;
    --glitch-cyan:     #00ffff;
    --glitch-yellow:   #f3b700;
}

body {
    margin: 0;
    font-family: 'Roboto Mono', 'VT323', monospace;
    background-color: var(--bg-deep);
    color: var(--neon);
    /* Player-state color, mirrored from the play button (JS sets
       data-player-state). The player's frame lines follow it — fainter
       and slower than the button, so the button stays the loudest. */
    --player-rgb: 171, 32, 253;
}

body[data-player-state="paused"]       { --player-rgb: 0, 255, 255; }
body[data-player-state="connecting"],
body[data-player-state="reconnecting"] { --player-rgb: 243, 183, 0; }
body[data-player-state="playing"]      { --player-rgb: 255, 0, 255; }

/* =========================================================
   GLOBE — the night sky, matrix rain, and planet all render
   inside this one three.js canvas (sky + rain are in-scene)
   ========================================================= */
#globeViz {
    width: 100vw;
    height: 100vh;
    height: 100dvh;             /* dynamic viewport — correct under iOS Safari's collapsing toolbars */
    will-change: transform;   /* hint browser to composite on GPU */
    transform-origin: 50% 50%;
}

/* =========================================================
   ROCKET LOADING SCREEN
   ========================================================= */
#loadingScreen {
    position: fixed;
    inset: 0;
    /* Semi-transparent so the globe renders visibly behind */
    background: rgba(0, 0, 16, 0.72);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    /* Purely visual — never intercept clicks */
    pointer-events: none;
}

#loadingScreen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---- Orbit loader: the rocket circles a mini planet ---- */
.orbit-loader {
    width: 116px;
    height: 116px;
    filter: drop-shadow(0 0 8px rgba(171, 32, 253, 0.5));
}

.orbit-loader svg {
    width: 100%;
    height: 100%;
}

.ol-orbit {
    stroke: rgba(255, 0, 255, 0.3);
    stroke-width: 1;
    stroke-dasharray: 2 5;
}

.ol-planet {
    fill: #12001f;
    stroke: rgba(171, 32, 253, 0.7);
    stroke-width: 1;
}

/* Cyan rim light — a hint of the day/night terminator */
.ol-rim {
    stroke: rgba(0, 255, 255, 0.55);
    stroke-width: 1.5;
    stroke-dasharray: 26 50;
    stroke-linecap: round;
}

.ol-carrier {
    /* view-box units — Safari resolves px transform-origins on SVG children
       against the viewport unless transform-box says otherwise */
    transform-box: view-box;
    transform-origin: 50% 50%;
    /* Counterclockwise so the nose (drawn pointing up) leads the orbit */
    animation: orbitSpin 3.7s linear infinite;
}

@keyframes orbitSpin {
    to { transform: rotate(-360deg); }
}

/* ---- Flame flicker ---- */
.rocket-flame {
    animation: flamePulse 0.2s ease-in-out infinite alternate;
    transform-origin: 50% 0%;
}

@keyframes flamePulse {
    0%   { transform: scaleY(1)   scaleX(1);    opacity: 1;   }
    100% { transform: scaleY(1.4) scaleX(0.8);  opacity: 0.75; }
}

/* ---- Loading text (glitch-text adds the pink/cyan ghosts + neon flicker) ---- */
.loading-title {
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: var(--neon);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--glow-60);
}

/* ---- Blinking cursor ---- */
.loading-cursor {
    display: inline-block;
    animation: blink 1s step-start infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ---- Progress bar ---- */
.loading-bar-container {
    width: 160px;
    height: 4px;
    border: 1px solid var(--glow-30);
    border-radius: 2px;
    overflow: hidden;
    background: rgba(171, 32, 253, 0.05);
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    /* The glitch trio, flowing */
    background: linear-gradient(90deg, #00ffff, #ff00ff, #f3b700, #00ffff);
    background-size: 200% 100%;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
    animation: loadBar 3s ease-out forwards, barFlow 2.2s linear infinite;
}

@keyframes barFlow {
    to { background-position: -200% 0; }
}
@keyframes loadBar {
    0%   { width: 0%;  }
    60%  { width: 75%; }
    90%  { width: 92%; }
    100% { width: 99%; } /* JS snaps to 100 % on dismiss */
}

/* ---- Glitch effect (ported from the dvb.digital homepage header) ----
   Pink + cyan ghost copies drift behind the text, while the base text
   flickers with hard-cut yellow/pink/cyan shadow pops (steps(1) = no
   interpolation, real flicker). --glitch-offset scales it for small type. */
.glitch-text {
    position: relative;
    transform: translateZ(0);
    --glitch-offset: 2px;
    animation: glitch-flicker 4s steps(1) infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    border-bottom: none;
}

.glitch-text::before {
    color: var(--glitch-pink);
    animation: glitch-shift 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    color: var(--glitch-cyan);
    animation: glitch-shift 2s infinite linear alternate;
}

@keyframes glitch-shift {
    0%   { transform: translate(0); }
    20%  { transform: translate(-2px, 2px); }
    40%  { transform: translate(-2px, -2px); }
    60%  { transform: translate(2px, 2px); }
    80%  { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-flicker {
    0%, 6%, 12%, 35%, 41%, 70%, 76%, 100% {
        text-shadow: 0 0 10px var(--glow-45);
    }
    7% {
        text-shadow:
            calc(var(--glitch-offset) * -1) 0 var(--glitch-cyan),
            var(--glitch-offset) 0 var(--glitch-pink),
            0 0 10px var(--glow-45);
    }
    9% {
        text-shadow:
            var(--glitch-offset) 0 var(--glitch-yellow),
            calc(var(--glitch-offset) * -1) 0 var(--glitch-cyan),
            0 0 10px var(--glow-45);
    }
    36% {
        text-shadow:
            var(--glitch-offset) 0 var(--glitch-cyan),
            calc(var(--glitch-offset) * -1) 0 var(--glitch-yellow),
            0 0 10px var(--glow-45);
    }
    38% {
        text-shadow:
            calc(var(--glitch-offset) * -1) 0 var(--glitch-pink),
            0 0 10px var(--glow-45);
    }
    71% {
        text-shadow:
            var(--glitch-offset) 0 var(--glitch-yellow),
            calc(var(--glitch-offset) * -1) 0 var(--glitch-pink),
            0 0 10px var(--glow-45);
    }
    73% {
        text-shadow:
            calc(var(--glitch-offset) * -1) 0 var(--glitch-cyan),
            var(--glitch-offset) 0 var(--glitch-yellow),
            0 0 10px var(--glow-45);
    }
}

/* =========================================================
   STATUS BARS
   ========================================================= */
#statusBar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Extends into the home-indicator zone as solid bar; the ticker SVG stays
       in the top 30px (see #tickerSvg) so the text never sinks into the inset */
    height: calc(30px + env(safe-area-inset-bottom, 0px));
    background-color: var(--panel-bg-strong);
    color: var(--neon);
    font-family: 'VT323', monospace;
    font-size: 13px;
    z-index: 10004; /* above the loading overlay AND the menu drawer */
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 -2px 10px var(--glow-20);
}

/* The player's bottom line — bows DOWNWARD (opposite of the horizon cap),
   giving the player a lens shape. Follows the state color, faint. */
#statusBar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 5px;                /* dip depth at center — subtle */
    background: var(--panel-bg-strong);
    border: 1px solid rgba(var(--player-rgb), 0.5);
    border-top: none;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    pointer-events: none;
    box-sizing: border-box;
    transition: border-color 0.6s ease;
    z-index: 1;
}

/* Live status text stays in the DOM for screen readers; the ticker shows it */
#statusInfo {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#tickerSvg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;               /* the ticker band — not the safe-area padding below it */
    z-index: 2;
}

#tickerText {
    font-family: 'VT323', monospace;
    font-size: 15px;
    letter-spacing: 1px;
    filter: drop-shadow(0 0 4px rgba(171, 32, 253, 0.45));
}

#topSolarBar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);   /* clear the notch on edge-to-edge devices */
    left: 0;
    width: 100%;
    background-color: var(--panel-bg-strong);
    color: var(--neon);
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 0 10px;
    z-index: 10000; /* Above the loading overlay */
    box-sizing: border-box;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 28px;
    box-shadow: 0 2px 10px var(--glow-20);
    white-space: nowrap;
    overflow: hidden;
}

/* The readings arch upward (∩) with the curved bottom edge — the mirror
   of the footer ticker's downward sag, kept gentle */
#topSolarBar > span:nth-child(1) { transform: rotate(-1deg) translateY(1.2px); }
#topSolarBar > span:nth-child(2) { transform: translateY(0.4px); }
#topSolarBar > span:nth-child(3) { transform: rotate(-0.4deg) translateY(-0.4px); }
#topSolarBar > span:nth-child(4) { transform: translateY(-0.7px); }
#topSolarBar > span:nth-child(5) { transform: rotate(0.4deg) translateY(-0.4px); }
#topSolarBar > span:nth-child(6) { transform: translateY(0.4px); }
#topSolarBar > span:nth-child(7) { transform: rotate(1deg) translateY(1.2px); }

/* The curved edge extension below the bar */
#topBarCurve {
    position: fixed;
    top: calc(27px + env(safe-area-inset-top, 0px)); /* 1px overlap into the bar — no seam */
    left: 0;
    width: 100%;
    height: 8px;
    z-index: 9999;
    pointer-events: none;
}
#topBarCurve .tbc-fill {
    fill: var(--panel-bg-strong);
}
#topBarCurve .tbc-line {
    fill: none;
    stroke: rgba(171, 32, 253, 0.55);
    stroke-width: 1;
}

#topSolarBar span {
    margin: 0 5px;
    color: var(--neon-bright);
}

/* Each reading in its own neon, glowing — the bar reads like a lit
   instrument cluster. (Borders and separators stay purple.) */
#topSolarBar span#topSunriseCountdown { /* next sunrise — brand yellow */
    color: #f3b700;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(243, 183, 0, 0.75), 0 0 16px rgba(243, 183, 0, 0.35);
}
#topSolarBar span#topApparentSolarTime { /* solar clock — pink */
    color: #ff00ff;
    text-shadow: 0 0 6px rgba(255, 0, 255, 0.7), 0 0 16px rgba(255, 0, 255, 0.3);
}
#topSolarBar span#topRealTime { /* civil clock — neon purple */
    color: #c77dff;
    text-shadow: 0 0 6px rgba(199, 125, 255, 0.75), 0 0 16px rgba(171, 32, 253, 0.4);
}
#topSolarBar span#topSunsetCountdown { /* next sunset — brand orange */
    color: #ff5800;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 88, 0, 0.75), 0 0 16px rgba(255, 88, 0, 0.35);
}

#topSolarBar .separator {
    color: var(--neon);
    font-size: 11px;
    margin: 0 3px;
}

/* =========================================================
   RADIO FOOTER — slim bar, oversized central play button
   ========================================================= */
#radioFooter {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px)); /* above the status bar (+ home-indicator inset) */
    left: 0;
    width: 100%;
    height: 48px;
    background-color: var(--panel-bg-strong);
    display: grid;
    /* Fixed middle column: the button is absolutely positioned over it, so it
       must not contribute height (it would stretch the row and push the side
       text off-center) — the column just keeps the text clear of the button. */
    grid-template-columns: 1fr 104px 1fr;
    align-items: center;
    z-index: 10004;             /* above the loading overlay AND the menu drawer */
    box-shadow: 0 -2px 14px var(--glow-20);
    box-sizing: border-box;
}

/* The bar's top edge is a horizon: a full-width elliptical cap whose neon
   line rises from the corners to a gentle crest behind the play button.
   The bottom edge of the bar stays straight. */
#radioFooter::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -9px;
    height: 10px;               /* 1px overlap into the bar — no seam */
    background: var(--panel-bg-strong);
    /* Follows the player state, faint — the button carries the color loudly */
    border: 1px solid rgba(var(--player-rgb), 0.55);
    border-bottom: none;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    box-shadow: 0 -3px 16px rgba(var(--player-rgb), 0.14);
    pointer-events: none;
    box-sizing: border-box;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.rf-left {
    grid-column: 1;             /* explicit: the absolute button leaves the flow */
    padding-left: 16px;
    min-width: 0;               /* allow the track title to ellipsize */
    text-align: left;
    line-height: 1;
    /* Follow the horizon: the inner end of each text block lifts gently
       toward the crest, echoing the bar's curved top edge */
    transform: rotate(-1.6deg);
    transform-origin: 20% 50%;
}

.rf-right {
    grid-column: 3;
    padding-right: 16px;
    text-align: right;
    line-height: 1;
    transform: rotate(1.6deg);
    transform-origin: 80% 50%;
}

#radioTrack {
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--neon);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    text-shadow: 0 0 6px var(--glow-45);
}

#radioArtist {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: var(--neon-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.rf-station {
    display: inline-block;
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--glow-45);
}

/* Small type needs a much gentler glitch than the big header treatment */
.rf-station.glitch-text {
    --glitch-offset: 1px;
}
.rf-station.glitch-text::before {
    animation: glitch-shift-sm 3s infinite linear alternate-reverse;
}
.rf-station.glitch-text::after {
    animation: glitch-shift-sm 2s infinite linear alternate;
}
@keyframes glitch-shift-sm {
    0%   { transform: translate(0); }
    25%  { transform: translate(-1px, 0.5px); }
    50%  { transform: translate(1px, -0.5px); }
    75%  { transform: translate(-0.5px, -0.5px); }
    100% { transform: translate(0); }
}

#radioListeners {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: var(--neon-bright);
    margin-top: 3px;
    letter-spacing: 0.5px;
}

/* ── The play button — deliberately bigger than everything around it.
      Absolutely positioned so its size never affects the bar's row height. ── */
#radioPlayBtn {
    /* State-encoded color (rgb triplet): the glyph, border, glow, and burst
       ring all follow it. paused=cyan (press me), connecting=amber
       (warming up), playing=pink (on air). Purple is only the fallback. */
    --btn-rgb: 171, 32, 253;
    position: absolute;
    left: 50%;
    top: -18px;                 /* pokes through the horizon crest — the obvious thing to press */
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 2px solid rgb(var(--btn-rgb));
    border-radius: 50%;
    /* Opaque disc — the footer's border line must not show through the button */
    background: #160026;
    color: rgb(var(--btn-rgb));
    font-size: 30px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease,
                border-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 0 14px rgba(var(--btn-rgb), 0.45), 0 0 34px rgba(var(--btn-rgb), 0.2);
    outline: none;
}

#radioPlayBtn[data-state="paused"] {
    --btn-rgb: 0, 255, 255;     /* cyan — inviting the press */
}
#radioPlayBtn[data-state="connecting"],
#radioPlayBtn[data-state="reconnecting"] {
    --btn-rgb: 243, 183, 0;     /* brand amber — dialing the stream */
}
#radioPlayBtn[data-state="playing"] {
    --btn-rgb: 255, 0, 255;     /* pink — on air */
}

#radioPlayBtn:hover {
    background: #251043;
    box-shadow: 0 0 22px rgba(var(--btn-rgb), 0.6), 0 0 46px rgba(var(--btn-rgb), 0.3);
}

#radioPlayBtn:active {
    transform: translateX(-50%) scale(0.93);
}

/* Active states — glow pulses in the state color */
#radioPlayBtn.playing {
    background: #1d0033;
    animation: btnGlow 1.8s ease-in-out infinite alternate;
}

@keyframes btnGlow {
    from { box-shadow: 0 0 12px rgba(var(--btn-rgb), 0.6), 0 0 28px rgba(var(--btn-rgb), 0.2); }
    to   { box-shadow: 0 0 24px rgba(var(--btn-rgb), 0.8), 0 0 50px rgba(var(--btn-rgb), 0.45); }
}

/* Optical centering: a play triangle's visual mass sits left of its
   bounding-box center (centroid at 1/3 width), so a geometrically centered
   ▶ reads as shifted left. Nudge it right; ⏸ and … stay unshifted. */
#radioPlayBtnLabel {
    display: inline-block;
}
#radioPlayBtnLabel.is-play {
    transform: translateX(3px);
}

/* ── Press feedback: an energy ring bursts off the button ── */
#radioPlayBtn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgb(var(--btn-rgb));
    opacity: 0;
    pointer-events: none;
}

#radioPlayBtn.burst::after {
    animation: ringOut 0.8s ease-out;
}

@keyframes ringOut {
    0%   { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0;   transform: scale(2.4); }
}

/* ── Energy beam rising from the button toward the planet ── */
#playBeam {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)); /* top of the play button */
    width: 2px;
    height: 0;
    transform: translateX(-50%);
    background: linear-gradient(to top, var(--neon), rgba(171, 32, 253, 0));
    box-shadow: 0 0 8px var(--glow-60);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
}

#playBeam.active {
    animation: beamUp 0.9s ease-out forwards;
}

@keyframes beamUp {
    0%   { height: 0;    opacity: 0.95; }
    60%  { height: 40vh; opacity: 0.7; }
    100% { height: 48vh; opacity: 0; }
}

/* =========================================================
   INFO BUTTON + MENU
   ========================================================= */
#infoBtn {
    position: fixed;
    top: calc(40px + env(safe-area-inset-top, 0px)); /* just below the solar bar */
    right: 14px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glow-45);
    border-radius: 50%;
    background: var(--panel-bg);
    color: var(--neon);
    font-family: 'VT323', monospace;
    font-size: 24px;
    font-style: italic;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px var(--glow-20);
    outline: none;
}

#infoBtn:hover,
#infoBtn[aria-expanded="true"] {
    border-color: var(--neon);
    color: #fff;
    box-shadow: 0 0 14px var(--glow-60);
}

/* Optical centering: the synthetic italic leans the stem rightward,
   so the glyph reads right-of-center — nudge it back left. */
#infoBtn .ib-glyph {
    display: inline-block;
    transform: translateX(-1.5px);
}

#infoMenu[hidden],
#menuBackdrop[hidden] {
    display: none; /* author display beats the hidden attr otherwise */
}

/* Dim + soften the globe while the drawer is open. Sits BELOW the bars
   (z 10000), so the solar bar and player stay crisp above it. */
#menuBackdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(3, 0, 10, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: backdropIn 0.2s ease-out;
}

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

/* Side drawer spanning the band BETWEEN the bars: from the bottom of the
   solar bar (28px + its 7px curve wing) to the top of the player footer
   (30px status + 48px bar). Scrollable — grows with the link list.
   z 10003: above the info/video buttons, which must not float over it. */
#infoMenu {
    position: fixed;
    top: calc(35px + env(safe-area-inset-top, 0px));
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: min(320px, 84vw);
    background: var(--panel-bg-strong);
    border-left: 1px solid var(--neon);
    border-top: 1px solid var(--glow-30);
    border-bottom: 1px solid var(--glow-30);
    box-shadow: -8px 0 30px var(--glow-30);
    z-index: 10003;
    overflow: hidden;            /* the inner .im-scroll scrolls */
    animation: drawerIn 0.22s ease-out;
}

@keyframes drawerIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* Closing mirrors opening: JS adds .closing, waits for animationend, THEN
   sets [hidden] — 'forwards' holds the slid-out pose so there's no snap-back
   frame in between. Ease-in: exits accelerate away, entrances decelerate. */
#infoMenu.closing {
    animation: drawerOut 0.22s ease-in forwards;
}

@keyframes drawerOut {
    from { transform: translateX(0); }
    to   { transform: translateX(100%); }
}

#menuBackdrop.closing {
    animation: backdropOut 0.22s ease-out forwards;
}

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

/* Still used by #videoPanel and #aboutOverlay entrances */
@keyframes menuIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Drawer close chip — pinned to the drawer (not .im-scroll), so it stays put
   while the links scroll. Rides --player-rgb like the play button: cyan
   paused, amber connecting, pink on air. */
#menuClose {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--player-rgb), 0.55);
    border-radius: 50%;
    background: var(--btn-bg);
    color: rgb(var(--player-rgb));
    font-family: 'VT323', monospace;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 10px rgba(var(--player-rgb), 0.3);
    transition: color 0.3s ease, border-color 0.3s ease,
                box-shadow 0.3s ease, background 0.15s ease,
                transform 0.15s ease;
}

#menuClose:hover {
    color: #fff;
    background: var(--btn-bg-hover);
    border-color: rgb(var(--player-rgb));
    box-shadow: 0 0 16px rgba(var(--player-rgb), 0.55);
}

#menuClose:active {
    transform: scale(0.9);
}

.im-scroll {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 0
             calc(18px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.im-head {
    font-family: 'VT323', monospace;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neon);
    text-shadow: 0 0 12px var(--glow-60);
    /* margin, NOT padding: the glitch ghost copies anchor to the padding-box
       origin, so padding here would offset them by its full amount */
    margin: 8px 20px 2px;
    align-self: flex-start;
}

.im-tagline {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: rgba(199, 125, 255, 0.6);
    letter-spacing: 1px;
    white-space: pre-line;
    padding: 0 20px 10px;
}

.im-section {
    font-family: 'VT323', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(199, 125, 255, 0.55);
    padding: 18px 20px 6px;
    border-bottom: 1px solid var(--glow-20);
    margin-bottom: 4px;
}

.im-foot {
    margin-top: auto;            /* pinned to the drawer bottom when short */
    font-family: 'VT323', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(199, 125, 255, 0.45);
    padding: 22px 20px 0;
}

#infoMenu a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 11px 20px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--neon-bright);
    text-decoration: none;
    transition: all 0.15s ease;
}

#infoMenu a:hover {
    color: #fff;
    background: rgba(171, 32, 253, 0.14);
    padding-left: 25px;
    animation: menu-item-glitch 0.5s infinite;
}

/* Hover glitch for menu items — same trio as the homepage menu effect */
@keyframes menu-item-glitch {
    0% {
        text-shadow: -1px 0 var(--glitch-cyan), 1px 0 var(--glitch-pink);
        transform: translateX(-0.5px);
    }
    25% {
        text-shadow: 1px 0 var(--glitch-pink), -1px 0 var(--glitch-yellow);
        transform: translateX(1px);
    }
    50% {
        text-shadow: -1.5px 0 var(--glitch-yellow), 1px 0 var(--glitch-cyan);
        transform: translateX(0.5px);
    }
    75% {
        text-shadow: 1px 0 var(--glitch-cyan), -2px 0 var(--glitch-pink);
        transform: translateX(-1px);
    }
    100% {
        text-shadow: -1px 0 var(--glitch-pink), 1px 0 var(--glitch-yellow);
        transform: translateX(0);
    }
}

#infoMenu .im-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

#infoMenu .im-sub {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: rgba(199, 125, 255, 0.6);
    margin-left: auto;
}

/* =========================================================
   LIVE VIDEO — button left of the info button; floating
   16:9 panel docked under the top-right buttons. video.js
   (vendored) is injected post-boot by video-player.js; its
   stylesheet lands AFTER this one, so every override below
   is #videoPanel-prefixed to win on specificity.
   ========================================================= */
#videoBtn[hidden],
#videoPanel[hidden] {
    display: none; /* author display would otherwise beat the hidden attr */
}

#videoBtn {
    position: fixed;
    top: calc(40px + env(safe-area-inset-top, 0px)); /* same row as #infoBtn */
    right: 64px;                                      /* 14px edge + 42px button + 8px gap */
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glow-45);
    border-radius: 50%;
    background: var(--panel-bg);
    color: var(--neon);
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px var(--glow-20);
    outline: none;
}

#videoBtn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

#videoBtn:hover,
#videoBtn[aria-expanded="true"] {
    border-color: var(--neon);
    color: #fff;
    box-shadow: 0 0 14px var(--glow-60);
}

#videoBtn[aria-expanded="true"] {
    color: var(--glitch-pink); /* on air */
}

#videoPanel {
    position: fixed;
    top: calc(90px + env(safe-area-inset-top, 0px)); /* under the button row, like #infoMenu */
    right: 14px;
    /* The stream is portrait (9:16), so the panel's WIDTH derives from the
       free vertical space between the button row and the player footer:
       video height = viewport - 90 top - 110 footer clearance - 30 head bar,
       width = that * 9/16. Capped by viewport width and a sane maximum.
       dvh, not vh: on mobile Safari 100vh is the LARGEST viewport (toolbars
       collapsed) and oversizes the panel; the vh line is the legacy fallback.
       Safe-area insets shrink the free band too, so subtract them. */
    width: min(calc((100vh - 230px) * 0.5625), calc(100vw - 28px), 380px);
    width: min(calc((100dvh - 230px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 0.5625), calc(100vw - 28px), 380px);
    background: var(--panel-bg-strong);
    border: 1px solid var(--neon);
    box-shadow: 0 0 20px var(--glow-30);
    z-index: 10001;
    overflow: hidden;
    transform-origin: top right;
    animation: menuIn 0.18s ease-out;
}

.vp-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 30px;
    padding: 0 4px 0 12px;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glow-30);
}

.vp-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--glitch-pink);
    font-size: 17px;
}

/* Blinking "on air" dot */
.vp-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--glitch-pink);
    box-shadow: 0 0 6px var(--glitch-pink);
    animation: vpBlink 1.6s ease-in-out infinite;
}

@keyframes vpBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

.vp-status {
    flex: 1;
    min-width: 0;
    color: var(--neon-bright);
    font-size: 14px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer; /* tapping an error status retries */
}

#videoClose {
    position: relative;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--neon);
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}
#videoClose:hover {
    color: #fff;
    border-color: var(--glow-45);
    box-shadow: 0 0 10px var(--glow-45);
}

/* ── video.js theme (neon) ── */
#videoPanel .video-js {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16; /* portrait stage — the MediaMTX feed is 1080x1920 */
    background: #000;
    font-family: 'VT323', monospace;
}

#videoPanel .vjs-control-bar {
    background: var(--panel-bg-strong);
    border-top: 1px solid var(--glow-30);
}

#videoPanel .vjs-play-progress,
#videoPanel .vjs-volume-level {
    background: var(--neon);
}

#videoPanel .vjs-big-play-button {
    width: 2em;
    height: 2em;
    line-height: 2em;
    border-radius: 50%;
    border: 1px solid var(--neon);
    background: var(--panel-bg);
    box-shadow: 0 0 14px var(--glow-45);
    transition: all 0.2s ease;
}
#videoPanel .video-js:hover .vjs-big-play-button,
#videoPanel .vjs-big-play-button:focus {
    background: var(--btn-bg-hover);
    border-color: #fff;
    box-shadow: 0 0 18px var(--glow-60);
}

#videoPanel .vjs-loading-spinner {
    border-color: var(--glow-45);
}

/* Live-edge indicator: pink when at the edge, like the radio's on-air state */
#videoPanel .vjs-seek-to-live-control.vjs-at-live-edge .vjs-icon-placeholder {
    color: var(--glitch-pink);
}

/* =========================================================
   ABOUT / LEGAL — shared by the standalone /about page and
   the in-app overlay (which keeps the stream playing)
   ========================================================= */
body.about-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% -20%, rgba(171, 32, 253, 0.12), transparent 55%),
        var(--bg-deep);
    padding: 0 18px 60px;
    box-sizing: border-box;
}

.back-link {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 16px;
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--neon-bright);
    text-decoration: none;
    letter-spacing: 1px;
    padding: 6px 12px;
    border: 1px solid var(--glow-30);
    background: var(--panel-bg);
    transition: all 0.2s ease;
    z-index: 10;
}
.back-link:hover {
    color: #fff;
    border-color: var(--neon);
    box-shadow: 0 0 12px var(--glow-45);
}

.about-main {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 72px;
}

.about-title {
    font-family: 'VT323', monospace;
    font-size: 40px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--neon);
    text-shadow: 0 0 14px var(--glow-60);
    margin: 0 0 36px;
}

.about-section {
    background: var(--panel-bg);
    border: 1px solid var(--glow-30);
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: 0 0 18px rgba(171, 32, 253, 0.08);
}

.about-section h2 {
    font-family: 'VT323', monospace;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neon);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glow-30);
    text-shadow: 0 0 8px var(--glow-45);
}

.about-section h3 {
    font-family: 'VT323', monospace;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-bright);
    margin: 20px 0 10px;
}
.about-section h3:first-of-type { margin-top: 0; }

.about-section p {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--neon-bright);
    margin: 0;
}

.about-section p + p,
.about-section h3 + p {
    margin-top: 12px;
}

.about-section .service-tags {
    margin-top: 4px;
}

.about-section p a {
    color: var(--glitch-cyan);
    text-decoration: underline;
    transition: all 0.2s ease;
}
.about-section p a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.info-grid {
    display: grid;
    grid-template-columns: minmax(150px, 32%) 1fr;
    gap: 6px 16px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
}
.info-grid .label { color: rgba(199, 125, 255, 0.65); }
.info-grid .value { color: var(--neon-bright); }

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.service-tags .tag {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--neon-bright);
    padding: 6px 12px;
    border: 1px solid var(--glow-30);
    background: rgba(171, 32, 253, 0.07);
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.link-list a {
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--neon);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--glow-45);
    background: rgba(171, 32, 253, 0.08);
    transition: all 0.2s ease;
}
.link-list a:hover {
    color: #fff;
    border-color: var(--neon);
    box-shadow: 0 0 14px var(--glow-60);
    transform: translateY(-2px);
}
.link-list .handle {
    color: var(--neon-bright);
    font-size: 13px;
    margin-left: 6px;
}

.about-footer {
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: rgba(199, 125, 255, 0.55);
    letter-spacing: 1px;
    margin-top: 34px;
}

/* ── In-app overlay: about/legal over the globe, stream unbroken ── */
#aboutOverlay[hidden] { display: none; }

#aboutOverlay {
    position: fixed;
    inset: 0;
    z-index: 10005;             /* full-screen read: above bars, menu AND player */
    background: rgba(3, 0, 10, 0.86);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    overflow-y: auto;
    padding: 0 18px 80px;
    box-sizing: border-box;
    animation: menuIn 0.2s ease-out;
}

#aboutOverlay .about-main {
    padding-top: 64px;
}

#aboutClose {
    position: fixed;
    top: calc(40px + env(safe-area-inset-top, 0px));
    right: 14px;                /* takes the info button's spot while open */
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glow-45);
    border-radius: 50%;
    background: var(--panel-bg-strong);
    color: var(--neon);
    font-family: 'VT323', monospace;
    font-size: 24px;
    cursor: pointer;
    z-index: 10006;
    transition: all 0.2s ease;
    outline: none;
}
#aboutClose:hover {
    color: #fff;
    border-color: var(--neon);
    box-shadow: 0 0 14px var(--glow-60);
}

/* =========================================================
   CRT OVERLAY — a living phosphor layer on every UI surface;
   the globe, rain, and sky underneath stay clean.

   Three time-based behaviours (independent of the audio):
     · scanlines crawl slowly downward (3px/s — calm)
     · a soft roll-bar sweeps down once per 9s cycle (VHS
       tracking), hidden off-band the rest of the time
     · rare micro-jitters + uneven flicker dips (glitch)
   Dark 1px lines every 3px: invisible over the near-black
   panels, but they visibly stripe the lit text and glyphs —
   exactly how phosphor scanlines read.
   ========================================================= */
#topSolarBar::after,
#statusBar::after,
#radioFooter::after,
#infoMenu::after,
#infoBtn::before,
#aboutClose::before,
#videoBtn::before,
#videoClose::before,
#videoPanel .vp-head::after,
#radioPlayBtn::before,
#aboutOverlay::after {
    background-image:
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.30) 0,
            rgba(0, 0, 0, 0.30) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(199, 125, 255, 0.05) 35%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(199, 125, 255, 0.05) 65%,
            transparent 100%
        );
    background-size: auto auto, 100% 90px;
    background-repeat: repeat, no-repeat;
    animation: crtLive 9s linear infinite;
}

#topSolarBar::after,
#statusBar::after,
#radioFooter::after,
#infoMenu::after,
#infoBtn::before,
#aboutClose::before,
#videoBtn::before,
#videoClose::before,
#videoPanel .vp-head::after,
#radioPlayBtn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 6;
}

/* The horizon cap draws its own background — it gets the static scanline
   texture layered over its fill (a moving band on the thin cap reads odd) */
#radioFooter::before {
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.30) 0,
        rgba(0, 0, 0, 0.30) 1px,
        transparent 1px,
        transparent 3px
    );
    background-color: var(--panel-bg-strong);
}

/* The about overlay scrolls — pin its phosphor layer to the viewport */
#aboutOverlay::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

/* The loading screen is a full surface too — same living phosphor */
#loadingScreen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background-image:
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.30) 0,
            rgba(0, 0, 0, 0.30) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(199, 125, 255, 0.05) 35%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(199, 125, 255, 0.05) 65%,
            transparent 100%
        );
    background-size: auto auto, 100% 90px;
    background-repeat: repeat, no-repeat;
    animation: crtLive 9s linear infinite;
}

/* One 9s cycle: continuous 3px/s scanline crawl; the roll-bar parks
   hidden above, sweeps to below between 62% and 74%; two flicker dips
   and one horizontal micro-jitter along the way. */
@keyframes crtLive {
    0% {
        background-position: 0 0, 0 -90px;
        opacity: 1;
        transform: translateX(0);
    }
    46.9% { opacity: 1; }
    47%   { opacity: 0.86; }
    48%   { opacity: 1; }
    48.6% { transform: translateX(0); }
    49%   { opacity: 0.72; transform: translateX(-0.8px); }
    49.4% { transform: translateX(0); }
    50%   { opacity: 0.97; }
    62%   { background-position: 0 16.74px, 0 -90px; }
    74%   { background-position: 0 19.98px, 0 calc(100% + 90px); }
    81.9% { opacity: 1; }
    82%   { opacity: 0.9; }
    83%   { opacity: 1; }
    100% {
        background-position: 0 27px, 0 calc(100% + 90px);
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #topSolarBar::after,
    #statusBar::after,
    #radioFooter::after,
    #infoMenu::after,
    #infoBtn::before,
    #aboutClose::before,
    #videoBtn::before,
    #videoClose::before,
    #videoPanel .vp-head::after,
    #radioPlayBtn::before,
    #aboutOverlay::after {
        animation: none;
    }
    .vp-title::before {
        animation: none;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    #globeViz {
        position: fixed; /* Keep it fixed as a background */
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: -1; /* Behind the panels */
    }

    #topSolarBar {
        padding: 0 5px;
        font-size: 11px;
        height: 24px;
        justify-content: space-between;
    }
    /* Narrow screens: the two terminator countdowns are the priority — the
       clocks (AST/RT) and their separators yield. Children: 1 sunrise, 2 sep,
       3 AST, 4 sep, 5 RT, 6 sep, 7 sunset → keep 1, 6, 7. */
    #topSolarBar > span:nth-child(2),
    #topSolarBar > span:nth-child(3),
    #topSolarBar > span:nth-child(4),
    #topSolarBar > span:nth-child(5) {
        display: none;
    }
    #topBarCurve {
        top: calc(23px + env(safe-area-inset-top, 0px));
        height: 6px;
    }
    #topSolarBar span {
        margin: 0 3px;
    }
    #topSolarBar .separator {
        margin: 0 2px;
    }

    #radioFooter {
        height: 46px;
        bottom: calc(26px + env(safe-area-inset-bottom, 0px));
        grid-template-columns: 1fr 84px 1fr;
    }
    #radioFooter::before {
        top: -7px;
        height: 8px;
    }
    .rf-left  { padding-left: 10px; }
    .rf-right { padding-right: 10px; }
    #radioTrack  { font-size: 13px; }
    .rf-station  { font-size: 13px; }
    #radioPlayBtn {
        width: 66px;
        height: 66px;
        top: -15px;
        font-size: 26px;
    }
    #playBeam { bottom: calc(87px + env(safe-area-inset-bottom, 0px)); }

    #statusBar {
        height: calc(26px + env(safe-area-inset-bottom, 0px));
    }
    #tickerSvg {
        height: 26px;
    }
    #statusBar::before {
        height: 4px;
    }
    #tickerText {
        font-size: 13px;
    }

    #infoBtn  { top: calc(32px + env(safe-area-inset-top, 0px)); right: 10px; width: 44px; height: 44px; font-size: 25px; }
    #infoMenu {
        /* Between the mobile bars: 24px solar bar + 6px curve wing above,
           26px status + 46px footer below */
        top: calc(30px + env(safe-area-inset-top, 0px));
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        width: min(300px, 86vw);
    }
    #menuClose { width: 40px; height: 40px; font-size: 25px; }

    .about-title { font-size: 30px; }
    .about-section { padding: 16px 16px; }
    .info-grid { grid-template-columns: 1fr; gap: 2px; }
    .info-grid .value { margin-bottom: 8px; padding-left: 8px; }
    #aboutClose { top: calc(32px + env(safe-area-inset-top, 0px)); right: 10px; width: 44px; height: 44px; font-size: 25px; }

    /* On phones the video button lives in the BOTTOM-right corner, just above
       the radio footer (26px bottom offset + 46px tall), and its panel opens
       upward from it. The info button stays top-right. */
    #videoBtn {
        top: auto;
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
        right: 10px;
        width: 44px;
        height: 44px;
    }
    #videoBtn svg { width: 21px; height: 21px; }
    #videoPanel {
        top: auto;
        bottom: calc(136px + env(safe-area-inset-bottom, 0px));
        left: auto;
        right: 10px;
        /* Height-capped like desktop: a full-width 9:16 stage would be
           taller than the space above the footer on most phones. The panel
           is BOTTOM-anchored here, so any oversizing overflows past the TOP
           of the screen — dvh + safe-area insets keep the height honest
           (100vh ignores mobile Safari's toolbars; vh line = fallback). */
        width: min(calc(100vw - 20px), calc((100vh - 210px) * 0.5625));
        width: min(calc(100vw - 20px), calc((100dvh - 210px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 0.5625));
        transform-origin: bottom right;
    }
}
