:root { --vh: 1vh; --vw: 1vw; }

    :root {
      --bg: #050505;
      --ink: #f4f1ea;
      --muted: rgba(244, 241, 234, 0.72);
      --pink: #fe00c1;
      --hairline: rgba(244, 241, 234, 0.14);
    }

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

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000000;
      color: var(--ink);
      font-family: 'Courier Prime', ui-monospace, monospace;
      user-select: none;
    }

    body.idle { cursor: none; }

    /* The canvas is sized and (for a TV mounted on its side) rotated by display.js, which also
       sets --vh/--vw to 1% of the canvas height/width so every size below follows the rotation. */
    .canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: var(--cw, 100vw);
      height: var(--ch, 100vh);
      transform-origin: 0 0;
      transform: var(--ct, none);
      overflow: hidden;
      background: var(--bg);
      display: flex;
      flex-direction: column;
    }

    .canvas.framed {
      outline: 1px solid var(--hairline);
    }

    /* Discrete hover controls — anchored bottom-right so they never cover the logo */
    .controls {
      position: absolute;
      bottom: 14px;
      right: 14px;
      z-index: 40;
      display: flex;
      gap: 6px;
      background: rgba(5, 5, 5, 0.92);
      padding: 5px 8px;
      border: 1px solid var(--hairline);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    body:not(.idle) .controls {
      opacity: 1;
      pointer-events: auto;
    }

    .ctrl-btn {
      background: transparent;
      border: 1px solid var(--hairline);
      color: var(--ink);
      padding: 4px 10px;
      font-family: 'Courier Prime', monospace;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      cursor: pointer;
      text-decoration: none;
    }

    .ctrl-btn:hover { border-color: var(--pink); color: var(--pink); }

    /* ============================================================
       DEDICATED TOP BAR (Never overlaps posters/photos)
       ============================================================ */
    .topbar {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: calc(1.3 * var(--vh)) 4%;
      background: #050505;
      border-bottom: 1px solid var(--hairline);
      z-index: 10;
    }

    .mode-landscape .topbar {
      padding: calc(1.8 * var(--vh)) calc(3.5 * var(--vw));
    }

    .topbar img {
      height: clamp(18px, calc(2.5 * var(--vh)), 28px);
      width: auto;
      display: block;
    }

    .clock {
      text-align: right;
      line-height: 1.2;
      font-variant-numeric: tabular-nums;
    }

    .clock-time {
      font-size: clamp(0.85rem, calc(1.7 * var(--vh)), 1.2rem);
      font-weight: 600;
      letter-spacing: 0.06em;
      color: var(--ink);
    }

    .clock-date {
      font-size: clamp(0.6rem, calc(1.05 * var(--vh)), 0.78rem);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }

    /* ============================================================
       MAIN BODY AREA (Below Top Bar)
       ============================================================ */
    .body-area {
      position: relative;
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    /* PORTRAIT: Edge-to-edge poster above, compact UATG/Chromolume editorial below */
    .mode-portrait .media-stage {
      position: relative;
      flex: 1;
      min-height: 0;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #050505;
      overflow: hidden;
      transition: opacity 0.4s ease;
    }

    .mode-portrait .media-stage img {
      position: relative;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 20%;
      display: block;
    }

    .mode-portrait .media-stage video {
      width: 100%;
      height: 100%;
      border: 0;
      object-fit: cover;
      background: #000;
    }

    .mode-portrait .media-stage iframe {
      width: 134%;
      height: 134%;
      flex-shrink: 0;
      border: 0;
      background: #000;
    }

    .media-stage iframe {
      pointer-events: none;
    }

    .stage-layer {
      position: absolute !important;
      inset: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      transition: opacity 2.2s ease-in-out;
    }

    .stage-layer.is-hidden {
      opacity: 0;
      pointer-events: none;
    }

    .mode-portrait .editorial-band {
      flex-shrink: 0;
      padding: calc(1.5 * var(--vh)) 4% calc(2 * var(--vh));
      border-top: 1px solid var(--hairline);
      background: #050505;
      display: flex;
      flex-direction: row;
      align-items: flex-end;
      justify-content: space-between;
      gap: 1rem;
      transition: opacity 0.4s ease;
    }

    .qr-box {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    .qr-box img {
      width: clamp(54px, calc(7.2 * var(--vh)), 84px);
      height: clamp(54px, calc(7.2 * var(--vh)), 84px);
      display: block;
    }

    .qr-label {
      font-size: clamp(0.55rem, calc(0.95 * var(--vh)), 0.7rem);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--muted);
    }

    /* LANDSCAPE: Full-bleed photography / trailer or blurred backdrop + poster */
    .mode-landscape .media-stage {
      position: absolute;
      inset: 0;
      z-index: 0;
      overflow: hidden;
    }

    .mode-landscape .media-stage img,
    .mode-landscape .media-stage video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 22%;
      animation: kenburns 22s ease-in-out infinite alternate;
    }

    .mode-landscape .media-stage video { animation: none; }
    .mode-landscape .media-stage iframe { width: 100%; height: 100%; border: 0; }

    .mode-landscape .media-stage.is-blurred img {
      filter: blur(44px) brightness(0.28);
      transform: scale(1.15);
      animation: none;
    }

    .mode-landscape .l-scrim {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background:
        linear-gradient(90deg, rgba(5, 5, 5, 0.88) 0%, rgba(5, 5, 5, 0.48) 46%, rgba(5, 5, 5, 0.12) 100%),
        linear-gradient(180deg, rgba(5, 5, 5, 0.15) 0%, rgba(5, 5, 5, 0.88) 100%);
    }

    .mode-portrait .l-scrim { display: none; }

    .mode-landscape .editorial-band {
      position: relative;
      z-index: 2;
      flex: 1;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: calc(4 * var(--vw));
      padding: 0 calc(3.5 * var(--vw)) calc(4.5 * var(--vh));
      transition: opacity 0.4s ease;
    }

    .l-editorial-col {
      max-width: 60ch;
      display: flex;
      flex-direction: column;
      gap: calc(1.1 * var(--vh));
    }

    .l-poster-right {
      display: none;
    }

    .mode-landscape .l-poster-right.active {
      display: block;
      height: calc(68 * var(--vh));
      flex-shrink: 0;
    }

    .mode-landscape .l-poster-right img {
      display: block;
      height: 100%;
      width: auto;
      object-fit: contain;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    }

    @keyframes kenburns {
      0% { transform: scale(1); }
      100% { transform: scale(1.06); }
    }

    .fading { opacity: 0; }

    /* ============================================================
       TYPOGRAPHY: Barlow Condensed + Courier Prime + Poppins (UATG × Chromolume)
       ============================================================ */
    .show-title {
      font-family: 'Barlow Condensed', sans-serif;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.01em;
      line-height: 0.96;
      color: var(--ink);
      font-size: clamp(2rem, calc(5.6 * var(--vh)), 4.6rem);
    }

    .mode-portrait .show-title {
      font-size: clamp(1.8rem, calc(4 * var(--vh)), 2.9rem);
    }

    .meta-line {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      font-size: clamp(0.72rem, calc(1.3 * var(--vh)), 0.95rem);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .meta-dates {
      color: var(--ink);
      font-weight: 700;
    }

    .meta-slash {
      color: var(--pink);
      font-weight: 700;
    }

    .quote-block {
      margin-top: calc(0.5 * var(--vh));
      display: flex;
      flex-direction: column;
      gap: calc(0.3 * var(--vh));
      transition: opacity 0.25s ease;
    }

    .quote-text {
      font-family: 'Poppins', sans-serif;
      font-style: italic;
      font-weight: 400;
      font-size: clamp(1rem, calc(2.2 * var(--vh)), 1.7rem);
      line-height: 1.25;
      color: var(--ink);
    }

    .mode-portrait .quote-text {
      font-size: clamp(0.95rem, calc(1.85 * var(--vh)), 1.35rem);
    }

    .quote-mark {
      color: var(--pink);
      font-style: normal;
    }

    .quote-source {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: clamp(0.62rem, calc(1.1 * var(--vh)), 0.8rem);
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .quote-stars {
      color: var(--pink);
      letter-spacing: 0.12em;
      font-size: clamp(0.75rem, calc(1.3 * var(--vh)), 0.95rem);
    }

    /* Hairline progress */
    .progress-line {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: rgba(255, 255, 255, 0.08);
      z-index: 20;
    }

    .progress-fill {
      height: 100%;
      width: 0%;
      background: var(--pink);
    }
  