/* Please give Adrian work. */

@font-face {
  font-family: "DSEG14Classic";
  src:
    url("../fonts/dseg/DSEG14Classic-Regular.woff2") format("woff2"),
    url("../fonts/dseg/DSEG14Classic-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DSEG14Classic";
  src:
    url("../fonts/dseg/DSEG14Classic-Bold.woff2") format("woff2"),
    url("../fonts/dseg/DSEG14Classic-Bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
      --bg: #020607;
      --panel: #071112;
      --green: #39ff88;
      --amber: #ffd166;
      --red: #ff4d6d;
      --blue: #64d2ff;
      --muted: #9be7be;
      --border: rgba(57, 255, 136, 0.65);
      --z-bg: 0;
      --z-effects: 2;
      --z-content: 10;
      --z-tabs: 40;
      --z-drawers: 100;
      --z-modal: 1000;
    }

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    html,
    body,
    a,
    button,
    summary,
    .download-button,
    .audio-control-button,
    .terminal-action-button,
    .floating-demo-button {
      cursor:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M3 2 L27 15 L16 18 L12 30 Z' fill='%23ffd166' stroke='%2339ff88' stroke-width='2'/%3E%3Cpath d='M11 10 L20 15 L14 16 Z' fill='%23000603'/%3E%3C/svg%3E") 3 2,
        auto;
    }

    body {
      margin: 0;
      background:
        radial-gradient(circle at top, rgba(57, 255, 136, 0.08), transparent 35%),
        linear-gradient(180deg, #020607 0%, #000 100%);
      color: var(--green);
      font-family: "Courier New", Courier, monospace;
      line-height: 1.5;
      min-height: 100vh;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.045),
        rgba(255, 255, 255, 0.045) 1px,
        transparent 1px,
        transparent 4px
      );
      mix-blend-mode: screen;
      z-index: 50;
    }

    body::after {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.95);
      z-index: 51;
    }

    a {
      color: var(--blue);
      text-decoration: none;
    }

    a:hover,
    a:focus {
      color: var(--amber);
      text-decoration: underline;
    }

    a:active,
    button:active,
    summary:active,
    .download-button:active,
    .audio-control-button:active {
      transform: translateY(1px);
      filter: brightness(1.25);
    }

    .terminal {
      width: min(1050px, calc(100% - 24px));
      margin: 24px auto;
      border: 2px solid var(--border);
      background: rgba(2, 8, 8, 0.92);
      box-shadow: 0 0 30px rgba(57, 255, 136, 0.22), inset 0 0 35px rgba(57, 255, 136, 0.05);
      position: relative;
      overflow: hidden;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      background: linear-gradient(90deg, rgba(57, 255, 136, 0.13), transparent);
      font-size: 0.86rem;
      color: var(--muted);
    }

    .status-light {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 999px;
      background: var(--green);
      box-shadow: 0 0 10px var(--green);
      margin-right: 6px;
    }

    .live-signal {
      color: var(--red);
      text-shadow: 0 0 8px rgba(255, 77, 109, 0.9);
      animation: pulseSignal 1.7s infinite;
      white-space: nowrap;
    }

    .live-signal__led {
      display: inline-block;
      width: 8px;
      height: 8px;
      margin-right: 6px;
      border: 1px solid rgba(255, 210, 216, 0.72);
      border-radius: 50%;
      background: #ff334f;
      box-shadow: 0 0 5px rgba(255, 51, 79, 0.72), inset 0 1px 1px rgba(255, 255, 255, 0.52);
      vertical-align: 0.04em;
    }

    @keyframes pulseSignal {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.42; }
    }

    header {
      padding: 42px 24px 28px;
      border-bottom: 1px dashed var(--border);
      background:
        linear-gradient(rgba(57, 255, 136, 0.06), transparent),
        repeating-linear-gradient(
          90deg,
          rgba(57, 255, 136, 0.045),
          rgba(57, 255, 136, 0.045) 1px,
          transparent 1px,
          transparent 90px
        );
    }


    .hero-command-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 18px;
      align-items: end;
    }

    .hero-demo-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      min-width: 170px;
      margin-bottom: 4px;
    }

    .hero-game-launch {
      appearance: none;
      -webkit-appearance: none;
      display: grid;
      justify-items: center;
      gap: 8px;
      width: min(100%, 220px);
      margin: 0 auto;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--green);
      font-family: inherit;
      text-transform: uppercase;
      cursor: pointer;
    }

    .hero-game-launch-label {
      color: var(--amber);
      font-size: 0.68rem;
      letter-spacing: 0.16em;
      line-height: 1.25;
      text-align: center;
      text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
    }

    .hero-game-disc {
      position: relative;
      display: grid;
      place-items: center;
      width: 118px;
      height: 118px;
      border: 1px solid rgba(100, 210, 255, 0.82);
      border-radius: 999px;
      background:
        radial-gradient(circle at center, #021419 0 8px, rgba(125, 249, 255, 0.92) 9px 12px, #020609 13px 18px, transparent 19px),
        conic-gradient(from 28deg, rgba(255,255,255,0.9), rgba(100,210,255,0.18), rgba(255,217,102,0.64), rgba(57,255,136,0.22), rgba(255,255,255,0.82), rgba(100,210,255,0.22), rgba(255,255,255,0.9)),
        radial-gradient(circle at 34% 24%, rgba(255,255,255,0.86), transparent 0 13%, rgba(100,210,255,0.12) 14% 36%, rgba(1,10,18,0.88) 68%);
      box-shadow:
        0 0 22px rgba(100, 210, 255, 0.28),
        0 0 34px rgba(57, 255, 136, 0.16),
        inset 0 0 20px rgba(255, 255, 255, 0.18);
      transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
    }

    .hero-game-disc::before,
    .hero-game-disc::after {
      content: "";
      position: absolute;
      border-radius: 999px;
      pointer-events: none;
    }

    .hero-game-disc::before {
      inset: 12px;
      border: 1px solid rgba(2, 16, 20, 0.42);
      box-shadow:
        inset 0 0 0 10px rgba(255, 255, 255, 0.05),
        inset 0 0 0 24px rgba(0, 0, 0, 0.1),
        inset 0 0 0 36px rgba(255, 255, 255, 0.05);
    }

    .hero-game-disc::after {
      inset: 24px 18px auto auto;
      width: 38px;
      height: 12px;
      background: rgba(255, 255, 255, 0.42);
      filter: blur(1px);
      transform: rotate(-24deg);
    }

    .hero-game-disc-core {
      width: 32px;
      height: 32px;
      border: 1px solid rgba(3, 12, 16, 0.8);
      border-radius: 999px;
      background: radial-gradient(circle, rgba(1,8,12,0.95) 0 34%, rgba(100,210,255,0.42) 35% 48%, rgba(2,12,18,0.96) 49%);
      box-shadow: 0 0 12px rgba(125, 249, 255, 0.38);
    }

    .hero-game-launch:hover .hero-game-disc,
    .hero-game-launch:focus .hero-game-disc {
      transform: translateY(-2px) rotate(12deg);
      filter: brightness(1.14);
      box-shadow:
        0 0 26px rgba(100, 210, 255, 0.38),
        0 0 42px rgba(57, 255, 136, 0.22),
        inset 0 0 22px rgba(255, 255, 255, 0.22);
    }

    .terminal-action-button {
      border: 1px solid var(--amber);
      background: rgba(255, 209, 102, 0.08);
      color: var(--amber);
      padding: 9px 12px;
      font-family: inherit;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-size: 0.76rem;
      text-align: center;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 38px;
    }

    .terminal-action-button:hover,
    .terminal-action-button:focus,
    .terminal-action-button.is-playing {
      background: var(--amber);
      color: #1c1200;
      text-decoration: none;
    }

    .floating-demo-button {
      position: fixed;
      left: 50%;
      bottom: 22px;
      z-index: 85;
      transform: translate(-50%, 18px);
      opacity: 0;
      pointer-events: none;
      border: 1px solid var(--amber);
      background: rgba(4, 12, 10, 0.92);
      color: var(--amber);
      padding: 10px 16px;
      font-family: inherit;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      box-shadow: 0 0 22px rgba(255, 209, 102, 0.18), inset 0 0 14px rgba(255, 209, 102, 0.06);
      transition: opacity 0.2s ease, transform 0.2s ease, background 0.18s ease, color 0.18s ease;
      backdrop-filter: blur(2px);
    }

    .floating-demo-button.visible {
      opacity: 0.92;
      pointer-events: auto;
      transform: translate(-50%, 0);
    }

    .floating-demo-button:hover,
    .floating-demo-button:focus,
    .floating-demo-button.is-playing {
      opacity: 1;
      background: var(--amber);
      color: #1c1200;
    }

    .kicker {
      color: var(--amber);
      letter-spacing: 0.14em;
      text-transform: uppercase;
      margin: 0 0 10px;
    }

    h1 {
      margin: 0;
      font-size: clamp(2.2rem, 8vw, 5.5rem);
      line-height: 0.95;
      text-shadow: 0 0 12px rgba(57, 255, 136, 0.7);
      letter-spacing: -0.06em;
    }

    .glitch-title { display: inline-block; }

    .glitch-title:hover {
      animation: subtleGlitch 0.32s steps(2, end) 1;
    }

    @keyframes subtleGlitch {
      0% {
        transform: translate(0, 0);
        text-shadow: 0 0 12px rgba(57, 255, 136, 0.7);
      }
      25% {
        transform: translate(1px, -1px);
        text-shadow:
          1px 0 rgba(100, 210, 255, 0.45),
          -1px 0 rgba(255, 77, 109, 0.35),
          0 0 12px rgba(57, 255, 136, 0.7);
      }
      50% { transform: translate(-1px, 1px); }
      75% { transform: translate(1px, 0); }
      100% {
        transform: translate(0, 0);
        text-shadow: 0 0 12px rgba(57, 255, 136, 0.7);
      }
    }

    .cursor { animation: blink 1s steps(2, start) infinite; }

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

    .tagline {
      max-width: 820px;
      margin: 18px 0 0;
      color: #d8ffe7;
      font-size: 1.05rem;
      min-height: 12.4em;
    }

    .terminal-typed-line {
      display: block;
      min-height: 1.5em;
      white-space: pre-wrap;
    }

    .terminal-typing-caret {
      display: inline-block;
      color: var(--green);
      animation: blink 1s steps(2, start) infinite;
    }

    @media (prefers-reduced-motion: reduce) {
      html:not([data-motion="full"]) .tagline { min-height: auto; }
      html:not([data-motion="full"]) .terminal-typing-caret { display: none; }
    }

.typing-caret::after {
      content: "|";
      color: var(--green);
      margin-left: 2px;
      animation: blink 1s steps(2, start) infinite;
    }

    .copy-module { margin-top: 18px; }

    .copy-audio-row {
      display: flex;
      justify-content: flex-start;
      margin-top: 14px;
    }

    .narration-button {
      border: 1px solid var(--amber);
      background: rgba(255, 209, 102, 0.08);
      color: var(--amber);
      padding: 9px 13px;
      font-family: inherit;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-size: 0.76rem;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .narration-button::before {
      content: "";
      display: inline-block;
      flex: 0 0 10px;
      width: 10px;
      height: 12px;
      background: var(--amber);
      clip-path: polygon(0 0, 100% 50%, 0 100%);
    }

    .narration-button.is-playing::before {
      background: linear-gradient(to right, var(--amber) 0 3px, transparent 3px 7px, var(--amber) 7px);
      clip-path: none;
    }

    .narration-button:hover,
    .narration-button:focus {
      background: var(--amber);
      color: #1c1200;
    }

    nav {
      padding: 14px;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      border-bottom: 1px solid var(--border);
      background: rgba(7, 17, 18, 0.88);
      position: sticky;
      top: 0;
      z-index: 30;
    }

    nav a {
      border: 1px solid var(--border);
      padding: 10px;
      color: var(--green);
      text-align: center;
      background: rgba(57, 255, 136, 0.045);
      text-transform: uppercase;
      font-size: 0.9rem;
    }

    nav a:hover,
    nav a:focus {
      background: var(--green);
      color: #001b0b;
      text-decoration: none;
    }

    main { padding: 22px; }

    .panel {
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(11, 24, 26, 0.95), rgba(3, 8, 9, 0.95));
      box-shadow: inset 0 0 20px rgba(57, 255, 136, 0.04);
      margin-bottom: 18px;
    }

    details.panel { padding: 0; }

    details.panel > summary {
      cursor: pointer;
      padding: 18px;
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      list-style: none;
      border-bottom: 1px dashed rgba(57, 255, 136, 0.25);
      user-select: none;
    }

    details.panel > summary::-webkit-details-marker { display: none; }

    details.panel > summary::before {
      content: "> ";
      color: var(--green);
    }

    details.panel > summary::after {
      content: " [CLOSE]";
      color: var(--muted);
      font-size: 0.72rem;
      letter-spacing: 0.05em;
    }

    details.panel:not([open]) > summary::after { content: " [OPEN]"; }

    details.panel > summary:hover {
      background: rgba(57, 255, 136, 0.06);
    }

    .panel-content { padding: 18px; }
    .compact-demo .panel-content { padding: 14px; }

    .demo-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 10px;
    }

    .demo-header h2 { margin-bottom: 4px; }

    .panel h2,
    .panel h3 {
      margin-top: 0;
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .goof-panel .panel-content > p {
      margin: 0 0 24px;
      color: var(--green);
      font-size: clamp(0.95rem, 1.7vw, 1.08rem);
      letter-spacing: 0.04em;
    }

    .goof-tape-widget {
      position: relative;
      display: grid;
      justify-items: stretch;
      gap: 14px;
      margin: 18px auto 14px;
      max-width: 100%;
    }

    .goof-tape-img {
      display: block;
      width: 100%;
      height: auto;
    }

    .goof-tape-canvas {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 2;
      display: block;
    }

    .goof-track-list {
      position: absolute;
      left: 50%;
      bottom: clamp(12px, 3vw, 34px);
      z-index: 5;
      display: none;
      width: min(92%, 440px);
      max-height: min(72vh, 360px);
      overflow-y: auto;
      transform: translateX(-50%);
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(255, 209, 102, 0.72);
      border-radius: 8px;
      background: rgba(2, 10, 14, 0.94);
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.46), 0 0 22px rgba(57, 255, 136, 0.12);
    }

    .goof-tape-widget.is-track-menu-open .goof-track-list {
      display: grid;
    }

    .goof-pause-button {
      border: 1px solid rgba(255, 209, 102, 0.72);
      background: rgba(255, 209, 102, 0.1);
      color: var(--amber);
      font-family: inherit;
      font-size: 0.72rem;
      line-height: 1.25;
      text-align: center;
      text-transform: uppercase;
      padding: 9px 10px;
    }

    .goof-pause-button:hover,
    .goof-pause-button:focus {
      background: var(--amber);
      color: #1f1600;
      outline: none;
    }

    .goof-pause-button:disabled {
      border-color: rgba(155, 231, 190, 0.24);
      background: rgba(155, 231, 190, 0.035);
      color: rgba(155, 231, 190, 0.42);
      cursor: not-allowed;
    }

    .goof-track-button {
      border: 1px solid rgba(57, 255, 136, 0.55);
      background: rgba(57, 255, 136, 0.045);
      color: var(--green);
      font-family: inherit;
      font-size: 0.78rem;
      line-height: 1.45;
      text-align: left;
      text-transform: uppercase;
      padding: 10px;
    }

    .goof-track-button span {
      display: block;
      color: var(--amber);
      font-size: 0.72rem;
      margin-bottom: 3px;
    }

    .goof-track-button:hover,
    .goof-track-button:focus,
    .goof-track-button.active {
      background: var(--green);
      color: #001b0b;
      outline: none;
    }

    .goof-track-button:hover span,
    .goof-track-button:focus span,
    .goof-track-button.active span {
      color: #3a2200;
    }

    .goof-recorder-shell {
      margin: 18px 0 14px;
      padding: clamp(12px, 1.5vw, 18px);
      border: 1px solid rgba(255, 209, 102, 0.48);
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(2, 10, 14, 0.78), rgba(0, 0, 0, 0.72));
      box-shadow: inset 0 0 22px rgba(57, 255, 136, 0.045);
    }

    .goof-player-topline {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 14px;
      color: var(--amber);
      font-size: clamp(0.66rem, 1.3vw, 0.82rem);
      letter-spacing: 0.18em;
      text-transform: uppercase;
    }

    .goof-warning-light {
      width: 13px;
      height: 13px;
      border-radius: 999px;
      background: rgba(255, 77, 109, 0.62);
      box-shadow: 0 0 12px rgba(255, 77, 109, 0.38);
    }

    .goof-player-state {
      justify-self: end;
      color: #ff7186;
    }

    .goof-recorder-main {
      display: grid;
      grid-template-columns: minmax(220px, 0.72fr) minmax(220px, 0.48fr);
      gap: clamp(16px, 2.2vw, 32px);
      align-items: center;
      margin: 16px 0 12px;
    }

    .goof-recorder-stage {
      position: relative;
      display: grid;
      place-items: center;
      justify-self: center;
      width: min(100%, 360px);
      max-width: 100%;
      overflow: visible;
    }

    .goof-recorder-image {
      display: block;
      width: 100%;
      height: auto;
      object-fit: contain;
      filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.32));
    }

    .goof-recorder-canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 3;
      pointer-events: none;
    }

    .goof-control-stack {
      display: grid;
      gap: 14px;
      justify-items: stretch;
    }

    .goof-play-button {
      width: 100%;
      min-height: 58px;
      border: 1px solid rgba(57, 255, 136, 0.72);
      border-radius: 9px 3px 10px 4px;
      background:
        linear-gradient(180deg, rgba(57, 255, 136, 0.15), rgba(0, 0, 0, 0.78));
      color: var(--green);
      font-family: inherit;
      font-size: clamp(0.58rem, 1vw, 0.72rem);
      letter-spacing: 0.08em;
      text-align: left;
      text-transform: uppercase;
      box-shadow: inset 0 0 18px rgba(57, 255, 136, 0.08);
    }

    .goof-play-button:hover,
    .goof-play-button:focus {
      color: var(--amber);
      border-color: rgba(255, 209, 102, 0.9);
      outline: none;
    }

    .goof-play-icon {
      display: inline-grid;
      place-items: center;
      width: 24px;
      height: 24px;
      margin-right: 8px;
      border: 1px solid currentColor;
      box-shadow: 0 0 10px rgba(57, 255, 136, 0.25);
    }

    .goof-meter-stack {
      display: grid;
      grid-template-columns: repeat(6, 7px);
      align-items: end;
      justify-self: end;
      gap: 5px;
      height: 42px;
      padding: 6px;
      border: 1px solid rgba(143, 216, 255, 0.3);
      background: rgba(0, 0, 0, 0.34);
      box-shadow: inset 0 0 14px rgba(100, 210, 255, 0.08);
    }

    .goof-meter-stack span {
      display: block;
      min-height: 8px;
      background: linear-gradient(180deg, #ffd166, var(--green));
      box-shadow: 0 0 10px rgba(57, 255, 136, 0.34);
    }

    .goof-meter-stack span:nth-child(1) { height: 18px; }
    .goof-meter-stack span:nth-child(2) { height: 25px; }
    .goof-meter-stack span:nth-child(3) { height: 14px; }
    .goof-meter-stack span:nth-child(4) { height: 34px; }
    .goof-meter-stack span:nth-child(5) { height: 22px; }
    .goof-meter-stack span:nth-child(6) { height: 38px; background: linear-gradient(180deg, var(--red), var(--green)); }

    .goof-progress-shell {
      height: 10px;
      margin-top: 12px;
      border: 1px solid rgba(100, 210, 255, 0.42);
      background: rgba(0, 0, 0, 0.44);
    }

    .goof-progress-fill {
      width: 0;
      height: 100%;
      background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
      box-shadow: 0 0 12px rgba(57, 255, 136, 0.5);
    }

    .goof-player-footer {
      margin-top: 10px;
      color: rgba(216, 255, 231, 0.72);
      font-size: 0.78rem;
      letter-spacing: 0.08em;
    }

    @media (max-width: 780px) {
      .goof-recorder-shell {
        padding: 12px;
        border-radius: 12px;
      }

      .goof-player-topline {
        grid-template-columns: auto 1fr;
        gap: 8px 10px;
      }

      .goof-player-state {
        grid-column: 1 / -1;
        justify-self: start;
      }

      .goof-recorder-main {
        grid-template-columns: 1fr;
      }

      .goof-recorder-stage {
        width: min(82%, 300px);
      }

      .goof-recorder-image {
        width: 100%;
      }

      .goof-meter-stack {
        justify-self: center;
      }
    }

    .custom-audio-player {
      border: 1px solid rgba(57, 255, 136, 0.8);
      background:
        linear-gradient(180deg, rgba(5, 20, 18, 0.96), rgba(0, 5, 5, 0.96)),
        repeating-linear-gradient(
          to bottom,
          rgba(57, 255, 136, 0.05) 0px,
          rgba(57, 255, 136, 0.05) 1px,
          transparent 1px,
          transparent 5px
        );
      padding: 14px;
      margin-top: 14px;
      box-shadow:
        inset 0 0 20px rgba(57, 255, 136, 0.08),
        0 0 18px rgba(57, 255, 136, 0.14);
    }

    .custom-audio-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 12px;
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 0.84rem;
    }

    .custom-audio-status {
      color: var(--green);
      font-size: 0.72rem;
      text-shadow: 0 0 8px rgba(57, 255, 136, 0.7);
      white-space: nowrap;
    }

    .custom-audio-controls {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 10px;
      align-items: center;
    }

    .audio-control-button {
      border: 1px solid var(--green);
      background: rgba(57, 255, 136, 0.06);
      color: var(--green);
      padding: 8px 10px;
      font-family: inherit;
      text-transform: uppercase;
      font-size: 0.78rem;
    }

    .audio-control-button:hover,
    .audio-control-button:focus {
      background: var(--green);
      color: #001b0b;
    }

    .audio-progress-shell {
      position: relative;
      height: 14px;
      border: 1px solid rgba(57, 255, 136, 0.65);
      background:
        repeating-linear-gradient(
          90deg,
          rgba(57, 255, 136, 0.12) 0px,
          rgba(57, 255, 136, 0.12) 1px,
          transparent 1px,
          transparent 8px
        ),
        rgba(0, 0, 0, 0.5);
      cursor: pointer;
      overflow: hidden;
    }

    .audio-progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--green), var(--blue));
      box-shadow: 0 0 10px rgba(57, 255, 136, 0.75);
    }

    .audio-time {
      color: var(--muted);
      font-size: 0.78rem;
      min-width: 88px;
      text-align: right;
    }

    .audio-download-row,
    .download-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
    }

    .audio-download-button,
    .download-button {
      display: inline-block;
      border: 1px solid var(--green);
      color: var(--green);
      padding: 8px 10px;
      background: rgba(57, 255, 136, 0.06);
      text-transform: uppercase;
      font-size: 0.78rem;
    }

    .audio-download-button:hover,
    .audio-download-button:focus,
    .download-button:hover,
    .download-button:focus {
      background: var(--green);
      color: #001b0b;
      text-decoration: none;
    }

    .profile-card {
      display: grid;
      grid-template-columns: 170px 1fr;
      gap: 20px;
      align-items: start;
    }

    .profile-photo-wrap {
      border: 1px solid var(--border);
      background: rgba(0, 0, 0, 0.35);
      padding: 8px;
      box-shadow: 0 0 16px rgba(57, 255, 136, 0.16);
    }

    .profile-photo-frame {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(57, 255, 136, 0.85);
      background: #000;
      box-shadow:
        inset 0 0 22px rgba(57, 255, 136, 0.22),
        0 0 16px rgba(57, 255, 136, 0.22);
      display: block;
      width: 100%;
      padding: 0;
      font-family: inherit;
    }

    .profile-audio-trigger {
      appearance: none;
      -webkit-appearance: none;
      color: inherit;
      cursor: pointer;
      text-align: left;
    }

    .profile-photo-frame:hover {
      box-shadow:
        inset 0 0 22px rgba(57, 255, 136, 0.26),
        0 0 20px rgba(57, 255, 136, 0.32);
    }

    .profile-photo {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      display: block;
      filter: grayscale(15%) contrast(135%) brightness(90%) sepia(10%);
      animation: selfiePhase 3.5s ease-in-out infinite;
    }

    .profile-photo-static {
      position: relative;
      z-index: 1;
    }

    .profile-photo-gif {
      position: absolute;
      inset: 0;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.14s ease;
    }

    .profile-photo-frame:hover .profile-photo-gif {
      opacity: 1;
    }

    .profile-photo-frame:hover .profile-photo-static {
      opacity: 0;
    }

    .profile-game-label {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      z-index: 4;
      padding: 6px 8px;
      border: 1px solid rgba(57, 255, 136, 0.68);
      background: linear-gradient(90deg, rgba(0, 10, 8, 0.92), rgba(0, 24, 18, 0.72));
      color: var(--green);
      font-size: 0.56rem;
      letter-spacing: 0.08em;
      line-height: 1.2;
      pointer-events: none;
      text-transform: uppercase;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 0 12px rgba(57, 255, 136, 0.2);
    }

    .profile-game-play-icon {
      width: 26px;
      height: 26px;
      border: 1px solid rgba(57, 255, 136, 0.78);
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      background: rgba(57, 255, 136, 0.08);
      box-shadow: inset 0 0 10px rgba(57, 255, 136, 0.12), 0 0 10px rgba(57, 255, 136, 0.14);
    }

    .profile-game-play-icon::before {
      content: "";
      display: block;
      margin-left: 2px;
      border-top: 6px solid transparent;
      border-bottom: 6px solid transparent;
      border-left: 9px solid currentColor;
    }

    .profile-game-label-copy {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }

    .profile-game-label-copy strong {
      font-size: 0.64rem;
      font-weight: 400;
      line-height: 1;
    }

    .profile-game-label-copy span {
      font-size: 0.48rem;
      opacity: 0.84;
      line-height: 1.1;
    }

    .profile-photo-frame::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 2;
      background:
        repeating-linear-gradient(
          to bottom,
          rgba(57, 255, 136, 0.22) 0px,
          rgba(57, 255, 136, 0.22) 1px,
          transparent 1px,
          transparent 4px
        );
      mix-blend-mode: screen;
      opacity: 0.45;
    }

    .profile-photo-frame::after {
      content: "";
      position: absolute;
      inset: -10%;
      pointer-events: none;
      z-index: 3;
      background:
        repeating-linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.12) 0px,
          rgba(255, 255, 255, 0.12) 1px,
          transparent 1px,
          transparent 3px
        ),
        repeating-linear-gradient(
          0deg,
          rgba(57, 255, 136, 0.08) 0px,
          rgba(57, 255, 136, 0.08) 1px,
          transparent 1px,
          transparent 5px
        );
      mix-blend-mode: screen;
      animation: selfieStaticPulse 1.8s steps(2, end) infinite;
    }

    @keyframes selfiePhase {
      0%, 100% {
        transform: translate(0, 0);
        filter: grayscale(15%) contrast(135%) brightness(90%) sepia(10%);
      }
      32% {
        transform: translate(1px, -1px);
        filter: grayscale(10%) contrast(150%) brightness(100%) sepia(8%);
      }
      34% { transform: translate(-1px, 1px); }
      36%, 70% { transform: translate(0, 0); }
      74% {
        transform: translate(1px, 0);
        filter: grayscale(20%) contrast(145%) brightness(96%) sepia(12%);
      }
      76% { transform: translate(0, 0); }
    }

    @keyframes selfieStaticPulse {
      0%, 100% {
        opacity: 0.06;
        transform: translate(0, 0);
      }
      25% {
        opacity: 0.16;
        transform: translate(-2px, 1px);
      }
      50% {
        opacity: 0.08;
        transform: translate(2px, -1px);
      }
      75% {
        opacity: 0.22;
        transform: translate(-1px, 2px);
      }
    }

    .profile-label {
      margin: 8px 0 0;
      font-size: 0.72rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .personality-label {
      color: var(--amber);
      text-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
    }

    .mission-copy {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .skill-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 2px;
    }

    .skill-tab-wrap {
      position: relative;
      display: inline-flex;
    }

    .skill-tab {
      border: 1px solid rgba(100, 210, 255, 0.82);
      color: #a9e7ff;
      background: rgba(100, 210, 255, 0.08);
      padding: 10px 14px;
      font-size: 0.94rem;
      font-family: inherit;
      text-transform: none;
      letter-spacing: 0.02em;
      line-height: 1.1;
      box-shadow: inset 0 0 12px rgba(100, 210, 255, 0.08);
    }

    .skill-tab:hover,
    .skill-tab:focus {
      background: rgba(100, 210, 255, 0.2);
      color: #e8f9ff;
      text-decoration: none;
      transform: translateY(-1px);
    }

    .skill-tab:active,
    .skill-tab.pressed {
      background: var(--blue);
      color: #031118;
      box-shadow: 0 0 16px rgba(100, 210, 255, 0.4);
    }

    .skill-tip {
      position: absolute;
      left: 0;
      top: calc(100% + 8px);
      width: max-content;
      max-width: 230px;
      background: rgba(0, 10, 10, 0.98);
      border: 1px solid rgba(100, 210, 255, 0.8);
      color: #d9f7ff;
      padding: 8px 10px;
      font-size: 0.76rem;
      line-height: 1.35;
      z-index: 40;
      box-shadow: 0 0 16px rgba(100, 210, 255, 0.18);
      opacity: 0;
      pointer-events: none;
      transform: translateY(-4px);
      transition: opacity 0.16s ease, transform 0.16s ease;
    }

    .skill-tip::before {
      content: "";
      position: absolute;
      left: 12px;
      top: -6px;
      width: 10px;
      height: 10px;
      background: rgba(0, 10, 10, 0.98);
      border-left: 1px solid rgba(100, 210, 255, 0.8);
      border-top: 1px solid rgba(100, 210, 255, 0.8);
      transform: rotate(45deg);
    }

    .skill-tab-wrap:hover .skill-tip,
    .skill-tab-wrap:focus-within .skill-tip {
      opacity: 1;
      transform: translateY(0);
    }

    .top-link-row {
      display: flex;
      justify-content: center;
      margin-top: 16px;
      border-top: 1px dashed rgba(57, 255, 136, 0.22);
      padding-top: 10px;
    }

    .top-link {
      display: inline-block;
      border: 1px solid rgba(57, 255, 136, 0.45);
      color: var(--muted);
      padding: 4px 7px;
      background: rgba(57, 255, 136, 0.035);
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .top-link:hover,
    .top-link:focus {
      background: var(--green);
      color: #001b0b;
      text-decoration: none;
    }

    .button {
      display: inline-block;
      margin-top: 10px;
      border: 1px solid var(--green);
      color: var(--green);
      padding: 9px 12px;
      background: rgba(57, 255, 136, 0.06);
      text-transform: uppercase;
    }

    .button:hover,
    .button:focus {
      background: var(--green);
      color: #001b0b;
      text-decoration: none;
    }

    .marquee {
      overflow: hidden;
      white-space: nowrap;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      background: rgba(255, 209, 102, 0.08);
      color: var(--amber);
      padding: 8px 0;
    }

    .marquee span {
      display: inline-block;
      padding-left: 100%;
      animation: scroll 84.02s linear infinite;
    }

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

    footer {
      padding: 18px 22px;
      border-top: 1px solid var(--border);
      color: var(--muted);
      font-size: 0.88rem;
      display: flex;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .side-tab {
      position: fixed;
      z-index: 80;
      width: 158px;
      height: 54px;
      border: 2px solid rgba(57, 255, 136, 0.72);
      background:
        linear-gradient(180deg, rgba(0, 22, 12, 0.72), rgba(0, 6, 4, 0.62));
      color: rgba(57, 255, 136, 0.88);
      font-family: inherit;
      font-size: 0.82rem;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow:
        0 0 18px rgba(57, 255, 136, 0.22),
        inset 0 0 18px rgba(57, 255, 136, 0.08);
      padding: 0 14px;
      opacity: 0.72;
      backdrop-filter: blur(2px);
      transition:
        opacity 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
      animation: archiveTabPulse 4.2s ease-in-out infinite;
    }

    .side-tab::before {
      content: "";
      position: absolute;
      inset: 6px;
      border: 1px dashed rgba(57, 255, 136, 0.35);
      pointer-events: none;
    }

    .side-tab::after {
      content: "";
      position: absolute;
      inset: -5px;
      border: 1px solid rgba(57, 255, 136, 0.1);
      pointer-events: none;
    }

    @keyframes archiveTabPulse {
      0%, 100% {
        box-shadow:
          0 0 14px rgba(57, 255, 136, 0.18),
          inset 0 0 14px rgba(57, 255, 136, 0.08);
      }
      50% {
        box-shadow:
          0 0 26px rgba(57, 255, 136, 0.36),
          inset 0 0 20px rgba(57, 255, 136, 0.14);
      }
    }

    .side-tab:hover,
    .side-tab:focus {
      opacity: 1;
      background: rgba(57, 255, 136, 0.96);
      color: #001b0b;
      box-shadow:
        0 0 34px rgba(57, 255, 136, 0.65),
        inset 0 0 22px rgba(0, 0, 0, 0.22);
      animation-play-state: paused;
    }

    .audio-drawer-tab,
    .writing-drawer-tab,
    .goofs-side-tab {
      left: 14px;
      top: auto;
      clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
    }

    .audio-drawer-tab { bottom: 88px; }
    .writing-drawer-tab { bottom: 26px; }

    .audio-drawer-tab .tab-arrow,
    .writing-drawer-tab .tab-arrow,
    .goofs-side-tab .tab-arrow { margin-right: calc(7px * var(--side-tab-scale, 1)); }

    .video-drawer-tab,
    .social-drawer-tab,
    .audio-producer-game-tab {
      right: 14px;
      top: auto;
      clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    }

    .video-drawer-tab { bottom: 150px; }
    .social-drawer-tab { bottom: 88px; }

    .video-drawer-tab .tab-arrow,
    .social-drawer-tab .tab-arrow,
    .audio-producer-game-tab .tab-arrow { margin-left: calc(7px * var(--side-tab-scale, 1)); }

.ambient-toggle:hover,
    .ambient-toggle:focus {
      opacity: 1;
      background: rgba(255, 209, 102, 0.95);
      color: #1c1200;
    }

.side-drawer {
      position: fixed;
      top: 0;
      width: min(560px, 94vw);
      height: 100vh;
      z-index: 100;
      background:
        linear-gradient(180deg, rgba(5, 20, 18, 0.98), rgba(0, 4, 4, 0.98)),
        repeating-linear-gradient(
          to bottom,
          rgba(57, 255, 136, 0.045) 0px,
          rgba(57, 255, 136, 0.045) 1px,
          transparent 1px,
          transparent 5px
        );
      box-shadow: 0 0 32px rgba(0, 0, 0, 0.65), 0 0 22px rgba(57, 255, 136, 0.18);
      padding: 18px;
      transition: transform 0.32s ease;
      overflow-y: auto;
    }

    .video-drawer {
      right: 0;
      border-left: 2px solid var(--border);
      transform: translateX(105%);
    }

    .audio-drawer {
      left: 0;
      border-right: 2px solid var(--border);
      transform: translateX(-105%);
    }

    .video-drawer.open,
    .audio-drawer.open {
      transform: translateX(0);
    }

    .drawer-backdrop {
      position: fixed;
      inset: 0;
      z-index: 90;
      background: rgba(0, 0, 0, 0.45);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .drawer-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }

    .drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      border-bottom: 1px dashed rgba(57, 255, 136, 0.35);
      padding-bottom: 12px;
      margin-bottom: 14px;
    }

    .drawer-kicker {
      margin: 0 0 4px;
      color: var(--muted);
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .drawer-header h2 {
      margin: 0;
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .drawer-close {
      border: 1px solid var(--red);
      background: rgba(255, 77, 109, 0.08);
      color: var(--red);
      font-family: inherit;
      text-transform: uppercase;
      padding: 8px 10px;
    }

    .drawer-close:hover,
    .drawer-close:focus {
      background: var(--red);
      color: #120004;
    }

    .drawer-player {
      border: 1px solid rgba(57, 255, 136, 0.75);
      background: #000;
      padding: 8px;
      box-shadow: inset 0 0 18px rgba(57, 255, 136, 0.08);
    }

    .video-iframe-shell { aspect-ratio: 16 / 9; }

    .video-iframe-shell iframe {
      width: 100%;
      height: 100%;
      display: block;
      background: #000;
    }

    .instagram-drawer-shell {
      display: none;
      max-width: 190px;
      max-height: 430px;
      margin: 0 auto;
      overflow: hidden;
    }

    .instagram-drawer-shell.active {
      display: block;
    }

    .instagram-drawer-shell .instagram-media {
      min-width: 0 !important;
      max-width: 190px !important;
      width: 100% !important;
      margin: 0 auto !important;
      transform: scale(0.72);
      transform-origin: top center;
    }

    .instagram-drawer-shell iframe {
      max-height: 430px !important;
    }

    .drawer-now {
      border: 1px dashed rgba(57, 255, 136, 0.45);
      background: rgba(0, 0, 0, 0.22);
      padding: 12px;
      margin-top: 12px;
    }

    .drawer-now h3 {
      margin: 0 0 6px;
      color: var(--green);
      text-transform: uppercase;
    }

    .drawer-now p { margin-bottom: 0; }

    .drawer-list {
      display: grid;
      gap: 10px;
      margin-top: 14px;
    }

    .archive-section-hidden,
    .drawer-item-hidden {
      display: none !important;
    }

    .drawer-item {
      border: 1px solid rgba(57, 255, 136, 0.55);
      background: rgba(57, 255, 136, 0.045);
      color: var(--green);
      font-family: inherit;
      text-align: left;
      padding: 10px;
      text-transform: uppercase;
    }

    .drawer-item span {
      display: block;
      color: var(--amber);
      font-size: 0.72rem;
      margin-bottom: 3px;
    }

    .drawer-item:hover,
    .drawer-item:focus,
    .drawer-item.active {
      background: var(--green);
      color: #001b0b;
    }

    .drawer-item:hover span,
    .drawer-item:focus span,
    .drawer-item.active span {
      color: #003115;
    }

    .writing-archive {
      border-top: 1px dashed rgba(57, 255, 136, 0.35);
      margin-top: 18px;
      padding-top: 14px;
    }

    .writing-archive h3 {
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 10px;
    }

    .writing-card {
      border: 1px dashed rgba(57, 255, 136, 0.5);
      padding: 12px;
      margin-top: 10px;
      background: rgba(0, 0, 0, 0.22);
    }

    .writing-card h4 {
      margin: 0 0 8px;
      color: var(--green);
      text-transform: uppercase;
    }


    .audio-link-archive {
      border-top: 1px dashed rgba(57, 255, 136, 0.35);
      margin-top: 18px;
      padding-top: 14px;
    }

    .audio-link-archive h3 {
      color: var(--amber);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 10px;
    }

    .file-card,
    .panel,
    .panel-content,
    summary,
    p,
    h2,
    h3,
    a {
      overflow-wrap: anywhere;
      word-break: normal;
    }

    @media (max-width: 850px) {
      nav {
        grid-template-columns: 1fr;
        position: static;
      }

      .hero-demo-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 390px;
      }

      .profile-card {
        grid-template-columns: 1fr;
      }

      .profile-photo-wrap {
        max-width: 190px;
      }

      header {
        padding: 32px 18px 24px;
      }

      main {
        padding: 14px;
      }
    }

    @media (max-width: 650px) {
      body { font-size: 0.95rem; }

      .terminal {
        width: calc(100% - 12px);
        margin: 6px auto;
      }
.demo-header { display: block; }
      main { padding: 10px; }
      .panel-content { padding: 12px; }

      details.panel > summary {
        padding: 14px 12px;
        font-size: 0.92rem;
      }

      .button,
      .download-button,
      .audio-download-button,
      .terminal-action-button,
      .floating-demo-button,
      .narration-button {
        font-size: 0.82rem;
        padding: 8px 10px;
      }

      .download-row,
      .audio-download-row,
      .hero-demo-actions {
        display: grid;
        grid-template-columns: 1fr;
      }

      .custom-audio-header { display: block; }
      .custom-audio-controls { grid-template-columns: 1fr; }
      .audio-time { text-align: left; }

      .topbar {
        flex-direction: column;
        align-items: flex-start;
      }

      header { padding: 24px 14px 20px; }
      .tagline { font-size: 0.98rem; }
      .copy-audio-row { display: block; }

      .skill-tip {
        position: static;
        opacity: 1;
        transform: none;
        margin-top: 6px;
        max-width: 100%;
        display: none;
      }

      .skill-tab-wrap:hover .skill-tip,
      .skill-tab-wrap:focus-within .skill-tip {
        display: block;
      }

      .side-tab {
        width: auto;
        min-width: 145px;
        height: 50px;
        padding: 0 14px;
        top: auto;
      }

      .audio-drawer-tab,
      .writing-drawer-tab {
        left: 12px;
      }

      .audio-drawer-tab { bottom: 76px; }
      .writing-drawer-tab { bottom: 14px; }

      .video-drawer-tab,
      .social-drawer-tab {
        right: 12px;
      }

      .video-drawer-tab { bottom: 138px; }
      .social-drawer-tab { bottom: 76px; }
      .floating-demo-button {
        bottom: 132px;
        width: min(220px, calc(100vw - 32px));
      }

.side-drawer {
        width: 100vw;
        padding: 14px;
      }
    }

/* Pure HTML/CSS Terran-style demo reel command module */
.terran-demo-console {
  width: min(470px, 42vw);
  min-width: 320px;
  position: relative;
  padding: 7px;
  border: 1px solid rgba(155, 231, 190, 0.42);
  background:
    linear-gradient(135deg, transparent 0 14px, rgba(35, 42, 42, 0.98) 14px calc(100% - 14px), transparent calc(100% - 14px)),
    linear-gradient(180deg, rgba(16, 22, 22, 0.98), rgba(2, 6, 7, 0.98));
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 18px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.9),
    inset 0 0 18px rgba(57, 255, 136, 0.055),
    0 0 16px rgba(57, 255, 136, 0.12);
}

.terran-demo-console::before,
.terran-demo-console::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 8px;
  height: 8px;
  background: var(--amber);
  border: 1px solid rgba(255, 77, 109, 0.9);
  box-shadow: 0 0 10px rgba(255, 77, 109, 0.85);
  pointer-events: none;
}

.terran-demo-console::before { left: 12px; }
.terran-demo-console::after { right: 12px; }

.terran-demo-main {
  position: relative;
  width: 100%;
  min-height: 74px;
  border: 1px solid rgba(57, 255, 136, 0.58);
  background:
    repeating-linear-gradient(to bottom, rgba(57, 255, 136, 0.055), rgba(57, 255, 136, 0.055) 1px, transparent 1px, transparent 5px),
    linear-gradient(90deg, rgba(2, 21, 17, 0.98), rgba(0, 7, 8, 0.98));
  color: #b8ffd1;
  font-family: inherit;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 14px);
  box-shadow:
    inset 0 0 16px rgba(57, 255, 136, 0.10),
    inset 0 0 0 1px rgba(0, 0, 0, 0.9);
}

