:root {
      --accent: #9b5b57;
      /* Alle Positionen exakt am Bildinhalt (1280×720) vermessen — 2026-07-03 */
      --tv-lock-left: 74.15%;
      --tv-lock-top: 54.25%;
      --tv-lock-width: 5.75%;
      --tv-lock-height: 21.45%;
      --tv-lock-pad: 0%;
      --tv-lock-gap: 0%;
      --tv-lock-digit-size: 1.75vmin;
      --tv-lock-key-size: 2.2vmin;
      --tv-lock-key-pad: 13.2%;
      --tv-lock-clear-pad: 9.3%;
      --tv-lock-display-height: auto;
      --tv-lock-display-pad-top: 4.5%;
      --tv-lock-display-pad-bottom: 0.8%;
      --tv-lock-display-pad-x: 0.8%;
      --tv-lock-display-gap: 5.0%;
      --tv-lock-keypad-pad-top: 1.3%;
      --tv-lock-keypad-pad-x: 1.0%;
      --tv-lock-keypad-pad-bottom: 0.0%;
      --tv-lock-key-gap-x: 0.0%;
      --tv-lock-key-gap-y: 0.0%;
      --tv-lock-opacity: 0.3;
      --tv-dial-left: 74.5%;
      --tv-dial-top: 24.8%;
      --tv-dial-size: 6.15%;
      --tv-scale-left: 74.45%;
      --tv-scale-top: 34.4%;
      --tv-scale-width: 8.4%;
      --tv-confirm-left: 74.45%;
      --tv-confirm-top: 40.9%;
      --tv-confirm-size: 1.5%;
      --tv-film-screen-left: 37.1%;
      --tv-film-screen-top: 21.8%;
      --tv-film-screen-width: 32.0%;
      --tv-film-screen-height: 48.6%;
      --tv-zoom-origin-x: calc(var(--tv-film-screen-left) + var(--tv-film-screen-width) / 2);
      --tv-zoom-origin-y: calc(var(--tv-film-screen-top) + var(--tv-film-screen-height) / 2);
      --tv-zoom-scale: 3.135;
      --door-knob-left: 65.2%;
      --door-knob-top: 43.3%;
      --door-knob-size: 10.6%;
      --tv-panel-left: 74.45%;
      --tv-panel-top: 47.30%;
      --tv-panel-width: 8.75%;
      /* TV-Bedienfeld-Bundle: Grafik + Schloss + Regler + Knopf — Handy-Tipp vergrößert alles */
      --tv-bundle-origin-x: 70.05%;
      --tv-bundle-origin-y: 37.50%;
      --tv-bundle-base-scale: 0.98;
      --tv-bundle-expand-scale: 2.00;
      --tv-bundle-scale: 1;
    }

    /* Schriftgrößen an der Bühne (statt am Viewport) ausrichten,
       damit Ziffern/Tasten auf jedem Bildschirm mit dem Bild mitskalieren.
       (cq-Einheiten = Prozent der Bühnengröße; vmin bleibt als Fallback.) */
    @supports (width: 1cqmin) {
      :root {
        --tv-lock-digit-size: 1.75cqmin;
        --tv-lock-key-size: 2.2cqmin;
      }
      .cc-tv-scale-readout {
        font-size: 3cqmin;
      }
    }

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

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
      color: #fff;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }

    /* ── 16:9-BÜHNE ─────────────────────────────────────────────────────
       Alle Szenenbilder sind 1280×720 (16:9). Statt die Bilder per
       object-fit:cover an den Viewport zu beschneiden (wodurch alle
       %-Positionen je nach Bildschirm verrutschen), wird das Spiel in
       eine feste 16:9-Bühne gelegt, die zentriert in den Bildschirm
       eingepasst wird (Letterbox, schwarze Balken bei abweichendem
       Seitenverhältnis). Alle Overlays/Steuerelemente sitzen in der
       Bühne → ihre %-Werte beziehen sich exakt aufs Bild und bleiben
       auf jedem Bildschirm pixelgenau an derselben Stelle. */
    #cc-root {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: min(100vw, 177.7778vh);
      height: min(100vh, 56.25vw);
      width: min(100dvw, 177.7778dvh);
      height: min(100dvh, 56.25dvw);
      background: #000;
      overflow: hidden;
      container-type: size;
    }

    #cc-entry-black {
      position: fixed;
      inset: 0;
      z-index: 6050;
      background: #000;
      pointer-events: auto;
      opacity: 1;
      visibility: visible;
      transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    #cc-entry-black.is-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    body.cc-entry-intro #cc-root,
    body.cc-entry-intro #cc-back {
      opacity: 0;
      pointer-events: none;
    }

    body.cc-entry-reveal #cc-root,
    body.cc-entry-reveal #cc-back {
      opacity: 1;
      transition: opacity 2.4s ease;
      pointer-events: none;
    }

    body.cc-entry-done #cc-root {
      pointer-events: auto;
    }

    .cc-scene {
      position: absolute;
      inset: 0;
      opacity: 0;
      transition: opacity 0.9s ease;
      pointer-events: none;
      cursor: default;
    }

    .cc-scene.is-active {
      opacity: 1;
      pointer-events: auto;
    }

    .cc-scene.is-clickable { cursor: pointer; }

    .cc-scene img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      user-select: none;
      -webkit-user-drag: none;
      pointer-events: none;
    }

    .cc-scene-portal .cc-scene-bg,
    .cc-scene-portal .cc-portal-overlay {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .cc-scene-portal .cc-portal-overlay {
      z-index: 2;
    }

    .cc-door-knob {
      position: absolute;
      left: var(--door-knob-left);
      top: var(--door-knob-top);
      width: var(--door-knob-size);
      aspect-ratio: 1;
      transform: translate(-50%, -50%);
      border: 0;
      border-radius: 50%;
      padding: 0;
      background: transparent;
      cursor: pointer;
      z-index: 4;
      touch-action: manipulation;
    }

    .cc-door-knob:focus-visible {
      outline: 2px solid rgba(255, 255, 255, 0.55);
      outline-offset: 2px;
    }

    .cc-scene .cc-tv-lock {
      z-index: 3;
    }

    .cc-film-stage {
      position: absolute;
      inset: 0;
      background: #000;
      overflow: hidden;
    }

    .cc-camera-rig {
      position: absolute;
      inset: 0;
      transform-origin: var(--tv-zoom-origin-x) var(--tv-zoom-origin-y);
      transition: transform 2.8s cubic-bezier(0.55, 0, 1, 0.42);
    }

    .cc-film-stage.is-tv-zoom .cc-camera-rig,
    .cc-film-stage.is-tv-zoom-settle .cc-camera-rig {
      will-change: transform;
    }

    .cc-film-stage.is-tv-zoom .cc-camera-rig {
      transform: scale(var(--tv-zoom-scale));
    }

    .cc-film-stage.is-tv-zoom-settle .cc-camera-rig {
      transform: scale(1);
      transition: transform 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .cc-film-stage #cc-tv-stack {
      position: absolute;
      left: var(--tv-film-screen-left);
      top: var(--tv-film-screen-top);
      width: var(--tv-film-screen-width);
      height: var(--tv-film-screen-height);
      overflow: hidden;
      background: #0a0a0a;
      border-radius: 4% / 5%;
      z-index: 1;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.45s ease;
      isolation: isolate;
      box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.75),
        inset 0 0 42px rgba(20, 40, 20, 0.22);
    }

    .cc-film-stage #cc-tv-stack::before {
      content: '';
      position: absolute;
      inset: 0;
      z-index: 28;
      pointer-events: none;
      border-radius: inherit;
      background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.36) 0px,
        rgba(0, 0, 0, 0.36) 1px,
        rgba(0, 0, 0, 0.1) 1px,
        rgba(0, 0, 0, 0.1) 3px
      );
      opacity: 0.78;
    }

    .cc-film-stage #cc-tv-stack::after {
      content: '';
      position: absolute;
      inset: 0;
      z-index: 29;
      pointer-events: none;
      border-radius: inherit;
      background:
        radial-gradient(ellipse 88% 78% at 50% 48%, transparent 42%, rgba(0, 0, 0, 0.52) 100%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.04) 0%, transparent 38%, transparent 62%, rgba(0, 0, 0, 0.12) 100%);
      box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
    }

    @keyframes cc-crt-phosphor {
      0%, 100% { opacity: 0.52; }
      50% { opacity: 0.48; }
    }

    .cc-film-stage #cc-tv-stack.is-visible::before {
      animation: cc-crt-phosphor 0.14s steps(2) infinite;
    }

    .cc-film-stage.is-tv-zoom #cc-tv-stack,
    .cc-film-stage.is-tv-zoom-settle #cc-tv-stack {
      transition:
        opacity 0.45s ease,
        left 1.5s cubic-bezier(0.22, 0.61, 0.36, 1),
        top 1.5s cubic-bezier(0.22, 0.61, 0.36, 1),
        width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1),
        height 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .cc-film-stage.is-tv-zoom-settle #cc-tv-stack {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      z-index: 12;
    }

    .cc-film-stage #cc-tv-stack.is-visible {
      opacity: 1;
      visibility: visible;
    }

    .cc-tv-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #000;
      opacity: 0;
      transition: opacity 0.1s linear;
      filter:
        contrast(1.18)
        brightness(0.88)
        saturate(0.82)
        sepia(0.12)
        blur(0.4px);
      transform: scale(1.02);
    }

    .cc-tv-finale {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #000;
      opacity: 0;
      z-index: 20;
      transition: opacity 0.5s ease;
      filter:
        contrast(1.18)
        brightness(0.88)
        saturate(0.82)
        sepia(0.12)
        blur(0.4px);
      transform: scale(1.02);
    }

    .cc-tv-finale.is-active {
      opacity: 1;
    }

    .cc-film-stage.is-tv-zoom-settle .cc-tv-finale {
      object-fit: cover;
      opacity: 1;
    }

    .cc-film-stage.is-tv-zoom-settle .cc-film-overlay {
      opacity: 0;
      visibility: hidden;
    }

    #cc-root > #cc-tv-controls-bundle,
    .cc-camera-rig > #cc-tv-controls-bundle {
      z-index: 25;
    }

    .cc-tv-controls-bundle {
      position: absolute;
      inset: 0;
      z-index: 25;
      pointer-events: none;
      visibility: hidden;
    }

    .cc-tv-controls-bundle.is-visible {
      visibility: visible;
    }

    .cc-tv-controls-bundle .cc-tv-panel {
      z-index: 1;
    }

    @media (pointer: coarse) {
      .cc-tv-controls-bundle.is-visible.is-mobile-scalable {
        pointer-events: auto;
      }

      body.cc-tv-controls-expanded .cc-tv-controls-bundle.is-visible.is-mobile-scalable {
        transform: scale(var(--tv-bundle-expand-scale));
        transform-origin: var(--tv-bundle-origin-x) var(--tv-bundle-origin-y);
        transition: transform 0.22s ease;
      }
    }

    body.cc-tv-bundle-tool-active .cc-tv-controls-bundle.is-visible {
      pointer-events: auto;
      transform: scale(var(--tv-bundle-scale, var(--tv-bundle-base-scale, 1)));
      transform-origin: var(--tv-bundle-origin-x) var(--tv-bundle-origin-y);
      transition: transform 0.22s ease;
      --tv-bundle-scale: var(--tv-bundle-base-scale, 1);
    }

    body.cc-tv-bundle-tool-active.cc-tv-controls-expanded .cc-tv-controls-bundle.is-visible {
      --tv-bundle-scale: var(--tv-bundle-expand-scale);
    }

    body.cc-tv-tool-skip-intro #cc-entry-black {
      display: none !important;
    }

    body.cc-tv-tool-skip-intro.cc-entry-intro #cc-root,
    body.cc-tv-tool-skip-intro.cc-entry-intro #cc-back {
      opacity: 1;
      pointer-events: auto;
    }

    #cc-tv-bundle-tool {
      position: fixed;
      left: 12px;
      top: 12px;
      z-index: 6200;
      width: min(19rem, 42vw);
      max-height: calc(100vh - 24px);
      overflow: auto;
      padding: 0 0.95rem 1rem;
      background: rgba(6, 10, 14, 0.94);
      border: 1px solid rgba(90, 200, 210, 0.35);
      border-radius: 0.5rem;
      color: rgba(230, 245, 248, 0.9);
      font-size: 0.72rem;
      line-height: 1.45;
      font-family: 'VT323', monospace;
    }

    .cc-tv-bundle-tool-drag {
      position: sticky;
      top: 0;
      z-index: 2;
      margin: 0 -0.95rem 0.55rem;
      padding: 0.7rem 0.95rem 0.5rem;
      background: rgba(6, 10, 14, 0.98);
      border-bottom: 1px solid rgba(90, 200, 210, 0.22);
      cursor: grab;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }

    .cc-tv-bundle-tool-drag.is-dragging {
      cursor: grabbing;
    }

    #cc-tv-bundle-tool h2 {
      font-family: 'Metal Mania', cursive;
      font-size: 1rem;
      letter-spacing: 0.06em;
      margin: 0;
      color: #fff;
    }

    .cc-tv-bundle-tool-drag-hint {
      display: block;
      margin-top: 0.2rem;
      font-size: 0.62rem;
      letter-spacing: 0.04em;
      color: rgba(140, 210, 220, 0.55);
    }

    #cc-tv-bundle-tool p {
      margin: 0 0 0.45rem;
      color: rgba(160, 220, 228, 0.75);
    }

    #cc-tv-bundle-tool label {
      display: block;
      margin: 0.45rem 0 0.15rem;
      color: rgba(160, 220, 228, 0.75);
    }

    #cc-tv-bundle-tool input[type="range"] {
      width: 100%;
      accent-color: #4ecbd6;
    }

    #cc-tv-bundle-tool .cc-tv-bundle-tool-pad {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.35rem;
      margin: 0.55rem 0;
    }

    #cc-tv-bundle-tool button {
      font: inherit;
      background: rgba(30, 50, 58, 0.9);
      border: 1px solid rgba(90, 200, 210, 0.35);
      color: #e8f8fa;
      border-radius: 0.3rem;
      padding: 0.35rem 0.4rem;
      cursor: pointer;
    }

    #cc-tv-bundle-tool #cc-tv-bundle-tool-export {
      width: 100%;
      margin-top: 0.65rem;
      padding: 0.45rem;
      background: rgba(50, 140, 150, 0.35);
    }

    #cc-tv-bundle-tool-status {
      margin-top: 0.5rem;
      color: rgba(140, 210, 220, 0.85);
      word-break: break-all;
    }

    #cc-tv-bundle-origin-handle {
      position: absolute;
      left: var(--tv-bundle-origin-x);
      top: var(--tv-bundle-origin-y);
      width: 1.1rem;
      height: 1.1rem;
      border-radius: 50%;
      border: 2px solid #5ee8f0;
      background: rgba(40, 200, 210, 0.35);
      transform: translate(-50%, -50%);
      z-index: 30;
      cursor: move;
      pointer-events: auto;
      display: none;
      box-shadow: 0 0 10px rgba(80, 220, 230, 0.5);
    }

    body.cc-tv-bundle-tool-active #cc-tv-bundle-origin-handle {
      display: block;
    }

    body.cc-finale-controls-hidden #cc-tv-controls-bundle,
    body.cc-finale-controls-hidden #cc-tv-panel {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }

    #cc-overlay-holder {
      position: fixed;
      width: 0;
      height: 0;
      overflow: hidden;
      visibility: hidden;
      pointer-events: none;
    }

    .cc-overlay-fade-out {
      pointer-events: none !important;
      user-select: none;
    }

    .cc-tv-panel {
      position: absolute;
      left: var(--tv-panel-left);
      top: var(--tv-panel-top);
      width: var(--tv-panel-width);
      aspect-ratio: 274 / 1024;
      transform: translate(-50%, -50%);
      z-index: 17;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      user-select: none;
    }

    .cc-tv-panel.is-visible {
      opacity: 1;
      visibility: visible;
    }

    .cc-tv-panel img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
    }

    body.cc-tv-panel-active .cc-tv-scale-panel {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }

    body.cc-tv-panel-active .cc-tv-scale-panel::before {
      display: none;
    }

    body.cc-tv-panel-active .cc-tv-lock {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }

    body.cc-tv-panel-active .cc-tv-lock::before {
      display: none;
    }

    body.cc-tv-panel-active .cc-code-display {
      background: transparent;
      border-color: transparent;
      flex: 0 0 var(--tv-lock-display-height, auto);
      padding: var(--tv-lock-display-pad-top) var(--tv-lock-display-pad-x) var(--tv-lock-display-pad-bottom);
      gap: var(--tv-lock-display-gap);
    }

    body.cc-tv-panel-active .cc-keypad {
      gap: var(--tv-lock-key-gap-y) var(--tv-lock-key-gap-x);
      padding: var(--tv-lock-keypad-pad-top) var(--tv-lock-keypad-pad-x) var(--tv-lock-keypad-pad-bottom);
    }

    body.cc-tv-panel-active .cc-key {
      padding: var(--tv-lock-key-pad) 0;
    }

    body.cc-tv-panel-active .cc-key-clear {
      padding: var(--tv-lock-clear-pad) 0;
    }

    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-tv-lock {
      outline: 1px dashed rgba(255, 220, 0, 0.55);
      outline-offset: 1px;
    }

    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-code-digit {
      background: rgba(0, 220, 255, 0.12) !important;
      border: 1px solid rgba(0, 220, 255, 0.55) !important;
      color: rgba(0, 220, 255, 0.35) !important;
    }

    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-code-digit.is-filled {
      color: rgba(0, 255, 200, 0.9) !important;
      text-shadow: none;
    }

    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-key {
      background: rgba(255, 120, 0, 0.12) !important;
      border: 1px solid rgba(255, 120, 0, 0.55) !important;
    }

    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-key:hover,
    body.cc-tv-lock-calib-active.cc-tv-panel-active .cc-key:active {
      background: rgba(255, 120, 0, 0.28) !important;
    }

    body.cc-tv-panel-active .cc-code-digit {
      color: transparent;
      background: transparent;
      border-color: transparent;
      text-shadow: none;
      box-shadow: none;
    }

    body.cc-tv-panel-active .cc-code-digit.is-filled {
      color: rgba(255, 184, 74, 0.92);
      text-shadow: 0 0 6px rgba(255, 160, 40, 0.85);
    }

    body.cc-tv-panel-active .cc-key {
      color: transparent;
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }

    body.cc-tv-panel-active .cc-key:hover,
    body.cc-tv-panel-active .cc-key:active {
      background: rgba(255, 255, 255, 0.08);
      color: transparent;
    }

    body.cc-tv-panel-active .cc-tv-scale-confirm {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }

    body.cc-tv-panel-active .cc-tv-scale-confirm.is-visible {
      animation: cc-confirm-panel-blink 1.1s ease-in-out infinite;
    }

    body.cc-tv-panel-active .cc-tv-scale-confirm-led {
      opacity: 0;
    }

    @keyframes cc-confirm-panel-blink {
      0%, 100% { filter: brightness(0.75); }
      50% { filter: brightness(1.45) drop-shadow(0 0 8px rgba(255, 50, 50, 0.85)); }
    }

    .cc-tv-dial {
      position: absolute;
      left: var(--tv-dial-left);
      top: var(--tv-dial-top);
      width: var(--tv-dial-size);
      aspect-ratio: 1;
      border-radius: 50%;
      overflow: hidden;
      transform: translate(-50%, -50%) rotate(var(--dial-angle, 0deg));
      transform-origin: 50% 50%;
      z-index: 20;
      padding: 0;
      border: 0;
      background: transparent;
      cursor: grab;
      touch-action: none;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
      -webkit-mask-image: radial-gradient(circle, #000 99.5%, transparent 100%);
      mask-image: radial-gradient(circle, #000 99.5%, transparent 100%);
    }

    .cc-tv-dial.is-visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .cc-tv-dial.is-dragging { cursor: grabbing; }

    .cc-tv-dial-svg {
      width: 100%;
      height: 100%;
      display: block;
      pointer-events: none;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    }

    .cc-tv-scale {
      position: absolute;
      left: var(--tv-scale-left);
      top: var(--tv-scale-top);
      width: var(--tv-scale-width);
      aspect-ratio: 3.75;
      transform: translate(-50%, -50%);
      z-index: 19;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      user-select: none;
    }

    .cc-tv-scale.is-visible {
      opacity: 1;
      visibility: visible;
    }

    .cc-tv-scale-panel {
      position: relative;
      width: 100%;
      height: 100%;
      padding: 14% 5% 10%;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 28%),
        linear-gradient(180deg, #a3b0c0 0%, #8496a8 46%, #6f8094 100%);
      border: 1px solid #4f5d6d;
      border-radius: 2px;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -2px 5px rgba(0, 0, 0, 0.28),
        0 1px 4px rgba(0, 0, 0, 0.42);
      overflow: hidden;
    }

    .cc-tv-scale-panel::before {
      content: '';
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0 1px,
        transparent 1px 3px
      );
      pointer-events: none;
      opacity: 0.45;
    }

    .cc-tv-scale-track {
      position: relative;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 8%;
    }

    .cc-tv-scale-readout {
      position: relative;
      z-index: 2;
      font-family: 'VT323', monospace;
      font-size: clamp(0.78rem, 3vmin, 1.2rem);
      line-height: 1;
      color: #0a0e14;
      letter-spacing: 0.05em;
      text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
      text-align: center;
      min-width: 2.5ch;
      min-height: 1em;
    }

    .cc-tv-scale-readout.is-empty {
      color: transparent;
      text-shadow: none;
    }

    .cc-tv-scale-confirm {
      position: absolute;
      left: var(--tv-confirm-left);
      top: var(--tv-confirm-top);
      width: var(--tv-confirm-size);
      aspect-ratio: 1;
      transform: translate(-50%, -50%);
      z-index: 19;
      padding: 0;
      border: 1px solid rgba(80, 0, 0, 0.8);
      border-radius: 50%;
      background: #6e0c0c;
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      touch-action: manipulation;
      box-shadow:
        inset 0 1px 0 rgba(255, 120, 120, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.55);
    }

    .cc-tv-scale-confirm.is-visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      animation: cc-confirm-blink 1.1s ease-in-out infinite;
    }

    .cc-tv-scale-confirm.is-success {
      animation: none;
      background: #1a5c28;
      border-color: rgba(40, 120, 60, 0.9);
      box-shadow: 0 0 10px rgba(60, 200, 90, 0.55);
      pointer-events: none;
    }

    .cc-tv-scale-confirm.is-visible,
    .cc-tv-scale-confirm.is-success {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .cc-tv-scale-confirm-led {
      display: block;
      width: 42%;
      height: 42%;
      margin: 0;
      border-radius: 50%;
      flex-shrink: 0;
      background: radial-gradient(circle at 35% 30%, #ffb0b0 0%, #ff3030 55%, #8a0000 100%);
    }

    .cc-tv-scale-confirm.is-success .cc-tv-scale-confirm-led {
      background: radial-gradient(circle at 35% 30%, #b8ffc8 0%, #40d060 55%, #1a6030 100%);
    }

    @keyframes cc-confirm-blink {
      0%, 100% {
        background: #5a0808;
        box-shadow: inset 0 1px 0 rgba(255, 100, 100, 0.2), 0 0 4px rgba(180, 20, 20, 0.35);
      }
      50% {
        background: #c81818;
        box-shadow: inset 0 1px 0 rgba(255, 180, 180, 0.35), 0 0 16px rgba(255, 50, 50, 0.85);
      }
    }

    .cc-film-stage #cc-tv-stack.is-resonance {
      animation: cc-resonance-pulse 2.8s ease-out;
    }

    @keyframes cc-resonance-pulse {
      0% { filter: brightness(2.2) saturate(1.5) contrast(1.1); }
      35% { filter: brightness(1.4) saturate(1.25); }
      100% { filter: brightness(1) saturate(1); }
    }

    .cc-film-stage .cc-film-overlay {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      pointer-events: none;
      z-index: 2;
    }

    .cc-tv-lock {
      position: absolute;
      left: var(--tv-lock-left);
      top: var(--tv-lock-top);
      width: var(--tv-lock-width);
      height: var(--tv-lock-height);
      transform: translate(-50%, -50%);
      z-index: 6;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: var(--tv-lock-gap);
      padding: var(--tv-lock-pad);
      background: linear-gradient(165deg, rgba(74, 74, 74, var(--tv-lock-opacity)) 0%, rgba(36, 36, 36, var(--tv-lock-opacity)) 100%);
      border: 1px solid rgba(0, 0, 0, 0.55);
      border-radius: 1px;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.5);
      overflow: hidden;
      pointer-events: none;
      visibility: hidden;
    }

    .cc-tv-lock.is-visible {
      visibility: visible;
      pointer-events: auto;
    }

    .cc-tv-lock::before {
      content: '';
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0px,
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 3px
      );
      pointer-events: none;
      z-index: 1;
      opacity: 0.5;
    }

    .cc-code-display {
      position: relative;
      z-index: 2;
      display: flex;
      justify-content: center;
      gap: 5%;
      padding: 4% 0 2%;
      background: rgba(0, 0, 0, 0.45);
      border: 1px inset rgba(0, 0, 0, 0.6);
      border-radius: 1px;
    }

    .cc-code-digit {
      flex: 1;
      min-width: 0;
      aspect-ratio: 0.65;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'VT323', monospace;
      font-size: var(--tv-lock-digit-size);
      color: rgba(255, 170, 50, 0.35);
      background: #0a0a0a;
      border: 1px inset rgba(0, 0, 0, 0.8);
      text-shadow: none;
    }

    .cc-code-digit.is-filled {
      color: #ffb84a;
      text-shadow: 0 0 6px rgba(255, 160, 40, 0.85);
      box-shadow: inset 0 0 4px rgba(255, 140, 30, 0.25);
    }

    .cc-keypad {
      position: relative;
      z-index: 2;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: var(--tv-lock-gap);
      flex: 1;
    }

    .cc-key {
      font-family: 'VT323', monospace;
      font-size: var(--tv-lock-key-size);
      line-height: 1;
      color: #c8c8c8;
      background: linear-gradient(180deg, #555 0%, #383838 100%);
      border: 1px solid rgba(0, 0, 0, 0.65);
      border-radius: 1px;
      padding: var(--tv-lock-key-pad) 0;
      cursor: pointer;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
      transition: background 0.1s ease, transform 0.1s ease;
    }

    .cc-key:hover {
      background: linear-gradient(180deg, #666 0%, #444 100%);
      color: #fff;
    }

    .cc-key:active {
      background: linear-gradient(180deg, #333 0%, #222 100%);
      transform: scale(0.96);
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .cc-key-clear {
      grid-column: span 3;
      font-size: calc(var(--tv-lock-key-size) * 0.75);
      letter-spacing: 0.08em;
      color: #999;
      padding: 10% 0;
    }

    #cc-hint {
      position: fixed;
      left: 50%;
      bottom: calc(18px + env(safe-area-inset-bottom, 0px));
      transform: translateX(-50%);
      font-family: 'Metal Mania', cursive;
      font-size: clamp(0.82rem, 2.4vw, 1rem);
      letter-spacing: 0.08em;
      color: rgba(255, 255, 255, 0.85);
      text-transform: none;
      pointer-events: none;
      z-index: 50;
      text-align: center;
      padding: 0 16px;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
      display: none;
    }

    #cc-hint.is-visible {
      display: block;
    }


    #cc-back {
      position: fixed;
      top: calc(12px + env(safe-area-inset-top, 0px));
      left: calc(12px + env(safe-area-inset-left, 0px));
      z-index: 50;
      font-family: 'Metal Mania', cursive;
      font-size: 0.95rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #fff;
      text-decoration: none;
      border: 1px solid rgba(255, 255, 255, 0.38);
      border-radius: 0.3rem;
      padding: 0.32rem 0.72rem;
      background: rgba(0, 0, 0, 0.35);
    }

    #cc-skip {
      position: fixed;
      right: calc(12px + env(safe-area-inset-right, 0px));
      bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      z-index: 50;
      font-family: 'Metal Mania', cursive;
      font-size: 0.82rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.65);
      background: rgba(0, 0, 0, 0.45);
      border: 1px solid rgba(255, 255, 255, 0.25);
      border-radius: 0.3rem;
      padding: 0.35rem 0.65rem;
      cursor: pointer;
      display: none;
    }

    #cc-skip.is-visible { display: block; }

    .cc-endgame,
    .cc-victory {
      position: fixed;
      inset: 0;
      z-index: 6000;
      background: #000;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.35s ease, visibility 0.35s ease;
    }

    .cc-endgame.is-active,
    .cc-victory.is-active {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .cc-endgame-video,
    .cc-victory-video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #000;
      display: block;
      transition: opacity 2.6s ease;
    }

    .cc-endgame.is-fading-black .cc-endgame-video {
      opacity: 0;
    }

    .cc-numbers-panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: clamp(10px, 2.2vh, 18px);
      padding: clamp(16px, 4vh, 36px) 16px calc(20px + env(safe-area-inset-bottom, 0px));
      background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 38%, rgba(0, 0, 0, 0.92) 100%);
      pointer-events: auto;
    }

    .cc-numbers-question {
      font-family: 'Metal Mania', cursive;
      font-size: clamp(1rem, 3.4vw, 1.45rem);
      letter-spacing: 0.06em;
      text-transform: none;
      color: rgba(255, 255, 255, 0.92);
      text-align: center;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
    }

    .cc-numbers-fields {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: clamp(8px, 2vw, 14px);
      width: min(100%, 520px);
    }

    .cc-numbers-input {
      width: clamp(62px, 16vw, 88px);
      height: clamp(44px, 9vw, 56px);
      border: 1px solid rgba(255, 255, 255, 0.42);
      border-radius: 0.35rem;
      background: rgba(0, 0, 0, 0.55);
      color: #fff;
      font-family: 'VT323', monospace;
      font-size: clamp(1.45rem, 5vw, 2rem);
      letter-spacing: 0.14em;
      text-align: center;
      outline: none;
      caret-color: #fff;
    }

    .cc-numbers-input:focus {
      border-color: rgba(255, 255, 255, 0.78);
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
    }

    .cc-numbers-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      gap: 12px;
    }

    .cc-numbers-submit {
      font-family: 'Metal Mania', cursive;
      font-size: clamp(0.82rem, 2.4vw, 1rem);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #fff;
      background: rgba(0, 0, 0, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.38);
      border-radius: 0.3rem;
      padding: 0.42rem 1.1rem;
      cursor: pointer;
    }

    .cc-numbers-return {
      font-size: clamp(0.82rem, 2.4vw, 1rem);
      margin-top: 2px;
    }

    .cc-lost-panel {
      position: absolute;
      inset: 0;
      z-index: 3;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: clamp(18px, 4vh, 28px);
      background: #000;
      opacity: 0;
      transition: opacity 2.8s ease;
      pointer-events: none;
    }

    .cc-lost-panel.is-visible {
      opacity: 1;
      pointer-events: auto;
    }

    .cc-lost-title {
      font-family: 'Metal Mania', cursive;
      font-size: clamp(1.6rem, 6vw, 2.6rem);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: #fff;
      text-align: center;
    }

    .cc-return-btn {
      font-family: 'Metal Mania', cursive;
      font-size: clamp(0.95rem, 2.8vw, 1.15rem);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.88);
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.42);
      border-radius: 0.3rem;
      padding: 0.45rem 1.2rem;
      cursor: pointer;
    }

    body.cc-endgame-active #cc-back,
    body.cc-endgame-active #cc-skip,
    body.cc-endgame-active #cc-tv-dial,
    body.cc-endgame-active #cc-tv-scale,
    body.cc-endgame-active #cc-tv-scale-confirm,
    body.cc-endgame-active #cc-tv-panel,
    body.cc-victory-active #cc-back,
    body.cc-victory-active #cc-hint,
    body.cc-victory-active #cc-skip,
    body.cc-victory-active #cc-tv-dial,
    body.cc-victory-active #cc-tv-scale,
    body.cc-victory-active #cc-tv-scale-confirm,
    body.cc-victory-active #cc-tv-panel {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }

    body.cc-endgame-active #cc-hint.is-visible {
      opacity: 1 !important;
      visibility: visible !important;
      display: block !important;
    }

    #cc-rotate-hint {
      position: fixed;
      inset: 0;
      z-index: 5500;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px));
      background: rgba(0, 0, 0, 0.88);
      text-align: center;
    }

    #cc-rotate-hint[hidden] {
      display: none !important;
    }

    .cc-rotate-hint-card {
      max-width: 18rem;
      color: #fff;
    }

    .cc-rotate-hint-icon {
      display: block;
      width: 4.5rem;
      height: 4.5rem;
      margin: 0 auto 1.25rem;
      border: 2px solid rgba(255, 255, 255, 0.55);
      border-radius: 0.65rem;
      position: relative;
      animation: cc-rotate-phone 2.2s ease-in-out infinite;
    }

    .cc-rotate-hint-icon::before {
      content: '';
      position: absolute;
      left: 50%;
      top: 0.45rem;
      width: 1.1rem;
      height: 0.22rem;
      margin-left: -0.55rem;
      border-radius: 0.2rem;
      background: rgba(255, 255, 255, 0.45);
    }

    @keyframes cc-rotate-phone {
      0%, 100% { transform: rotate(0deg); }
      45% { transform: rotate(90deg); }
    }

    .cc-rotate-hint-title {
      font-family: 'Metal Mania', cursive;
      font-size: 1.35rem;
      letter-spacing: 0.05em;
      margin-bottom: 0.65rem;
    }

    .cc-rotate-hint-text {
      font-size: 0.95rem;
      line-height: 1.45;
      color: rgba(255, 255, 255, 0.82);
      margin-bottom: 1.35rem;
    }

    #cc-rotate-dismiss {
      font-family: 'Metal Mania', cursive;
      font-size: 0.9rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 0.35rem;
      padding: 0.55rem 1.1rem;
      cursor: pointer;
      touch-action: manipulation;
    }

    @media (min-aspect-ratio: 1/1), (pointer: fine) {
      #cc-rotate-hint { display: none !important; }
    }

    #cc-fullscreen-hint {
      position: fixed;
      inset: 0;
      z-index: 5700;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: max(16px, env(safe-area-inset-top, 0px)) 18px max(16px, env(safe-area-inset-bottom, 0px));
      background: rgba(0, 0, 0, 0.9);
      text-align: center;
    }

    #cc-fullscreen-hint[hidden] {
      display: none !important;
    }

    .cc-fullscreen-hint-card {
      max-width: 20rem;
      color: #fff;
    }

    .cc-fullscreen-hint-icon {
      display: block;
      width: 3.6rem;
      height: 2.2rem;
      margin: 0 auto 1.1rem;
      border: 2px solid rgba(255, 255, 255, 0.45);
      border-radius: 0.35rem;
      position: relative;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .cc-fullscreen-hint-icon::before {
      content: '';
      position: absolute;
      left: 0.35rem;
      right: 0.35rem;
      top: 0.32rem;
      height: 0.38rem;
      border-radius: 0.12rem;
      background: rgba(255, 255, 255, 0.22);
    }

    .cc-fullscreen-hint-title {
      font-family: 'Metal Mania', cursive;
      font-size: 1.3rem;
      letter-spacing: 0.05em;
      margin-bottom: 0.6rem;
    }

    .cc-fullscreen-hint-android,
    .cc-fullscreen-hint-ios {
      font-size: 0.9rem;
      line-height: 1.45;
      margin-bottom: 1.1rem;
    }

    .cc-fullscreen-hint-android {
      color: rgba(255, 255, 255, 0.82);
    }

    .cc-fullscreen-hint-ios {
      display: none;
      color: rgba(200, 220, 255, 0.9);
      padding: 0.6rem 0.7rem;
      border-radius: 0.35rem;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.14);
    }

    body.cc-fullscreen-ios .cc-fullscreen-hint-android,
    body.cc-fullscreen-ios #cc-fullscreen-enter,
    body.cc-fullscreen-ios #cc-fullscreen-btn {
      display: none !important;
    }

    body.cc-fullscreen-ios .cc-fullscreen-hint-ios {
      display: block;
    }

    #cc-fullscreen-enter,
    #cc-fullscreen-dismiss {
      font-family: 'Metal Mania', cursive;
      font-size: 0.88rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #fff;
      border-radius: 0.35rem;
      padding: 0.55rem 1rem;
      cursor: pointer;
      touch-action: manipulation;
    }

    #cc-fullscreen-enter {
      display: block;
      width: 100%;
      margin-bottom: 0.55rem;
      background: rgba(90, 170, 180, 0.35);
      border: 1px solid rgba(120, 210, 220, 0.55);
    }

    #cc-fullscreen-dismiss {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.28);
      color: rgba(255, 255, 255, 0.72);
    }

    #cc-fullscreen-btn {
      position: fixed;
      z-index: 5400;
      right: calc(10px + env(safe-area-inset-right, 0px));
      top: calc(10px + env(safe-area-inset-top, 0px));
      width: 2.35rem;
      height: 2.35rem;
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 0.4rem;
      background: rgba(0, 0, 0, 0.55);
      color: #fff;
      font-size: 1.15rem;
      line-height: 1;
      cursor: pointer;
      touch-action: manipulation;
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }

    #cc-fullscreen-btn[hidden] {
      display: none !important;
    }

    @media (display-mode: standalone), (display-mode: fullscreen) {
      #cc-fullscreen-hint,
      #cc-fullscreen-btn { display: none !important; }
    }

    @media (max-aspect-ratio: 1/1), (pointer: fine) {
      #cc-fullscreen-hint,
      #cc-fullscreen-btn { display: none !important; }
    }

    body.cc-is-fullscreen #cc-fullscreen-hint,
    body.cc-is-fullscreen #cc-fullscreen-btn {
      display: none !important;
    }

    body.cc-mobile-chrome #cc-root {
      left: var(--cc-vv-left, 50%);
      top: var(--cc-vv-top, 50%);
      width: var(--cc-vv-stage-w, min(100dvw, 177.7778dvh));
      height: var(--cc-vv-stage-h, min(100dvh, 56.25dvw));
    }