.terran-demo-main:hover,
.terran-demo-main:focus {
  color: #eafff0;
  border-color: rgba(57, 255, 136, 0.95);
  box-shadow:
    inset 0 0 20px rgba(57, 255, 136, 0.18),
    0 0 18px rgba(57, 255, 136, 0.22);
}

.terran-play-cell {
  width: 58px;
  height: 52px;
  border: 1px solid rgba(57, 255, 136, 0.55);
  background: rgba(0, 0, 0, 0.34);
  display: grid;
  place-items: center;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  box-shadow: inset 0 0 12px rgba(57, 255, 136, 0.12);
}

.terran-play-symbol {
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 23px solid var(--green);
  filter: drop-shadow(0 0 8px rgba(57, 255, 136, 0.85));
  margin-left: 5px;
}

.terran-pause-symbol {
  display: none;
  gap: 6px;
}

.terran-pause-symbol span {
  width: 8px;
  height: 29px;
  display: block;
  background: var(--green);
  box-shadow: 0 0 8px rgba(57, 255, 136, 0.85);
}

.terran-demo-console.is-playing .terran-play-symbol { display: none; }
.terran-demo-console.is-playing .terran-pause-symbol { display: flex; }

.terran-demo-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.terran-demo-label {
  color: var(--green);
  font-size: clamp(1rem, 2vw, 1.55rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(57, 255, 136, 0.7);
  white-space: nowrap;
}

.terran-demo-subline {
  color: var(--amber);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.terran-demo-subline::before {
  content: "/// ";
  color: var(--green);
}

.terran-demo-visualizer {
  height: 48px;
  border: 1px solid rgba(57, 255, 136, 0.45);
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
  padding: 8px 7px;
  background: rgba(0, 0, 0, 0.28);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.terran-demo-visualizer span {
  width: 6px;
  height: 14px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(57, 255, 136, 0.65);
  opacity: 0.75;
}

.terran-demo-visualizer span:nth-child(2) { height: 24px; }
.terran-demo-visualizer span:nth-child(3) { height: 32px; }
.terran-demo-visualizer span:nth-child(4) { height: 19px; }
.terran-demo-visualizer span:nth-child(5) { height: 38px; }

.terran-demo-console.is-playing .terran-demo-visualizer span {
  animation: terranMeter 0.74s steps(4, end) infinite;
}
.terran-demo-console.is-playing .terran-demo-visualizer span:nth-child(2) { animation-duration: 0.48s; }
.terran-demo-console.is-playing .terran-demo-visualizer span:nth-child(3) { animation-duration: 0.62s; }
.terran-demo-console.is-playing .terran-demo-visualizer span:nth-child(4) { animation-duration: 0.53s; }
.terran-demo-console.is-playing .terran-demo-visualizer span:nth-child(5) { animation-duration: 0.69s; }

@keyframes terranMeter {
  0%, 100% { transform: scaleY(0.35); opacity: 0.58; }
  35% { transform: scaleY(1); opacity: 1; }
  70% { transform: scaleY(0.62); opacity: 0.76; }
}

.terran-demo-status-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 7px;
  align-items: center;
  margin-top: 7px;
}

.terran-mini-control {
  border: 1px solid rgba(57, 255, 136, 0.55);
  background: rgba(57, 255, 136, 0.05);
  color: var(--green);
  font-family: inherit;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: 28px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.terran-mini-control:hover,
.terran-mini-control:focus {
  background: var(--green);
  color: #001b0b;
  text-decoration: none;
}

.terran-stop-symbol {
  width: 8px;
  height: 8px;
  background: currentColor;
  display: inline-block;
}

.terran-demo-time {
  justify-self: end;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.terran-demo-progress {
  height: 8px;
  margin-top: 7px;
  border: 1px solid rgba(57, 255, 136, 0.4);
  background:
    repeating-linear-gradient(90deg, rgba(57, 255, 136, 0.14) 0 1px, transparent 1px 8px),
    rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.terran-demo-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  box-shadow: 0 0 10px rgba(57, 255, 136, 0.8);
}

@media (max-width: 850px) {
  .terran-demo-console {
    width: min(100%, 520px);
    min-width: 0;
  }
}

@media (max-width: 650px) {
  .terran-demo-main {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .terran-demo-visualizer {
    grid-column: 1 / -1;
    width: 100%;
    height: 38px;
  }

  .terran-demo-status-row {
    grid-template-columns: 1fr 1fr;
  }

  .terran-demo-time {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .terran-demo-label {
    white-space: normal;
  }

  .terran-demo-subline {
    white-space: normal;
  }
}


/* Header and demo controls */
.hero-command-row {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: center;
  gap: 16px;
}

.hero-demo-actions {
  min-width: 0;
  margin-bottom: 0;
}

.terran-demo-console {
  width: min(340px, 34vw);
  min-width: 280px;
  padding: 5px;
}

.terran-demo-main {
  min-height: 54px;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 7px 9px;
}

.terran-play-cell {
  width: 40px;
  height: 38px;
}

.terran-play-symbol {
  border-top-width: 10px;
  border-bottom-width: 10px;
  border-left-width: 17px;
}

.terran-pause-symbol span {
  width: 6px;
  height: 21px;
}

.terran-demo-label {
  font-size: clamp(0.82rem, 1.35vw, 1.05rem);
  letter-spacing: 0.07em;
}

.terran-demo-subline {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
}

.terran-demo-visualizer {
  height: 36px;
  gap: 3px;
  padding: 6px 5px;
}

.terran-demo-visualizer span {
  width: 4px;
  height: 10px;
}

.terran-demo-visualizer span:nth-child(2) { height: 17px; }
.terran-demo-visualizer span:nth-child(3) { height: 24px; }
.terran-demo-visualizer span:nth-child(4) { height: 14px; }
.terran-demo-visualizer span:nth-child(5) { height: 28px; }

.terran-demo-status-row {
  margin-top: 5px;
  gap: 5px;
}

.terran-mini-control {
  min-height: 22px;
  padding: 3px 6px;
  font-size: 0.55rem;
}

.terran-demo-time {
  font-size: 0.58rem;
}

.terran-demo-progress {
  height: 6px;
  margin-top: 5px;
}

.copy-module {
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.tagline {
  max-width: 760px;
  min-height: 11.4em;
}

.terminal-typed-line {
  color: #d8ffe7;
}

.floating-demo-button {
  z-index: 250;
  bottom: 24px;
  border: 1px solid rgba(57, 255, 136, 0.85);
  background: rgba(0, 10, 8, 0.94);
  color: var(--green);
  box-shadow: 0 0 24px rgba(57, 255, 136, 0.28), inset 0 0 14px rgba(57, 255, 136, 0.1);
}

.floating-demo-button.visible {
  opacity: 0.96;
}

@media (max-width: 850px) {
  .hero-command-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .terran-demo-console {
    width: min(100%, 380px);
    min-width: 0;
  }
}

/* Mobile hero and archive controls */
@media (max-width: 650px) {
  body {
    font-size: 0.88rem;
    padding-bottom: 92px;
  }

  .terminal {
    width: calc(100% - 8px);
    margin: 4px auto;
  }

  .topbar {
    padding: 7px 10px;
    gap: 4px;
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .live-signal {
    font-size: 0.68rem;
  }

  .system-notice {
    padding: 6px 10px;
    font-size: 0.58rem;
    letter-spacing: 0.055em;
  }

  .system-notice::before {
    display: none;
  }

  header {
    padding: 22px 12px 16px;
  }

  .kicker {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .hero-command-row {
    gap: 10px;
  }

  .hero-game-launch {
    width: min(100%, 180px);
  }

  .hero-game-launch-label {
    font-size: 0.56rem;
    letter-spacing: 0.12em;
  }

  .hero-game-disc {
    width: 88px;
    height: 88px;
  }

  .hero-command-row .glitch-title {
    font-size: clamp(2rem, 12.5vw, 3.35rem);
    line-height: 0.9;
    letter-spacing: -0.08em;
  }

  .hero-demo-actions.terran-demo-console,
  .terran-demo-console {
    max-width: 250px;
    justify-self: start;
    padding: 4px;
  }

  .terran-demo-main {
    min-height: 42px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 7px;
  }

  .terran-play-cell {
    width: 28px;
    height: 27px;
  }

  .terran-play-symbol {
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 12px;
    margin-left: 2px;
  }

  .terran-pause-symbol span {
    width: 4px;
    height: 15px;
  }

  .terran-demo-label {
    font-size: 0.72rem;
    letter-spacing: 0.055em;
  }

  .terran-demo-subline {
    display: none;
  }

  .terran-demo-visualizer {
    display: none;
  }

  .terran-demo-status-row {
    grid-template-columns: 1fr 1fr;
    margin-top: 4px;
    gap: 5px;
  }

  .terran-mini-control {
    min-height: 21px;
    padding: 3px 5px;
    font-size: 0.5rem;
  }

  .terran-demo-time {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.52rem;
  }

  .terran-demo-progress {
    height: 5px;
    margin-top: 4px;
  }

  .copy-module {
    margin-top: 14px;
  }

  .tagline {
    max-width: 100%;
    min-height: 0;
    font-size: 0.86rem;
    line-height: 1.42;
  }

  .terminal-typed-line {
    min-height: 1.25em;
  }

  nav {
    padding: 9px;
    gap: 7px;
  }

  nav a {
    padding: 8px;
    font-size: 0.74rem;
  }

  main {
    padding: 8px;
  }

  .panel-content {
    padding: 10px;
  }

  details.panel > summary {
    padding: 11px 10px;
    font-size: 0.78rem;
  }

  .profile-card {
    gap: 12px;
  }

  .profile-photo-wrap {
    max-width: 155px;
  }

  .mission-copy p {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .skill-tabs {
    gap: 7px;
  }

  .skill-tab {
    padding: 8px 9px;
    font-size: 0.78rem;
  }

  .side-tab {
    position: fixed;
    width: 78px;
    min-width: 0;
    height: 34px;
    padding: 0 6px;
    font-size: 0.55rem;
    line-height: 1.05;
    letter-spacing: 0.055em;
    opacity: 0.82;
    z-index: 220;
    clip-path: none;
    border-width: 1px;
    text-align: center;
  }

  .side-tab::before {
    inset: 4px;
  }

  .side-tab::after {
    display: none;
  }

  .audio-drawer-tab,
  .writing-drawer-tab {
    left: 8px;
  }

  .video-drawer-tab,
  .social-drawer-tab {
    right: 8px;
  }

  .audio-drawer-tab,
  .video-drawer-tab {
    bottom: 50px;
  }

  .writing-drawer-tab,
  .social-drawer-tab {
    bottom: 10px;
  }

  .tab-arrow {
    display: none;
  }

  .floating-demo-button {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: min(168px, calc(100vw - 190px));
    min-width: 130px;
    min-height: 34px;
    font-size: 0.62rem;
    padding: 7px 9px;
  }

  .floating-demo-button.visible {
    transform: translateX(-50%) translateY(0);
  }

  footer {
    padding: 14px 12px 102px;
    font-size: 0.68rem;
  }
}

@media (max-width: 390px) {
  .hero-demo-actions.terran-demo-console,
  .terran-demo-console {
    max-width: 230px;
  }

  .hero-command-row .glitch-title {
    font-size: clamp(1.8rem, 11.5vw, 3rem);
  }

  .side-tab {
    width: 70px;
    font-size: 0.5rem;
  }

  .floating-demo-button {
    width: 128px;
    font-size: 0.56rem;
  }
}


/* Mobile demo controls and archive dock */
.terran-demo-progress {
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

.terran-demo-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  bottom: -10px;
}

@media (max-width: 650px) {
  body {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }

  header {
    padding: 18px 10px 14px;
  }

  .hero-command-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-command-row .glitch-title {
    font-size: clamp(1.85rem, 11vw, 3rem);
    line-height: 0.9;
    letter-spacing: -0.075em;
  }

  .hero-demo-actions.terran-demo-console,
  .terran-demo-console {
    width: min(100%, 300px) !important;
    max-width: 300px !important;
    min-width: 0 !important;
    justify-self: start;
    padding: 3px;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 12px);
  }

  .terran-demo-console::before,
  .terran-demo-console::after {
    width: 6px;
    height: 6px;
    top: 8px;
  }

  .terran-demo-main {
    min-height: 40px !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 6px;
    padding: 5px 7px;
  }

  .terran-play-cell {
    width: 26px !important;
    height: 25px !important;
  }

  .terran-play-symbol {
    border-top-width: 7px !important;
    border-bottom-width: 7px !important;
    border-left-width: 12px !important;
    margin-left: 2px;
  }

  .terran-pause-symbol span {
    width: 4px !important;
    height: 15px !important;
  }

  .terran-demo-label {
    font-size: 0.7rem !important;
    line-height: 1.1;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }

  .terran-demo-subline,
  .terran-demo-visualizer {
    display: none !important;
  }

  .terran-demo-status-row {
    grid-template-columns: auto auto 1fr !important;
    margin-top: 3px;
    gap: 4px;
  }

  .terran-mini-control {
    min-height: 19px !important;
    padding: 2px 5px !important;
    font-size: 0.48rem !important;
    letter-spacing: 0.045em;
  }

  .terran-stop-symbol {
    width: 6px;
    height: 6px;
  }

  .terran-demo-time {
    grid-column: auto !important;
    justify-self: end !important;
    font-size: 0.48rem !important;
    letter-spacing: 0.035em;
  }

  .terran-demo-progress {
    height: 5px !important;
    margin-top: 4px !important;
  }

  .copy-module {
    margin-top: 12px;
  }

  .tagline {
    font-size: 0.78rem !important;
    line-height: 1.32 !important;
    min-height: 0 !important;
  }

  .terminal-typed-line {
    min-height: 1.1em;
  }

  .side-tab {
    position: fixed !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    padding: 0 4px !important;
    font-size: 0.48rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    line-height: 1.05;
    letter-spacing: 0.02em;
    white-space: normal !important;
    overflow: hidden;
    overflow-wrap: anywhere;
    opacity: 0.94;
    z-index: 240;
    clip-path: none !important;
    border-width: 1px;
    background: rgba(0, 12, 8, 0.96);
    backdrop-filter: blur(3px);
    box-shadow: inset 0 0 12px rgba(57, 255, 136, 0.08), 0 -4px 18px rgba(0, 0, 0, 0.55);
    animation: none;
  }

  .side-tab::before,
  .side-tab::after {
    display: none !important;
  }

  .audio-drawer-tab {
    left: 4px !important;
    right: calc(50vw + 3px) !important;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .writing-drawer-tab {
    left: calc(50vw + 3px) !important;
    right: 4px !important;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .video-drawer-tab {
    left: 4px !important;
    right: calc(50vw + 3px) !important;
  }

  .social-drawer-tab {
    left: calc(50vw + 3px) !important;
    right: 4px !important;
    font-size: 0.46rem !important;
    line-height: 1;
  }

  .tab-arrow {
    display: none !important;
  }



  body.drawer-open .side-tab,
  .side-tab.mobile-tabs-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(115%) !important;
    pointer-events: none !important;
  }

  body.drawer-open .floating-demo-button {
    opacity: 0 !important;
    transform: translateY(115%) !important;
    pointer-events: none !important;
  }

  .floating-demo-button {
    bottom: 50px !important;
    width: min(160px, calc(100vw - 24px));
    min-width: 0;
    min-height: 30px;
    font-size: 0.56rem;
    padding: 6px 8px;
  }

  footer {
    padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 390px) {
  .hero-demo-actions.terran-demo-console,
  .terran-demo-console {
    width: min(100%, 280px) !important;
    max-width: 280px !important;
  }

  .side-tab {
    font-size: 0.45rem !important;
  }
}


/* Prevent the desktop title and demo console from overlapping. */
@media (min-width: 651px) {
  header {
    position: relative;
  }

  .hero-command-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 248px !important;
    align-items: start !important;
    gap: 14px !important;
  }

  .hero-command-row .glitch-title {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(2.35rem, 5.2vw, 4.15rem) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.06em !important;
    white-space: nowrap !important;
  }

  .hero-demo-actions.terran-demo-console,
  .terran-demo-console {
    width: 248px !important;
    min-width: 0 !important;
    max-width: 248px !important;
    justify-self: end !important;
    align-self: end !important;
    padding: 4px !important;
  }

  .terran-demo-main {
    min-height: 42px !important;
    grid-template-columns: 34px minmax(0, 1fr) 30px !important;
    gap: 6px !important;
    padding: 5px 7px !important;
  }

  .terran-play-cell {
    width: 29px !important;
    height: 28px !important;
  }

  .terran-play-symbol {
    border-top-width: 7px !important;
    border-bottom-width: 7px !important;
    border-left-width: 12px !important;
  }

  .terran-pause-symbol span {
    width: 4px !important;
    height: 15px !important;
  }

  .terran-demo-label {
    font-size: 0.68rem !important;
    letter-spacing: 0.055em !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  .terran-demo-subline {
    display: none !important;
  }

  .terran-demo-visualizer {
    height: 28px !important;
    gap: 2px !important;
    padding: 5px 4px !important;
  }

  .terran-demo-visualizer span {
    width: 3px !important;
  }

  .terran-demo-status-row {
    margin-top: 4px !important;
    gap: 4px !important;
    grid-template-columns: auto auto 1fr !important;
  }

  .terran-mini-control {
    min-height: 18px !important;
    padding: 2px 5px !important;
    font-size: 0.48rem !important;
  }

  .terran-demo-time {
    font-size: 0.5rem !important;
    justify-self: end !important;
  }

  .terran-demo-progress {
    height: 5px !important;
    margin-top: 4px !important;
  }
}

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

.signal-game-modal {
  --signal-gold: #ffd966;
  --signal-cyan: #58fff0;
  --signal-green: #7cff7c;
  --signal-red: #ff5d5d;
  --signal-panel: rgba(0, 0, 0, 0.78);
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
}

.signal-game-modal.open {
  display: flex;
}

.signal-game-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(88, 255, 240, 0.08), transparent 52%),
    rgba(0, 0, 0, 0.88);
}

.signal-game-crt-shell {
  position: relative;
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 2px solid rgba(255, 217, 102, 0.9);
  background:
    url("/assets/rail-shooter/ui/crt-screen-overlay.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(13, 12, 6, 0.96), rgba(0, 0, 0, 0.98));
  box-shadow:
    0 0 38px rgba(255, 217, 102, 0.22),
    inset 0 0 0 3px rgba(0, 0, 0, 0.86),
    inset 0 0 46px rgba(88, 255, 240, 0.08);
  padding: 18px;
}

.signal-game-bezel {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url("/assets/rail-shooter/ui/crt-tv-frame.png") center / 100% 100% no-repeat;
  opacity: 0.56;
}

.signal-game-topbar,
#gameWrap {
  position: relative;
  z-index: 2;
}

.signal-game-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 217, 102, 0.48);
  padding-bottom: 10px;
}

.signal-game-kicker {
  margin: 0 0 4px;
  color: var(--signal-cyan);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signal-game-topbar h2 {
  margin: 0;
  color: var(--signal-gold);
  font-size: clamp(1.05rem, 2.6vw, 1.75rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.signal-game-close,
#gameWrap button,
#gameWrap .mailButton {
  border: 1px solid var(--signal-gold);
  background: #111;
  color: var(--signal-gold);
  font-family: inherit;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
  text-transform: uppercase;
}

.signal-game-close:hover,
.signal-game-close:focus,
#gameWrap button:hover,
#gameWrap button:focus,
#gameWrap .mailButton:hover,
#gameWrap .mailButton:focus {
  background: var(--signal-gold);
  color: #000;
  text-decoration: none;
}

#gameWrap {
  width: min(980px, calc(100vw - 88px), calc((100vh - 150px) * 1020 / 745));
  height: auto;
  max-height: calc(100vh - 150px);
  margin: 0 auto 18px;
  aspect-ratio: 1020 / 745;
}

#gameWrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--signal-gold);
  background: #02020b;
  image-rendering: pixelated;
}

#ui {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 4;
  display: none;
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.45;
  pointer-events: none;
  text-shadow: 0 0 6px #000;
}

#missionText {
  max-width: 360px;
  margin-top: 8px;
  color: var(--signal-gold);
}

#questionPanel {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: none;
  width: min(92%, 760px);
  transform: translateX(-50%);
  border: 1px solid var(--signal-gold);
  background: var(--signal-panel);
  box-shadow: 0 0 18px rgba(255, 217, 102, 0.22);
  color: #fff;
  padding: 14px 18px;
  text-align: center;
}

#questionPanel.final-baron-question {
  bottom: 14px;
  width: min(94%, 780px);
  max-height: 46%;
  overflow-y: auto;
  border-color: var(--signal-red);
  box-shadow:
    0 0 24px rgba(255, 93, 93, 0.28),
    inset 0 0 22px rgba(255, 93, 93, 0.14);
}

#questionText {
  font-size: clamp(0.9rem, 2.1vw, 1.08rem);
  line-height: 1.4;
}

#questionTitle {
  margin-bottom: 8px;
  color: var(--signal-gold);
  font-weight: 700;
  text-transform: uppercase;
}

#answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 0.82rem;
  text-align: left;
}

#gameWrap .answer {
  border: 1px solid rgba(255, 217, 102, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
  text-transform: none;
}

#gameWrap .answer:hover,
#gameWrap .answer:focus {
  border-color: var(--signal-cyan);
  background: rgba(88, 255, 240, 0.12);
  color: #fff;
}

#gameWrap .answer.correct {
  border-color: var(--signal-green);
  background: rgba(124, 255, 124, 0.16);
}

#gameWrap .answer.wrong {
  border-color: var(--signal-red);
  background: rgba(255, 93, 93, 0.16);
}

#gameWrap .answer strong {
  color: var(--signal-cyan);
  margin-right: 8px;
}

.answer-hint {
  margin-top: 8px;
  color: #aaa;
  font-size: 0.76rem;
}

.boss-banner {
  position: absolute;
  left: 50%;
  top: 92px;
  z-index: 8;
  display: none;
  width: min(88%, 620px);
  transform: translateX(-50%);
  border: 2px solid var(--signal-red);
  background: rgba(0, 0, 0, 0.84);
  box-shadow:
    0 0 20px rgba(255, 93, 93, 0.38),
    inset 0 0 22px rgba(255, 93, 93, 0.18);
  color: var(--signal-red);
  font-size: clamp(1.5rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 14px 18px;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 93, 93, 0.7);
}

.boss-banner.show {
  display: block;
  animation: bossPulse 0.72s steps(2, end) infinite;
}

.choice-reaction-window {
  --reaction-accent: var(--signal-cyan);
  position: absolute;
  top: 78px;
  right: 18px;
  z-index: 9;
  width: clamp(150px, 22%, 230px);
  overflow: hidden;
  border: 1px solid var(--reaction-accent);
  background: #020507;
  box-shadow:
    0 0 20px color-mix(in srgb, var(--reaction-accent) 38%, transparent),
    inset 0 0 22px rgba(0, 0, 0, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.choice-reaction-window.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.choice-reaction-window.correct {
  --reaction-accent: var(--signal-green);
}

.choice-reaction-window.incorrect {
  --reaction-accent: var(--signal-red);
}

.choice-reaction-chrome {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--reaction-accent) 52%, transparent);
  background: rgba(0, 0, 0, 0.76);
}

.choice-reaction-chrome span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--reaction-accent);
  box-shadow: 0 0 8px var(--reaction-accent);
}

.choice-reaction-window img,
.choice-reaction-window video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.choice-reaction-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.86) 34%);
  color: var(--reaction-accent);
  font-size: clamp(0.6rem, 1.4vw, 0.76rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  text-shadow: 0 0 8px #000;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
}

.tab-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
}

.drawer-item {
  color: #dcf4ff !important;
  font-size: 0.98rem;
  line-height: 1.45;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.34);
}

.drawer-item span {
  color: #ffd87a !important;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.drawer-item:hover,
.drawer-item:focus,
.drawer-item.active {
  color: #02101f !important;
}

.drawer-item:hover span,
.drawer-item:focus span,
.drawer-item.active span {
  color: #3d2800 !important;
}

.drawer-now h3,
#drawer-audio-title {
  color: #e7fbff !important;
  line-height: 1.2;
}

.drawer-now p,
#drawer-audio-project {
  color: rgba(226, 244, 255, 0.88);
  line-height: 1.5;
}

.instagram-drawer-shell {
  max-width: min(100%, 460px);
  width: 100%;
  max-height: none;
  margin-inline: auto;
}

.social-live-card {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 12px;
  color: #dff9ff;
  background:
    linear-gradient(rgba(100, 210, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 210, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(6, 18, 28, 0.98), rgba(1, 7, 13, 0.99));
  background-size: 18px 18px, 18px 18px, auto;
}

.social-live-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: rgba(184, 245, 255, 0.8);
  font: 700 0.62rem/1.2 "Share Tech Mono", "Courier New", monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.social-live-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.social-live-light {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 216, 122, 0.92);
  background: rgba(255, 216, 122, 0.76);
  box-shadow: 0 0 7px rgba(255, 216, 122, 0.46);
}

.social-live-state {
  flex: 0 0 auto;
  color: #ffd87a;
}

.social-live-bezel {
  position: relative;
  padding: 6px;
  border: 1px solid rgba(157, 179, 189, 0.75);
  border-radius: 6px;
  background:
    radial-gradient(circle at 7px 7px, #4f5960 0 2px, #a8b6bd 2px 3px, transparent 3px),
    radial-gradient(circle at calc(100% - 7px) 7px, #4f5960 0 2px, #a8b6bd 2px 3px, transparent 3px),
    radial-gradient(circle at 7px calc(100% - 7px), #4f5960 0 2px, #a8b6bd 2px 3px, transparent 3px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #4f5960 0 2px, #a8b6bd 2px 3px, transparent 3px),
    repeating-linear-gradient(94deg, #4c565d 0 1px, #293239 2px 4px, #606b72 5px 6px);
  box-shadow:
    inset 0 1px rgba(235, 249, 255, 0.36),
    inset 0 -2px rgba(0, 0, 0, 0.62),
    0 0 12px rgba(100, 210, 255, 0.12);
}

.social-live-crt {
  position: relative;
  height: 250px;
  overflow: hidden;
  border: 1px solid rgba(100, 210, 255, 0.6);
  border-radius: 9px / 6px;
  background: #010509;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.82),
    0 0 8px rgba(100, 210, 255, 0.2);
}

.social-live-crt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(143, 216, 255, 0.045) 3px 4px),
    radial-gradient(ellipse at center, transparent 64%, rgba(0, 0, 0, 0.24));
}

.social-live-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #02070b;
  transition: opacity 180ms linear, visibility 180ms linear;
}

.social-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-preview-missing,
.social-preview-loading {
  margin: 0;
  padding: 24px;
  color: rgba(226, 244, 255, 0.78);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.social-live-frame {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 250px;
  min-height: 250px;
  max-height: 250px !important;
  border: 0;
  opacity: 0;
  background: #ffffff;
  transition: opacity 180ms linear;
}

.social-live-card.is-live .social-live-frame {
  opacity: 1;
}

.social-live-card.is-live .social-live-poster {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.social-live-card.is-live .social-live-light {
  border-color: rgba(57, 255, 136, 0.9);
  background: rgba(57, 255, 136, 0.78);
  box-shadow: 0 0 7px rgba(57, 255, 136, 0.5);
}

.social-live-card.is-fallback .social-live-state {
  color: rgba(226, 244, 255, 0.76);
}

.social-live-details {
  display: grid;
  gap: 7px;
  justify-items: start;
  min-width: 0;
  padding: 2px 3px 0;
  text-align: left;
}

.social-live-details h3 {
  margin: 0;
  color: #f2fbff;
  font-size: clamp(0.96rem, 2vw, 1.15rem);
  line-height: 1.2;
  text-transform: uppercase;
}

.social-live-details p {
  margin: 0;
  color: rgba(226, 244, 255, 0.88);
  font-size: 0.78rem;
  line-height: 1.4;
}

.social-live-details .social-link-button {
  justify-self: start;
  min-height: 0;
  padding: 6px 8px;
  font-size: 0.68rem;
  line-height: 1.1;
  letter-spacing: 0.06em;
}

@media (max-width: 480px) {
  .social-live-card {
    padding: 9px;
  }

  .social-live-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .social-live-crt,
  .social-live-frame {
    height: 230px;
    min-height: 230px;
    max-height: 230px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) .social-live-poster,
  html:not([data-motion="full"]) .social-live-frame {
    transition: none;
  }
}

@keyframes bossPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.45);
  }
}

#overlay,
#landingScreen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.86);
  padding: 24px;
  overflow-y: auto;
  text-align: center;
}

#overlay h1,
#landingScreen h1 {
  margin: 0 0 12px;
  color: var(--signal-gold);
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#overlay p,
#landingScreen p {
  max-width: 720px;
  color: #ddd;
  line-height: 1.45;
}

.start-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px 14px;
  max-width: 620px;
  margin: 14px auto;
  color: #f4f4f4;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: left;
}

#startBtn {
  display: block;
  width: min(100%, 340px);
  margin: 12px auto 0;
  box-shadow: 0 0 18px rgba(100, 210, 255, 0.3);
}

.practice-box {
  max-width: 540px;
  margin: 10px auto;
  border: 1px solid rgba(100, 210, 255, 0.52);
  border-radius: 8px;
  background: #000;
  box-shadow:
    inset 0 0 24px rgba(100, 210, 255, 0.08),
    0 0 18px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.practice-box-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(100, 210, 255, 0.26);
  background: rgba(4, 18, 32, 0.92);
  color: var(--signal-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  text-transform: uppercase;
}

#practiceCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: clamp(300px, 40vh, 350px);
  background: #000;
  object-fit: cover;
  object-position: center center;
  outline: none;
}

#practiceCanvas:focus {
  box-shadow: inset 0 0 0 2px var(--signal-gold);
}

.practice-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-top: 1px solid rgba(100, 210, 255, 0.22);
  background: rgba(5, 14, 28, 0.86);
}

.practice-controls button {
  width: 100%;
  min-height: 32px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 6px 7px;
}

.practice-controls button.is-active {
  border-color: rgba(255, 217, 102, 0.95);
  box-shadow: 0 0 14px rgba(255, 217, 102, 0.26);
}

@media (max-width: 780px) {
  .practice-controls {
    grid-template-columns: 1fr;
  }
}

.start-controls span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-controls kbd {
  display: inline-block;
  min-width: 2.1em;
  border: 1px solid rgba(255, 217, 102, 0.7);
  background: rgba(255, 217, 102, 0.1);
  color: var(--signal-gold);
  font-family: inherit;
  font-size: 0.8em;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
  text-align: center;
}

#landingScreen {
  display: none;
  background: rgba(0, 0, 0, 0.92);
  z-index: 12;
  padding: 14px;
  overflow: hidden;
}

#landingScreen > div {
  width: min(100%, 980px);
  max-height: 100%;
  overflow: auto;
  padding: 12px 12px 18px;
  box-sizing: border-box;
}

.signal-ending-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(390px, 32vw, 450px);
  align-items: start;
  gap: clamp(14px, 1.6vw, 20px);
}

.signal-ending-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.signal-ending-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(100%, 760px);
}

.signal-leaderboard-rail {
  display: flex;
  align-self: stretch;
  width: 100%;
  min-width: 0;
}

#landingScreen h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(1.2rem, 3.2vw, 2.15rem);
  line-height: 1.14;
}

#landingScreen p {
  max-width: 56ch;
  margin: 0 auto;
  font-size: clamp(0.94rem, 1.7vw, 1.08rem);
  line-height: 1.5;
}

.landing-crt-visual {
  width: min(100%, 760px);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 4px auto 0;
  border: 1px solid var(--signal-gold);
  background:
    url("/assets/rail-shooter/ui/crt-broadcast-placeholder.png") center / cover no-repeat,
    radial-gradient(circle at center, rgba(88, 255, 240, 0.12), transparent 58%),
    #03070a;
  box-shadow:
    0 0 22px rgba(88, 255, 240, 0.16),
    inset 0 0 30px rgba(0, 0, 0, 0.72);
}

#finalStats {
  width: min(100%, 760px);
  max-width: 100%;
  margin: 0 auto 8px;
  color: #ddd;
  line-height: 1.35;
}

.signal-run-highscores {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(125, 231, 255, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(4, 14, 26, 0.92), rgba(2, 8, 18, 0.96));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.34);
  text-align: left;
  box-sizing: border-box;
}

.signal-leaderboard-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-color: rgba(125, 231, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(6, 16, 30, 0.96), rgba(1, 6, 14, 0.98)),
    radial-gradient(circle at top, rgba(88, 255, 240, 0.08), transparent 52%);
  box-shadow:
    0 0 22px rgba(88, 255, 240, 0.1),
    inset 0 0 24px rgba(0, 0, 0, 0.48);
}

.signal-run-highscores-header {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.signal-run-highscores h2 {
  margin: 0;
  color: #7de7ff;
  font-family: "Share Tech Mono", "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-leaderboard-title {
  color: #f0fbff;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.75rem, 1.2vw, 0.92rem);
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 10px rgba(125, 231, 255, 0.24),
    0 0 2px rgba(255, 255, 255, 0.3);
}

#highScoreCurrentScore,
#highScoreStatus {
  margin: 0;
  color: #cfe8f5;
  font-size: 0.88rem;
  line-height: 1.4;
}

#highScoreForm label {
  display: block;
  margin-bottom: 6px;
  color: #ffd966;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-run-highscore-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 8px;
}

#highScoreName {
  min-width: 0;
  border: 1px solid rgba(125, 231, 255, 0.36);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  color: #f6fdff;
  font: inherit;
  padding: 10px 12px;
  text-transform: uppercase;
}

#highScoreName:focus {
  outline: none;
  border-color: rgba(255, 217, 102, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 217, 102, 0.18);
}

#highScoreSubmit {
  min-height: 42px;
  white-space: nowrap;
}

#highScoreStatus[data-tone="error"] {
  color: #ff9eaa;
}

#highScoreStatus[data-tone="success"] {
  color: #8effc7;
}

#highScoreList {
  margin: 10px 0 0;
  padding-left: 0;
  color: #edf8ff;
  list-style: none;
}

#highScoreList li {
  display: grid;
  grid-template-columns: 78px 3ch minmax(10ch, 1fr) 8ch;
  gap: 7px;
  align-items: baseline;
  padding: 4px 0;
}

.signal-leaderboard-row {
  min-height: 30px;
  border-bottom: 1px solid rgba(125, 231, 255, 0.08);
}

.signal-leaderboard-row:last-child {
  border-bottom: 0;
}

.signal-leaderboard-row-empty {
  display: block;
  padding: 8px 0 4px;
  color: rgba(237, 248, 255, 0.72);
  text-align: center;
}

#highScoreList .score-badge {
  display: inline-flex;
  align-items: center;
  min-width: 72px;
  padding: 2px 6px;
  border: 1px solid rgba(125, 231, 255, 0.2);
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.signal-leaderboard-badge {
  justify-content: center;
  min-width: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.5rem;
  line-height: 1.5;
}

.signal-leaderboard-icon {
  display: inline-block;
  flex: 0 0 auto;
}

.signal-leaderboard-icon-ship {
  width: 30px;
  height: 18px;
  background-image: url("/assets/rail-shooter/ships/rail-gun-ship-sheet.png");
  background-repeat: no-repeat;
  background-size: 300% 400%;
  background-position: 0 0;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 0 4px rgba(255, 122, 122, 0.32))
    saturate(1.05);
}

.signal-leaderboard-icon-easy-boss {
  width: 28px;
  height: 20px;
  background-image: url("/assets/rail-shooter/sprites/Easy-Mode-Boss.png");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: 0 0;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 0 4px rgba(159, 220, 255, 0.3))
    saturate(1.04);
}

#highScoreList .score-rank {
  color: #ffd966;
}

.signal-leaderboard-rank {
  text-align: right;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.62rem;
}

#highScoreList .score-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-leaderboard-name {
  min-width: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.56rem, 0.68vw, 0.62rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

#highScoreList .score-name.easy-pilot,
#highScoreList .score-badge.easy-pilot {
  color: #9fdcff;
}

#highScoreList .score-badge.easy-pilot {
  border-color: rgba(159, 220, 255, 0.34);
  background: rgba(159, 220, 255, 0.08);
}

#highScoreList .score-name.rock-smasher,
#highScoreList .score-badge.rock-smasher {
  color: #ff7a7a;
}

#highScoreList .score-badge.rock-smasher {
  border-color: rgba(255, 122, 122, 0.34);
  background: rgba(255, 122, 122, 0.08);
}

#highScoreList .score-name.ace-pilot,
#highScoreList .score-badge.ace-pilot {
  color: #ffd966;
}

#highScoreList .score-badge.ace-pilot {
  border-color: rgba(255, 217, 102, 0.4);
  background: rgba(255, 217, 102, 0.1);
}

#highScoreList .score-value {
  color: #7de7ff;
  font-variant-numeric: tabular-nums;
}

.signal-leaderboard-score {
  justify-self: end;
  text-align: right;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.ending-video {
  display: none;
  width: min(100%, 620px);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 4px auto 8px;
  border: 1px solid var(--signal-red);
  background: #000;
  box-shadow:
    0 0 22px rgba(255, 93, 93, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.72);
}

#landingScreen.bad-ending .landing-crt-visual {
  display: none;
}

#landingScreen.bad-ending .ending-video {
  display: block;
}

#instructions {
  position: absolute;
  left: 50%;
  bottom: -34px;
  display: none;
  width: 100%;
  transform: translateX(-50%);
  color: #aaa;
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 760px) {
  .signal-ending-layout {
    grid-template-columns: 1fr;
  }

  .signal-leaderboard-rail {
    width: min(100%, 560px);
    justify-self: center;
  }

  .signal-run-highscores-header,
  .signal-run-highscore-form-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .signal-run-highscores-header {
    align-items: start;
  }

  #highScoreSubmit {
    width: 100%;
  }

  .signal-game-modal {
    padding: 10px;
  }

  .signal-game-crt-shell {
    width: calc(100vw - 20px);
    padding: 12px;
  }

  .signal-game-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .signal-game-close {
    align-self: flex-end;
  }

  #ui {
    font-size: 0.68rem;
  }

  #missionText {
    max-width: 220px;
  }

  #questionPanel {
    bottom: 10px;
    padding: 10px;
  }

  .choice-reaction-window {
    top: 72px;
    right: 10px;
    width: clamp(128px, 34%, 172px);
  }

  #answers {
    grid-template-columns: 1fr;
    font-size: 0.68rem;
  }

  #instructions {
    bottom: -46px;
    font-size: 0.68rem;
  }

  .start-controls {
    grid-template-columns: 1fr;
    max-width: 330px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) #gameWrap canvas {
    filter: none;
  }
}
/* Portfolio XP chrome */

:root {
  --xp-blue: #1d72ff;
  --xp-blue-deep: #0637a8;
  --xp-blue-light: #8fd8ff;
  --xp-cyan: #64d2ff;
  --xp-violet: #7a5cff;
  --xp-glass: rgba(29, 114, 255, 0.16);
  --xp-glass-strong: rgba(100, 210, 255, 0.22);
  --xp-shadow: rgba(29, 114, 255, 0.42);
  --xp-inner-dark: rgba(0, 10, 22, 0.78);
  --xp-white-edge: rgba(235, 250, 255, 0.38);
}

.terminal {
  border-color: rgba(100, 210, 255, 0.82);
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(180deg, rgba(7, 20, 35, 0.96), rgba(2, 8, 8, 0.93)),
    radial-gradient(circle at 20% 0%, rgba(100, 210, 255, 0.12), transparent 32%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 32px rgba(100, 210, 255, 0.22),
    0 0 62px rgba(29, 114, 255, 0.12),
    inset 0 1px 0 var(--xp-white-edge),
    inset 0 0 38px rgba(57, 255, 136, 0.05);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid rgba(143, 216, 255, 0.22);
  border-radius: 7px 7px 3px 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.terminal > * {
  position: relative;
  z-index: 2;
}

.topbar {
  border-bottom-color: rgba(143, 216, 255, 0.72);
  border-radius: 7px 7px 0 0;
  background:
    linear-gradient(180deg, rgba(143, 216, 255, 0.35) 0%, rgba(29, 114, 255, 0.28) 18%, rgba(6, 55, 168, 0.34) 58%, rgba(3, 18, 58, 0.38) 100%),
    linear-gradient(90deg, rgba(57, 255, 136, 0.14), rgba(100, 210, 255, 0.14), rgba(122, 92, 255, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 18px rgba(29, 114, 255, 0.18);
}

/* Portfolio shell and controls */
header,
nav,
footer,
.marquee {
  border-color: rgba(100, 210, 255, 0.58) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.65);
}

header {
  background:
    radial-gradient(circle at 18% 0%, rgba(100, 210, 255, 0.14), transparent 28%),
    linear-gradient(rgba(57, 255, 136, 0.045), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(100, 210, 255, 0.055),
      rgba(100, 210, 255, 0.055) 1px,
      transparent 1px,
      transparent 90px
    );
}

nav {
  background:
    linear-gradient(180deg, rgba(143, 216, 255, 0.1), rgba(7, 17, 18, 0.9)),
    rgba(7, 17, 18, 0.88);
}

nav a,
.button,
.download-button,
.audio-download-button,
.terminal-action-button,
.narration-button,
.audio-control-button,
.floating-demo-button,
.drawer-close,
.terran-mini-control {
  border-color: rgba(143, 216, 255, 0.74) !important;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(29, 114, 255, 0.16), rgba(0, 12, 20, 0.42));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 12px rgba(100, 210, 255, 0.12);
}

nav a:hover,
nav a:focus,
.button:hover,
.button:focus,
.download-button:hover,
.download-button:focus,
.audio-download-button:hover,
.audio-download-button:focus,
.terminal-action-button:hover,
.terminal-action-button:focus,
.terminal-action-button.is-playing,
.narration-button:hover,
.narration-button:focus,
.audio-control-button:hover,
.audio-control-button:focus,
.floating-demo-button:hover,
.floating-demo-button:focus,
.floating-demo-button.is-playing,
.drawer-close:hover,
.drawer-close:focus,
.terran-mini-control:hover,
.terran-mini-control:focus {
  color: #001227;
  background:
    linear-gradient(180deg, #dff7ff 0%, #8fd8ff 24%, #1d72ff 62%, #0637a8 100%);
  border-color: rgba(235, 250, 255, 0.88) !important;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.62),
    0 0 18px rgba(100, 210, 255, 0.42);
}

.panel,
.custom-audio-player,
.profile-photo-wrap,
.profile-photo-frame,
.writing-card,
.drawer-now,
.drawer-player,
.audio-link-archive,
.writing-archive,
.terran-demo-console {
  border-color: rgba(100, 210, 255, 0.68) !important;
  border-radius: 7px;
  background-image:
    linear-gradient(180deg, rgba(143, 216, 255, 0.07), transparent 36%),
    linear-gradient(180deg, rgba(11, 24, 36, 0.96), rgba(3, 8, 9, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 18px rgba(29, 114, 255, 0.12),
    inset 0 0 22px rgba(57, 255, 136, 0.035);
}

.panel,
.custom-audio-player,
.writing-card,
.drawer-now,
.drawer-player,
.terran-demo-console {
  position: relative;
}

.panel::before,
.custom-audio-player::before,
.writing-card::before,
.drawer-now::before,
.drawer-player::before,
.terran-demo-console::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(235, 250, 255, 0.54), transparent);
  box-shadow: 0 0 10px rgba(100, 210, 255, 0.42);
}

details.panel > summary,
.drawer-header {
  border-bottom-color: rgba(143, 216, 255, 0.42) !important;
  background:
    linear-gradient(180deg, rgba(143, 216, 255, 0.13), rgba(29, 114, 255, 0.07)),
    linear-gradient(90deg, rgba(100, 210, 255, 0.1), transparent 70%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.54);
}

.side-tab {
  border-color: rgba(143, 216, 255, 0.78) !important;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(210, 245, 255, 0.18), rgba(29, 114, 255, 0.18) 36%, rgba(0, 18, 38, 0.74)),
    linear-gradient(90deg, rgba(57, 255, 136, 0.08), rgba(122, 92, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.75),
    0 0 18px rgba(29, 114, 255, 0.22),
    0 0 32px rgba(57, 255, 136, 0.08);
}

.side-tab::before {
  border-color: rgba(235, 250, 255, 0.16);
  border-style: solid;
}

.side-tab::after {
  border-color: rgba(100, 210, 255, 0.14);
  box-shadow: 0 0 12px rgba(100, 210, 255, 0.16);
}

.side-tab:hover,
.side-tab:focus {
  color: #001227;
  background:
    linear-gradient(180deg, #e9fbff, #8fd8ff 28%, #1d72ff 68%, #0637a8);
}

.side-drawer {
  border-color: rgba(143, 216, 255, 0.82) !important;
  background:
    radial-gradient(circle at top, rgba(100, 210, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(5, 20, 35, 0.98), rgba(0, 4, 8, 0.98)),
    repeating-linear-gradient(
      to bottom,
      rgba(100, 210, 255, 0.04) 0px,
      rgba(100, 210, 255, 0.04) 1px,
      transparent 1px,
      transparent 5px
    );
  box-shadow:
    0 0 38px rgba(0, 0, 0, 0.72),
    0 0 30px rgba(29, 114, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 24px rgba(57, 255, 136, 0.045);
}

.drawer-item,
.skill-tab,
.top-link {
  border-color: rgba(143, 216, 255, 0.62) !important;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(29, 114, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.64),
    0 0 10px rgba(100, 210, 255, 0.1);
}

.drawer-item:hover,
.drawer-item:focus,
.drawer-item.active,
.skill-tab:hover,
.skill-tab:focus,
.skill-tab.pressed,
.top-link:hover,
.top-link:focus {
  color: #001227;
  background:
    linear-gradient(180deg, #dff7ff 0%, #8fd8ff 26%, #1d72ff 68%, #0637a8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(0, 0, 0, 0.68),
    0 0 16px rgba(100, 210, 255, 0.34);
}

.audio-progress-shell,
.terran-demo-progress {
  border-color: rgba(143, 216, 255, 0.66) !important;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.26)),
    repeating-linear-gradient(
      90deg,
      rgba(100, 210, 255, 0.14) 0px,
      rgba(100, 210, 255, 0.14) 1px,
      transparent 1px,
      transparent 8px
    ),
    rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.78),
    0 0 12px rgba(29, 114, 255, 0.16);
}

.audio-progress-fill,
.terran-demo-progress span {
  background: linear-gradient(90deg, var(--green), var(--xp-cyan), var(--xp-blue));
  box-shadow: 0 0 12px rgba(100, 210, 255, 0.72);
}

/* Reduce glow density on small screens. */
@media (max-width: 650px) {
  .terminal,
  .panel,
  .side-drawer,
  .side-tab {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 0 14px rgba(29, 114, 255, 0.14);
  }

  .terminal::before {
    inset: 3px;
  }
}
/* Signal Run XP chrome */

:root {
  --game-xp-blue: #1d72ff;
  --game-xp-blue-deep: #0637a8;
  --game-xp-cyan: #64d2ff;
  --game-xp-light: #8fd8ff;
  --game-xp-green: #39ff88;
  --game-xp-gold: #ffd166;
  --game-xp-red: #ff4d6d;
  --game-xp-glass: rgba(4, 18, 32, 0.92);
  --game-xp-edge: rgba(235, 250, 255, 0.42);
}

/* Signal Run shell and controls */
.signal-game-crt-shell {
  border-color: rgba(143, 216, 255, 0.84) !important;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(100, 210, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(5, 20, 36, 0.98), rgba(0, 4, 10, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 36px rgba(29, 114, 255, 0.28),
    0 0 70px rgba(57, 255, 136, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.78),
    inset 0 0 48px rgba(100, 210, 255, 0.08);
}

.signal-game-bezel {
  opacity: 0.34;
  mix-blend-mode: screen;
}

.signal-game-topbar {
  align-items: center;
  border-bottom-color: rgba(143, 216, 255, 0.52) !important;
  border-radius: 8px 8px 0 0;
  padding: 10px 6px 12px;
  background:
    linear-gradient(180deg, rgba(143, 216, 255, 0.22), rgba(29, 114, 255, 0.13) 48%, rgba(3, 18, 58, 0.26)),
    linear-gradient(90deg, rgba(57, 255, 136, 0.08), rgba(100, 210, 255, 0.12), rgba(122, 92, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 16px rgba(29, 114, 255, 0.18);
}

.signal-game-kicker {
  color: var(--game-xp-cyan);
}

.signal-game-topbar h2 {
  color: var(--game-xp-green);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.72),
    0 0 9px rgba(57, 255, 136, 0.42);
}

.signal-game-close,
#gameWrap button,
#gameWrap .mailButton {
  border-color: rgba(143, 216, 255, 0.78) !important;
  border-radius: 6px;
  color: var(--game-xp-light);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(29, 114, 255, 0.18), rgba(0, 12, 28, 0.74));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.75),
    0 0 12px rgba(100, 210, 255, 0.16);
}

.signal-game-close:hover,
.signal-game-close:focus,
#gameWrap button:hover,
#gameWrap button:focus,
#gameWrap .mailButton:hover,
#gameWrap .mailButton:focus {
  color: #001227;
  background:
    linear-gradient(180deg, #e9fbff 0%, #8fd8ff 28%, #1d72ff 68%, #0637a8 100%);
  border-color: rgba(235, 250, 255, 0.92) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(0, 0, 0, 0.68),
    0 0 18px rgba(100, 210, 255, 0.42);
}

/* CRT glass layers; interactive overlays stay above them. */
#gameWrap {
  position: relative;
  border-radius: 18px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 16%),
    linear-gradient(180deg, rgba(29, 114, 255, 0.22), rgba(0, 5, 15, 0.94));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 28px rgba(29, 114, 255, 0.28),
    0 0 56px rgba(57, 255, 136, 0.08),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -3px 0 rgba(0, 0, 0, 0.82),
    inset 2px 0 0 rgba(143, 216, 255, 0.18),
    inset -2px 0 0 rgba(0, 0, 0, 0.58);
}

#gameWrap canvas {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 12px;
  background: #02020b;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.95),
    inset 0 0 0 4px rgba(143, 216, 255, 0.26),
    inset 0 0 34px rgba(0, 0, 0, 0.82),
    0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 18px rgba(100, 210, 255, 0.16);
}

#gameWrap::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 8;
  pointer-events: none;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.38)),
    radial-gradient(circle at 50% 38%, transparent 46%, rgba(0, 0, 0, 0.28) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 4px
    );
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.26),
    inset 0 -3px 0 rgba(0, 0, 0, 0.72),
    inset 2px 0 0 rgba(143, 216, 255, 0.14),
    inset -2px 0 0 rgba(0, 0, 0, 0.52);
  mix-blend-mode: screen;
}

#gameWrap::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 9;
  pointer-events: none;
  border-radius: 12px;
  background:
    radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 18%, rgba(0, 0, 0, 0.18) 100%);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.74),
    inset 0 0 70px rgba(0, 0, 0, 0.42);
}

#overlay,
#landingScreen,
#questionPanel,
.choice-reaction-window,
#instructions {
  z-index: 12;
}