/* ══ PORTRAIT MOBILE ONLY (9:16) ═══════════════════════════════════════
   Landscape / desktop: unchanged 16:9 stage + original art + original %.
   Portrait: full-bleed 9:16 stage + world-mobile art (sharp 16:9 plate
   centered, soft blurred extension top/bottom). Hotspot Y/%height are
   remapped in JS so door/lock stay ON the plate — never offset.
   ════════════════════════════════════════════════════════════════════ */
body.cc-stage-portrait #cc-root {
  width: min(100vw, 56.25vh);
  height: min(100vh, 177.7778vw);
  width: min(100dvw, 56.25dvh);
  height: min(100dvh, 177.7778dvw);
}

body.cc-stage-portrait.cc-mobile-chrome #cc-root {
  width: var(--cc-vv-stage-w, min(100dvw, 56.25dvh));
  height: var(--cc-vv-stage-h, min(100dvh, 177.7778dvw));
}

/* Fill stage 1:1 with 9:16 art (no crop of the content plate) */
body.cc-stage-portrait .cc-scene img,
body.cc-stage-portrait .cc-scene-portal .cc-scene-bg,
body.cc-stage-portrait .cc-scene-portal .cc-portal-overlay,
body.cc-stage-portrait .cc-film-stage .cc-film-overlay {
  object-fit: fill;
  object-position: center center;
}

/* Portrait already fills the phone — no “rotate” blocker */
body.cc-stage-portrait #cc-rotate-hint {
  display: none !important;
}

/* Never scale the control bundle in portrait: would leave the room art behind */
body.cc-stage-portrait.cc-tv-controls-expanded .cc-tv-controls-bundle.is-visible.is-mobile-scalable {
  transform: none !important;
}