#ui {
  position: absolute;
  z-index: 13;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--game-xp-green);
  font-size: 0.72rem;
  text-shadow: 0 0 8px rgba(57, 255, 136, 0.45);
}

#ui span,
#missionText {
  border: 1px solid rgba(143, 216, 255, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(0, 12, 24, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.66),
    0 0 10px rgba(100, 210, 255, 0.12);
  padding: 4px 8px;
}

#missionText {
  max-width: min(380px, 100%);
  color: var(--game-xp-cyan);
}

#questionPanel {
  border-color: rgba(143, 216, 255, 0.72) !important;
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(100, 210, 255, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(4, 18, 32, 0.96), rgba(0, 5, 12, 0.96));
  box-shadow:
    0 0 28px rgba(29, 114, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.74);
}

#questionTitle {
  color: var(--game-xp-cyan);
  text-shadow: 0 0 8px rgba(100, 210, 255, 0.45);
}

#answers button.correct {
  border-color: rgba(57, 255, 136, 0.86) !important;
  background:
    linear-gradient(180deg, rgba(214, 255, 231, 0.92), rgba(57, 255, 136, 0.78));
  color: #001b0b;
}

#answers button.wrong {
  border-color: rgba(255, 77, 109, 0.86) !important;
  background:
    linear-gradient(180deg, rgba(255, 205, 215, 0.92), rgba(255, 77, 109, 0.82));
  color: #27000a;
}

.landing-crt-visual,
.ending-video {
  border: 0;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.95),
    inset 0 0 0 4px rgba(143, 216, 255, 0.22),
    inset 0 0 34px rgba(0, 0, 0, 0.82),
    0 0 24px rgba(29, 114, 255, 0.22);
}

/* Reduce frame bulk on narrow screens. */
@media (max-width: 760px) {
  .signal-game-crt-shell {
    padding: 10px;
    border-radius: 10px;
  }

  #gameWrap {
    padding: 6px;
    border-radius: 12px;
  }

  #gameWrap::before,
  #gameWrap::after {
    inset: 6px;
    border-radius: 8px;
  }

  #gameWrap canvas {
    border-radius: 8px;
  }

  #ui {
    top: 9px;
    left: 9px;
    right: 9px;
    gap: 5px;
    font-size: 0.62rem;
  }

  #ui span,
  #missionText {
    padding: 3px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) #gameWrap::before {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.28)),
      radial-gradient(circle at 50% 38%, transparent 46%, rgba(0, 0, 0, 0.24) 100%);
  }
}
/* Signal Run HUD and title */

:root {
  --game-retro-font: "Press Start 2P", "Courier New", monospace;
  --game-question-font: "Share Tech Mono", "Courier New", monospace;
  --game-answer-font: "VT323", "Courier New", monospace;
}

#ui {
  position: absolute;
  z-index: 14;
  top: 10px;
  left: 10px;
  right: 10px;

  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;

  font-family: var(--game-retro-font);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.02em;

  color: #57ff9a;
  text-shadow: 0 0 6px rgba(87, 255, 154, 0.45);
}

#ui > div,
#ui > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 28px;
  padding: 6px 10px;

  border-radius: 999px;
  border: 1px solid rgba(120, 215, 255, 0.55);

  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), transparent 40%),
    rgba(0, 15, 28, 0.82);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.72),
    0 0 10px rgba(80, 180, 255, 0.14);

  white-space: nowrap;
}

#missionText {
  display: block;
  flex: 0 0 100%;
  margin-top: 4px;
  max-width: 420px;
  padding: 7px 12px;

  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;

  color: #9fe4ff;
  text-shadow: 0 0 6px rgba(100, 210, 255, 0.35);
}

/* Landing title */
.signal-game-kicker,
.arcade-mission-kicker,
.landing-kicker,
#landingScreen .eyebrow,
#landingScreen .kicker,
#landingScreen .subtitle {
  display: none !important;
}

#landingScreen h1,
#overlay h1,
.signal-game-topbar h2 {
  font-family: var(--game-retro-font);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;

  color: #57ff57;
  text-shadow:
    0 0 6px rgba(87, 255, 87, 0.35),
    0 0 14px rgba(87, 255, 87, 0.22);
}

#landingScreen > div,
#overlay > div {
  text-align: center;
}

#landingScreen p,
#overlay p {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Compact HUD on narrow screens. */
@media (max-width: 760px) {
  #ui {
    gap: 6px;
    font-size: 8px;
  }

  #ui > div,
  #ui > span {
    min-height: 24px;
    padding: 5px 8px;
  }

  #missionText {
    font-size: 11px;
    max-width: 100%;
  }

  #landingScreen h1,
  #overlay h1,
  .signal-game-topbar h2 {
    font-size: clamp(18px, 6vw, 28px);
  }
}

/* Mini-game CRT and HUD */

#missionText {
  display: none !important;
}

.signal-game-kicker {
  display: none !important;
}

.signal-game-topbar {
  align-items: center;
}

.signal-game-topbar > div {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
}

.signal-game-topbar h2,
#landingScreen h1,
#overlay h1 {
  font-family: "Press Start 2P", "Courier New", monospace;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  color: #e9fff8;
  text-shadow:
    0 0 8px rgba(135, 235, 255, 0.42),
    0 0 20px rgba(71, 168, 255, 0.22);
}

.signal-game-topbar h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 30px);
}

#gameWrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 16px;
  padding: 9px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), transparent 16%),
    linear-gradient(180deg, rgba(29,114,255,0.22), rgba(0,5,15,0.96));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 0 28px rgba(29,114,255,0.28),
    inset 0 2px 0 rgba(255,255,255,0.30),
    inset 0 -3px 0 rgba(0,0,0,0.82),
    inset 2px 0 0 rgba(143,216,255,0.18),
    inset -2px 0 0 rgba(0,0,0,0.58);
}

#gameWrap canvas {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 11px;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.95),
    inset 0 0 0 4px rgba(143,216,255,0.22),
    inset 0 0 34px rgba(0,0,0,0.82),
    0 1px 0 rgba(255,255,255,0.22),
    0 0 18px rgba(100,210,255,0.16);
}

#gameWrap::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 5;
  pointer-events: none;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), transparent 18%, transparent 72%, rgba(0,0,0,0.32)),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.045) 0px,
      rgba(255,255,255,0.045) 1px,
      transparent 1px,
      transparent 4px
    );
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.22),
    inset 0 -3px 0 rgba(0,0,0,0.68),
    inset 2px 0 0 rgba(143,216,255,0.12),
    inset -2px 0 0 rgba(0,0,0,0.48);
  mix-blend-mode: screen;
}

#gameWrap::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 6;
  pointer-events: none;
  border-radius: 11px;
  background:
    radial-gradient(circle at center, transparent 58%, rgba(0,0,0,0.56) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 18%, rgba(0,0,0,0.16) 100%);
  box-shadow:
    inset 0 0 34px rgba(0,0,0,0.70),
    inset 0 0 70px rgba(0,0,0,0.38);
}

#overlay,
#landingScreen,
#questionPanel,
#bossBanner,
.choice-reaction-window,
#instructions {
  z-index: 14;
}

@media (max-width: 760px) {
  .signal-game-topbar h2,
  #landingScreen h1,
  #overlay h1 {
    font-size: clamp(18px, 5.4vw, 26px);
  }

  #gameWrap {
    padding: 8px;
    border-radius: 14px;
  }

  #gameWrap::before,
  #gameWrap::after {
    inset: 8px;
    border-radius: 10px;
  }
}

/* Intern In The Stars: readable quiz panel + boss-visible layout */

#questionPanel {
  bottom: 14px;
  width: min(720px, 78%);
  max-width: 720px;
  max-height: 40%;
  padding: 12px 16px;
  overflow-y: auto;
  text-align: left;
}

#questionPanel.static-baron-question,
#questionPanel.final-baron-question {
  bottom: 14px;
  width: min(740px, 80%);
  max-width: 740px;
  max-height: 40%;
  padding: 12px 16px;
  overflow-y: auto;
}

/* Keep the game title retro, but make quiz reading easier */
#signalGameTitle,
#overlay h1,
#landingScreen h1 {
  font-family: "Press Start 2P", monospace;
}

/* Keep the victory screen compact enough to reveal stats + leaderboard in one view */
#landingScreen > div {
  width: min(96vw, 1180px);
  padding: 8px 10px 14px;
}

.signal-ending-layout {
  grid-template-columns: minmax(0, 1fr) clamp(390px, 32vw, 450px);
  gap: clamp(14px, 1.6vw, 20px);
}

#landingScreen h1 {
  max-width: 11ch;
  font-size: clamp(16px, 3.2vw, 28px);
  line-height: 1.04;
}

#landingScreen p {
  max-width: 52ch;
  font-size: clamp(0.88rem, 1.45vw, 1rem);
  line-height: 1.38;
}

.landing-crt-visual,
.ending-video {
  width: min(100%, 560px);
  margin: 2px auto 6px;
}

#finalStats {
  width: min(100%, 560px);
}

.signal-run-highscores {
  padding: 10px 12px;
}

#highScoreList {
  margin-top: 8px;
}

@media (max-width: 860px) {
  #landingScreen > div {
    width: min(100%, 640px);
  }

  .signal-ending-layout {
    grid-template-columns: 1fr;
  }

  .signal-leaderboard-rail {
    width: min(100%, 560px);
    justify-self: center;
  }
}

#questionTitle {
  font-family: "Share Tech Mono", "Segoe UI", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: #7de7ff;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 0 8px rgba(100, 210, 255, 0.45);
}

#questionText {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 62ch;
  color: #f1fbff;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 6px rgba(0, 0, 0, 0.8);
}

#answers {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 9px;
}

#gameWrap .answer {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  padding: 7px 10px;
  color: #f7fbff;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 5px rgba(0, 0, 0, 0.8);
}

#gameWrap .answer strong {
  font-family: "Share Tech Mono", monospace;
  font-size: 17px;
  color: #57fff0;
  margin-right: 8px;
}

.answer-hint {
  margin-top: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(235, 248, 255, 0.72);
}

/* Signal Run gameplay readability */
#ui {
  top: 12px;
  left: 12px;
  right: 12px;
  gap: 6px;
  max-width: min(620px, calc(100% - 24px));
  align-items: flex-start;
}

#ui .hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 5px 9px;
  font-size: 9px;
}

#ui .hud-chip-run {
  gap: 10px;
}

#ui .hud-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#ui .hud-chip-signal {
  color: #8ae6ff;
}

#questionPanel {
  left: 50%;
  right: auto;
  bottom: 18px;
  width: min(720px, 85%);
  max-width: 720px;
  padding: 16px 18px;
  transform: translateX(-50%);
  text-align: left;
}

#questionPanel.final-baron-question,
#questionPanel.static-baron-question {
  bottom: 18px;
  left: 50%;
  right: auto;
  width: min(720px, 85%);
  max-width: 720px;
  max-height: 460px;
  transform: translateX(-50%);
}

#questionTitle,
#questionText {
  text-align: left;
}

#questionText {
  font-family: var(--game-question-font);
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #eaf8ff;
  text-shadow: none;
  max-width: 66ch;
}

#answers {
  grid-template-columns: 1fr;
  gap: 8px;
}

#gameWrap .answer {
  display: block;
  width: 100%;
  font-family: var(--game-answer-font);
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0.03em;
  color: #f3fbff;
  text-shadow: none;
  padding: 8px 12px;
  white-space: normal;
  text-wrap: pretty;
}

.answer-hint {
  font-family: var(--game-question-font);
  text-align: left;
}

.signal-game-topbar h2,
#questionTitle {
  font-family: var(--game-retro-font);
  letter-spacing: 1px;
}

#questionText {
  font-family: var(--game-question-font);
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #eaf8ff;
  text-shadow: none;
}

@media (max-width: 760px) {
  #ui {
    max-width: calc(100% - 18px);
  }

  #ui .hud-chip {
    font-size: 8px;
    padding: 4px 7px;
  }

  #questionPanel,
  #questionPanel.final-baron-question,
  #questionPanel.static-baron-question {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: 52%;
    transform: none;
  }
}
/* Intern In The Stars intro video screen */
.signal-intro-screen {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  place-items: center;
  padding: 14px 18px;
  background:
    radial-gradient(circle at center, rgba(100, 210, 255, 0.16), transparent 46%),
    rgba(0, 0, 0, 0.78);
}

.signal-intro-screen.is-active {
  display: grid;
}

.signal-game-modal.intro-active .signal-game-topbar {
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom-color: transparent;
  padding-bottom: 0;
}

.signal-game-modal.intro-active .signal-game-crt-shell {
  background: linear-gradient(180deg, rgba(5, 14, 24, 0.98), rgba(0, 3, 8, 0.99));
}

.signal-game-modal.intro-active .signal-game-bezel,
.signal-game-modal.intro-active #gameWrap::before {
  opacity: 0;
}

.signal-intro-card {
  width: min(92%, 760px);
  padding: 16px 18px 14px;
  border: 1px solid rgba(57, 255, 136, 0.65);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(5, 18, 24, 0.96), rgba(2, 7, 10, 0.98));
  box-shadow:
    0 0 28px rgba(57, 255, 136, 0.18),
    inset 0 0 22px rgba(100, 210, 255, 0.08);
  text-align: center;
}

.signal-intro-kicker {
  margin: 0 0 10px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.signal-intro-card h3 {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1rem, 2.6vw, 1.55rem);
  line-height: 1.25;
}

.signal-intro-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 248px;
  overflow: hidden;
  border: 1px solid rgba(100, 210, 255, 0.55);
  border-radius: 12px;
  background:
    radial-gradient(circle at center, rgba(100, 210, 255, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(4, 12, 20, 1), rgba(0, 0, 0, 1));
  box-shadow:
    inset 0 0 32px rgba(0, 0, 0, 0.78),
    0 0 18px rgba(100, 210, 255, 0.16);
}

.signal-intro-video-frame::before,
.signal-intro-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.signal-intro-video-frame::before {
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 248, 220, 0.2), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.18));
  opacity: 0.42;
}

.signal-intro-video-frame::after {
  inset: -1.5%;
  background: url("/assets/rail-shooter/ui/crt-tv-frame.png") center / 100% 100% no-repeat;
  opacity: 0.62;
}

.signal-intro-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  position: relative;
  z-index: 1;
}

.signal-intro-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  color: #d8ffe7;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at center, rgba(255, 209, 102, 0.12), transparent 52%),
    rgba(2, 8, 12, 0.96);
}

.signal-intro-fallback[hidden] {
  display: none !important;
}

.signal-intro-fallback-title {
  margin: 0;
  color: var(--amber);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.8rem, 2.2vw, 1.15rem);
}

.signal-intro-fallback p {
  max-width: 44ch;
  margin: 0;
}

.signal-intro-copy {
  margin: 0 auto 12px;
  max-width: 44ch;
  color: #f3fff9;
  font-size: clamp(1rem, 1.55vw, 1.12rem);
  line-height: 1.45;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 0 14px rgba(87, 255, 154, 0.12);
}

.signal-intro-media-controls {
  position: relative;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 12px;
}

.signal-intro-status {
  margin: 0;
  color: #d8ffe7;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.62rem, 1.35vw, 0.78rem);
  line-height: 1.45;
  text-transform: uppercase;
}

.signal-intro-status[hidden],
.signal-intro-play[hidden] {
  display: none !important;
}

.signal-intro-play {
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 10px 16px;
  background: rgba(57, 255, 136, 0.12);
  color: var(--green);
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.signal-intro-play:hover,
.signal-intro-play:focus {
  background: var(--green);
  color: #021109;
}

.signal-intro-skip {
  position: relative;
  z-index: 5;
  margin-top: 12px;
  border: 1px solid var(--amber);
  background: rgba(255, 209, 102, 0.1);
  color: var(--amber);
  padding: 10px 16px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.signal-intro-skip:hover,
.signal-intro-skip:focus {
  background: var(--amber);
  color: #1c1200;
}

@media (max-width: 760px) {
  .signal-intro-screen {
    padding: 10px;
  }

  .signal-intro-card {
    width: 100%;
    padding: 12px;
  }

  .signal-intro-video-frame {
    min-height: 184px;
  }
}

.crawler-shield {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  color: #e9f7ff;
  font-family: "Share Tech Mono", "Courier New", monospace;
}

.crawler-shield-card {
  width: min(520px, calc(100vw - 40px));
  border: 1px solid rgba(255, 107, 125, 0.62);
  background: rgba(20, 3, 7, 0.95);
  box-shadow: 0 0 28px rgba(255, 107, 125, 0.18);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.crawler-shield-card h1 {
  margin: 0 0 10px;
  color: #ff6b7d;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Signal Run layout tuning */
.signal-game-crt-shell:has(#landingScreen[style*="display: grid"]) {
  width: min(1240px, calc(100vw - 48px)) !important;
}

#gameWrap {
  width: min(770px, calc(100vw - 88px), calc(78vh * 1020 / 745)) !important;
  height: auto !important;
  max-height: 78vh !important;
  margin: 0 auto 16px !important;
}

#gameWrap:has(#landingScreen[style*="display: grid"]) {
  width: min(1180px, calc(100vw - 88px)) !important;
  max-height: 78vh !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}

#gameWrap canvas {
  display: block !important;
  width: calc(100% - 18px) !important;
  height: auto !important;
  aspect-ratio: 1020 / 745 !important;
  margin: 9px auto !important;
}

.signal-intro-card {
  width: min(674px, calc(100vw - 72px)) !important;
  min-height: 0 !important;
  padding: 24px 19px !important;
  border-width: 5px !important;
  border-style: solid !important;
  border-color: rgba(57, 255, 136, 0.09) !important;
  border-radius: 60px !important;
  background: rgba(2, 12, 16, 1) !important;
  box-shadow:
    0 0 42px rgba(57, 255, 136, 0.22),
    inset 0 0 21px rgba(100, 210, 255, 0.08) !important;
}

.signal-intro-copy {
  margin-top: 16px !important;
  margin-bottom: 52px !important;
  font-size: 23px !important;
  line-height: 1.09 !important;
  max-width: 38ch !important;
}

.signal-intro-video-frame {
  position: relative !important;
  isolation: isolate !important;
  width: min(320px, 100%) !important;
  aspect-ratio: 1672 / 941 !important;
  transform: scale(1.6) !important;
  transform-origin: center center !important;
  margin: 0 auto !important;
  margin-top: -12px !important;
  margin-bottom: -14px !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.signal-intro-video-frame::before,
.signal-intro-video-frame::after {
  content: none !important;
  display: none !important;
}

.signal-intro-video-frame::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 3 !important;
  pointer-events: none !important;
  background: url("/assets/rail-shooter/ui/IntroTube.png") center / contain no-repeat !important;
}

.signal-intro-video-screen {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  overflow: visible !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.signal-intro-video,
.signal-intro-fallback {
  position: absolute !important;
  top: 61.4% !important;
  left: 45.7% !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-46.5%, -35.3%) scale(1.93) !important;
  transform-origin: center center !important;
  object-fit: fill !important;
  object-position: 0% 0% !important;
  border-radius: 17% / 6.5% !important;
}

.signal-intro-video {
  z-index: 1 !important;
  display: block !important;
  background: #000 !important;
}

.signal-intro-fallback {
  z-index: 2 !important;
  display: grid !important;
  place-items: center !important;
  padding: 18px !important;
  text-align: center !important;
  background: #000 !important;
}

.signal-intro-skip {
  margin-top: 50px !important;
  padding: 14px 31px !important;
  font-size: 21px !important;
  border-radius: 11px !important;
}

/* Protect leaderboard form controls from overlay hit-testing conflicts */
#highScoreForm,
.signal-run-highscore-form-row,
#highScoreName,
#highScoreSubmit {
  position: relative;
  z-index: 30;
  pointer-events: auto;
}

/* Compact start overlay without shrinking the game shell */
#overlay {
  padding: 18px !important;
}

#overlay > div {
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: 8px 10px 12px !important;
  box-sizing: border-box !important;
}

.practice-box {
  width: min(100%, 540px) !important;
  max-width: 540px !important;
  margin: 6px auto !important;
}

.practice-box-header {
  padding: 4px 9px !important;
}

.practice-box #practiceCanvas,
#practiceCanvas {
  display: block !important;
  width: 100% !important;
  max-width: 540px !important;
  aspect-ratio: 16 / 7.5 !important;
  height: clamp(210px, 28vh, 260px) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.practice-controls {
  width: 100% !important;
  max-width: 540px !important;
  margin: 0 auto !important;
  gap: 6px !important;
  padding: 6px !important;
}

.practice-controls button {
  min-height: 34px !important;
  padding: 6px 8px !important;
  font-size: 0.62rem !important;
}

@media (max-width: 780px) {
  .practice-box {
    width: 100% !important;
  }

  .practice-box #practiceCanvas,
  #practiceCanvas {
    max-width: 100% !important;
    height: clamp(180px, 34vh, 230px) !important;
  }

  .practice-controls {
    grid-template-columns: 1fr !important;
  }
}

.start-controls {
  width: min(100%, 560px) !important;
  max-width: 560px !important;
  margin: 12px auto !important;
  gap: 6px 12px !important;
}

#startBtn {
  width: min(100%, 280px) !important;
  margin: 10px auto 0 !important;
}

/* Signal Run debugger-controlled layout */
.signal-game-crt-shell {
  width: min(1120px, calc(100vw - 48px)) !important;
  max-height: calc(100vh - 24px) !important;
  overflow: hidden !important;
}

#gameWrap {
  width: min(770px, calc(100vw - 88px), calc(78vh * 1020 / 745)) !important;
  height: auto !important;
  max-height: 78vh !important;
  aspect-ratio: 1020 / 745 !important;
  margin: 0 auto 16px !important;
}

#gameWrap canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.signal-game-topbar h2 {
  font-size: 38px !important;
}

#questionPanel,
#questionPanel.static-baron-question,
#questionPanel.final-baron-question,
#questionPanel.unicorn-question {
  left: 50% !important;
  right: auto !important;
  bottom: 19px !important;
  width: min(690px, 82%) !important;
  max-width: 830px !important;
  max-height: min(55%, calc(100vh - 180px)) !important;
  transform: translateX(-50%) !important;
  padding: 10px 10px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  text-align: center !important;
  z-index: 11 !important;
  background: rgba(3, 12, 24, 0.71) !important;
  border-color: rgba(125, 231, 255, 0.4) !important;
}

#questionTitle {
  font-family: "Press Start 2P", "Courier New", monospace !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.18em !important;
  text-align: center !important;
}

#questionText {
  max-width: 71ch !important;
  font-family: "VT323", "Courier New", monospace !important;
  font-size: 22px !important;
  line-height: 1.35 !important;
  letter-spacing: 0.03em !important;
  text-align: center !important;
}

#answers {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

#gameWrap .answer {
  padding: 4px 11px !important;
  font-family: "Courier New", Courier, monospace !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  line-height: 0.9 !important;
  letter-spacing: 0 !important;
}

/* Static Baron warning tuning */
#questionPanel.static-baron-warning{bottom:18px!important;width:min(760px,82%)!important;max-width:780px!important;max-height:min(90%,calc(100vh - 150px))!important;padding:4px 20px!important;overflow-y:auto!important;overscroll-behavior:contain;text-align:left!important;background:rgba(3,12,24,0.51)!important;border-color:rgba(125,231,255,0.54)!important}
#questionPanel.static-baron-warning #questionTitle{margin-bottom:6px!important;font-size:11px!important;line-height:1.35!important;letter-spacing:0.35em!important;text-align:left!important}
#questionPanel.static-baron-warning #questionText{max-width:100ch!important;font-size:19px!important;line-height:1.25!important;text-align:left!important}
#questionPanel.static-baron-warning #questionText p{margin:0 0 6px!important;white-space:pre-line!important}
#questionPanel.static-baron-warning #answers{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:28px!important}
#questionPanel.static-baron-warning #answers .answer{padding:4px 34px!important;font-size:12px!important;line-height:1.75!important}

#questionPanel.static-baron-question {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#questionPanel.static-baron-question .challenge-answer {
  position: relative;
  z-index: 2;
  min-height: 44px;
}

#questionPanel.final-baron-dialogue {
  bottom: 18px !important;
  width: min(650px, 84%) !important;
  max-height: 45% !important;
  padding: 12px 16px 14px !important;
  overflow: hidden !important;
  text-align: left !important;
  background: rgba(2, 8, 18, 0.88) !important;
  border: 2px solid rgba(255, 216, 109, 0.88) !important;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.72),
    0 0 22px rgba(255, 93, 93, 0.22) !important;
}

#questionPanel.final-baron-dialogue #questionTitle {
  margin-bottom: 8px !important;
  color: #ffd86d !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  letter-spacing: 0.22em !important;
  text-align: left !important;
}

#questionPanel.final-baron-dialogue #questionText {
  min-height: 112px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  color: #f7fbff !important;
  font-size: 20px !important;
  line-height: 1.22 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  white-space: pre-line !important;
}

#questionPanel.final-baron-dialogue .answer-hint {
  display: none !important;
}

#questionPanel.final-baron-dialogue #answers {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  margin-top: 8px !important;
}

#questionPanel.final-baron-dialogue .final-baron-dialogue-ok {
  width: auto !important;
  min-width: 92px !important;
  min-height: 34px !important;
  padding: 7px 18px !important;
  border-color: rgba(255, 216, 109, 0.9) !important;
  color: #041018 !important;
  background: #ffd86d !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

#gameWrap .answer.challenge-answer-disabled,
#gameWrap .answer.challenge-answer-disabled:hover,
#gameWrap .answer.challenge-answer-disabled:focus {
  border-color: rgba(160, 160, 160, 0.35) !important;
  background: rgba(120, 120, 120, 0.12) !important;
  color: rgba(220, 220, 220, 0.48) !important;
  cursor: not-allowed !important;
}

.answer-hint {
  font-size: 14px !important;
}

#ui:not(.starship-hud) {
  top: 21px !important;
  left: 16px !important;
  right: 16px !important;
  max-width: min(960px, calc(100% - 32px)) !important;
  gap: 0 !important;
  font-size: 5px !important;
}

#ui:not(.starship-hud) .hud-chip,
#ui:not(.starship-hud) > div,
#ui:not(.starship-hud) > span {
  padding: 0 7px !important;
}

.boss-banner {
  top: 0 !important;
  width: min(88%, 600px) !important;
}

.signal-intro-video,
.signal-intro-fallback {
  top: 59.8% !important;
  left: 41.9% !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 84.1% !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-41.2%, -61.8%) scale(0.65) !important;
  transform-origin: center center !important;
  object-fit: cover !important;
  object-position: 46.5% 0 !important;
  border-radius: 22.5% / 11% !important;
}

/* Signal Run compact starship HUD */

#gameWrap #ui.starship-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  right: auto;
  z-index: 12;
  display: grid;
  width: min(760px, calc(100% - 24px));
  max-width: min(760px, calc(100% - 24px));
  gap: 3px;
  transform: translateX(-50%);
  pointer-events: none;
  font-family: "Share Tech Mono", "Courier New", monospace;
  color: #75f4ff;
  text-transform: uppercase;
  filter: drop-shadow(0 0 10px rgba(45, 211, 255, 0.18));
}

#gameWrap .starship-hud-shell {
  position: relative;
  display: grid;
  grid-template-columns:
    minmax(84px, 1fr)
    minmax(84px, 0.95fr)
    minmax(58px, 0.58fr)
    minmax(72px, 0.75fr)
    minmax(72px, 0.75fr)
    minmax(112px, 1.15fr);
  gap: 5px;
  align-items: stretch;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid rgba(111, 212, 255, 0.38);
  border-radius: 14px 14px 9px 9px;
  background:
    linear-gradient(
      180deg,
      rgba(30, 43, 52, 0.65),
      rgba(7, 13, 17, 0.68) 48%,
      rgba(2, 6, 10, 0.72)
    ),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 36px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -8px 18px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(0, 0, 0, 0.78),
    0 8px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

#gameWrap .starship-hud-shell::before,
#gameWrap .starship-hud-shell::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 30px;
  border: 1px solid rgba(107, 211, 255, 0.16);
  opacity: 0.8;
  pointer-events: none;
}

#gameWrap .starship-hud-shell::before {
  left: 8px;
  border-right: 0;
  clip-path: polygon(0 0, 100% 0, 72% 100%, 0 100%);
}

#gameWrap .starship-hud-shell::after {
  right: 8px;
  border-left: 0;
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

#gameWrap #ui .hud-cell {
  position: relative;
  display: grid;
  grid-template-rows: 13px 1fr;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 9px 5px;
  border: 1px solid rgba(99, 230, 255, 0.26);
  border-radius: 10px 4px 10px 4px;
  background:
    linear-gradient(
      180deg,
      rgba(8, 18, 24, 0.65),
      rgba(0, 4, 8, 0.72)
    ),
    radial-gradient(circle at 50% 120%, rgba(59, 226, 255, 0.09), transparent 60%);
  box-shadow:
    inset 0 0 18px rgba(67, 217, 255, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 10px rgba(35, 211, 255, 0.055);
  overflow: hidden;
}

#gameWrap #ui .hud-cell::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(80, 238, 255, 0.85), transparent);
  opacity: 0.78;
}

#gameWrap #ui .hud-cell::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 2px;
  border-radius: 99px;
  background: rgba(91, 238, 255, 0.48);
  box-shadow: 0 0 8px rgba(91, 238, 255, 0.52);
  opacity: 0.58;
}

#gameWrap #ui .hud-label {
  position: relative;
  z-index: 1;
  display: block;
  color: rgba(133, 238, 255, 0.84);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-shadow: 0 0 7px rgba(60, 226, 255, 0.46);
}

#gameWrap #ui .hud-value {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: #77f7ff;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 8px rgba(88, 239, 255, 0.74),
    0 1px 0 rgba(0, 0, 0, 0.95);
}

#gameWrap #ui .hud-unit {
  font-size: 0.72em;
  opacity: 0.9;
}

#gameWrap #ui .hud-run-icon {
  font-size: 17px;
  transform: translateY(1px);
}

#gameWrap #ui .hud-cell-signal {
  min-width: 0;
}

#gameWrap #ui .hud-cell-signal .hud-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#gameWrap #missionText.hud-mission {
  justify-self: center;
  max-width: min(680px, 94%);
  padding: 2px 10px 3px;
  border: 1px solid rgba(99, 230, 255, 0.14);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgba(0, 6, 10, 0.62);
  color: rgba(203, 247, 255, 0.76);
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 6px rgba(40, 220, 255, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  #gameWrap #ui.starship-hud {
    top: 8px;
    width: calc(100% - 18px);
    max-width: calc(100% - 18px);
  }

  #gameWrap .starship-hud-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
    padding: 5px;
    border-radius: 12px;
  }

  #gameWrap #ui .hud-cell {
    min-height: 30px;
    padding: 4px 6px;
  }

  #gameWrap #ui .hud-label {
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  #gameWrap #ui .hud-value {
    font-size: 14px;
  }

  #gameWrap #ui .hud-cell-signal .hud-value {
    font-size: 12px;
  }

  #gameWrap #missionText.hud-mission {
    max-width: calc(100% - 12px);
    font-size: 7px;
  }
}

@media (max-width: 480px) {
  #gameWrap .starship-hud-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #gameWrap #ui .hud-cell-run {
    display: none;
  }
}

/* Hide full-page compositing layers during Canvas gameplay on GPU-limited browsers. */
body.modal-open::before,
body.modal-open::after,
body.signal-run-active::before,
body.signal-run-active::after {
  display: none !important;
}

body.modal-open .terminal,
body.signal-run-active .terminal {
  box-shadow: none !important;
}

body.modal-open #gameWrap #ui.starship-hud,
body.signal-run-active #gameWrap #ui.starship-hud {
  filter: none !important;
}

body.signal-run-active .signal-game-crt-shell {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(29, 114, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72) !important;
}

body.signal-run-active .signal-game-bezel {
  opacity: 0.18 !important;
  mix-blend-mode: normal !important;
}

body.signal-run-active #gameWrap {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 16px rgba(29, 114, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.76) !important;
}

body.signal-run-active #gameWrap canvas {
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.9),
    inset 0 0 18px rgba(0, 0, 0, 0.68),
    0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

body.signal-run-active #gameWrap::before {
  opacity: 0.38;
  mix-blend-mode: normal !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.24)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.52) !important;
}

body.signal-run-active #gameWrap::after {
  opacity: 0.54;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.58),
    inset 0 0 40px rgba(0, 0, 0, 0.24) !important;
}

body.signal-run-low-fx .signal-game-backdrop,
.signal-game-modal.signal-run-low-fx .signal-game-backdrop {
  background: rgba(0, 0, 0, 0.9) !important;
}

body.signal-run-low-fx .signal-game-crt-shell,
.signal-game-modal.signal-run-low-fx .signal-game-crt-shell {
  box-shadow:
    0 0 0 1px rgba(143, 216, 255, 0.18),
    0 0 12px rgba(29, 114, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

body.signal-run-low-fx #gameWrap,
.signal-game-modal.signal-run-low-fx #gameWrap {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.72) !important;
}

body.signal-run-low-fx #gameWrap::before,
.signal-game-modal.signal-run-low-fx #gameWrap::before {
  opacity: 0.14;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), transparent 28%, rgba(0, 0, 0, 0.18)) !important;
  box-shadow: none !important;
}

body.signal-run-low-fx #gameWrap::after,
.signal-game-modal.signal-run-low-fx #gameWrap::after {
  opacity: 0.28;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.42) !important;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) #gameWrap::before {
    mix-blend-mode: normal !important;
  }
}

/* Compact cockpit reduces DOM overlay pressure without changing the 1020 x 745 canvas. */
body.signal-run-compact-cockpit .signal-game-modal {
  padding: 8px !important;
}

.signal-game-modal.signal-run-compact-cockpit .signal-game-crt-shell {
  width: min(1040px, calc(100vw - 16px)) !important;
  max-height: calc(100vh - 12px) !important;
  padding: 10px !important;
}

.signal-game-modal.signal-run-compact-cockpit .signal-game-topbar {
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
  padding-bottom: 6px !important;
}

.signal-game-modal.signal-run-compact-cockpit .signal-game-topbar h2 {
  font-size: clamp(1rem, 3vw, 1.65rem) !important;
  line-height: 1 !important;
}

.signal-game-modal.signal-run-compact-cockpit .signal-game-close {
  padding: 6px 9px !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
}

body.signal-run-compact-cockpit #gameWrap {
  width: min(770px, calc(100vw - 36px), calc((100vh - 96px) * 1020 / 745)) !important;
  max-height: calc(100vh - 96px) !important;
  aspect-ratio: 1020 / 745 !important;
  margin: 0 auto 8px !important;
}

body.signal-run-compact-cockpit #gameWrap canvas,
.signal-game-modal.signal-run-compact-cockpit #game {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

body.signal-run-compact-cockpit #gameWrap #ui.starship-hud {
  top: 7px !important;
  width: min(700px, calc(100% - 16px)) !important;
  max-width: min(700px, calc(100% - 16px)) !important;
  gap: 2px !important;
}

body.signal-run-compact-cockpit #gameWrap .starship-hud-shell {
  grid-template-columns:
    minmax(70px, 1fr)
    minmax(70px, 0.9fr)
    minmax(48px, 0.5fr)
    minmax(60px, 0.68fr)
    minmax(60px, 0.68fr)
    minmax(88px, 1fr) !important;
  gap: 3px !important;
  min-height: 36px !important;
  padding: 4px 5px !important;
  border-radius: 10px 10px 7px 7px !important;
}

body.signal-run-compact-cockpit #gameWrap #ui .hud-cell {
  grid-template-rows: 10px 1fr !important;
  min-height: 27px !important;
  padding: 3px 5px 4px !important;
  border-radius: 7px 3px 7px 3px !important;
}

body.signal-run-compact-cockpit #gameWrap #ui .hud-label {
  font-size: 7px !important;
  letter-spacing: 0.08em !important;
}

body.signal-run-compact-cockpit #gameWrap #ui .hud-value {
  gap: 2px !important;
  font-size: 14px !important;
  letter-spacing: 0.03em !important;
}

body.signal-run-compact-cockpit #gameWrap #ui .hud-cell-signal .hud-value {
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
}

body.signal-run-compact-cockpit #gameWrap #missionText.hud-mission {
  max-width: min(610px, calc(100% - 18px)) !important;
  padding: 1px 8px 2px !important;
  font-size: 7px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.04em !important;
}

body.signal-run-compact-cockpit #questionPanel,
body.signal-run-compact-cockpit #questionPanel.static-baron-question,
body.signal-run-compact-cockpit #questionPanel.final-baron-question,
body.signal-run-compact-cockpit #questionPanel.unicorn-question {
  bottom: 12px !important;
  width: min(650px, 84%) !important;
  max-height: min(48%, calc(100vh - 130px)) !important;
  padding: 7px 9px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body.signal-run-compact-cockpit #questionTitle {
  margin-bottom: 5px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: 0.12em !important;
}

body.signal-run-compact-cockpit #questionText {
  max-width: 68ch !important;
  font-size: 18px !important;
  line-height: 1.18 !important;
}

body.signal-run-compact-cockpit #answers {
  gap: 4px !important;
  margin-top: 6px !important;
}

body.signal-run-compact-cockpit #gameWrap .answer {
  padding: 3px 8px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-question {
  max-height: min(58%, calc(100vh - 124px)) !important;
  padding: 6px 8px !important;
  overflow-y: auto !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning {
  bottom: 10px !important;
  width: min(650px, 86%) !important;
  max-height: min(76%, calc(100vh - 118px)) !important;
  padding: 3px 12px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning #questionTitle {
  margin-bottom: 4px !important;
  font-size: 9px !important;
  line-height: 1.2 !important;
  letter-spacing: 0.24em !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning #questionText {
  max-width: 92ch !important;
  font-size: 15px !important;
  line-height: 1.16 !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning #questionText p {
  margin-bottom: 4px !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning #answers {
  gap: 8px !important;
  margin-top: 4px !important;
}

body.signal-run-compact-cockpit #questionPanel.static-baron-warning #answers .answer {
  min-height: 24px !important;
  padding: 3px 14px !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
}

body.signal-run-compact-cockpit .answer-hint {
  margin-top: 5px !important;
  font-size: 0.62rem !important;
}

body.signal-run-compact-cockpit #overlay,
body.signal-run-compact-cockpit #landingScreen {
  padding: 12px !important;
}

body.signal-run-compact-cockpit #overlay > div,
body.signal-run-compact-cockpit #landingScreen > div {
  max-height: 100% !important;
}

body.signal-run-compact-cockpit #overlay p,
body.signal-run-compact-cockpit #landingScreen p {
  margin-top: 6px !important;
  margin-bottom: 6px !important;
  font-size: 0.82rem !important;
  line-height: 1.25 !important;
}

.signal-run-compact-warning {
  display: none;
}

body.signal-run-compact-cockpit #overlay .signal-run-compact-warning {
  display: block;
  max-width: 62ch;
  margin: 6px auto 8px !important;
  color: var(--signal-gold);
  font-size: 0.72rem !important;
  line-height: 1.25 !important;
  letter-spacing: 0.02em;
}

body.signal-run-compact-cockpit .practice-box {
  max-width: 460px !important;
  margin: 6px auto !important;
}

body.signal-run-compact-cockpit .practice-box-header {
  padding: 4px 7px !important;
  font-size: 0.58rem !important;
}

body.signal-run-compact-cockpit #practiceCanvas {
  height: clamp(185px, 29vh, 250px) !important;
}

body.signal-run-compact-cockpit .practice-controls {
  gap: 4px !important;
  padding: 5px !important;
}

body.signal-run-compact-cockpit .practice-controls button {
  min-height: 27px !important;
  padding: 4px 5px !important;
  font-size: 0.56rem !important;
}

body.signal-run-compact-cockpit .start-controls {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
  gap: 5px 8px !important;
  max-width: 520px !important;
  margin: 8px auto !important;
  font-size: 0.72rem !important;
}

body.signal-run-compact-cockpit .start-controls kbd {
  min-width: 1.8em !important;
  padding: 3px 5px !important;
}

body.signal-run-compact-cockpit #startBtn {
  width: min(100%, 260px) !important;
  margin-top: 8px !important;
  padding: 7px 10px !important;
  font-size: 0.78rem !important;
}

body.signal-run-compact-cockpit .signal-intro-card {
  width: min(560px, calc(100vw - 44px)) !important;
  padding: 14px 15px !important;
  border-width: 3px !important;
  border-radius: 36px !important;
}

body.signal-run-compact-cockpit .signal-intro-copy {
  margin-top: 8px !important;
  margin-bottom: 28px !important;
  font-size: 17px !important;
  line-height: 1.08 !important;
}

body.signal-run-compact-cockpit .signal-intro-video-frame {
  width: min(300px, 100%) !important;
  min-height: 170px !important;
  margin-top: -4px !important;
  margin-bottom: -14px !important;
  transform: scale(1.32) !important;
}

body.signal-run-compact-cockpit .signal-intro-skip {
  margin-top: 42px !important;
  padding: 10px 18px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
}

body.signal-run-compact-cockpit .signal-ending-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
  gap: 10px !important;
}

body.signal-run-compact-cockpit #landingScreen h1 {
  margin-bottom: 7px !important;
  font-size: clamp(1rem, 3vw, 1.55rem) !important;
}

body.signal-run-compact-cockpit .ending-video {
  max-height: 210px !important;
}

body.signal-run-compact-cockpit #finalStats {
  font-size: 0.72rem !important;
  line-height: 1.25 !important;
}

body.signal-run-compact-cockpit .signal-ending-actions {
  gap: 7px !important;
}

body.signal-run-compact-cockpit .signal-ending-actions .mailButton,
body.signal-run-compact-cockpit .signal-ending-actions button {
  padding: 7px 9px !important;
  font-size: 0.7rem !important;
}

body.signal-run-compact-cockpit .signal-leaderboard-rail {
  min-width: 0 !important;
}

body.signal-run-compact-cockpit .signal-run-highscores,
body.signal-run-compact-cockpit .signal-leaderboard-card {
  padding: 8px !important;
}

body.signal-run-compact-cockpit .signal-run-highscores-header {
  gap: 6px !important;
}

body.signal-run-compact-cockpit .signal-run-highscores h2,
body.signal-run-compact-cockpit .signal-leaderboard-title {
  font-size: 0.82rem !important;
  line-height: 1.1 !important;
}

body.signal-run-compact-cockpit #highScoreCurrentScore,
body.signal-run-compact-cockpit #highScoreStatus,
body.signal-run-compact-cockpit #highScoreForm label {
  font-size: 0.66rem !important;
  line-height: 1.2 !important;
}

body.signal-run-compact-cockpit .signal-run-highscore-form-row {
  grid-template-columns: minmax(0, 1fr) minmax(100px, max-content) !important;
  gap: 6px !important;
}

body.signal-run-compact-cockpit #highScoreName,
body.signal-run-compact-cockpit #highScoreSubmit {
  min-height: 30px !important;
  padding: 5px 7px !important;
  font-size: 0.68rem !important;
}

body.signal-run-compact-cockpit #highScoreSubmit {
  min-width: 100px !important;
}

body.signal-run-compact-cockpit #highScoreList {
  gap: 5px !important;
  margin-top: 6px !important;
}

body.signal-run-compact-cockpit .signal-leaderboard-row {
  grid-template-columns: 62px 3ch minmax(8ch, 1fr) 7ch !important;
  gap: 5px !important;
}

body.signal-run-compact-cockpit .signal-leaderboard-badge,
body.signal-run-compact-cockpit .score-badge {
  width: 62px !important;
  height: 22px !important;
}

body.signal-run-compact-cockpit .signal-leaderboard-name,
body.signal-run-compact-cockpit .score-name,
body.signal-run-compact-cockpit .signal-leaderboard-score,
body.signal-run-compact-cockpit .score-value,
body.signal-run-compact-cockpit .signal-leaderboard-rank,
body.signal-run-compact-cockpit .score-rank {
  font-size: 0.54rem !important;
}

body.signal-run-compact-cockpit img.signal-leaderboard-icon-trophy,
body.signal-run-compact-cockpit .signal-leaderboard-icon-trophy {
  width: 34px !important;
  height: 20px !important;
  max-width: 34px !important;
  max-height: 20px !important;
}

/* Main portfolio layout */

:root {
  --site-shell-width: 1060px;
  --hero-copy-width: 780px;
  --hero-copy-x: -28px;
  --hero-copy-y: -3px;
  --hero-copy-font-size: 14px;
  --hero-copy-line-height: 1.18;
  --hero-demo-width: 390px;
  --goof-tape-desktop-width: 514px;
  --goof-tape-mobile-width: 685px;
}

/* Viewport overflow safety */
.terminal,
.terminal *,
#home,
#home *,
.panel,
.panel-content,
.profile-card,
.profile-photo-wrap,
.mission-copy,
.skill-tabs,
.goof-standalone-zone,
#goofs .goof-tape-widget,
.side-drawer,
.side-drawer *,
.signal-mobile-notice,
.signal-mobile-notice * {
  box-sizing: border-box;
}

.terminal,
header,
main,
nav,
footer,
.panel,
.panel-content,
.profile-card,
.goof-standalone-zone,
#goofs,
.side-drawer {
  max-width: 100vw !important;
}

.terminal,
#home,
#home .hero-command-row,
#home .copy-module,
#home .tagline.terminal-typewriter,
#home .terminal-typewriter .terminal-typed-line,
.profile-card,
.profile-photo-wrap,
.mission-copy,
.skill-tabs,
.goof-standalone-zone,
#goofs .goof-tape-widget,
.side-drawer,
.drawer-header,
.drawer-list,
.drawer-item,
.drawer-now,
.drawer-player,
.writing-archive,
.audio-link-archive {
  min-width: 0 !important;
}

.topbar {
  flex-wrap: wrap !important;
}

.topbar > * {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

.skill-tab-wrap {
  max-width: 100% !important;
}

.skill-tab {
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.skill-tip {
  display: none !important;
  max-width: min(230px, calc(100vw - 32px)) !important;
}

.skill-tab-wrap:hover .skill-tip,
.skill-tab-wrap:focus-within .skill-tip {
  display: block !important;
}

header,
#home,
.mission-copy,
.drawer-now,
.drawer-item,
.writing-card,
.audio-link-archive,
.goof-standalone-header {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 780px) {
  #signal-run-launch.profile-cd-launch {
    display: grid !important;
    position: absolute !important;
    top: -8px !important;
    left: -8px !important;
    right: auto !important;
    z-index: 40 !important;
    width: 64px !important;
    min-height: 64px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-disc {
    display: grid !important;
    width: 60px !important;
    height: 60px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}


/* Hero readability */
#home .tagline.terminal-typewriter {
  text-shadow: 0 0 6px rgba(125, 249, 255, 0.22);
}

#home .copy-module .terran-demo-label {
  font-size: 13px !important;
  line-height: 1.15 !important;
}

#home .copy-module .terran-demo-subline,
#home .copy-module .terran-demo-time,
#home .copy-module .terran-mini-control {
  font-size: 10px !important;
  line-height: 1.15 !important;
}

/* Main page grid */
.terminal {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: visible;
}

#home {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "kicker"
    "title"
    "copy";
  gap: 1.35rem clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  min-height: clamp(520px, 58vw, 640px);
  padding: clamp(2rem, 5vw, 4rem);
}

#home .kicker {
  grid-area: kicker;
  position: static;
  z-index: var(--z-content);
  margin: 0;
}

#home .hero-command-row {
  display: contents !important;
}

#home .glitch-title {
  grid-area: title;
  position: static;
  z-index: var(--z-content);
  max-width: 100% !important;
  margin: 0;
  font-size: clamp(3rem, 5.4vw, 5rem) !important;
  line-height: 0.95 !important;
  white-space: normal !important;
}

#home .copy-module {
  grid-area: copy;
  position: static;
  z-index: var(--z-content);
  max-width: 760px;
  margin-top: 0;
}

#home .tagline {
  min-height: 0;
}

.hero-right-rail {
  grid-area: right;
  display: grid;
  gap: 1.6rem;
  align-content: start;
  justify-items: center;
  align-self: start;
  justify-self: center;
  position: static;
  z-index: var(--z-content);
  width: min(100%, 340px);
  transform: none !important;
}

#home .hero-demo-actions,
#home .terran-demo-console {
  grid-area: auto;
  position: static;
  z-index: var(--z-content);
  align-self: start !important;
  justify-self: center !important;
  width: min(100%, 340px) !important;
  max-width: 340px !important;
  min-width: 0 !important;
  transform: none !important;
}

#home .hero-game-launch,
#home .signal-run-launch {
  position: static;
  z-index: var(--z-content);
  justify-self: center;
  transform: none !important;
}

@media (max-width: 1080px) {
  #home {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.2rem 1.5rem;
  }

  #home .glitch-title {
    font-size: clamp(2.8rem, 5vw, 4.2rem) !important;
  }

  .hero-right-rail {
    width: min(100%, 300px);
  }

  #home .hero-demo-actions,
  #home .terran-demo-console {
    width: min(100%, 300px) !important;
    max-width: 300px !important;
  }
}

@media (max-width: 850px) {
  #home {
    min-height: 0;
    padding: 2rem 1rem 1.5rem;
    gap: 1rem;
  }

  .hero-right-rail {
    justify-self: start;
    justify-items: start;
    width: min(100%, 360px);
    gap: 1rem;
  }

  #home .hero-demo-actions,
  #home .terran-demo-console {
    width: min(100%, 340px) !important;
    max-width: 340px !important;
  }
}

@media (max-width: 650px) {
  #home {
    padding: 18px 10px 14px;
  }

  #home .kicker {
    white-space: normal;
  }

  #home .glitch-title {
    font-size: clamp(1.85rem, 11vw, 3rem);
    line-height: 0.9;
  }
}

/* Hero and top viewport */
.hero-right-rail:empty {
  display: none !important;
}

#home {
  position: relative;
  min-height: 0 !important;
}

#home .hero-command-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

#home .copy-module {
  position: relative;
  z-index: 5;
  display: grid !important;
  gap: 0 !important;
}

#home .tagline.terminal-typewriter {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

#home .terminal-typewriter .terminal-typed-line {
  display: block !important;
  width: 100% !important;
}

#home .terminal-typewriter .terminal-typed-line[data-type-line=""] {
  display: block !important;
  min-height: 0 !important;
}

#home .copy-module .demo-under-welcome {
  justify-self: start !important;
  width: min(var(--hero-demo-width), 100%) !important;
  max-width: 100% !important;
}

#home .copy-module .demo-under-welcome.terran-demo-console {
  padding: 5px !important;
}

#home .copy-module .demo-under-welcome .terran-demo-main {
  min-height: 31px !important;
  padding: 4px 6px !important;
}

#home .copy-module .demo-under-welcome .terran-demo-status-row,
#home .copy-module .demo-under-welcome .terran-demo-progress {
  margin-top: 4px !important;
}

#home .copy-module .demo-under-welcome .terran-mini-control {
  min-height: 26px !important;
  padding: 5px 8px !important;
  font-size: 10px !important;
}

#home .copy-module .demo-under-welcome .terran-demo-main,
#home .copy-module .demo-under-welcome .terran-demo-status-row,
#home .copy-module .demo-under-welcome .terran-demo-progress {
  max-width: 100% !important;
}

nav[aria-label="Main navigation"] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin-top: 0 !important;
}

/* Profile CD launcher */
.profile-photo-wrap {
  position: relative !important;
}

#signal-run-launch.profile-cd-launch,
.profile-cd-launch {
  position: absolute !important;
  top: -12px !important;
  left: -12px !important;
  right: auto !important;
  z-index: 6 !important;
  display: none !important;
  place-items: center !important;
  width: clamp(58px, calc(7vw + 2px), 84px) !important;
  min-height: clamp(58px, calc(7vw + 2px), 84px) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform: none !important;
  pointer-events: auto !important;
}

#signal-run-launch.profile-cd-launch .hero-game-disc {
  /* Mobile swaps the desktop CD sprite for the Atari box. */
  width: clamp(54px, calc(6.5vw + 2px), 78px) !important;
  height: clamp(54px, calc(6.5vw + 2px), 78px) !important;
  margin: 0 !important;
  border: 1px solid rgba(100, 210, 255, 0.86) !important;
  border-radius: 999px !important;
  background: url("/assets/ui/iits-desktop-cd-sprite.png") center center / cover no-repeat !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(100, 210, 255, 0.32),
    0 8px 20px rgba(0, 0, 0, 0.42) !important;
  overflow: hidden !important;
  image-rendering: auto !important;
  pointer-events: none !important;
}

#signal-run-launch.profile-cd-launch .hero-game-disc::before,
#signal-run-launch.profile-cd-launch .hero-game-disc::after,
#signal-run-launch.profile-cd-launch .hero-game-disc-core {
  display: none !important;
  content: none !important;
}

#signal-run-launch.profile-cd-launch:hover .hero-game-disc,
#signal-run-launch.profile-cd-launch:focus-visible .hero-game-disc {
  transform: scale(1.04) rotate(8deg) !important;
}

#signal-run-launch.profile-cd-launch .hero-game-launch-label {
  /* Visually hide the label without removing it from the accessibility tree. */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

#signal-run-launch.profile-cd-launch .hero-game-launch-label::before,
#signal-run-launch.profile-cd-launch .hero-game-launch-label::after {
  content: none !important;
}

/* Reveal the accessible label above the CD on hover or keyboard focus. */
#signal-run-launch.profile-cd-launch:hover .hero-game-launch-label,
#signal-run-launch.profile-cd-launch:focus-visible .hero-game-launch-label {
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  transform: translate(calc(-50% + 18px), -0.4em) !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0.2rem 0.4rem !important;
  border: none !important;
  overflow: visible !important;
  clip-path: none !important;
  display: block !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  color: var(--amber) !important;
  font-size: 0.6rem !important;
  text-align: center !important;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.65) !important;
}

/* Goofs tape recorder canvas */
.goof-standalone-zone {
  position: relative;
  margin: clamp(16px, 2.2vw, 26px) clamp(10px, 2vw, 22px) 0;
  padding: clamp(12px, 1.6vw, 18px) clamp(12px, 2.3vw, 28px) clamp(26px, 4vw, 48px);
  border-top: 1px dashed rgba(57, 255, 136, 0.38);
  border-bottom: 1px solid rgba(100, 210, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(3, 14, 18, 0.38), rgba(0, 0, 0, 0.06) 58%, rgba(3, 14, 18, 0.18));
  min-height: 0;
  max-width: calc(100vw - 20px) !important;
}

.goof-standalone-header {
  max-width: 100%;
  margin: 0;
}

.goof-standalone-header h2 {
  margin: 0 0 10px;
  color: #ffd86d;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(8px, 0.9vw, 11px);
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goof-standalone-header p {
  margin: 0;
  color: #57ff9a;
  font-family: "Pixelify Sans", "Share Tech Mono", sans-serif;
  font-size: clamp(12px, 1.35vw, 17px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

#goofs .goof-tape-widget {
  position: relative;
  width: min(96%, var(--goof-tape-desktop-width), calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  margin: clamp(12px, 1.7vw, 20px) auto 0;
  line-height: 0;
}

#goofs .goof-tape-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34));
  user-select: none;
  -webkit-user-drag: none;
}

#goofs .goof-tape-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
  touch-action: manipulation;
}

#goofs .goof-tape-canvas:focus-visible {
  outline: 2px solid rgba(255, 216, 109, 0.95);
  outline-offset: 4px;
}

.goof-standalone-return {
  margin-top: 0;
}

/* Mobile Signal Run desktop-only notice */
.signal-mobile-notice[hidden] {
  display: none !important;
}

.signal-mobile-notice {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: none !important;
  place-items: center !important;
  padding: 18px !important;
}

.signal-mobile-notice.open {
  display: grid !important;
}

.signal-mobile-notice-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background:
    radial-gradient(circle at center, rgba(100, 210, 255, 0.14), transparent 48%),
    rgba(0, 0, 0, 0.82) !important;
}

.signal-mobile-notice-card {
  position: relative !important;
  z-index: 1 !important;
  width: min(88vw, 380px) !important;
  max-width: calc(100vw - 36px) !important;
  padding: 18px 16px 16px !important;
  border: 1px solid rgba(143, 216, 255, 0.76) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(5, 20, 36, 0.98), rgba(0, 4, 10, 0.98)) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 32px rgba(29, 114, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  text-align: center !important;
}

.signal-mobile-notice-card h2 {
  margin: 0 0 12px !important;
  color: #57ff9a !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: clamp(0.82rem, 5vw, 1.08rem) !important;
  line-height: 1.35 !important;
}

.signal-mobile-notice-card p {
  margin: 0 0 16px !important;
  color: #8fd8ff !important;
  font-family: "Share Tech Mono", monospace !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
}

.signal-mobile-notice-close {
  min-height: 40px !important;
  border: 1px solid rgba(143, 216, 255, 0.78) !important;
  border-radius: 6px !important;
  padding: 9px 14px !important;
  color: #8fd8ff !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(29, 114, 255, 0.18), rgba(0, 12, 28, 0.74)) !important;
  cursor: pointer !important;
}

.signal-mobile-notice-close:hover,
.signal-mobile-notice-close:focus {
  color: #001227 !important;
  background:
    linear-gradient(180deg, #e9fbff 0%, #8fd8ff 28%, #1d72ff 68%, #0637a8 100%) !important;
  outline: none !important;
}

/* Main page layering */
.side-tab {
  z-index: var(--z-tabs) !important;
}

.side-drawer,
.floating-demo-button {
  z-index: var(--z-drawers) !important;
}

.signal-game-modal {
  z-index: var(--z-modal) !important;
}

@media (min-width: 851px) {
  .side-tab {
    opacity: 0.525;
  }

  .side-tab:hover,
  .side-tab:focus {
    opacity: 1;
  }

  .audio-drawer-tab,
  .video-drawer-tab {
    bottom: 116px !important;
  }

  .writing-drawer-tab,
  .social-drawer-tab {
    bottom: 54px !important;
  }
}

/* Desktop layout */
@media (min-width: 781px) {
  .terminal {
    width: min(var(--site-shell-width), calc(100% - 24px)) !important;
    max-width: var(--site-shell-width) !important;
    opacity: 1 !important;
    transform: translate(0px, -13px) !important;
  }

  .topbar {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    font-size: 13px !important;
    transform: translate(0px, 0px) !important;
  }

  #home {
    padding: 12px 174px 13px 38px !important;
    background-color: rgba(0, 0, 0, 0) !important;
  }

  #home .kicker {
    margin: 0 0 5px !important;
    max-width: min(560px, 100%) !important;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.12em !important;
    transform: translate(0px, 0px) !important;
  }

  #home .glitch-title {
    margin: 0 !important;
    font-family: "VT323", "Courier New", monospace !important;
    font-size: 98px !important;
    line-height: 0.7 !important;
    letter-spacing: 0.105em !important;
    transform: translate(1px, 0px) !important;
    text-shadow: 0 0 7px rgba(57, 255, 136, 0.42), 0 0 13px rgba(125, 249, 255, 0.24) !important;
  }

  #home .copy-module {
    width: min(var(--hero-copy-width), calc(100vw - 90px)) !important;
    max-width: min(var(--hero-copy-width), calc(100vw - 90px)) !important;
    margin-top: -8px !important;
    transform: translate(var(--hero-copy-x), var(--hero-copy-y)) !important;
    font-family: "Share Tech Mono", "Courier New", monospace !important;
  }

  #home .tagline.terminal-typewriter,
  #home .terminal-typewriter .terminal-typed-line {
    font-size: var(--hero-copy-font-size) !important;
    line-height: var(--hero-copy-line-height) !important;
    white-space: normal !important;
    overflow: visible !important;
    border-right: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  #home .terminal-typewriter .terminal-typed-line[data-type-line=""] {
    height: 0.28em !important;
  }

  #home .terminal-typewriter .terminal-typing-caret {
    display: none !important;
  }

  #home .copy-module .demo-under-welcome {
    width: min(var(--hero-demo-width), 100%) !important;
    margin-top: 10px !important;
    transform: translate(0px, 0px) scale(1) !important;
    transform-origin: center center !important;
  }

  nav[aria-label="Main navigation"] {
    font-size: 11px !important;
    transform: translate(0px, 0px) !important;
  }

  .profile-card {
    padding: 16px !important;
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    gap: 18px !important;
  }

  .profile-photo-wrap {
    width: 175px !important;
    max-width: 175px !important;
    transform: translate(-9px, 1px) scale(1.1) !important;
    transform-origin: center center !important;
  }

  #contact {
    padding: 0 !important;
    margin-top: 0 !important;
    margin-inline: auto !important;
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    font-size: 16px !important;
  }

  #goofs {
    padding: 0 !important;
    margin-top: 10px !important;
    width: min(100%, 1200px) !important;
    max-width: 1200px !important;
  }

  #goofs .goof-tape-widget {
    margin-top: -80px !important;
    transform: translate(-2px, 32px) scale(1) !important;
    transform-origin: center center !important;
  }

  [data-drawer-open="audio"] {
    bottom: 116px !important;
    left: 14px !important;
    transform: translate(0px, 0px) !important;
  }

  [data-drawer-open="video"] {
    bottom: 116px !important;
    right: 14px !important;
    transform: translate(0px, 0px) !important;
  }

  [data-drawer-open="social"] {
    bottom: 54px !important;
    right: 14px !important;
    transform: translate(0px, 0px) !important;
  }

  footer {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    font-size: 12px !important;
    transform: translate(0px, 0px) !important;
  }
}

/* Mobile layout */
@media (max-width: 780px) {
  .terminal {
    width: min(calc(100% - 12px), calc(100vw - 12px)) !important;
    max-width: calc(100vw - 12px) !important;
    margin-inline: auto !important;
  }

  .topbar {
    align-items: flex-start !important;
    gap: 6px 10px !important;
    white-space: normal !important;
  }

  .live-signal {
    white-space: normal !important;
  }

  #home {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "kicker"
      "title"
      "copy" !important;
    justify-items: stretch !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 22px 16px 18px !important;
  }

  #home .kicker {
    grid-area: kicker !important;
    width: 100% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.45 !important;
  }

  #home .hero-command-row {
    display: contents !important;
  }

  #home .glitch-title {
    grid-area: title !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(1.65rem, 7vw, 2.45rem) !important;
    line-height: 0.95 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  #home .copy-module {
    grid-area: copy !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }

  #home .tagline.terminal-typewriter,
  #home .terminal-typewriter .terminal-typed-line {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  #home .hero-right-rail {
    display: none !important;
  }

  nav[aria-label="Main navigation"] {
    grid-template-columns: 1fr !important;
    gap: clamp(7px, 1vw, 12px) !important;
  }

  .profile-card {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profile-photo-wrap {
    max-width: min(100%, 300px) !important;
  }

  .mission-copy,
  .mission-copy p,
  .skill-tabs {
    max-width: 100% !important;
  }

  .side-drawer {
    width: min(100vw, calc(100vw - 12px)) !important;
    max-width: 100vw !important;
    padding-inline: min(18px, 4vw) !important;
    overflow-x: clip !important;
  }

  .drawer-header {
    flex-wrap: wrap !important;
  }

  .drawer-header h2,
  .drawer-now h3,
  .drawer-now p,
  .drawer-item,
  .drawer-item span,
  .writing-card,
  .writing-card h4,
  .audio-link-archive,
  .audio-link-archive h3 {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .drawer-player,
  .video-iframe-shell,
  .instagram-drawer-shell,
  .drawer-list {
    width: 100% !important;
    max-width: 100% !important;
  }

  .goof-standalone-zone {
    margin-inline: 0;
    padding-inline: min(14px, 4vw);
    max-width: 100% !important;
  }

  #goofs .goof-tape-widget {
    width: min(96%, var(--goof-tape-mobile-width), calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    margin-top: 18px !important;
    transform: none !important;
  }

  #goofs .goof-track-list,
  #goofs .goof-track-button,
  #goofs .goof-pause-button {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* Hero title wrapping */
@media (min-width: 901px) {
  #home .hero-command-row,
  #home .hero-command-row > * {
    min-width: 0 !important;
  }

  #home h1.glitch-title {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: clamp(4rem, 6vw, 5.25rem) !important;
    line-height: 0.76 !important;
  }
}

@media (max-width: 900px) {
  #home h1.glitch-title {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    font-size: clamp(2rem, 8vw, 3.4rem) !important;
    line-height: 0.95 !important;
  }
}

/* Mobile archive dock */
@media (max-width: 900px) {
  :root {
    --archive-dock-button-height: 42px;
    --archive-dock-gap: 6px;
    --archive-dock-edge: max(8px, env(safe-area-inset-left, 0px));
    --archive-dock-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    --archive-dock-width: min(186px, calc((100vw - 38px) / 2));
    --archive-dock-height: calc(var(--archive-dock-button-height) + var(--archive-dock-button-height) + var(--archive-dock-button-height) + var(--archive-dock-gap) + var(--archive-dock-gap) + 16px + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: calc(var(--archive-dock-height) + 24px) !important;
  }

  main,
  .terminal {
    padding-bottom: calc(var(--archive-dock-height) + 22px) !important;
  }

  footer {
    padding-bottom: calc(var(--archive-dock-height) + 20px) !important;
  }

  #mission,
  #contact,
  #goofs,
  .panel {
    scroll-margin-bottom: calc(var(--archive-dock-height) + 24px);
  }

  #goofs {
    margin-top: calc(var(--archive-dock-height) + 18px) !important;
  }

  .side-tab {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 90 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--archive-dock-width) !important;
    min-width: 0 !important;
    max-width: var(--archive-dock-width) !important;
    height: var(--archive-dock-button-height) !important;
    min-height: var(--archive-dock-button-height) !important;
    padding: 0 8px !important;
    border-width: 1px !important;
    clip-path: none !important;
    opacity: 0.92 !important;
    transform: none !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
    font-size: clamp(0.5rem, 1.55vw, 0.66rem) !important;
    line-height: 1.05 !important;
    letter-spacing: 0.035em !important;
    background: rgba(2, 14, 22, 0.92) !important;
    backdrop-filter: blur(4px) !important;
    box-shadow:
      0 0 16px rgba(0, 0, 0, 0.58),
      inset 0 0 13px rgba(100, 210, 255, 0.11) !important;
    animation: none !important;
  }

  .side-tab::before,
  .side-tab::after {
    display: none !important;
  }

  .side-tab:hover,
  .side-tab:focus {
    opacity: 1 !important;
    transform: none !important;
  }

  .audio-drawer-tab {
    left: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: calc(var(--archive-dock-bottom) + var(--archive-dock-button-height) + var(--archive-dock-gap)) !important;
  }

  .writing-drawer-tab {
    right: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: calc(var(--archive-dock-bottom) + var(--archive-dock-button-height) + var(--archive-dock-gap)) !important;
  }

  .video-drawer-tab {
    left: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: var(--archive-dock-bottom) !important;
  }

  .social-drawer-tab {
    right: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: var(--archive-dock-bottom) !important;
  }

  .goofs-side-tab {
    left: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    right: auto !important;
    bottom: calc(var(--archive-dock-bottom) + var(--archive-dock-button-height) + var(--archive-dock-gap) + var(--archive-dock-button-height) + var(--archive-dock-gap)) !important;
  }

  .audio-producer-game-tab {
    left: auto !important;
    right: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: calc(var(--archive-dock-bottom) + var(--archive-dock-button-height) + var(--archive-dock-gap) + var(--archive-dock-button-height) + var(--archive-dock-gap)) !important;
  }

  .tab-arrow {
    display: none !important;
  }

  body.drawer-open .side-tab,
  .side-tab.mobile-tabs-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(110%) !important;
    pointer-events: none !important;
  }

  .floating-demo-button {
    bottom: calc(var(--archive-dock-height) + 10px) !important;
  }
}

/* Keep the mobile dock in Audio/Video, Writing/Social reading order. */
@media (max-width: 900px) {
  .video-drawer-tab {
    left: auto !important;
    right: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    bottom: calc(var(--archive-dock-bottom) + var(--archive-dock-button-height) + var(--archive-dock-gap)) !important;
  }

  .writing-drawer-tab {
    left: max(8px, calc(50vw - var(--archive-dock-width) - 3px)) !important;
    right: auto !important;
    bottom: var(--archive-dock-bottom) !important;
  }
}

/* Keep drawer navigation visibly clickable before it is opened. */
@media (min-width: 901px) {
  .side-tab {
    width: 172px !important;
    height: 58px !important;
    padding: 0 12px !important;
    font-size: 0.74rem !important;
    letter-spacing: 0.06em !important;
    opacity: 0.96 !important;
    cursor: pointer;
    color: #e8f9ff !important;
    border-color: rgba(143, 216, 255, 0.96) !important;
    background:
      linear-gradient(180deg, rgba(12, 39, 55, 0.98), rgba(2, 14, 22, 0.97)) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      0 0 16px rgba(100, 210, 255, 0.24),
      0 0 24px rgba(57, 255, 136, 0.12) !important;
    text-shadow: 0 0 6px rgba(100, 210, 255, 0.42);
  }

  .audio-drawer-tab,
  .writing-drawer-tab,
  .goofs-side-tab {
    left: 24px !important;
  }

  .video-drawer-tab,
  .social-drawer-tab {
    right: 24px !important;
  }
}

@media (min-width: 901px) {
  .video-drawer-tab { bottom: 178px !important; }
  .social-drawer-tab { bottom: 116px !important; }
  .audio-producer-game-tab {
    right: 24px !important;
    bottom: 54px !important;
    width: 172px !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.035em !important;
  }
  .audio-drawer-tab { bottom: 178px !important; }
  .writing-drawer-tab { bottom: 116px !important; }
  .goofs-side-tab { bottom: 54px !important; }
}

@media (max-width: 900px) {
  .side-tab {
    opacity: 1 !important;
    cursor: pointer;
    color: #e8f9ff !important;
    font-size: clamp(0.58rem, 1.8vw, 0.7rem) !important;
    letter-spacing: 0.045em !important;
    white-space: nowrap !important;
    padding: 0 8px !important;
    gap: 6px !important;
    border-color: rgba(143, 216, 255, 0.96) !important;
    background: rgba(2, 14, 22, 0.98) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 0 15px rgba(100, 210, 255, 0.2),
      0 0 20px rgba(57, 255, 136, 0.12) !important;
    text-shadow: 0 0 5px rgba(100, 210, 255, 0.38);
  }

  .side-tab .tab-arrow {
    display: inline-flex !important;
    color: #57ff9a;
  }
}

.side-tab:focus-visible {
  outline: 2px solid #57ff9a !important;
  outline-offset: 4px;
}

.side-tab:hover,
.side-tab:focus-visible {
  opacity: 1 !important;
  border-color: #57ff9a !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 20px rgba(100, 210, 255, 0.35),
    0 0 28px rgba(57, 255, 136, 0.22) !important;
}


/* Intern In The Stars mobile demake */

.signal-mobile-notice-card,
.signal-mobile-notice-card * {
  box-sizing: border-box;
}

.signal-mobile-notice-backdrop {
  background: rgba(0, 6, 10, 0.9) !important;
}

.signal-mobile-notice-card {
  --iits-mobile-box-bg: #02070b;
  --iits-mobile-box-face: #06121a;
  --iits-mobile-box-cyan: #66f5ff;
  --iits-mobile-box-blue: #1d72ff;
  --iits-mobile-box-amber: #ffd84a;
  position: relative !important;
  isolation: isolate !important;
  width: min(100%, 356px) !important;
  max-width: calc(100vw - 28px) !important;
  border: 1px solid rgba(102, 245, 255, 0.88) !important;
  border-radius: 4px !important;
  padding: 18px 16px 16px !important;
  color: #dffcff !important;
  background: var(--iits-mobile-box-bg) !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.96),
    0 12px 30px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(29, 114, 255, 0.32),
    inset 0 0 28px rgba(102, 245, 255, 0.08),
    inset 0 -18px 34px rgba(0, 0, 0, 0.72) !important;
  overflow: hidden !important;
}

.signal-mobile-notice-card::before,
.signal-mobile-notice-card::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
}

.signal-mobile-notice-card::before {
  z-index: 2 !important;
  background: repeating-linear-gradient(
    180deg,
    rgba(102, 245, 255, 0.13) 0,
    rgba(102, 245, 255, 0.13) 1px,
    transparent 1px,
    transparent 4px
  ) !important;
  opacity: 0.42 !important;
}

.signal-mobile-notice-card::after {
  z-index: 0 !important;
  background:
    linear-gradient(90deg, rgba(102, 245, 255, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29, 114, 255, 0.13) 1px, transparent 1px) !important;
  background-size: 18px 18px, 18px 18px !important;
  opacity: 0.45 !important;
}

.signal-mobile-notice-card > * {
  position: relative !important;
  z-index: 1 !important;
}

.signal-mobile-notice-card h2 {
  margin: 0 0 10px !important;
  color: var(--iits-mobile-box-amber) !important;
  font-family: "Press Start 2P", "Courier New", monospace !important;
  font-size: clamp(0.82rem, 4vw, 1.02rem) !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
  text-shadow: 1px 1px 0 rgba(29, 114, 255, 0.68) !important;
}

.signal-mobile-notice-card p {
  margin: 0 0 16px !important;
  color: #bcecff !important;
  font-family: "Share Tech Mono", "Courier New", monospace !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

.signal-mobile-notice-card .signal-mobile-notice-status {
  margin: 10px 0 0 !important;
}

.signal-mobile-notice-card .signal-mobile-notice-status:empty {
  position: absolute !important;
  margin: 0 !important;
}

.signal-mobile-notice-actions {
  display: grid !important;
  gap: 9px !important;
  margin-top: 4px !important;
}

.signal-mobile-notice-actions .signal-mobile-notice-close,
.signal-mobile-notice-demake {
  width: 100% !important;
  min-height: 44px !important;
  border-radius: 2px !important;
  padding: 10px 12px !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: 0.58rem !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: transform 80ms linear, background-color 80ms linear, color 80ms linear !important;
}

.signal-mobile-notice-demake {
  border: 1px solid rgba(255, 216, 74, 0.88) !important;
  color: var(--iits-mobile-box-amber) !important;
  background: #111306 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 74, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.76) !important;
}

.signal-mobile-notice-actions .signal-mobile-notice-close {
  border: 1px solid rgba(102, 245, 255, 0.82) !important;
  color: var(--iits-mobile-box-cyan) !important;
  background: #06131b !important;
  box-shadow:
    inset 0 0 0 1px rgba(29, 114, 255, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.76) !important;
}

.signal-mobile-notice-demake:hover,
.signal-mobile-notice-demake:focus,
.signal-mobile-notice-demake:focus-visible {
  color: #001227 !important;
  background: var(--iits-mobile-box-amber) !important;
  outline: 2px solid rgba(255, 216, 74, 0.95) !important;
  outline-offset: 2px !important;
}

.signal-mobile-notice-actions .signal-mobile-notice-close:hover,
.signal-mobile-notice-actions .signal-mobile-notice-close:focus,
.signal-mobile-notice-actions .signal-mobile-notice-close:focus-visible {
  color: #001227 !important;
  background: var(--iits-mobile-box-cyan) !important;
  outline: 2px solid rgba(102, 245, 255, 0.95) !important;
  outline-offset: 2px !important;
}

.signal-mobile-notice-demake:active,
.signal-mobile-notice-actions .signal-mobile-notice-close:active {
  transform: translateY(1px) !important;
}

@media (max-width: 780px), (hover: none) and (pointer: coarse) {
  #signal-run-launch.profile-cd-launch {
    display: grid !important;
    position: absolute !important;
    top: -10px !important;
    left: -10px !important;
    right: auto !important;
    z-index: 40 !important;
    width: 86.7px !important;
    min-height: 103.7px !important;
    place-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-disc {
    display: grid !important;
    position: relative !important;
    place-items: center !important;
    width: 81.6px !important;
    height: 98.6px !important;
    margin: 0 !important;
    border: 1px solid rgba(102, 245, 255, 0.88) !important;
    border-radius: 3px !important;
    background: url("/assets/ui/iits-mobile-atari-box-sprite.png") center center / cover no-repeat !important;
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.95),
      0 6px 16px rgba(0, 0, 0, 0.58) !important;
    overflow: hidden !important;
    filter: none !important;
    transform: none !important;
    transition: transform 80ms linear, filter 80ms linear !important;
    image-rendering: auto !important;
    pointer-events: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-disc::before,
  #signal-run-launch.profile-cd-launch .hero-game-disc::after {
    display: none !important;
    content: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-disc-core {
    display: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-disc-core::before {
    content: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-launch-label,
  #signal-run-launch.profile-cd-launch:hover .hero-game-launch-label,
  #signal-run-launch.profile-cd-launch:focus-visible .hero-game-launch-label {
    position: absolute !important;
    inset: 8px 8px auto !important;
    z-index: 3 !important;
    display: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    clip-path: none !important;
    color: #ffd84a !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-shadow: 1px 1px 0 rgba(29, 114, 255, 0.76) !important;
    transform: none !important;
    white-space: normal !important;
    pointer-events: none !important;
  }

  #signal-run-launch.profile-cd-launch .hero-game-launch-label::before,
  #signal-run-launch.profile-cd-launch:hover .hero-game-launch-label::before,
  #signal-run-launch.profile-cd-launch:focus-visible .hero-game-launch-label::before,
  #signal-run-launch.profile-cd-launch .hero-game-launch-label::after,
  #signal-run-launch.profile-cd-launch:hover .hero-game-launch-label::after,
  #signal-run-launch.profile-cd-launch:focus-visible .hero-game-launch-label::after {
    content: none !important;
    display: none !important;
  }

  #signal-run-launch.profile-cd-launch:hover .hero-game-disc,
  #signal-run-launch.profile-cd-launch:focus-visible .hero-game-disc {
    transform: translateY(-1px) !important;
    filter: brightness(1.08) !important;
  }

  #signal-run-launch.profile-cd-launch:active .hero-game-disc {
    transform: translateY(1px) !important;
    filter: brightness(0.92) !important;
  }
}

.iits2600-modal[hidden] {
  display: none !important;
}

.iits2600-modal,
.iits2600-modal * {
  box-sizing: border-box;
}

.iits2600-modal {
  --iits2600-black: #050505;
  --iits2600-blue: #0b1736;
  --iits2600-cyan: #66f5ff;
  --iits2600-gold: #ffd84a;
  --iits2600-red: #ff4d5f;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  width: 100vw;
  max-width: 100vw;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow: hidden;
  color: #f8fbff;
  font-family: "Press Start 2P", "Courier New", monospace;
}

.iits2600-modal.open {
  display: grid;
}

.iits2600-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(102, 245, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.88), rgba(0, 0, 0, 0.96));
}

.iits2600-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 380px);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  border: 2px solid var(--iits2600-gold);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #151515 0%, #080808 100%);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(255, 216, 74, 0.22),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.iits2600-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 2px solid rgba(255, 216, 74, 0.7);
  background: #101010;
}

.iits2600-kicker {
  margin: 0 0 6px;
  color: var(--iits2600-cyan);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.74rem;
  line-height: 1;
  text-transform: uppercase;
}

.iits2600-topbar h2 {
  margin: 0;
  max-width: 210px;
  color: var(--iits2600-gold);
  font-size: 0.68rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.iits2600-close {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(102, 245, 255, 0.82);
  border-radius: 4px;
  padding: 8px 9px;
  color: var(--iits2600-cyan);
  font-family: "Press Start 2P", monospace;
  font-size: 0.52rem;
  line-height: 1.1;
  background: #0a1327;
  cursor: pointer;
}

.iits2600-close:focus,
.iits2600-close:hover {
  color: #001227;
  background: var(--iits2600-cyan);
  outline: none;
}

.iits2600-screen-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 10px;
  background: #050508;
}

.iits2600-screen-wrap::after {
  display: none;
}

.iits2600-screen {
  position: relative;
  width: min(100%, 340px, calc((100dvh - 132px) * 0.8333));
  min-width: 0;
}

#iits2600Canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 5 / 6;
  border: 2px solid #000;
  background: #020306;
  box-shadow: 0 0 0 2px #ffd84a;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  user-select: none;
}

.iits2600-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.iits2600-question-controls {
  position: absolute;
  inset: 2px;
  pointer-events: none;
}

.iits2600-question-controls button {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#iits2600Canvas:focus-visible,
.iits2600-question-controls button:focus-visible {
  outline: 2px solid var(--iits2600-cyan);
  outline-offset: -2px;
}

.iits2600-score-entry {
  position: fixed;
  left: 50%;
  bottom: calc(var(--iits2600-keyboard-inset, 0px) + max(14px, env(safe-area-inset-bottom)));
  z-index: 10003;
  display: grid;
  width: min(88vw, 320px);
  gap: 6px;
  transform: translateX(-50%);
  padding: 8px;
  border: 2px solid var(--iits2600-cyan);
  background: #020306;
  box-shadow: 0 0 0 2px #000, 0 0 18px rgba(102, 245, 255, 0.22);
}

.iits2600-score-entry[hidden] {
  display: none !important;
}

.iits2600-score-label,
.iits2600-score-status {
  margin: 0;
  color: var(--iits2600-gold);
  font-family: "Press Start 2P", monospace;
  font-size: 0.44rem;
  line-height: 1.45;
  text-align: center;
}

.iits2600-score-status {
  min-height: 1.45em;
  color: var(--iits2600-cyan);
}

.iits2600-score-status:empty {
  display: none;
}

.iits2600-score-input,
.iits2600-score-submit {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--iits2600-gold);
  border-radius: 0;
  color: #f8fbff;
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  background: #071033;
}

.iits2600-score-submit {
  color: var(--iits2600-black);
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  background: var(--iits2600-gold);
}

.iits2600-score-submit[aria-disabled="true"] {
  color: #4b5162;
  background: #1a1a1a;
}

.iits2600-score-result:not(:empty) {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 12px;
  width: fit-content;
  max-width: min(calc(100% - 24px), 320px);
  margin-inline: auto;
  padding: 6px 8px;
  background: #020306;
  pointer-events: none;
}

.iits2600-score-result:empty {
  display: block;
  position: absolute;
  min-height: 0;
  margin: 0;
}

body.iits2600-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.iits2600-open::before,
body.iits2600-open::after {
  display: none !important;
}

@media (max-height: 430px) {
  .iits2600-shell {
    width: min(100%, 540px);
  }

  .iits2600-topbar {
    align-items: center;
    padding: 8px;
  }

  .iits2600-kicker {
    display: none;
  }

  .iits2600-topbar h2 {
    max-width: 310px;
  }

  .iits2600-screen-wrap {
    padding: 8px;
  }

  .iits2600-screen-wrap::after {
    inset: 8px;
  }

  .iits2600-screen {
    width: min(100%, 286px, calc((100dvh - 86px) * 0.8333));
  }
}


/* Signal Run intro tube */

.signal-intro-card {
  width: min(674px, calc(100vw - 72px)) !important;
  min-height: 0 !important;
  padding: 24px 19px !important;
  border-width: 5px !important;
  border-style: solid !important;
  border-color: rgba(57, 255, 136, 0.09) !important;
  border-radius: 60px !important;
  background: rgba(2, 12, 16, 1) !important;
  box-shadow:
    0 0 58px rgba(57, 255, 136, 0.22),
    inset 0 0 29px rgba(100, 210, 255, 0.08) !important;
}

.signal-intro-copy {
  margin-top: 16px !important;
  margin-bottom: 60px !important;
  font-size: 24px !important;
  line-height: 1.13 !important;
  max-width: 38ch !important;
}

.signal-intro-video-frame {
  width: min(335px, 100%) !important;
  transform: scale(1.6) !important;
  transform-origin: center center !important;
  margin-top: -9px !important;
  margin-bottom: -25px !important;
}

.signal-intro-video,
.signal-intro-fallback {
  top: 59.8% !important;
  left: 41.9% !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 84.1% !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-41.2%, -61.8%) scale(0.65) !important;
  transform-origin: center center !important;
  object-fit: cover !important;
  object-position: 46.5% 0% !important;
  border-radius: 22.5% / 11% !important;
}

.signal-intro-skip {
  margin-top: 80px !important;
  padding: 16px 31px !important;
  font-size: 21px !important;
  border-radius: 14px !important;
}


/* Signal Run scoreboard and submit controls */

/* Keep the ending leaderboard inside its rail and away from the modal scrollbar. */
.signal-leaderboard-rail,
.signal-run-highscores,
.signal-leaderboard-card {
  position: relative !important;
  z-index: 80 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

.signal-ending-layout {
  grid-template-columns: minmax(0, 1fr) clamp(390px, 32vw, 450px) !important;
  gap: clamp(14px, 1.6vw, 20px) !important;
  overflow: visible !important;
}

.signal-run-highscore-form-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(142px, max-content) !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 100 !important;
  pointer-events: auto !important;
}

#highScoreName,
#highScoreSubmit {
  position: relative !important;
  z-index: 110 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  min-width: 0 !important;
}

#highScoreName {
  width: 100% !important;
}

#highScoreSubmit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 124px !important;
  max-width: 100% !important;
  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;
}

/* Make leaderboard rows readable and stop names/scores from fighting each other. */
#highScoreList {
  display: grid !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 0 !important;
  max-width: 100% !important;
}

.signal-leaderboard-row {
  display: grid !important;
  grid-template-columns: 78px 3ch minmax(10ch, 1fr) 8ch !important;
  align-items: center !important;
  gap: 7px !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.signal-leaderboard-badge,
.score-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 78px !important;
  min-width: 0 !important;
  height: 28px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.signal-leaderboard-rank,
.score-rank {
  justify-self: end !important;
  text-align: right !important;
}

.signal-leaderboard-name,
.score-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(0.56rem, 0.68vw, 0.62rem) !important;
  letter-spacing: 0.02em !important;
}

.signal-leaderboard-score,
.score-value {
  justify-self: end !important;
  text-align: right !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: 0.04em !important;
}

.signal-leaderboard-icon-trophy {
  display: block !important;
  width: 42px !important;
  height: 24px !important;
  background: url("/assets/rail-shooter/ui/ace-pilot-trophy.png") center / contain no-repeat !important;
  filter:
    drop-shadow(0 0 4px rgba(255, 217, 102, 0.65))
    drop-shadow(0 0 8px rgba(125, 231, 255, 0.22)) !important;
}

#highScoreList .score-badge.ace-pilot,
#highScoreList .signal-leaderboard-badge.ace-pilot {
  border-color: rgba(255, 217, 102, 0.58) !important;
  background: rgba(255, 217, 102, 0.12) !important;
}

@media (max-width: 980px) {
  .signal-ending-layout {
    grid-template-columns: 1fr !important;
  }

  .signal-leaderboard-rail {
    width: min(100%, 640px) !important;
    justify-self: center !important;
  }
}

@media (max-width: 860px) {
  .signal-run-highscore-form-row {
    grid-template-columns: 1fr !important;
  }

  #highScoreSubmit {
    width: 100% !important;
  }

  .signal-leaderboard-row {
    grid-template-columns: 72px 3ch minmax(8ch, 1fr) 8ch !important;
    gap: 6px !important;
  }

  .signal-leaderboard-badge,
  .score-badge {
    width: 72px !important;
    min-width: 0 !important;
  }
}


/* The image element prevents earlier trophy background rules from hiding it. */
img.signal-leaderboard-icon-trophy,
.signal-leaderboard-icon-trophy {
  display: block !important;
  width: 44px !important;
  height: 26px !important;
  max-width: 44px !important;
  max-height: 26px !important;
  object-fit: contain !important;
  object-position: center !important;
  background: none !important;
  clip-path: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter:
    drop-shadow(0 0 4px rgba(255, 217, 102, 0.75))
    drop-shadow(0 0 8px rgba(125, 231, 255, 0.25)) !important;
}

#highScoreList .score-badge.ace-pilot,
#highScoreList .signal-leaderboard-badge.ace-pilot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}


/* Hidden game layers must not intercept the main page. */
  .signal-game-modal[hidden],
  .signal-intro-screen[hidden],
  .signal-intro-fallback[hidden] {
    display: none !important;
  }

  .signal-game-modal:not(.open) {
    pointer-events: none;
  }

  /* Leave enough HUD width for the final S in LIVES. */
  #gameWrap .starship-hud-shell {
    grid-template-columns:
      minmax(92px, 1fr)
      minmax(92px, 0.95fr)
      minmax(96px, 0.9fr)
      minmax(70px, 0.72fr)
      minmax(70px, 0.72fr)
      minmax(108px, 1.1fr) !important;
  }

  #gameWrap #ui.starship-hud .hud-cell-lives {
    min-width: 96px !important;
  }

  #gameWrap #ui.starship-hud .hud-cell-lives .hud-label {
    font-size: 9px !important;
    letter-spacing: 0.13em !important;
  }

/* Site-Guard popup */
#siteGuardOops {
        position: fixed;
        inset: 0;
        z-index: 2147483647;
        display: none;
        place-items: center;
        padding: 22px;
        pointer-events: none;
        background:
          radial-gradient(circle at center, rgba(125, 249, 255, 0.13), transparent 32rem),
          rgba(0, 0, 0, 0.62);
        font-family: "Share Tech Mono", "Courier New", monospace;
      }

      #siteGuardOops.visible {
        display: grid;
        pointer-events: auto;
      }

      #siteGuardOops .site-guard-oops-box {
        width: min(92vw, 460px);
        border: 1px solid rgba(125, 249, 255, 0.72);
        border-radius: 16px;
        padding: 20px;
        color: #dffbff;
        text-align: center;
        background:
          linear-gradient(180deg, rgba(11, 27, 38, 0.96), rgba(2, 7, 13, 0.98));
        box-shadow:
          0 0 34px rgba(125, 249, 255, 0.22),
          inset 0 0 22px rgba(125, 249, 255, 0.08);
      }

      #siteGuardOops .site-guard-oops-kicker {
        margin: 0 0 10px;
        color: #ffd86d;
        font-size: 12px;
        letter-spacing: 0.16em;
        text-transform: uppercase;
      }

      #siteGuardOops .site-guard-oops-message {
        margin: 0 0 18px;
        color: #7df9ff;
        font-size: clamp(18px, 3vw, 24px);
        line-height: 1.25;
        text-shadow: 0 0 12px rgba(125, 249, 255, 0.32);
      }

      #siteGuardOops .site-guard-oops-close {
        appearance: none;
        -webkit-appearance: none;
        border: 1px solid rgba(255, 216, 109, 0.86);
        border-radius: 10px;
        padding: 11px 16px;
        color: #ffd86d;
        background: rgba(255, 216, 109, 0.09);
        font: inherit;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        cursor: pointer;
      }

      #siteGuardOops .site-guard-oops-close:hover,
      #siteGuardOops .site-guard-oops-close:focus-visible {
        color: #120c00;
        background: #ffd86d;
        outline: none;
      }

/* Header Signal Run launch channel */
#home .hero-right-rail {
  align-self: end;
  align-content: end;
  justify-self: end;
  justify-items: end;
  padding-bottom: 0.25rem;
}

.hero-game-channel {
  display: grid;
  gap: 7px;
  width: min(100%, 320px);
  margin-top: 0;
}

.hero-game-channel-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: rgba(184, 245, 255, 0.78);
  font: 700 0.64rem/1 "Share Tech Mono", "Courier New", monospace;
  letter-spacing: 0.12em;
  text-transform: none;
  text-shadow: 0 0 7px rgba(100, 210, 255, 0.22);
}

.hero-game-channel-status > span {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 209, 102, 0.9);
  background: rgba(255, 209, 102, 0.72);
  box-shadow: 0 0 7px rgba(255, 209, 102, 0.48);
}

.mission-game-bezel {
  position: relative;
  width: 100%;
  height: 87px;
  padding: 7px 9px;
  border: 1px solid #8b969d;
  border-radius: 5px;
  background:
    repeating-linear-gradient(93deg, rgba(255, 255, 255, 0.08) 0 1px, rgba(15, 22, 27, 0.06) 1px 3px),
    linear-gradient(180deg, #8e999f 0%, #58636a 18%, #343e44 72%, #1b242a 100%);
  box-shadow:
    inset 0 2px 0 rgba(232, 243, 247, 0.42),
    inset 0 -3px 0 rgba(4, 10, 14, 0.72),
    inset 2px 0 0 rgba(218, 229, 234, 0.12),
    inset -2px 0 0 rgba(0, 0, 0, 0.28),
    0 6px 14px rgba(0, 0, 0, 0.42);
}

.mission-game-bezel::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 5px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 7px rgba(255, 209, 102, 0.58);
  opacity: 0.76;
}

.mission-game-screw {
  position: absolute;
  z-index: 4;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(9, 15, 19, 0.78);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 43%, rgba(6, 11, 14, 0.82) 44% 56%, transparent 57%),
    radial-gradient(circle at 35% 30%, #c5cdd1, #5f6a70 48%, #1d252a 76%);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.18);
}

.mission-game-screw-nw { top: 4px; left: 5px; }
.mission-game-screw-ne { top: 4px; right: 5px; }
.mission-game-screw-sw { bottom: 5px; left: 5px; }
.mission-game-screw-se { right: 5px; bottom: 5px; }

.mission-game-screen-shell {
  position: relative;
  height: 100%;
  padding: 2px;
  overflow: hidden;
  border: 1px solid rgba(5, 11, 16, 0.94);
  border-radius: 13px / 9px;
  background: linear-gradient(180deg, #111b21, #02070b);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.92),
    0 1px 0 rgba(210, 230, 238, 0.16);
}

#home .mission-game-launch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid rgba(89, 173, 194, 0.48);
  border-radius: 10px / 7px;
  color: #b8f5ff;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(15, 66, 82, 0.54), transparent 67%),
    linear-gradient(180deg, #06131d, #01070d 78%, #020407);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.84),
    inset 0 0 8px rgba(100, 210, 255, 0.16),
    0 0 10px rgba(100, 210, 255, 0.14);
  font: 700 0.84rem/1 "Share Tech Mono", "Courier New", monospace;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transform: none !important;
  transition: border-color 120ms linear, box-shadow 120ms linear, filter 90ms linear;
}

#home .mission-game-launch::before,
#home .mission-game-launch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

#home .mission-game-launch::before {
  background: linear-gradient(90deg,
    rgba(255, 203, 74, 0.82) 0 16.6%,
    rgba(67, 220, 235, 0.78) 16.6% 33.2%,
    rgba(95, 215, 140, 0.76) 33.2% 49.8%,
    rgba(225, 76, 188, 0.76) 49.8% 66.4%,
    rgba(224, 65, 73, 0.78) 66.4% 83%,
    rgba(68, 92, 219, 0.8) 83% 100%);
  mix-blend-mode: screen;
}

#home .mission-game-launch::after {
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(104, 226, 255, 0.8) 6% 66%, rgba(255, 71, 191, 0.62) 66% 91%, transparent 91%) 0 26% / 100% 5px no-repeat,
    linear-gradient(90deg, rgba(255, 72, 190, 0.55), transparent 42%, rgba(112, 231, 255, 0.72)) 0 69% / 100% 3px no-repeat;
}

.mission-game-crt-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(118deg, rgba(215, 247, 255, 0.13), transparent 29% 70%, rgba(100, 210, 255, 0.04)),
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(143, 216, 255, 0.075) 3px 4px);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.52);
}

.mission-game-launch-labels {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.mission-game-launch-labels > span {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: stretch;
}

.mission-game-launch-idle {
  color: #b8f5ff;
  text-shadow: 0 0 8px rgba(100, 210, 255, 0.54);
}

.mission-game-launch-active {
  opacity: 0;
  color: #ffffff;
  letter-spacing: 0.22em;
  text-shadow:
    -2px 0 rgba(100, 210, 255, 0.9),
    2px 0 rgba(225, 76, 188, 0.72),
    0 0 11px rgba(100, 210, 255, 0.62);
}

@keyframes crtScreenInterruption {
  0%, 100% { filter: brightness(1) contrast(1); }
  22% { filter: brightness(1.65) contrast(1.35) saturate(1.45); }
  48% { filter: brightness(0.82) contrast(1.7) saturate(1.25); }
  72% { filter: brightness(1.28) contrast(1.18); }
}

@keyframes crtColorBars {
  0%, 100% { opacity: 0; transform: translateX(0); }
  18% { opacity: 0.7; transform: translateX(-4%); }
  38% { opacity: 0.3; transform: translateX(3%); }
  55% { opacity: 0; transform: translateX(0); }
}

@keyframes crtTrackingTears {
  0%, 100% { opacity: 0; transform: translateX(0); }
  31% { opacity: 0.9; transform: translateX(13px); }
  52% { opacity: 0.55; transform: translateX(-9px); }
  74% { opacity: 0; transform: translateX(0); }
}

@keyframes crtIdleBreak {
  0%, 18% { opacity: 1; transform: translateX(0); text-shadow: 0 0 8px rgba(100, 210, 255, 0.54); }
  34% { opacity: 0.72; transform: translateX(-3px); text-shadow: -3px 0 #64d2ff, 3px 0 #dd4cbc; }
  52% { opacity: 0.28; transform: translateX(5px); }
  68%, 100% { opacity: 0; transform: translateX(0); }
}

@keyframes crtLaunchResolve {
  0%, 50% { opacity: 0; transform: translateX(-5px); }
  68% { opacity: 0.58; transform: translateX(3px); }
  84% { opacity: 1; transform: translateX(-1px); }
  100% { opacity: 1; transform: translateX(0); }
}

@media (hover: hover) and (pointer: fine) {
  #home .mission-game-launch:hover {
    border-color: rgba(143, 216, 255, 0.88);
    box-shadow:
      inset 0 0 18px rgba(0, 0, 0, 0.78),
      inset 0 0 10px rgba(100, 210, 255, 0.25),
      0 0 16px rgba(100, 210, 255, 0.3);
    animation: crtScreenInterruption 310ms steps(4, end) 1;
  }

  #home .mission-game-launch:hover::before { animation: crtColorBars 310ms steps(4, end) 1; }
  #home .mission-game-launch:hover::after { animation: crtTrackingTears 310ms steps(4, end) 1; }
  #home .mission-game-launch:hover .mission-game-launch-idle { animation: crtIdleBreak 310ms steps(4, end) 1 both; }
  #home .mission-game-launch:hover .mission-game-launch-active { animation: crtLaunchResolve 310ms steps(4, end) 1 both; }
}

#home .mission-game-launch:focus-visible {
  border-color: var(--amber);
  outline: 2px solid rgba(255, 209, 102, 0.98);
  outline-offset: -4px;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.78),
    inset 0 0 10px rgba(100, 210, 255, 0.25),
    0 0 17px rgba(100, 210, 255, 0.34);
  animation: crtScreenInterruption 310ms steps(4, end) 1;
}

#home .mission-game-launch:focus-visible::before { animation: crtColorBars 310ms steps(4, end) 1; }
#home .mission-game-launch:focus-visible::after { animation: crtTrackingTears 310ms steps(4, end) 1; }
#home .mission-game-launch:focus-visible .mission-game-launch-idle { animation: crtIdleBreak 310ms steps(4, end) 1 both; }
#home .mission-game-launch:focus-visible .mission-game-launch-active { animation: crtLaunchResolve 310ms steps(4, end) 1 both; }

#home .mission-game-launch:active {
  filter: brightness(1.12);
}

#home .mission-game-launch:active .mission-game-launch-idle { opacity: 0; }
#home .mission-game-launch:active .mission-game-launch-active { opacity: 1; }

@media (max-width: 780px) {
  #home {
    grid-template-areas:
      "kicker"
      "title"
      "copy" !important;
  }

  #home .hero-right-rail {
    display: none !important;
  }
}

/* Prevent the hero title from entering the launch-button column. */
@media (min-width: 781px) and (max-width: 1350px) {
  #home h1.glitch-title {
    font-size: clamp(3rem, 4.3vw, 3.65rem) !important;
  }
}

@media (min-width: 1351px) {
  #home h1.glitch-title {
    font-size: clamp(3.65rem, 4.5vw, 4rem) !important;
  }
}

@media (min-width: 781px) and (max-width: 960px) {
  #home {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "kicker"
      "title"
      "copy" !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) #home .mission-game-launch,
  html:not([data-motion="full"]) #home .mission-game-launch::before,
  html:not([data-motion="full"]) #home .mission-game-launch::after,
  html:not([data-motion="full"]) #home .mission-game-launch .mission-game-launch-idle,
  html:not([data-motion="full"]) #home .mission-game-launch .mission-game-launch-active {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  html:not([data-motion="full"]) #home .mission-game-launch:hover::before,
  html:not([data-motion="full"]) #home .mission-game-launch:focus-visible::before {
    opacity: 0.08;
  }

  html:not([data-motion="full"]) #home .mission-game-launch:hover .mission-game-launch-idle,
  html:not([data-motion="full"]) #home .mission-game-launch:focus-visible .mission-game-launch-idle {
    opacity: 0;
  }

  html:not([data-motion="full"]) #home .mission-game-launch:hover .mission-game-launch-active,
  html:not([data-motion="full"]) #home .mission-game-launch:focus-visible .mission-game-launch-active {
    opacity: 1;
  }
}

/* Header balance, welcome copy spacing, and main navigation links. */
nav[aria-label="Main navigation"] {
  grid-template-columns: none !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

@media (min-width: 781px) {
  #home {
    padding-right: 38px !important;
  }

  #home .copy-module {
    transform: translate(0, var(--hero-copy-y)) !important;
  }

  #home .hero-right-rail {
    justify-self: end !important;
    justify-items: end !important;
  }

  #home .tagline.terminal-typewriter,
  #home .terminal-typewriter .terminal-typed-line {
    line-height: 1.35 !important;
  }

  #home .terminal-typewriter .terminal-typed-line[data-type-line=""] {
    height: 0.68em !important;
    min-height: 0.68em !important;
  }
}

@media (max-width: 780px) {
  nav[aria-label="Main navigation"] {
    grid-template-columns: 1fr !important;
    grid-auto-flow: row;
  }
}

/* Goofs cassette modal and physical transport controls. */
body.goofs-modal-open {
  overflow: hidden;
}

#goofs.goofs-modal[hidden] {
  display: none !important;
}

#goofs.goofs-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 600 !important;
  display: grid !important;
  place-items: center;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: clamp(12px, 3vw, 32px) !important;
}

.goofs-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 5, 8, 0.8);
  backdrop-filter: blur(2px);
}

#goofs .goofs-modal__panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px)) !important;
  max-width: 920px !important;
  max-height: calc(100dvh - 32px);
  margin: 0 !important;
  padding: clamp(16px, 2.4vw, 28px) !important;
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid rgba(100, 210, 255, 0.72);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(125, 249, 255, 0.025) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(3, 18, 23, 0.99), rgba(0, 7, 10, 0.99));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78), 0 0 28px rgba(57, 255, 136, 0.12);
  outline: none;
  isolation: isolate;
}

#goofs .goof-standalone-header {
  padding-bottom: 2px;
  border-bottom: 1px dashed rgba(57, 255, 136, 0.32);
}

#goofs .goof-standalone-header h2 {
  color: #e9ffff;
  font-family: "Geist Pixel", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "ELSH" 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-shadow:
    -1px 0 #ff4fa8,
    1px 0 #59d9ff,
    0 0 6px rgba(118, 232, 255, 0.42);
}

@media (min-width: 781px) {
  #goofs .goof-standalone-header h2 {
    font-size: 1.05rem;
  }

  #goofs .goof-standalone-header p {
    font-size: clamp(1.2rem, 1.65vw, 1.4rem);
    line-height: 1.2;
  }
}

#goofs .goofs-lcd-console {
  display: contents;
}

#goofs .goofs-nightlight-button {
  display: none;
}

#goofs .goofs-now-playing {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: center;
  gap: 3px;
  width: min(450px, 72%);
  min-height: 54px;
  margin: 14px auto 0;
  padding: 7px 14px 8px;
  overflow: hidden;
  border: 4px solid #373b3b;
  border-radius: 7px;
  outline: 1px solid rgba(139, 146, 140, 0.72);
  background:
    linear-gradient(108deg, rgba(255, 255, 239, 0.28), transparent 31%),
    repeating-linear-gradient(90deg, rgba(47, 54, 43, 0.026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #cbd0b4, #b8bea3);
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 240, 0.34),
    inset 0 -4px 8px rgba(38, 43, 35, 0.22),
    0 2px 0 rgba(151, 157, 153, 0.35),
    0 5px 12px rgba(0, 0, 0, 0.38);
  color: #3c4338;
  font-family: "Share Tech Mono", "Courier New", monospace;
  line-height: 1;
  text-transform: uppercase;
}

#goofs .goofs-now-playing::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(102deg, transparent 12%, rgba(255, 255, 242, 0.12) 34%, transparent 56%);
  content: "";
  pointer-events: none;
}

#goofs .goofs-now-playing__label {
  position: relative;
  z-index: 1;
  color: rgba(48, 54, 45, 0.68);
  font-size: clamp(0.5rem, 0.85vw, 0.62rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

#goofs .goofs-now-playing__meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#goofs .goofs-now-playing__clock {
  color: #30362d;
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: clamp(0.58rem, 0.9vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

#goofs .goofs-now-playing__window {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  height: 1.55em;
  overflow: hidden;
}

#goofs .goofs-now-playing__segments {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  color: rgba(52, 59, 49, 0.035);
  font-family: "DSEG14Classic", monospace;
  font-size: clamp(1rem, 1.9vw, 1.3rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  white-space: nowrap;
}

#goofs .goofs-now-playing__title {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  display: block;
  width: max-content;
  min-width: 0;
  color: #20261f;
  font-size: clamp(1rem, 1.9vw, 1.3rem);
  font-family: "DSEG14Classic", "Share Tech Mono", monospace;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-shadow: none;
  transform: translate(0, -50%);
  white-space: nowrap;
}

#goofs .goofs-now-playing__title::after {
  position: absolute;
  top: 0;
  left: calc(100% + 3rem);
  content: attr(data-marquee);
  white-space: nowrap;
}

#goofs .goofs-now-playing.is-playing .goofs-now-playing__title.is-scrolling {
  animation: goofs-lcd-scroll-right-to-left 20s linear 1.5s infinite;
}

@keyframes goofs-lcd-scroll-right-to-left {
  from { transform: translate(0, -50%); }
  to { transform: translate(calc(-100% - 3rem), -50%); }
}

#goofs .goofs-now-playing.is-playing {
  background:
    linear-gradient(108deg, rgba(255, 255, 239, 0.34), transparent 31%),
    repeating-linear-gradient(90deg, rgba(47, 54, 43, 0.026) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #d5d9bc, #c2c8aa);
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 240, 0.42),
    inset 0 -4px 8px rgba(38, 43, 35, 0.18),
    0 2px 0 rgba(151, 157, 153, 0.4),
    0 5px 13px rgba(0, 0, 0, 0.4);
}

#goofs .goofs-now-playing.is-playing .goofs-now-playing__title {
  color: #171d17;
  text-shadow: none;
}

@media (min-width: 781px) {
  #goofs .goofs-lcd-console {
    position: relative;
    z-index: 31;
    display: grid;
    grid-template-columns: minmax(0, 600px) 92px;
    align-items: end;
    justify-content: center;
    gap: 12px;
    width: min(720px, 84%);
    margin: 14px auto 0;
  }

  #goofs .goofs-now-playing {
    width: 100%;
    min-height: 72px;
    margin: 0;
    padding: 9px 18px 10px;
  }

  #goofs .goofs-now-playing__label {
    font-size: 0.68rem;
  }

  #goofs .goofs-now-playing__clock {
    font-size: 0.72rem;
  }

  #goofs .goofs-now-playing__segments,
  #goofs .goofs-now-playing__title {
    font-size: clamp(1.3rem, 2.35vw, 1.65rem);
  }

  #goofs .goofs-nightlight-button {
    position: relative;
    z-index: 31;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-height: 48px;
    padding: 7px 8px 6px;
    border: 1px solid rgba(138, 199, 215, 0.82);
    border-radius: 4px;
    color: #a9d7df;
    background: linear-gradient(180deg, #233940, #071319 68%, #03090d);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      inset 0 -2px 3px rgba(0, 0, 0, 0.82),
      0 2px 5px rgba(0, 0, 0, 0.52);
    font: 700 0.58rem/1 "Share Tech Mono", monospace;
    letter-spacing: 0.08em;
    cursor: pointer;
  }

  #goofs .goofs-nightlight-button__lamp {
    width: 18px;
    height: 8px;
    border: 1px solid #403719;
    border-radius: 5px;
    background: #75652b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.72);
  }

  #goofs .goofs-nightlight-button:hover,
  #goofs .goofs-nightlight-button:focus-visible {
    color: #e1faff;
    border-color: #d5f7ff;
    outline: none;
  }

  #goofs .goofs-nightlight-button:active {
    transform: translateY(1px);
  }

  #goofs .goofs-nightlight-button[aria-pressed="true"] {
    color: #fff1a8;
    border-color: rgba(255, 219, 92, 0.9);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      inset 0 -2px 3px rgba(0, 0, 0, 0.82),
      0 0 13px rgba(255, 207, 66, 0.3);
  }

  #goofs .goofs-nightlight-button[aria-pressed="true"] .goofs-nightlight-button__lamp {
    border-color: #ffe989;
    background: #ffd94a;
    box-shadow:
      inset 0 1px 2px rgba(255, 255, 220, 0.7),
      0 0 10px rgba(255, 218, 72, 0.94);
  }

  #goofs .goofs-modal__panel.is-nightlight .goofs-now-playing {
    background:
      linear-gradient(108deg, rgba(255, 250, 218, 0.38), transparent 31%),
      repeating-linear-gradient(90deg, rgba(86, 63, 24, 0.035) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, #e1d7ad, #c7bc8d);
    box-shadow:
      inset 0 2px 7px rgba(255, 252, 221, 0.52),
      inset 0 -4px 8px rgba(66, 49, 20, 0.18),
      0 0 14px rgba(255, 202, 92, 0.48),
      0 0 30px rgba(255, 180, 62, 0.3);
    animation: goofs-lcd-nightlight-flicker 5.6s linear infinite;
  }

  #goofs .goofs-modal__panel.is-nightlight .goofs-window-close,
  #goofs .goofs-modal__panel.is-nightlight .goof-tape-canvas,
  #goofs .goofs-modal__panel.is-nightlight .goofs-cassette-deck,
  #goofs .goofs-modal__panel.is-nightlight .goofs-cassette-rewind,
  #goofs .goofs-modal__panel.is-nightlight .goofs-cassette-forward,
  #goofs .goofs-modal__panel.is-nightlight .goofs-cassette-stop,
  #goofs .goofs-modal__panel.is-nightlight .goof-track-list {
    z-index: 31;
  }
}

@keyframes goofs-lcd-nightlight-flicker {
  0%, 18%, 21%, 54%, 57%, 79%, 82%, 100% {
    filter: brightness(1) saturate(1);
  }
  19.2%, 55.2%, 80.2% {
    filter: brightness(0.965) saturate(0.98);
  }
  20%, 56%, 81% {
    filter: brightness(1.035) saturate(1.04);
  }
}

#goofs .goof-tape-widget {
  width: min(96%, var(--goof-tape-desktop-width), calc(100vw - 52px)) !important;
  max-width: calc(100vw - 52px) !important;
  margin: clamp(8px, 1.5vw, 16px) auto 0 !important;
  transform: none !important;
  transform-origin: center center !important;
}

#goofs .goofs-tape-transition {
  --goofs-tape-slot-y: 60%;
  position: absolute;
  top: var(--goofs-tape-slot-y);
  left: 52.2%;
  z-index: 20;
  width: min(62%, 300px);
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -116%)
    perspective(1000px)
    rotateX(-48deg)
    rotateY(4deg)
    rotateZ(-3deg)
    scale(1.02);
  transform-origin: center;
  will-change: transform, opacity;
}

#goofs .goofs-tape-transition svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter:
    drop-shadow(0 5px 5px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 5px rgba(125, 249, 255, 0.28))
    drop-shadow(0 0 10px rgba(87, 255, 154, 0.2));
}

#goofs .goofs-transition-cassette,
#goofs .goofs-transition-reel-set,
#goofs .goofs-transition-hub,
#goofs .goofs-transition-shadow {
  transform-box: fill-box;
  transform-origin: center;
}

#goofs .goofs-transition-body {
  stroke: rgba(213, 255, 243, 0.94);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

#goofs .goofs-transition-body-inner,
#goofs .goofs-transition-window,
#goofs .goofs-transition-window-inner,
#goofs .goofs-transition-reel,
#goofs .goofs-transition-hub,
#goofs .goofs-transition-guide,
#goofs .goofs-transition-label,
#goofs .goofs-transition-screws circle {
  vector-effect: non-scaling-stroke;
}

#goofs .goofs-transition-body-inner {
  fill: none;
  stroke: rgba(100, 214, 205, 0.38);
  stroke-width: 1;
}

#goofs .goofs-transition-ribs {
  fill: none;
  stroke: rgba(186, 255, 236, 0.16);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

#goofs .goofs-transition-screws circle {
  fill: #101c1c;
  stroke: rgba(212, 255, 240, 0.72);
  stroke-width: 1.2;
}

#goofs .goofs-transition-window {
  fill: rgba(1, 8, 10, 0.82);
  stroke: rgba(125, 249, 255, 0.78);
  stroke-width: 2;
}

#goofs .goofs-transition-window-inner {
  fill: rgba(16, 37, 38, 0.42);
  stroke: rgba(87, 255, 154, 0.28);
  stroke-width: 1;
}

#goofs .goofs-transition-reel {
  fill: rgba(6, 15, 17, 0.82);
  stroke: rgba(205, 255, 242, 0.9);
  stroke-width: 2;
}

#goofs .goofs-transition-spokes {
  fill: none;
  stroke: rgba(111, 230, 221, 0.56);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

#goofs .goofs-transition-hub,
#goofs .goofs-transition-guide {
  fill: rgba(8, 25, 27, 0.95);
  stroke: rgba(87, 255, 154, 0.76);
  stroke-width: 1.6;
}

#goofs .goofs-transition-tape,
#goofs .goofs-transition-highlight {
  fill: none;
  stroke: rgba(87, 255, 154, 0.62);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

#goofs .goofs-transition-highlight {
  stroke: rgba(255, 255, 255, 0.52);
  stroke-width: 1.2;
}

#goofs .goofs-transition-label {
  stroke: rgba(225, 255, 230, 0.76);
  stroke-width: 1.4;
}

#goofs .goofs-transition-label-kicker,
#goofs .goofs-transition-track-title {
  fill: #17251f;
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-weight: 700;
  paint-order: stroke fill;
}

#goofs .goofs-transition-label-kicker {
  font-size: 6.5px;
  letter-spacing: 0.18em;
  opacity: 0.72;
}

#goofs .goofs-transition-track-title {
  font-size: 9px;
  letter-spacing: 0.045em;
}

#goofs .goofs-transition-shadow {
  fill: rgba(0, 0, 0, 0.58);
  opacity: 0;
}

#goofs .goof-tape-widget::after {
  position: absolute;
  top: 48.7%;
  left: 34.1%;
  z-index: 21;
  width: 41.8%;
  height: 5.4%;
  border-top: 1px solid rgba(125, 249, 255, 0.68);
  border-radius: 4px 4px 50% 50%;
  background: linear-gradient(180deg, rgba(1, 5, 7, 0.96), rgba(2, 12, 14, 0.72) 58%, transparent);
  box-shadow:
    0 5px 9px rgba(0, 0, 0, 0.92),
    0 -1px 8px rgba(87, 255, 154, 0.42);
  content: "";
  opacity: 0;
  pointer-events: none;
}

#goofs .goofs-tape-transition.is-entering {
  animation: goofs-cassette-enter 1700ms cubic-bezier(0.2, 0.72, 0.24, 1) forwards;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-cassette {
  animation: goofs-cassette-guided-settle 1700ms ease-in-out 1 both;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-reel--left {
  animation: goofs-reel-spin 1700ms linear 1 both;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-reel--right {
  animation: goofs-reel-spin-reverse 1700ms linear 1 both;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-hub {
  animation: goofs-hub-pulse 1700ms ease-in-out 1 both;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-tape {
  animation: goofs-tape-feed 160ms linear 1220ms 3;
  stroke-dasharray: 9 6;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-highlight {
  animation: goofs-highlight-sweep 760ms ease-out 120ms 1 both;
  stroke-dasharray: 34 18;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-label,
#goofs .goofs-tape-transition.is-entering .goofs-transition-label-kicker,
#goofs .goofs-tape-transition.is-entering .goofs-transition-track-title {
  animation: goofs-label-wake 620ms ease-out 80ms 1 both;
}

#goofs .goofs-tape-transition.is-entering .goofs-transition-shadow {
  animation: goofs-shadow-land 1700ms ease-in 1 both;
}

#goofs .goof-tape-widget.is-receiving-tape::after {
  animation: goofs-slot-capture 1700ms ease-out 1 both;
}

#goofs .goof-tape-widget.is-receiving-tape .goof-tape-img {
  animation: goofs-receive-tape 1700ms ease-out;
}

@keyframes goofs-cassette-enter {
  0% {
    opacity: 0;
    transform: translate(-50%, -116%) perspective(1000px) rotateX(-48deg) rotateY(4deg) rotateZ(-3deg) scale(1.02);
  }
  10% {
    opacity: 0.98;
    transform: translate(-50%, -116%) perspective(1000px) rotateX(-48deg) rotateY(4deg) rotateZ(-3deg) scale(1.02);
  }
  50% {
    opacity: 0.98;
    transform: translate(-50%, -75%) perspective(1000px) rotateX(-23deg) rotateY(-1deg) rotateZ(1.1deg) scale(0.91);
  }
  64% {
    opacity: 0.98;
    transform: translate(-50%, -59%) perspective(1000px) rotateX(-7deg) rotateY(0deg) rotateZ(-0.35deg) scale(0.79);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -40%) perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.72);
  }
  79% {
    opacity: 1;
    transform: translate(-50%, -40%) perspective(1000px) rotateX(13deg) rotateY(0deg) rotateZ(0deg) scale(0.72);
  }
  86% {
    opacity: 1;
    transform: translate(-50%, -41%) perspective(1000px) rotateX(-9deg) rotateY(0deg) rotateZ(0deg) scale(0.72);
  }
  92% {
    opacity: 0.94;
    transform: translate(-50%, -40%) perspective(1000px) rotateX(3deg) rotateY(0deg) rotateZ(0deg) scale(0.72);
  }
  96% {
    opacity: 0.64;
    transform: translate(-50%, -40%) perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -38%) perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.7);
  }
}

@keyframes goofs-cassette-guided-settle {
  0%, 12% { transform: translateX(-1px) rotate(-0.35deg); }
  38% { transform: translateX(1px) rotate(0.28deg); }
  58% { transform: translateX(-0.5px) rotate(-0.1deg); }
  70% { transform: translateY(2px) rotate(0deg); }
  75% { transform: translateY(-1px) rotate(0deg); }
  79%, 100% { transform: translateY(0) rotate(0deg); }
}

@keyframes goofs-reel-spin {
  0%, 72% { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}

@keyframes goofs-reel-spin-reverse {
  0%, 72% { transform: rotate(0deg); }
  100% { transform: rotate(-720deg); }
}

@keyframes goofs-hub-pulse {
  0%, 72% { opacity: 0.82; transform: scale(0.96); }
  82% { opacity: 1; transform: scale(1.05); }
  91% { opacity: 0.76; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(0.98); }
}

@keyframes goofs-tape-feed {
  to { stroke-dashoffset: -30; }
}

@keyframes goofs-highlight-sweep {
  from { opacity: 0; stroke-dashoffset: 24; }
  36% { opacity: 0.82; }
  to { opacity: 0.08; stroke-dashoffset: -104; }
}

@keyframes goofs-label-wake {
  from { opacity: 0.38; }
  38% { opacity: 1; }
  to { opacity: 0.86; }
}

@keyframes goofs-shadow-land {
  0%, 42% { opacity: 0; transform: scaleX(0.46); }
  60% { opacity: 0.3; transform: scaleX(0.78); }
  72% { opacity: 0.82; transform: scaleX(1); }
  90% { opacity: 0.54; transform: scaleX(0.86); }
  100% { opacity: 0; transform: scaleX(0.72); }
}

@keyframes goofs-slot-capture {
  0%, 61% { opacity: 0; }
  68% { opacity: 0.34; }
  73% { opacity: 1; }
  90% { opacity: 0.4; }
  100% { opacity: 0; }
}

@keyframes goofs-receive-tape {
  0%, 66% { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34)) brightness(1); }
  73% { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34)) brightness(1.16) contrast(1.05); }
  84% { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34)) brightness(1.08); }
  95%, 100% { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34)) brightness(1); }
}

#goofs .goof-tape-img,
#goofs .goof-tape-canvas {
  transform: none !important;
}

.goofs-cassette-stop {
  position: absolute;
  top: 23%;
  left: 65%;
  z-index: 9;
  display: grid;
  place-items: center;
  width: clamp(20px, 5%, 28px);
  aspect-ratio: 1.65;
  padding: 0;
  border: 1px solid rgba(255, 123, 145, 0.8);
  border-radius: 3px;
  color: #fff4bf;
  background: linear-gradient(180deg, #a72d4b 0%, #6f1530 58%, #390a1b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 203, 211, 0.36),
    inset 0 -2px 2px rgba(25, 0, 7, 0.72),
    0 0 8px rgba(255, 67, 105, 0.62);
  font: 700 clamp(6px, 1vw, 8px)/1 "Share Tech Mono", monospace;
  letter-spacing: 0.01em;
  text-shadow: 0 0 5px rgba(255, 240, 170, 0.9);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.goofs-cassette-deck,
.goofs-cassette-rewind,
.goofs-cassette-forward {
  position: absolute;
  top: 23%;
  z-index: 9;
  display: grid;
  place-items: center;
  width: clamp(20px, 5%, 28px);
  aspect-ratio: 1.65;
  padding: 0;
  border: 1px solid rgba(132, 205, 255, 0.88);
  border-radius: 3px;
  color: #dff8ff;
  background: linear-gradient(180deg, #287eb6 0%, #16527f 58%, #092b49 100%);
  box-shadow:
    inset 0 1px 0 rgba(218, 245, 255, 0.42),
    inset 0 -2px 2px rgba(0, 17, 34, 0.78),
    0 0 8px rgba(56, 176, 255, 0.64);
  font: 700 clamp(6px, 1.1vw, 9px)/1 "Share Tech Mono", monospace;
  letter-spacing: 0;
  text-shadow: 0 0 5px rgba(170, 231, 255, 0.9);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

.goofs-cassette-deck {
  left: 45.8%;
  border-color: rgba(126, 255, 176, 0.9);
  color: #e2ffed;
  background: linear-gradient(180deg, #26975d 0%, #146c42 58%, #073b25 100%);
  box-shadow:
    inset 0 1px 0 rgba(218, 255, 232, 0.46),
    inset 0 -2px 2px rgba(0, 31, 17, 0.78),
    0 0 8px rgba(57, 255, 136, 0.64);
  text-shadow: 0 0 5px rgba(182, 255, 212, 0.92);
}

.goofs-cassette-stop {
  font-size: clamp(7px, 1.1vw, 9px);
  letter-spacing: 0;
}

.goofs-cassette-rewind {
  left: 52.2%;
}

.goofs-cassette-forward {
  left: 58.6%;
}

#goofs .goof-tape-widget.is-track-menu-open .goofs-cassette-stop,
#goofs .goof-tape-widget.is-track-menu-open .goofs-cassette-deck,
#goofs .goof-tape-widget.is-track-menu-open .goofs-cassette-rewind,
#goofs .goof-tape-widget.is-track-menu-open .goofs-cassette-forward {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.goofs-cassette-deck:hover,
.goofs-cassette-deck:focus-visible,
.goofs-cassette-deck[aria-pressed="true"] {
  color: #ffffff;
  border-color: #ddffea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64), 0 0 14px rgba(57, 255, 136, 0.94);
  outline: none;
}

.goofs-cassette-rewind:hover,
.goofs-cassette-rewind:focus-visible,
.goofs-cassette-rewind.is-active,
.goofs-cassette-forward:hover,
.goofs-cassette-forward:focus-visible,
.goofs-cassette-forward.is-active {
  color: #ffffff;
  border-color: #e6f8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 0 14px rgba(56, 176, 255, 0.92);
  outline: none;
}

.goofs-cassette-deck:active,
.goofs-cassette-rewind:active,
.goofs-cassette-rewind.is-active,
.goofs-cassette-forward:active,
.goofs-cassette-forward.is-active {
  transform: translate(-50%, calc(-50% + 2px));
}

.goofs-cassette-stop:hover,
.goofs-cassette-stop:focus-visible {
  color: #fffbe1;
  border-color: #ffd0d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 13px rgba(255, 67, 105, 0.88);
  outline: none;
}

.goofs-cassette-stop:active {
  transform: translate(-50%, calc(-50% + 2px));
}

.goofs-window-close {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 29px;
  height: 25px;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 5px;
  color: #ffffff;
  background: linear-gradient(135deg, #f6a58f 0%, #e55e42 18%, #c92f19 62%, #9e170c 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.68),
    inset -1px -1px 0 rgba(83, 0, 0, 0.68),
    0 0 0 1px #123f91,
    0 2px 5px rgba(0, 0, 0, 0.55);
  font: 700 20px/1 Arial, sans-serif;
  text-shadow: 1px 1px 0 rgba(83, 0, 0, 0.7);
  cursor: pointer;
}

.goofs-window-close:hover,
.goofs-window-close:focus-visible {
  background: linear-gradient(135deg, #ffd0c2 0%, #f27656 22%, #dc3b20 66%, #ac1d0e 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.82), inset -1px -1px 0 rgba(83, 0, 0, 0.7), 0 0 0 2px #5ea2ff, 0 0 10px rgba(63, 135, 255, 0.5);
  outline: none;
}

.goofs-window-close:active {
  transform: translateY(1px);
  box-shadow: inset 1px 1px 2px rgba(83, 0, 0, 0.62), 0 0 0 1px #123f91;
}

#goofs .goof-standalone-header {
  padding-right: 38px;
}

.goofs-transport {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  width: min(760px, 100%);
  margin: 8px auto 0;
  padding: 10px 12px;
  border: 1px solid rgba(57, 255, 136, 0.38);
  border-radius: 5px;
  background: rgba(0, 13, 15, 0.84);
  box-shadow: inset 0 0 15px rgba(57, 255, 136, 0.055);
}

.goofs-transport__buttons {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 7px;
}

.goofs-transport button {
  min-width: 58px;
  padding: 7px 9px;
  border: 1px solid rgba(143, 216, 255, 0.62);
  border-radius: 3px;
  color: var(--green);
  background: linear-gradient(180deg, rgba(143, 216, 255, 0.12), rgba(0, 12, 20, 0.76));
  font: inherit;
  font-size: 0.72rem;
  text-transform: uppercase;
  cursor: pointer;
}

.goofs-transport button:hover,
.goofs-transport button:focus-visible,
.goofs-transport button[aria-pressed="true"] {
  color: #001b0b;
  border-color: #a9ffd0;
  background: var(--green);
  box-shadow: 0 0 10px rgba(57, 255, 136, 0.34);
  outline: none;
}

.goofs-transport__timeline {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#goofs-scrubber {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
  background: transparent;
  cursor: ew-resize;
}

#goofs-scrubber::-webkit-slider-runnable-track {
  height: 3px;
  border: 1px solid rgba(87, 255, 154, 0.64);
  background: rgba(87, 255, 154, 0.14);
  box-shadow: 0 0 6px rgba(87, 255, 154, 0.24);
}

#goofs-scrubber::-webkit-slider-thumb {
  width: 10px;
  height: 15px;
  margin-top: -7px;
  border: 1px solid #d9ffe8;
  border-radius: 1px;
  background: var(--green);
  box-shadow: 0 0 7px rgba(87, 255, 154, 0.7);
  -webkit-appearance: none;
}

#goofs-scrubber::-moz-range-track {
  height: 3px;
  border: 1px solid rgba(87, 255, 154, 0.64);
  background: rgba(87, 255, 154, 0.14);
}

#goofs-scrubber::-moz-range-thumb {
  width: 10px;
  height: 15px;
  border: 1px solid #d9ffe8;
  border-radius: 1px;
  background: var(--green);
  box-shadow: 0 0 7px rgba(87, 255, 154, 0.7);
}

.goofs-transport output {
  min-width: 92px;
  color: #bfffd9;
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap;
}

.goofs-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

nav[aria-label="Main navigation"] .nav-goofs-trigger {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(143, 216, 255, 0.74);
  border-radius: 5px;
  color: var(--green);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(29, 114, 255, 0.16), rgba(0, 12, 20, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.72);
  font: inherit;
  font-size: 0.9rem;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

nav[aria-label="Main navigation"] .nav-goofs-trigger:hover,
nav[aria-label="Main navigation"] .nav-goofs-trigger:focus-visible {
  color: #001227;
  border-color: rgba(235, 250, 255, 0.88);
  background: linear-gradient(180deg, #dff7ff 0%, #8fd8ff 24%, #1d72ff 62%, #0637a8 100%);
  box-shadow: 0 0 18px rgba(100, 210, 255, 0.42);
  outline: none;
}

@media (max-width: 780px) {
  #goofs.goofs-modal {
    padding: 8px !important;
  }

  #goofs .goofs-modal__panel.is-nightlight .goofs-now-playing {
    background:
      linear-gradient(108deg, rgba(255, 250, 218, 0.38), transparent 31%),
      repeating-linear-gradient(90deg, rgba(86, 63, 24, 0.035) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, #e1d7ad, #c7bc8d);
    box-shadow:
      inset 0 2px 7px rgba(255, 252, 221, 0.52),
      inset 0 -4px 8px rgba(66, 49, 20, 0.18),
      0 0 14px rgba(255, 202, 92, 0.48),
      0 0 30px rgba(255, 180, 62, 0.3);
    animation: goofs-lcd-nightlight-flicker 5.6s linear infinite;
  }

  #goofs .goofs-window-close {
    top: 8px;
    right: 8px;
    left: auto;
    transform: none;
  }

  #goofs .goofs-window-close:active {
    transform: translateY(1px);
  }

  #goofs .goof-standalone-header {
    padding-right: 0;
  }

  #goofs .goof-tape-canvas {
    touch-action: pan-y;
  }

  #goofs .goofs-modal__panel {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px);
    padding: 14px 10px 12px !important;
  }

  #goofs .goofs-now-playing {
    grid-template-columns: 1fr;
    gap: 5px;
    width: calc(100% - 12px);
    min-height: 52px;
    margin-top: 10px;
    padding: 8px 10px;
  }

  #goofs .goofs-now-playing__title {
    font-size: clamp(0.82rem, 3.8vw, 1rem);
  }

  #goofs .goofs-now-playing__segments {
    font-size: clamp(0.82rem, 3.8vw, 1rem);
  }

  #goofs .goof-tape-widget {
    width: min(100%, var(--goof-tape-mobile-width), calc(100vw - 36px)) !important;
    max-width: calc(100vw - 36px) !important;
    margin-top: 10px !important;
  }

  #goofs .goofs-tape-transition {
    width: min(56.5%, 300px);
  }

  #goofs .goof-track-list {
    top: 4px;
    bottom: auto;
    width: calc(100% - 16px);
    max-height: min(58dvh, 330px);
    gap: 8px;
    padding: 8px;
    overscroll-behavior: contain;
  }

  #goofs .goof-track-button {
    min-height: 58px;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .goofs-transport {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 54px;
    padding: 8px;
  }

  .goofs-transport__buttons {
    display: none;
  }

  #goofs .goofs-cassette-deck,
  #goofs .goofs-cassette-rewind,
  #goofs .goofs-cassette-forward,
  #goofs .goofs-cassette-stop {
    top: auto;
    bottom: -48px;
    width: clamp(48px, 16vw, 66px);
    height: 44px;
    aspect-ratio: auto;
    transform: translate(-50%, 0);
  }

  #goofs .goofs-cassette-deck {
    left: 20%;
  }

  #goofs .goofs-cassette-rewind {
    left: 40%;
  }

  #goofs .goofs-cassette-forward {
    left: 60%;
  }

  #goofs .goofs-cassette-stop {
    left: 80%;
  }

  #goofs .goofs-cassette-deck,
  #goofs .goofs-cassette-rewind,
  #goofs .goofs-cassette-forward {
    font-size: 0.76rem;
  }

  #goofs .goofs-cassette-stop {
    font-size: 0.72rem;
  }

  #goofs .goofs-cassette-deck:active,
  #goofs .goofs-cassette-rewind:active,
  #goofs .goofs-cassette-rewind.is-active,
  #goofs .goofs-cassette-forward:active,
  #goofs .goofs-cassette-forward.is-active,
  #goofs .goofs-cassette-stop:active {
    transform: translate(-50%, 2px);
  }

  .goofs-transport__timeline {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  nav[aria-label="Main navigation"] .nav-goofs-trigger {
    padding: 8px;
    font-size: 0.74rem;
  }
}

/* Main navigation label typography. */
nav[aria-label="Main navigation"] > a,
nav[aria-label="Main navigation"] > button {
  color: #e9ffff !important;
  font-family: "Geist Pixel", sans-serif !important;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "ELSH" 0;
  letter-spacing: 0.08em;
  text-shadow:
    -1px 0 #ff4fa8,
    1px 0 #59d9ff,
    0 0 6px rgba(118, 232, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 12px 2px rgba(125, 255, 174, 0.3),
    0 0 24px 2px rgba(83, 224, 137, 0.16) !important;
}

@media (min-width: 781px) {
  nav[aria-label="Main navigation"] {
    gap: 8px !important;
    padding: 16px !important;
    overflow: visible;
  }
}

nav[aria-label="Main navigation"] > a:hover,
nav[aria-label="Main navigation"] > a:focus,
nav[aria-label="Main navigation"] > .nav-goofs-trigger:hover,
nav[aria-label="Main navigation"] > .nav-goofs-trigger:focus-visible {
  color: #00170a !important;
  text-shadow: none;
}


/* ============================================================
   DESKTOP KONAMI -> DOUBLE A EASTER EGG TEST — SHUTDOWN PASS
   Test-only presentation. main-page.js owns the keyboard state.
   ============================================================ */

@keyframes konami-terminal-corrupt {
  0%, 100% { transform: translate3d(0, 0, 0) skewX(0deg); filter: none; opacity: 1; }
  8% { transform: translate3d(-8px, 1px, 0) skewX(-1.1deg); filter: contrast(1.45) saturate(0.45) hue-rotate(14deg); }
  16% { transform: translate3d(10px, -2px, 0) skewX(1.6deg); filter: contrast(1.85) saturate(1.8) hue-rotate(-22deg); }
  24% { transform: translate3d(-3px, 0, 0) skewX(-0.4deg); filter: contrast(1.2) brightness(0.64); opacity: 0.88; }
  34% { transform: translate3d(14px, 3px, 0) skewX(2.2deg); filter: contrast(2) saturate(0.25); }
  43% { transform: translate3d(-11px, -2px, 0) skewX(-1.6deg); filter: contrast(1.55) hue-rotate(31deg); }
  54% { transform: translate3d(5px, 1px, 0) skewX(0.8deg); filter: brightness(1.55) contrast(1.8); }
  67% { transform: translate3d(-2px, 0, 0) skewX(-0.3deg); filter: brightness(0.42) contrast(2.1); opacity: 0.7; }
  78% { transform: translate3d(12px, -1px, 0) skewX(1deg); filter: brightness(1.85) contrast(2.3) grayscale(0.45); }
  88% { transform: translate3d(-7px, 2px, 0) skewX(-1.2deg); filter: brightness(0.22) contrast(2.5); opacity: 0.48; }
}

@keyframes konami-terminal-fail {
  0% { opacity: 1; filter: contrast(1.5) brightness(0.82); transform: translateX(0) skewX(0); }
  9% { opacity: 0.18; filter: contrast(2.8) brightness(1.7); transform: translateX(18px) skewX(2deg); }
  17% { opacity: 0.9; filter: contrast(1.7) brightness(0.45); transform: translateX(-13px) skewX(-1.3deg); }
  31% { opacity: 0.3; filter: contrast(3) brightness(1.2) grayscale(0.65); transform: translateX(7px); }
  45% { opacity: 0.96; filter: contrast(1.9) brightness(0.34); transform: translateX(-4px) skewX(0.7deg); }
  58% { opacity: 0.08; filter: contrast(3.2) brightness(2); transform: translateX(20px) skewX(2.5deg); }
  74% { opacity: 0.78; filter: contrast(2.2) brightness(0.28); transform: translateX(-9px); }
  100% { opacity: 0.42; filter: contrast(2.6) brightness(0.16); transform: translateX(3px); }
}

@keyframes konami-crt-collapse {
  0% {
    transform: scale3d(1, 1, 1);
    filter: brightness(0.9) contrast(1.8) saturate(0.55);
    opacity: 0.92;
  }
  38% {
    transform: scale3d(1.015, 0.36, 1);
    filter: brightness(1.7) contrast(2.5) saturate(0.2);
    opacity: 1;
  }
  63% {
    transform: scale3d(1.04, 0.025, 1);
    filter: brightness(4.8) contrast(3.4) saturate(0);
    opacity: 1;
  }
  82% {
    transform: scale3d(0.62, 0.006, 1);
    filter: brightness(7) contrast(4) saturate(0);
    opacity: 0.95;
  }
  100% {
    transform: scale3d(0.018, 0.003, 1);
    filter: brightness(9) contrast(4) saturate(0);
    opacity: 0;
  }
}

@keyframes konami-power-line {
  0% { transform: translate(-50%, -50%) scaleX(1); opacity: 0; box-shadow: 0 0 6px rgba(230,255,239,0.4); }
  18% { opacity: 1; }
  58% { transform: translate(-50%, -50%) scaleX(0.82); opacity: 1; box-shadow: 0 0 22px rgba(235,255,243,0.9), 0 0 70px rgba(190,255,214,0.28); }
  100% { transform: translate(-50%, -50%) scaleX(0.015); opacity: 0; box-shadow: 0 0 2px rgba(255,255,255,0); }
}

@keyframes konami-error-arrive {
  0% { opacity: 0; transform: scaleX(1.7) scaleY(0.02); filter: blur(3px) brightness(3); }
  28% { opacity: 1; transform: scaleX(0.9) scaleY(1.08); filter: blur(0) brightness(1.4); }
  55% { transform: scaleX(1.03) scaleY(0.96); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}

@keyframes konami-error-jitter {
  0%, 100% { translate: 0 0; text-shadow: -5px 0 rgba(255, 0, 0, 0.24), 5px 0 rgba(255, 255, 255, 0.08); }
  22% { translate: -9px 1px; text-shadow: 11px 0 rgba(255, 0, 0, 0.4), -4px 0 rgba(255, 255, 255, 0.12); }
  47% { translate: 7px -2px; text-shadow: -13px 0 rgba(255, 0, 0, 0.45), 4px 0 rgba(255, 255, 255, 0.1); }
  71% { translate: -3px 2px; text-shadow: 7px 0 rgba(255, 0, 0, 0.35), -8px 0 rgba(255, 255, 255, 0.06); }
}

@keyframes konami-scan-drop {
  from { transform: translateY(-110%); }
  to { transform: translateY(110%); }
}

body.konami-easteregg-running {
  overflow: hidden !important;
  background: #000 !important;
}

body.konami-easteregg-running::before,
body.konami-easteregg-running::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 2147483000;
}

body.konami-easteregg-running::before {
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.065) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,0,0,0.018) 0 2px, transparent 2px 7px),
    linear-gradient(90deg, rgba(255,0,0,0.07), transparent 24%, transparent 76%, rgba(0,210,255,0.06));
  mix-blend-mode: screen;
  opacity: 0.82;
}

body.konami-easteregg-running::after {
  inset: -20% 0 auto;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.18), transparent);
  opacity: 0.7;
  animation: konami-scan-drop 0.28s linear infinite;
}

body.konami-easteregg-running:not(.konami-secret-open) .terminal {
  position: relative;
  z-index: 1;
  transform-origin: 50% 50%;
  animation: konami-terminal-corrupt 0.15s steps(2, jump-none) infinite;
  will-change: transform, filter, opacity;
}

/* Horizontal tear bands during the first corruption stage. */
body.konami-easteregg-running:not(.konami-secret-open) .terminal::before,
body.konami-easteregg-running:not(.konami-secret-open) .terminal::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 9vh;
  pointer-events: none;
  z-index: 2147482500;
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: invert(0.16) contrast(2.1) saturate(0.35);
}

body.konami-easteregg-running:not(.konami-secret-open) .terminal::before {
  top: 18vh;
  transform: translateX(-18px);
}

body.konami-easteregg-running:not(.konami-secret-open) .terminal::after {
  top: 64vh;
  transform: translateX(21px);
}

/* The signal stops behaving like a glitch and starts behaving like hardware failure. */
body.konami-shutdown-failing:not(.konami-secret-open) .terminal {
  animation: konami-terminal-fail 0.105s steps(1, end) infinite;
}

body.konami-shutdown-failing:not(.konami-secret-open)::before {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.13) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,0,0,0.045) 0 3px, rgba(0,210,255,0.035) 3px 6px, transparent 6px 12px),
    rgba(0,0,0,0.08);
  opacity: 0.96;
}

/* Classic CRT power-down: full image crushes into one bright horizontal line. */
body.konami-shutdown-collapse:not(.konami-secret-open) .terminal {
  animation: konami-crt-collapse 0.36s cubic-bezier(0.62, 0.02, 0.84, 0.22) forwards !important;
  transform-origin: 50% 50%;
}

body.konami-shutdown-collapse:not(.konami-secret-open) .terminal::before,
body.konami-shutdown-collapse:not(.konami-secret-open) .terminal::after {
  opacity: 0 !important;
}

body.konami-shutdown-collapse:not(.konami-secret-open)::after {
  inset: 50% auto auto 50%;
  width: min(92vw, 1500px);
  height: 2px;
  background: #eefcf3;
  opacity: 0;
  animation: konami-power-line 0.38s ease-out forwards;
  transform-origin: 50% 50%;
}

/* Dead set: no scan, no image, no glow. */
body.konami-shutdown-dark:not(.konami-secret-open)::before {
  inset: 0;
  background: #000;
  mix-blend-mode: normal;
  opacity: 1;
}

body.konami-shutdown-dark:not(.konami-secret-open)::after {
  display: none;
}

body.konami-shutdown-dark:not(.konami-secret-open) .terminal {
  animation: none !important;
  opacity: 0 !important;
  visibility: hidden;
}

body.konami-error-visible::before {
  content: "ERROR";
  display: grid;
  place-items: center;
  inset: 0;
  color: #ff1616;
  background: #000;
  font-family: "Press Start 2P", "Share Tech Mono", monospace;
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-indent: 0.08em;
  opacity: 1;
  mix-blend-mode: normal;
  animation:
    konami-error-arrive 0.16s steps(3, end) both,
    konami-error-jitter 0.11s 0.17s steps(2, jump-none) infinite;
}

/* AUDIO ARCHIVE — compact title-only track cards */
.audio-drawer .audio-drawer-item {
  display: flex;
  align-items: center;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  padding-block: 5px;
}

.primary-demo-stage {
  display: grid;
  justify-items: center;
  width: 100%;
  padding: 0 12px;
}

.primary-demo-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: min(var(--hero-demo-width, 390px), 100%);
  margin: -4px auto 8px;
  color: rgba(255, 216, 109, 0.62);
  font: 700 0.78rem/1.4 "Share Tech Mono", "Courier New", monospace;
  letter-spacing: 0.16em;
}

.primary-demo-links a {
  color: #ffd86d;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 216, 109, 0.42);
  transition: color 160ms ease, border-color 160ms ease, text-shadow 160ms ease;
}

.primary-demo-links a:hover,
.primary-demo-links a:focus-visible {
  color: #57ff9a;
  border-color: currentColor;
  text-shadow: 0 0 7px rgba(87, 255, 154, 0.6);
}

.primary-demo-links a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.goofs-page-intro {
  width: min(100%, var(--site-shell-width, 1060px));
  margin: 8px auto 18px;
  padding: 14px clamp(16px, 2.2vw, 26px) 16px;
  border-top: 1px dashed rgba(57, 255, 136, 0.38);
  border-bottom: 1px solid rgba(100, 210, 255, 0.18);
  background: linear-gradient(180deg, rgba(3, 14, 18, 0.24), transparent 72%);
}

.goofs-page-intro h2 {
  margin: 0 0 8px;
  color: #ffd86d;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.72rem, 1.25vw, 0.95rem);
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.goofs-page-intro p {
  margin: 0;
  color: #57ff9a;
  font-family: "Pixelify Sans", "Share Tech Mono", sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  font-weight: 700;
  line-height: 1.35;
}

#goofs.goofs-modal {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px !important;
}

#goofs .goofs-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 8, 0.48);
  backdrop-filter: blur(1px);
}

#goofs .goofs-modal__panel {
  flex: 0 0 auto;
  width: min(760px, calc(100vw - 32px)) !important;
  max-width: 760px !important;
  max-height: none;
  margin: auto 0 !important;
  padding: 0 0 8px !important;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#goofs .goofs-player-assembly {
  position: relative;
  width: min(100%, 760px);
  margin-inline: auto;
}

#goofs .goofs-player-assembly__chrome {
  display: flex;
  min-height: 48px;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 4px;
}

#goofs .goofs-window-close {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 40;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  transform: none;
}

#goofs .goofs-window-close:active {
  transform: translateY(1px);
}

#goofs .goofs-lcd-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  width: min(100%, 660px);
  margin: 0 auto 8px;
}

#goofs .goofs-now-playing {
  width: 100%;
  min-height: 54px;
  margin: 0;
}

#goofs .goofs-nightlight-button {
  position: relative;
  z-index: 31;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 80px;
  min-height: 48px;
  padding: 7px 8px 6px;
  border: 1px solid rgba(138, 199, 215, 0.82);
  border-radius: 4px;
  color: #a9d7df;
  background: linear-gradient(180deg, #233940, #071319 68%, #03090d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 3px rgba(0, 0, 0, 0.82), 0 2px 5px rgba(0, 0, 0, 0.52);
  font: 700 0.58rem/1 "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
  cursor: pointer;
}

#goofs .goofs-nightlight-button__lamp {
  width: 18px;
  height: 8px;
  border: 1px solid #403719;
  border-radius: 5px;
  background: #75652b;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.72);
}

#goofs .goofs-nightlight-button:hover,
#goofs .goofs-nightlight-button:focus-visible {
  color: #e1faff;
  border-color: #d5f7ff;
  outline: 2px solid #ffd86d;
  outline-offset: 2px;
}

#goofs .goofs-nightlight-button[aria-pressed="true"] {
  color: #fff1a8;
  border-color: rgba(255, 219, 92, 0.9);
}

#goofs .goofs-nightlight-button[aria-pressed="true"] .goofs-nightlight-button__lamp {
  border-color: #ffe989;
  background: #ffd94a;
  box-shadow: inset 0 1px 2px rgba(255, 255, 220, 0.7), 0 0 10px rgba(255, 218, 72, 0.94);
}

#goofs .goof-tape-widget {
  width: min(96%, var(--goof-tape-desktop-width, 514px), calc(100vw - 40px)) !important;
  max-width: calc(100vw - 40px) !important;
  margin: 8px auto 0 !important;
}

@media (max-width: 780px) {
  #goofs.goofs-modal {
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px !important;
  }

  #goofs .goofs-modal__panel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 4px 8px !important;
  }

  #goofs .goofs-window-close {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    transform: none;
  }

  #goofs .goofs-window-close:active {
    transform: translateY(1px);
  }

  #goofs .goofs-lcd-console {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    width: 100%;
  }

  #goofs .goofs-now-playing {
    width: 100%;
    min-height: 52px;
    margin: 0;
  }

  #goofs .goofs-nightlight-button {
    min-width: 68px;
    min-height: 48px;
  }

  #goofs .goof-tape-widget {
    width: min(100%, var(--goof-tape-mobile-width, 685px), calc(100vw - 36px)) !important;
    max-width: calc(100vw - 36px) !important;
  }

  .goofs-page-intro {
    margin-top: 6px;
    padding-inline: 16px;
  }
}

@media (min-width: 781px) and (max-height: 700px) {
  #goofs.goofs-modal {
    justify-content: flex-start;
  }

}

@media (min-width: 781px) and (max-width: 900px),
  (min-width: 781px) and (any-pointer: coarse) {
  #goofs .goofs-cassette-deck,
  #goofs .goofs-cassette-rewind,
  #goofs .goofs-cassette-forward,
  #goofs .goofs-cassette-stop {
    top: auto;
    bottom: -48px;
    width: clamp(48px, 8vw, 66px);
    height: 44px;
    aspect-ratio: auto;
    transform: translate(-50%, 0);
  }

  #goofs .goofs-cassette-deck { left: 20%; }
  #goofs .goofs-cassette-rewind { left: 40%; }
  #goofs .goofs-cassette-forward { left: 60%; }
  #goofs .goofs-cassette-stop { left: 80%; }

  .goofs-transport {
    margin-top: 54px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  #goofs.goofs-modal {
    justify-content: flex-start;
    padding-block: 8px !important;
  }

  #goofs .goofs-modal__panel {
    margin-block: 0 !important;
  }

  #goofs .goof-tape-widget {
    width: min(96%, 360px, calc(100vw - 40px)) !important;
    max-width: calc(100vw - 40px) !important;
  }
}

@media (max-height: 540px) and (orientation: landscape) and (any-pointer: coarse) {
  #goofs .goofs-cassette-deck,
  #goofs .goofs-cassette-rewind,
  #goofs .goofs-cassette-forward,
  #goofs .goofs-cassette-stop {
    top: auto;
    bottom: -52px;
    width: clamp(48px, 8vw, 66px);
    height: 48px;
    aspect-ratio: auto;
    transform: translate(-50%, 0);
  }

  #goofs .goofs-cassette-deck { left: 20%; }
  #goofs .goofs-cassette-rewind { left: 40%; }
  #goofs .goofs-cassette-forward { left: 60%; }
  #goofs .goofs-cassette-stop { left: 80%; }

  .goofs-transport {
    margin-top: 58px;
  }
}

html[data-motion="reduced"] #goofs,
html[data-motion="reduced"] #goofs *,
html[data-motion="reduced"] #goofs::before,
html[data-motion="reduced"] #goofs::after,
html[data-motion="reduced"] #goofs *::before,
html[data-motion="reduced"] #goofs *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Compact Goofs modal controls and page-wide nightlight. */
.goofs-transport {
  position: relative !important;
  width: min(480px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  margin: 10px auto 0 !important;
  padding: 6px 9px !important;
}

.goofs-transport__timeline {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#goofs-scrubber {
  height: 16px;
}

.goofs-transport output {
  min-width: 82px;
  font-size: 0.68rem;
}

#goofs .goofs-window-close {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
}

@media (max-width: 900px), (any-pointer: coarse) {
  #goofs .goofs-cassette-deck,
  #goofs .goofs-cassette-rewind,
  #goofs .goofs-cassette-forward,
  #goofs .goofs-cassette-stop {
    top: auto !important;
    bottom: -36px !important;
    width: clamp(34px, 7vw, 42px) !important;
    height: 32px !important;
    aspect-ratio: auto !important;
  }

  .goofs-transport {
    margin-top: 42px !important;
  }
}

body.goofs-nightlight-active #goofs .goofs-modal__backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: brightness(0.72) blur(2px);
}

/* Replace the always-visible mobile drawer grid with one compact Explore control. */
.mobile-explore,
.mobile-explore__items { display: contents; }
.mobile-explore__toggle { display: none; }

/* Both desktop stacks share the measured outer border of the unchanged portfolio panel. */
.mobile-explore[data-navigation-mode="stacks"] {
  --side-tab-scale: 1;
  --side-tab-height: calc(58px * var(--side-tab-scale));
  --side-tab-gap: calc(4px * var(--side-tab-scale));
  --side-stack-height: calc(3 * var(--side-tab-height) + 2 * var(--side-tab-gap));
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: 54px !important;
  left: var(--side-panel-left) !important;
  display: block;
  width: var(--side-panel-width);
  height: var(--side-stack-height);
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent;
  box-shadow: none;
  transform: none;
  z-index: var(--z-tabs, 80);
  pointer-events: none;
}

.mobile-explore[data-navigation-mode="stacks"][data-reel-side-tabs] {
  bottom: clamp(
    8px,
    calc(54px + (100dvh - var(--side-reel-center) - var(--side-stack-height) / 2 - 54px) * var(--side-reel-blend)),
    calc(100dvh - var(--side-stack-height) - 8px)
  ) !important;
}

.mobile-explore[data-navigation-mode="stacks"] .side-tab {
  position: absolute !important;
  top: 0 !important;
  bottom: auto !important;
  width: calc(var(--side-tab-width) * var(--side-tab-scale)) !important;
  min-width: 0 !important;
  max-width: calc(var(--side-tab-width) * var(--side-tab-scale)) !important;
  height: var(--side-tab-height) !important;
  min-height: var(--side-tab-height) !important;
  padding-inline: calc(clamp(8px, (var(--side-tab-width) - 128px) / 11 + 8px, 12px) * var(--side-tab-scale)) !important;
  gap: calc(8px * var(--side-tab-scale));
  font-size: calc(.74rem * var(--side-tab-scale)) !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  pointer-events: auto !important;
}

.mobile-explore[data-navigation-mode="stacks"] .audio-producer-game-tab {
  font-size: calc(.62rem * var(--side-tab-scale)) !important;
}

.mobile-explore[data-navigation-mode="stacks"] :is(.audio-drawer-tab, .writing-drawer-tab, .goofs-side-tab) {
  left: auto !important;
  right: calc(100% + 10px) !important;
}

.mobile-explore[data-navigation-mode="stacks"] :is(.video-drawer-tab, .social-drawer-tab, .audio-producer-game-tab) {
  right: auto !important;
  left: calc(100% + 10px) !important;
}

.mobile-explore[data-navigation-mode="stacks"] :is(.writing-drawer-tab, .social-drawer-tab) {
  top: calc(var(--side-tab-height) + var(--side-tab-gap)) !important;
}

.mobile-explore[data-navigation-mode="stacks"] :is(.goofs-side-tab, .audio-producer-game-tab) {
  top: calc(2 * (var(--side-tab-height) + var(--side-tab-gap))) !important;
}

@media (min-width: 901px) {
  body.compact-side-navigation { padding-bottom: 70px !important; }
}

  .mobile-explore[data-navigation-mode="compact"] {
    position: fixed !important;
    z-index: 120 !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    display: block;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 20px));
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: translateX(-50%);
    pointer-events: none;
  }

  [data-navigation-mode="compact"] .mobile-explore__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: min(172px, 100%);
    min-height: 48px;
    margin-inline: auto;
    padding: 8px 14px;
    border: 1px solid rgba(143, 216, 255, .74);
    border-radius: 6px;
    background: linear-gradient(180deg, #14242a, #071114);
    box-shadow: inset 0 1px rgba(255,255,255,.13), 0 5px 18px rgba(0,0,0,.55);
    color: #e2edf0;
    font: 700 11px/1.1 "Share Tech Mono", monospace;
    letter-spacing: .1em;
    cursor: pointer;
    pointer-events: auto;
  }

  [data-navigation-mode="compact"] .mobile-explore__toggle > span {
    color: #d7a34b;
    font: 20px/1 Arial, sans-serif;
  }

  [data-navigation-mode="compact"] .mobile-explore__toggle[aria-expanded="true"] > span { transform: rotate(45deg); }
  [data-navigation-mode="compact"] .mobile-explore__toggle:hover,
  [data-navigation-mode="compact"] .mobile-explore__toggle:focus-visible { border-color: #79ffac; outline: 2px solid rgba(121,255,172,.62); outline-offset: 2px; }

  [data-navigation-mode="compact"] .mobile-explore__items[hidden] { display: none !important; }
  [data-navigation-mode="compact"] .mobile-explore__items:not([hidden]) {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: min(68vh, 460px);
    max-height: min(68dvh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border: 1px solid rgba(112, 133, 136, .72);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15,23,25,.98), rgba(5,10,12,.99));
    box-shadow: 0 12px 30px rgba(0,0,0,.72), inset 0 1px rgba(255,255,255,.08);
    pointer-events: auto;
  }

  [data-navigation-mode="compact"] .mobile-explore__items .side-tab {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  [data-navigation-mode="compact"] .mobile-explore__items .tab-arrow { display: none !important; }
  body.drawer-open .mobile-explore[data-navigation-mode="compact"],
  body.v3-mobile-overlay-open .mobile-explore[data-navigation-mode="compact"] { visibility: hidden; pointer-events: none; }
