  :root{
    --bg: #07080b;
    --bg-raised: #11131a;
    --velvet: #E50914;
    --marquee: #FF4D5A;
    --marquee-bright: #FF7A84;
    --cream: #F2EFE9;
    --cream-dim: #9BA1AE;
    --teal: #223341;
    --teal-light: #2B3A45;
    --line: rgba(242,239,233,0.12);
    --blush: #F2A6C6;
    --mint: #65B891;
    --lilac: #8E7CC3;
    --sky: #63A4FF;
    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 10px;
    --ease-bounce: cubic-bezier(.34,1.56,.64,1);
    --ease-smooth: cubic-bezier(.22,.85,.35,1);
    --shadow-glow: 0 10px 30px -12px rgba(232,163,61,0.35);
    --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
    --body: 'Inter', system-ui, sans-serif;
    --chat-font: 'Quicksand', 'Baloo 2', 'Inter', system-ui, sans-serif;
    --chat-display: 'Baloo 2', 'Quicksand', var(--display);
    /* Real color-emoji fonts appended last so 😂🔥❤️ etc. always render as
       full-color glyphs instead of empty boxes, no matter what the primary
       font stack above is. */
    --emoji-font: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  }
  *{ box-sizing:border-box; }
  html,body{ margin:0; padding:0; }
  *{ scroll-behavior:smooth; }
  /* ---------- iPhone / iOS Safari fit ---------- */
  html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; height:-webkit-fill-available; }
  html, body{ overscroll-behavior-y:none; }
  body{ min-height:100vh; min-height:100dvh; -webkit-font-smoothing:antialiased; }
  button, .icon-btn, .btn, .copy-btn, .leave-btn, .tab, .sticker-grid button, .speed-grid button, .reaction-chip{
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
  }
  input, textarea{ -webkit-tap-highlight-color: transparent; }
  /* iOS Safari zooms the page in if a focused input's font-size is under 16px —
     force 16px on any text input while a touch/coarse pointer is the primary input. */
  @media (pointer:coarse){
    input[type=text], input[type=url], input[type=search], .chat-foot input{ font-size:16px !important; }
  }
  /* Buttons/inputs don't inherit font-family by default in most browsers —
     without this reset they fall back to the OS UI font, which is where
     emoji glyphs were breaking (stickers, reaction chips, emoji pickers). */
  button, input, textarea, select{
    font-family: var(--body), var(--emoji-font);
  }
  html.booting .app{ visibility:hidden; }
  body{
    background:
      radial-gradient(ellipse 900px 500px at 15% -10%, rgba(196,69,61,0.18), transparent 60%),
      radial-gradient(ellipse 900px 600px at 100% 0%, rgba(232,163,61,0.12), transparent 55%),
      radial-gradient(ellipse 700px 500px at 50% 110%, rgba(142,124,195,0.10), transparent 60%),
      var(--bg);
    color: var(--cream);
    font-family: var(--body), var(--emoji-font);
    min-height: 100vh;
    background-attachment: fixed;
  }
  .app{
    max-width: 1180px; margin: 0 auto; position:relative;
    padding: calc(28px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) calc(60px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
  }
  a{ color: var(--marquee-bright); }
  button{ transition: transform .18s var(--ease-bounce), filter .15s, background .15s, border-color .15s, box-shadow .2s, opacity .15s; }
  input, textarea{ transition: border-color .18s, box-shadow .18s; }


  /* ---------- screen switching ---------- */
  .screen{ display:none; }
  .screen.active{ display:block; animation: screen-in .4s var(--ease-smooth); }
  @keyframes screen-in{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }

  .cards{ display:grid; grid-template-columns: 1fr 1fr; gap: 22px; position:relative; z-index:1; }
  @media (max-width: 800px){ .cards{ grid-template-columns: 1fr; } }

  .ticket{
    position: relative;
    background: linear-gradient(165deg, var(--bg-raised), rgba(18,22,31,0.88));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 26px 26px;
    overflow: hidden;
    box-shadow: 0 20px 50px -30px rgba(0,0,0,0.6);
    transition: transform .3s var(--ease-smooth), box-shadow .3s var(--ease-smooth), border-color .3s;
  }
  .ticket:hover{
    transform: translateY(-3px);
    border-color: rgba(232,163,61,0.35);
    box-shadow: 0 26px 60px -28px rgba(0,0,0,0.65), var(--shadow-glow);
  }
  .ticket::before{
    content:"";
    position:absolute; top:0; bottom:0; right: -1px; width: 1px;
    background-image: radial-gradient(circle, var(--bg) 3px, transparent 3.2px);
    background-size: 1px 16px;
    background-repeat: repeat-y;
  }
  .ticket-eyebrow{
    font-family: var(--display); letter-spacing: 2px; font-size: 13px;
    color: var(--marquee); text-transform: uppercase; margin-bottom: 6px;
  }
  .ticket h2{ font-family: var(--display); font-size: 28px; letter-spacing:.5px; margin: 0 0 6px; }
  .ticket .sub{ color: var(--cream-dim); font-size: 13.5px; margin-bottom: 20px; line-height:1.5; }

  label{ display:block; font-size: 12.5px; color: var(--cream-dim); margin: 14px 0 6px; font-weight:600; letter-spacing:.02em; }
  input[type=text], input[type=url]{
    width:100%; background: var(--input-bg); border: 1px solid var(--line); color: var(--cream);
    padding: 12px 13px; border-radius: var(--radius-sm); font-family: var(--body); font-size: 14.5px;
    outline: none;
  }
  input[type=text]:focus, input[type=url]:focus{ border-color: var(--marquee); box-shadow: 0 0 0 3px rgba(232,163,61,0.15); }
  input[type=text]::placeholder, input[type=url]::placeholder{ color: #5b6270; }

  .tabs{ display:flex; gap:6px; background:var(--input-bg); padding:4px; border-radius: 9px; border:1px solid var(--line); }
  .tab{
    flex:1; text-align:center; padding: 8px 6px; border-radius:7px; font-size: 13px; font-weight:600;
    color: var(--cream-dim); cursor:pointer; user-select:none; transition: all .15s;
  }
  .tab.active{ background: var(--teal-light); color: var(--cream); }

  .filepick{
    margin-top: 10px; border: 1px dashed var(--line); border-radius: 9px; padding: 16px;
    text-align:center; cursor:pointer; font-size: 13px; color: var(--cream-dim); transition: border-color .15s, background .15s;
  }
  .filepick:hover{ border-color: var(--marquee); background: rgba(232,163,61,0.04); }
  .filepick strong{ color: var(--cream); }

  .code-input{
    font-family: var(--display); font-size: 30px; letter-spacing: 8px; text-align:center;
    text-transform:uppercase; padding: 14px 10px;
  }

  .btn{
    appearance:none; border:none; cursor:pointer; font-family: var(--body); font-weight:700;
    font-size: 14.5px; padding: 14px 20px; border-radius: 999px; width:100%; margin-top: 18px;
    transition: transform .18s var(--ease-bounce), filter .12s, box-shadow .2s; letter-spacing:.01em;
  }
  .btn:hover{ transform: translateY(-2px); }
  .btn:active{ transform: scale(0.97); }
  .btn-primary{ background: linear-gradient(120deg, var(--velvet), #a83730); color: #fff; box-shadow: 0 10px 24px -8px rgba(196,69,61,.7); }
  .btn-primary:hover{ filter: brightness(1.08); box-shadow: 0 14px 30px -8px rgba(196,69,61,.8); }
  .btn-secondary{ background: linear-gradient(120deg, var(--marquee-bright), var(--marquee)); color: #fff; box-shadow: 0 10px 24px -8px rgba(232,163,61,.6); }
  .btn-secondary:hover{ filter: brightness(1.05); box-shadow: 0 14px 30px -8px rgba(232,163,61,.7); }
  .btn:disabled{ opacity:.45; cursor:not-allowed; filter:none; transform:none; }

  .hint-error{ color: #ef8b84; font-size: 12.5px; margin-top: 8px; min-height: 16px; }

  .howrow{ display:flex; gap:16px; margin-top:40px; flex-wrap:wrap; position:relative; z-index:1; }
  .howcell{ flex:1; min-width: 220px; padding:18px 16px; border-top:1px solid var(--line); border-radius: var(--radius-sm); transition: background .2s; }
  .howcell:hover{ background: rgba(242,239,233,0.03); }
  .howcell .num{ font-family: var(--display); color: var(--marquee); font-size:13px; letter-spacing:2px; }
  .howcell p{ margin:6px 0 0; font-size: 13.5px; color: var(--cream-dim); line-height:1.5; }

  /* ================= ROOM ================= */
  .room-top{ display:flex; align-items:center; justify-content:space-between; gap: 16px; flex-wrap:wrap; margin-bottom: 20px; }
  .code-chip{
    display:flex; align-items:center; gap: 10px; background: var(--bg-raised);
    border:1px solid var(--line); padding: 9px 10px 9px 16px; border-radius: 999px;
    flex-wrap: wrap; box-shadow: 0 8px 24px -16px rgba(0,0,0,0.5);
  }
  .code-chip .lbl{ font-size:11px; color: var(--cream-dim); letter-spacing:1px; text-transform:uppercase; }
  .code-chip .val{ font-family: var(--display); font-size:20px; letter-spacing:4px; color: var(--marquee-bright); }
  .copy-btn{
    background: var(--teal-light); border:1px solid var(--line); color: var(--cream); font-size:12px;
    padding: 7px 12px; border-radius:999px; cursor:pointer; font-weight:600;
  }
  .copy-btn:hover{ background: var(--teal); transform: translateY(-1px); }
  .copy-btn-ghost{ background:transparent; border-color: rgba(232,163,61,0.35); color: var(--marquee-bright); }
  .copy-btn-ghost:hover{ background: rgba(232,163,61,0.12); }
  .leave-btn{ background:none; border:1px solid var(--line); color:var(--cream-dim); font-size:12.5px; padding:10px 16px; border-radius:999px; cursor:pointer; }
  .leave-btn:hover{ color: var(--cream); border-color: var(--velvet); background: rgba(196,69,61,0.1); transform: translateY(-1px); }

  .room-grid{ display:grid; grid-template-columns: 1fr 320px; gap: 20px; align-items:start; }
  @media (max-width: 900px){ .room-grid{ grid-template-columns: 1fr; } }

  .screen-frame{
    position: relative;
    background: #000; border-radius: var(--radius-lg); overflow:hidden; border:1px solid var(--line);
    box-shadow: 0 24px 70px -24px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.03) inset;
  }
  .screen-frame video{ width:100%; display:block; max-height: 62vh; background:#000; cursor:pointer; filter: brightness(1); }

  .controls{ background: var(--bg-raised); border:1px solid var(--line); border-top:none; border-radius:0 0 var(--radius-lg) var(--radius-lg); padding: 14px 18px 18px; }
  .seek-row{ display:flex; align-items:center; gap:10px; }
  input[type=range]{
    flex:1; accent-color: var(--marquee); height: 5px; border-radius: 999px; cursor:pointer;
    -webkit-appearance:none; appearance:none; background: var(--teal-light); touch-action: pan-x;
  }
  input[type=range]::-webkit-slider-runnable-track{ height:5px; border-radius:999px; background:transparent; }
  input[type=range]::-webkit-slider-thumb{
    -webkit-appearance:none; appearance:none; width:16px; height:16px; border-radius:50%;
    background: var(--marquee); margin-top:-5.5px; box-shadow: 0 2px 6px -1px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.25);
  }
  input[type=range]::-moz-range-track{ height:5px; border-radius:999px; background: var(--teal-light); }
  input[type=range]::-moz-range-thumb{
    width:16px; height:16px; border-radius:50%; background: var(--marquee); border: 2px solid rgba(255,255,255,0.25);
  }
  @media (max-width: 760px){
    input[type=range]::-webkit-slider-thumb{ width:20px; height:20px; margin-top:-7.5px; }
    input[type=range]::-moz-range-thumb{ width:20px; height:20px; }
  }
  .time{ font-size:12px; color: var(--cream-dim); font-variant-numeric: tabular-nums; min-width:38px; }
  .ctl-row{ display:flex; align-items:center; gap:8px; margin-top:12px; flex-wrap:wrap; row-gap:10px; }
  .ctl-row .sync-note{ order:99; }
  .icon-btn{
    background: var(--teal-light); border:1px solid var(--line); color:var(--cream); width:38px; height:38px;
    border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
    position:relative;
  }
  .icon-btn:hover{ background: var(--teal); transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 18px -10px rgba(0,0,0,0.6); }
  .icon-btn:active{ transform: scale(0.94); }
  .icon-btn svg{ width:16px; height:16px; }
  .icon-btn.on{ box-shadow: 0 0 0 2px rgba(196,69,61,0.35); }
  .security-btn{
    background: #C4453D; border-color: #C4453D; color:#fff;
  }
  .security-btn:hover{ background:#a8362f; box-shadow: 0 8px 18px -8px rgba(196,69,61,0.7); }
  .security-btn:active{ transform: scale(0.94); }

  #security-overlay{
    display:none; position:fixed; inset:0; background:#000; z-index:2000;
  }
  html.security-blackout, body.security-blackout{ overflow:hidden; }
  body.security-blackout #security-overlay{ display:block; }

  .speed-btn span{ font-family: var(--display); font-size:12.5px; letter-spacing:.5px; }
  .kbd-btn{ font-family: var(--chat-display); font-weight:700; font-size:14px; }
  .sync-note{ font-size:11.5px; color:var(--cream-dim); margin-left:auto; display:flex; align-items:center; gap:7px; }
  .sync-dot{
    width:7px; height:7px; border-radius:50%; background: var(--mint); flex-shrink:0;
    box-shadow: 0 0 0 3px rgba(101,184,145,0.18);
    animation: sync-pulse 2s ease-in-out infinite;
  }
  @keyframes sync-pulse{ 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.55; transform:scale(.8); } }

  .count-badge{
    position:absolute; top:-5px; right:-5px; min-width:16px; height:16px; padding:0 3px;
    border-radius:999px; background: var(--velvet); color:#fff; font-size:10px; font-weight:700;
    display:flex; align-items:center; justify-content:center; box-shadow: 0 0 0 2px var(--bg-raised);
    font-family: var(--body);
  }
  #participants-btn .count-badge{ background: var(--mint); }

  .speed-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; width: 190px; }
  .speed-grid button{
    appearance:none; border:1px solid var(--line); background: var(--teal-light); color: var(--cream-dim);
    font-family: var(--body); font-weight:700; font-size:12.5px; padding:7px 4px; border-radius:9px; cursor:pointer;
  }
  .speed-grid button:hover{ background: var(--teal); color: var(--cream); }
  .speed-grid button.active{ background: var(--marquee); color:#fff; border-color: transparent; }

  .participants-popover{ width:200px; max-height:220px; overflow-y:auto; }
  .participants-list{ display:flex; flex-direction:column; gap:8px; }
  .participant-row{ display:flex; align-items:center; gap:9px; font-size:13px; font-family: var(--chat-font); }
  .participant-dot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
  .participant-name{ display:flex; align-items:center; gap:1px; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .participants-empty{ font-size:12.5px; color: var(--cream-dim); }

  /* ---------- verified tick / admin badge ---------- */
  .verified-badge{ display:inline-flex; flex-shrink:0; margin-left:3px; vertical-align:-2px; }
  .verified-badge svg{ width:14px; height:14px; }
  .admin-badge{
    display:inline-flex; align-items:center; flex-shrink:0; margin-left:5px; padding:1px 6px 2px;
    border-radius:999px; font-family: var(--body); font-size:9.5px; font-weight:800; letter-spacing:.04em;
    background: linear-gradient(120deg, var(--marquee-bright), var(--marquee)); color:#fff;
  }
  .msg .who .verified-badge svg, .msg .who .admin-badge{ transform: translateY(1px); }

  /* ---------- code word box ---------- */
  .code-popover{ width:190px; }
  .code-popover input[type=text]{
    width:100%; background: var(--teal); border:1px solid var(--line); border-radius:9px; color:var(--cream);
    font-family: var(--body); font-size:13px; padding:9px 10px; outline:none; margin-bottom:8px;
  }
  .code-popover input[type=text]:focus{ border-color: var(--sky); }
  .code-submit-btn{
    width:100%; appearance:none; border:none; border-radius:9px; padding:8px 4px; cursor:pointer;
    background: linear-gradient(120deg, var(--marquee-bright), var(--marquee)); color:#fff;
    font-family: var(--body); font-weight:800; font-size:12.5px;
  }
  .code-submit-btn:hover{ filter:brightness(1.06); }
  .code-feedback{ font-size:11.5px; color: var(--cream-dim); margin-top:8px; text-align:center; min-height:14px; }
  .code-feedback.ok{ color: var(--mint); }
  .code-feedback.err{ color: var(--velvet); }

  /* ---------- admin popover ---------- */
  .admin-popover{ width:240px; }
  .ai-mode-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; }
  .ai-mode-grid button{
    appearance:none; border:1px solid var(--line); background: var(--teal-light); color: var(--cream-dim);
    font-family: var(--body); font-weight:700; font-size:11px; padding:7px 3px; border-radius:9px; cursor:pointer;
  }
  .ai-mode-grid button:hover{ background: var(--teal); color: var(--cream); }
  .ai-mode-grid button.active{ background: var(--marquee); color:#fff; border-color: transparent; }
  .admin-popover textarea{
    width:100%; resize:vertical; min-height:56px; background: var(--teal); border:1px solid var(--line);
    border-radius:9px; color:var(--cream); font-family: var(--body); font-size:12.5px; padding:8px 10px;
    outline:none; margin-bottom:8px;
  }
  .admin-popover textarea:focus{ border-color: var(--sky); }
  .admin-kick-list{ display:flex; flex-direction:column; gap:7px; max-height:150px; overflow-y:auto; }
  .admin-kick-row{ display:flex; align-items:center; gap:8px; font-size:12.5px; font-family: var(--chat-font); }
  .admin-kick-row .participant-name{ flex:1; }
  .kick-btn{
    appearance:none; border:1px solid rgba(196,69,61,0.5); background: rgba(196,69,61,0.15); color: var(--velvet);
    font-family: var(--body); font-weight:800; font-size:10.5px; letter-spacing:.03em; padding:4px 8px; border-radius:7px;
    cursor:pointer; flex-shrink:0;
  }
  .kick-btn:hover{ background: var(--velvet); color:#fff; }
  .admin-kick-empty{ font-size:12px; color: var(--cream-dim); }

  .kbd-popover{ width:210px; }
  .kbd-row{ display:flex; align-items:center; gap:8px; font-size:12.5px; color: var(--cream-dim); padding:4px 0; }
  .kbd-row span{ margin-left:2px; }
  kbd{
    background: var(--teal-light); border:1px solid var(--line); border-radius:5px; padding:2px 6px;
    font-family: var(--body); font-size:11px; color: var(--cream); box-shadow: 0 1px 0 var(--line);
  }

  .chat-panel{
    background: var(--bg-raised); border:1px solid var(--line); border-radius: var(--radius-lg);
    display:flex; flex-direction:column; height: 62vh; min-height: 420px;
    box-shadow: 0 20px 60px -30px rgba(0,0,0,0.6);
  }
  .chat-head{ padding: 15px 16px; border-bottom:1px solid var(--line); font-family: var(--display); letter-spacing:1px; font-size:16px; display:flex; align-items:center; justify-content:space-between; }
  #chat-close-btn{ display:none; width:32px; height:32px; }
  .chat-body{ flex:1; overflow-y:auto; padding: 14px; display:flex; flex-direction:column; gap:10px; scroll-behavior:smooth; }
  .msg{ max-width: 86%; animation: msg-in .25s var(--ease-smooth); }
  @keyframes msg-in{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }
  .msg .who{ font-size:11px; color: var(--marquee); font-weight:700; margin-bottom:2px; }
  .msg .bubble{ background: var(--teal-light); padding: 9px 12px; border-radius: 14px; font-size:13.5px; line-height:1.4; }
  .msg.me{ align-self:flex-end; }
  .msg.me .who{ color: var(--cream-dim); text-align:right; }
  .msg.me .bubble{ background: var(--velvet); }
  .msg.sys{ align-self:center; font-size:11.5px; color:var(--cream-dim); background:none; text-align:center; }
  .msg-reactions{ display:flex; gap:4px; margin-top:4px; flex-wrap:wrap; }
  .msg.me .msg-reactions{ justify-content:flex-end; }
  .reaction-chip{
    appearance:none; border:1px solid var(--line); background: var(--bg-raised); color:var(--cream-dim);
    border-radius:999px; padding:2px 7px; font-size:12px; cursor:pointer; display:flex; align-items:center; gap:4px;
    transition: background .12s, border-color .12s; opacity:.6;
  }
  .reaction-chip:hover{ opacity:1; border-color: var(--marquee); }
  .reaction-chip .c{ font-size:11px; font-variant-numeric:tabular-nums; min-width:2px; }
  .reaction-chip .c:empty{ display:none; }
  .reaction-chip.mine{ opacity:1; background: rgba(232,163,61,0.18); border-color: var(--marquee); color: var(--marquee-bright); }
  .chat-foot{ padding: 12px; border-top:1px solid var(--line); display:flex; gap:8px; align-items:center; }
  .chat-foot input{ flex:1; border-radius: 999px; }
  #chat-emoji-btn{ font-size:18px; flex-shrink:0; }
  #chat-emoji-popover .sticker-grid{ width:220px; }
  .send-btn{
    background: linear-gradient(120deg, var(--marquee-bright), var(--marquee)); border:none; color:#fff;
    font-weight:700; padding:0 18px; border-radius:999px; cursor:pointer; font-size:13px; flex-shrink:0;
    height:38px; box-shadow: 0 8px 18px -10px rgba(232,163,61,0.6);
  }
  .send-btn:hover{ filter:brightness(1.06); transform: translateY(-1px); }
  .send-btn:active{ transform: scale(0.95); }

  /* ================= ON-SCREEN (VIRTUAL) KEYBOARD ================= */
  /* A compact, semi-transparent keyboard that sits below the chat box,
     toggled from #vkbd-toggle-btn. While it's open the real chat input
     gets inputmode="none", so the device's own keyboard never pops up —
     that's the point: on a tablet like iPad the native keyboard is huge
     and swallows a big chunk of the screen, this panel only takes the
     little bit of room it actually needs. */
  #vkbd-toggle-btn.on{ background: var(--marquee); color:#fff; border-color:transparent; }
  .vkbd{
    display:flex; flex-direction:column; gap:6px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(18,22,31,0.55);
    -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
    flex-shrink: 0;
  }
  .vkbd[hidden]{ display:none; }
  .vkbd-row{ display:flex; gap:5px; }
  .vkbd-key{
    appearance:none; border:1px solid var(--line); background: rgba(242,239,233,0.07); color: var(--cream);
    border-radius:8px; font-family: var(--body), var(--emoji-font); font-size:14px; font-weight:600;
    min-width:0; flex:1; height:38px; display:flex; align-items:center; justify-content:center;
    cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation;
    -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
    transition: background .1s, transform .1s;
  }
  .vkbd-key:hover{ background: rgba(242,239,233,0.12); }
  .vkbd-key:active{ background: var(--teal); transform: scale(0.94); }
  .vkbd-key.vkbd-func{ background: rgba(242,239,233,0.03); color: var(--cream-dim); font-size:12px; flex:1.3; }
  .vkbd-key.active{ background: var(--marquee); color:#fff; border-color:transparent; }
  .vkbd-key.vkbd-space{ flex:5; }
  .vkbd-key.vkbd-enter{ flex:1.6; background: linear-gradient(120deg, var(--marquee-bright), var(--marquee)); color:#fff; border:none; }

  /* keep the see-through look consistent in floating/see-through chat mode too */
  #screen-room.chat-floating .vkbd{
    background: rgba(8,10,14,0.55) !important; border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,0.14) !important; border-top:none !important;
    margin-top:6px; pointer-events:auto;
  }

  @media (max-width: 1024px) and (pointer: coarse){
    .vkbd-key{ height:42px; font-size:15.5px; }
  }

  ::-webkit-scrollbar{ width:8px; }
  ::-webkit-scrollbar-thumb{ background: var(--teal-light); border-radius:999px; }
  ::-webkit-scrollbar-thumb:hover{ background: var(--marquee); }
  ::-webkit-scrollbar-track{ background: transparent; }

  @media (prefers-reduced-motion: reduce){ *{ animation: none !important; transition: none !important; } }

  .setup-banner{
    background: linear-gradient(120deg, rgba(196,69,61,0.16), rgba(232,163,61,0.12));
    border: 1px solid rgba(232,163,61,0.4);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 26px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--cream);
  }
  .setup-banner strong{ color: var(--marquee-bright); }
  .setup-banner code{
    background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 5px; font-size: 12.5px;
  }
  .setup-banner a{ color: var(--marquee-bright); }

  /* ================= LIGHT / NIGHT TOGGLE ================= */
  body.light .screen-frame{ background:#000; }
  body.light .setup-banner{ color: var(--cream); }

  /* ================= EXTRA CONTROL BUTTONS ================= */
  .ctl-spacer{ flex:1; }
  .vol-wrap{ display:flex; align-items:center; gap:6px; }
  .vol-wrap input[type=range]{ width:80px; flex:none; }
  .icon-btn.on{ background: var(--velvet); border-color: transparent; }
  .icon-btn.on:hover{ background: var(--velvet); filter:brightness(1.1); }

  .popover-wrap{ position:relative; }
  /* Popovers are positioned with `position:fixed` and placed by JS
     (positionPopover() in script.js) every time they open — clamped to
     stay fully inside the viewport, flipped above/below the button
     depending on available space, and capped to scroll internally if
     they're taller than the screen. This keeps every options panel
     (brightness, stickers, participants, admin, code box, etc.) fully
     reachable on any window size or device, instead of relying on a
     fixed anchor offset that can push tall panels off-screen. */
  .popover{
    position: fixed; top:0; left:0;
    background: var(--bg-raised); border:1px solid var(--line); border-radius: var(--radius-md);
    padding: 13px; box-shadow: 0 20px 50px -18px rgba(0,0,0,0.65); z-index: 300;
    display:none; max-width: calc(100vw - 20px);
    max-height: calc(var(--app-vh, 100vh) - 20px); overflow-y:auto; -webkit-overflow-scrolling: touch;
    opacity:0; transform: translateY(6px) scale(.96);
    transition: opacity .16s var(--ease-smooth), transform .16s var(--ease-smooth);
  }
  .popover.open{ display:block; animation: popover-in .18s var(--ease-bounce) forwards; }
  @keyframes popover-in{ from{ opacity:0; transform: translateY(6px) scale(.96); } to{ opacity:1; transform: translateY(0) scale(1); } }
  .popover .p-label{ font-size:11px; color:var(--cream-dim); letter-spacing:.04em; text-transform:uppercase; margin-bottom:8px; }
  .brightness-popover input[type=range]{ width:150px; }
  .brightness-popover .p-val{ font-size:12px; color:var(--cream-dim); margin-top:6px; text-align:center; }

  #captions-position-popover input[type=range]{ width:150px; }
  #captions-position-popover .p-val{ font-size:12px; color:var(--cream-dim); margin-top:6px; text-align:center; }

  .sticker-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap:4px; }
  .sticker-grid button{
    appearance:none; border:none; background:none; font-size:22px; cursor:pointer;
    padding:6px; border-radius:10px; line-height:1; transition: background .12s, transform .18s var(--ease-bounce);
  }
  .sticker-grid button:hover{ background: var(--teal-light); transform: scale(1.22) rotate(-6deg); }

  /* ================= STICKERS OVERLAY (floats over the video) ================= */
  .stickers-layer{
    position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index: 5;
  }
  .floating-sticker{
    position:absolute; bottom: 8%; font-size: 40px; animation: sticker-float 2.6s ease-out forwards;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4));
  }
  @keyframes sticker-float{
    0%{ transform: translateY(0) scale(0.6) rotate(0deg); opacity:0; }
    12%{ opacity:1; transform: translateY(-10%) scale(1) rotate(-4deg); }
    100%{ transform: translateY(-320%) scale(1.05) rotate(6deg); opacity:0; }
  }

  /* ================= THEATER / FULL VIEW MODE ================= */
  #screen-room.theater .room-grid{ display:block; }
  #screen-room.theater .room-top{ display:none; }
  #screen-room.theater{
    position:fixed; inset:0; z-index: 200; margin:0; padding:0; background:#000;
    max-width:none; width:100vw; height:100vh; height:100dvh;
  }
  #screen-room.theater > .room-grid{ height:100%; }
  #screen-room.theater .screen-frame{
    position:fixed; inset:0; border-radius:0; border:none; z-index:1;
    display:flex; align-items:center; justify-content:center;
  }
  #screen-room.theater .screen-frame video{ max-height:100vh; max-height:100dvh; height:100vh; height:100dvh; width:100%; object-fit:contain; }
  #screen-room.theater .controls{
    position:fixed; left:0; right:0; bottom:0; z-index:20; border-radius:0;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0.0) 100%);
    border:none; padding: 30px 20px calc(18px + env(safe-area-inset-bottom, 0px));
    transition: right .25s ease, opacity .35s ease, transform .35s ease;
    opacity:1; transform: translateY(0);
  }
  #screen-room.theater.controls-idle .controls{
    opacity:0; transform: translateY(14px); pointer-events:none;
  }
  #screen-room.theater.controls-idle .theater-exit{
    opacity:0; pointer-events:none;
  }
  #screen-room.theater.controls-idle{ cursor:none; }
  .theater-exit{ transition: opacity .35s ease; }
  #screen-room.theater.chat-open .controls{ right: 340px; }
  #screen-room.theater .chat-panel{
    position:fixed; top:0; right:0; height:100vh; width:340px; z-index:30;
    border-radius:0; border-left:1px solid var(--line);
    background: rgba(18,22,31,0.32); backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transform: translateX(100%); transition: transform .25s ease;
  }
  #screen-room.theater .chat-head{ background: rgba(0,0,0,0.15); }
  #screen-room.theater .chat-foot{ background: rgba(0,0,0,0.15); }
  body.light #screen-room.theater .chat-panel{ background: rgba(255,255,255,0.35); }
  #screen-room.theater.chat-open .chat-panel{ transform: translateX(0); box-shadow: -20px 0 50px -20px rgba(0,0,0,0.6); }
  .theater-exit{
    position:fixed; top: calc(16px + env(safe-area-inset-top, 0px)); left: calc(16px + env(safe-area-inset-left, 0px)); z-index:40; background: rgba(0,0,0,0.55); border:1px solid var(--line);
    color:#fff; width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .theater-exit:not(.show){ display:none; }
  .theater-exit svg{ width:16px; height:16px; }

  /* ================= FLOATING / SEE-THROUGH CHAT MODE ================= */
  /* Toggled from the chat header. Chat becomes a transparent popup that
     floats over the movie, anchored to the bottom and growing upward as
     messages arrive, so the video stays visible behind it. Overrides
     apply regardless of theater/mobile layout, hence the !important. */
  #screen-room.chat-floating .room-grid{ grid-template-columns: 1fr !important; }
  #screen-room.chat-floating .chat-panel{
    position: fixed !important; left:auto !important; right: 22px !important; top:auto !important;
    transform: none !important; bottom: 92px !important;
    width: min(360px, 92vw) !important; height:auto !important; min-height:0 !important; max-height:54vh !important;
    background: transparent !important; border:none !important; box-shadow:none !important; border-radius:0 !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    z-index: 25; display:flex; flex-direction:column; justify-content:flex-end; pointer-events:none;
  }
  #screen-room.theater.chat-floating .controls{ right:0 !important; }
  #screen-room.chat-floating .chat-head{
    background:transparent !important; border:none !important; padding: 0 4px 8px !important;
    justify-content:flex-end !important; pointer-events:none;
  }
  #screen-room.chat-floating .chat-head > span{ display:none; }
  #screen-room.chat-floating .chat-head-actions{ pointer-events:auto; }
  #screen-room.chat-floating #chat-color-btn{ display:none; }
  #screen-room.chat-floating .chat-overlay-btn,
  #screen-room.chat-floating #chat-close-btn{
    background: rgba(8,10,14,0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,0.14); display:flex !important;
  }
  #screen-room.chat-floating .chat-body{
    flex: 0 1 auto !important; overflow-y:auto; max-height: calc(54vh - 56px);
    background:transparent !important; padding: 8px 2px; pointer-events:auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 22px, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0, black 22px, black 100%);
  }
  #screen-room.chat-floating .msg .bubble{ background: rgba(10,12,16,0.58); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow:0 6px 18px -10px rgba(0,0,0,0.6); }
  #screen-room.chat-floating .msg.sys{ background: rgba(0,0,0,0.4); padding:4px 10px; border-radius:999px; }
  #screen-room.chat-floating .chat-foot{
    background: rgba(8,10,14,0.55) !important; backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-radius: 999px !important; border:1px solid rgba(255,255,255,0.14) !important; margin-top:8px;
    pointer-events:auto;
  }
  #screen-room.chat-floating .chat-foot input{ background:transparent; color:#fff; }
  #screen-room.chat-floating .msg-reactions{ opacity:0.85; }
  .chat-overlay-btn.on{ background: var(--marquee); color:#fff; border-color:transparent; }
  @media (max-width: 760px){
    #screen-room.chat-floating .chat-panel{
      bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
      right: calc(10px + env(safe-area-inset-right, 0px)) !important;
      width: min(320px, 88vw) !important;
    }
  }

  /* ================= iPHONE / SMALL-SCREEN PLAYER TUNING ================= */
  @media (max-width: 760px){
    .app{ padding-left: calc(14px + env(safe-area-inset-left, 0px)); padding-right: calc(14px + env(safe-area-inset-right, 0px)); }
    .brand-name{ font-size:22px; }
    .hero p{ font-size:14.5px; }
    .ticket{ padding: 20px 16px 18px; }
    .code-input{ font-size:24px; letter-spacing:5px; padding:12px 8px; }
    .room-top{ margin-bottom:14px; }
    .code-chip{ padding:8px 8px 8px 12px; gap:6px; }
    .code-chip .val{ font-size:16px; letter-spacing:2.5px; }
    .copy-btn{ padding:6px 9px; font-size:11px; }
    .leave-btn{ padding:9px 12px; font-size:12px; }

    .screen-frame video{ max-height: 40vh; max-height: 40dvh; }
    .controls{ padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }

    /* Icon buttons grow to a comfortable 44px tap target, and the row
       scrolls horizontally instead of wrapping into a cramped grid. */
    .icon-btn{ width:44px; height:44px; flex-shrink:0; }
    .ctl-row{
      flex-wrap: nowrap; overflow-x: auto; overflow-y:hidden;
      -webkit-overflow-scrolling: touch; scrollbar-width: none;
      padding-bottom: 2px; margin: 12px -12px 0; padding-left:12px; padding-right:12px;
    }
    .ctl-row::-webkit-scrollbar{ display:none; }
    .ctl-row .sync-note{ display:none; } /* redundant on phones, saves space */
    .vol-wrap input[type=range]{ width:56px; }
    .speed-btn{ width:auto; padding:0 10px; }

    /* Popover placement itself is handled by JS (positionPopover()) at
       every breakpoint now — no viewport-specific override needed here. */
  }

  /* ================= MOBILE CHAT ================= */
  /* pointer:coarse (not just a raw width cutoff) so this also catches
     iPad in portrait — where the chat panel would otherwise stay a
     plain, non-fixed panel that the on-screen keyboard can overlap —
     while a narrow desktop/laptop browser window (mouse = pointer:fine)
     keeps the normal side-by-side layout instead of getting the phone
     treatment. */
  @media (max-width: 1024px) and (pointer: coarse){
    .chat-panel{
      position: fixed; left:0; right:0; bottom: var(--kbd-inset, 0px); top:auto;
      height:78vh; height:78dvh;
      max-height: min(78vh, calc(var(--app-vh, 100vh) - var(--kbd-inset, 0px) - 8px));
      border-radius: 16px 16px 0 0; z-index:150;
      transform: translateY(100%); transition: transform .25s ease, bottom .15s ease;
      box-shadow: 0 -20px 50px -20px rgba(0,0,0,0.6);
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    #screen-room.chat-open .chat-panel{ transform: translateY(0); }
    #chat-close-btn{ display:flex; }
    #chat-toggle-btn{
      display:flex !important; position:fixed;
      right: calc(16px + env(safe-area-inset-right, 0px));
      bottom: calc(16px + env(safe-area-inset-bottom, 0px));
      z-index:160; width:52px; height:52px; border-radius:50%;
      box-shadow: 0 10px 26px -8px rgba(0,0,0,0.6);
    }
    #screen-room.chat-open #chat-toggle-btn{ display:none !important; }
    .chat-head{ padding: 14px 14px; }
    .chat-head span{ font-size:15px; }
    .chat-head-actions .icon-btn{ width:36px; height:36px; }
    .chat-foot{ padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 0px)); gap:8px; }
    .chat-foot input, .send-btn, .chat-foot .icon-btn{ min-height:44px; }
    .send-btn{ padding: 0 16px; }
    .reaction-chip{ padding:6px 10px; font-size:13px; min-height:30px; }
    .msg{ max-width: 92%; }
    .msg .bubble{ padding: 10px 13px; }
  }

  /* ================= BOOT LOADER (reload -> straight back into the room) ================= */
  .boot-loader{
    position:fixed; inset:0; z-index:999; background: var(--bg);
    display:none; flex-direction:column; align-items:center; justify-content:center; gap:16px;
  }
  .boot-mark{
    width: 46px; height: 46px; border-radius: 10px;
    background: linear-gradient(155deg, var(--velvet), #8f2e28);
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 0 0 1px var(--line), 0 8px 20px -6px rgba(196,69,61,0.6);
  }
  .boot-mark svg{ width:24px; height:24px; }
  .boot-spinner{
    width:22px; height:22px; border-radius:50%;
    border: 2.5px solid var(--line); border-top-color: var(--marquee);
    animation: boot-spin .8s linear infinite;
  }
  @keyframes boot-spin{ to{ transform: rotate(360deg); } }
  .boot-text{ color: var(--cream-dim); font-size: 13.5px; letter-spacing:.02em; }

  /* ================= TOASTS (join / leave popups) ================= */
  .toast-stack{
    position: fixed; top: calc(18px + env(safe-area-inset-top, 0px)); right: calc(18px + env(safe-area-inset-right, 0px)); z-index: 400;
    display:flex; flex-direction:column; gap:10px; align-items:flex-end;
    pointer-events:none; max-width: calc(100vw - 36px);
  }
  .toast{
    display:flex; align-items:center; gap:10px;
    background: var(--bg-raised); border:1px solid var(--line); border-radius: 999px;
    padding: 11px 18px 11px 14px; box-shadow: 0 16px 40px -14px rgba(0,0,0,0.6);
    font-family: var(--chat-font); font-size: 13.5px; font-weight:600; color: var(--cream);
    animation: toast-in .4s var(--ease-bounce) forwards, toast-out .3s ease forwards var(--toast-life, 3.2s);
    max-width: 320px;
  }
  .toast .dot{
    width:9px; height:9px; border-radius:50%; flex-shrink:0;
    background: #65B891; box-shadow: 0 0 0 3px rgba(101,184,145,0.18);
  }
  .toast.leave .dot{ background: var(--velvet); box-shadow: 0 0 0 3px rgba(196,69,61,0.18); }
  @keyframes toast-in{
    from{ transform: translateX(30px); opacity:0; }
    to{ transform: translateX(0); opacity:1; }
  }
  @keyframes toast-out{
    to{ transform: translateX(30px); opacity:0; }
  }
  @media (max-width: 760px){
    .toast-stack{ left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); align-items:stretch; }
    .toast{ max-width:none; }
  }

  /* ================= CUTE / PREMIUM CHAT STYLING ================= */
  .chat-head{ font-family: var(--chat-display); font-weight:600; letter-spacing:.5px; }
  .chat-head-actions{ display:flex; align-items:center; gap:6px; }
  .chat-body, .chat-foot input, .msg .who, .msg .bubble{ font-family: var(--chat-font), var(--emoji-font); }
  .msg .who{ font-weight:700; font-size:11.5px; letter-spacing:.03em; }
  .msg .bubble{
    font-size:14px; font-weight:500; line-height:1.5;
    border-radius: 14px; border-left: 3px solid var(--marquee);
    box-shadow: 0 3px 10px -6px rgba(0,0,0,0.5);
    background: linear-gradient(155deg, var(--teal-light), var(--teal));
  }
  .msg.me .bubble{
    border-left: 3px solid var(--cream-dim);
    background: linear-gradient(155deg, var(--velvet), #9c342e);
  }
  .chat-foot input{ font-weight:600; font-size:14px; }
  .send-btn{ font-family: var(--chat-font); letter-spacing:.02em; }

  .color-btn{ position:relative; }
  .color-dot{
    width:16px; height:16px; border-radius:50%;
    background: var(--marquee); box-shadow: 0 0 0 2px rgba(242,239,233,0.25);
  }
  .color-grid{ display:grid; grid-template-columns: repeat(5, 1fr); gap:8px; }
  .color-swatch{
    appearance:none; width:26px; height:26px; border-radius:50%; cursor:pointer;
    border: 2px solid transparent; transition: transform .12s, border-color .12s;
  }
  .color-swatch:hover{ transform: scale(1.12); }
  .color-swatch.active{ border-color: var(--cream); box-shadow: 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--cream); }

  /* ---------- captions ---------- */
  #captions-btn{ width:auto; padding:0 10px; }
  #captions-upload-btn svg{ width:15px; height:15px; }
  video::cue{
    background: rgba(11,14,20,0.72);
    color: var(--cream);
    font-family: var(--chat-font);
    font-weight:600;
    font-size: 0.82em;
    line-height:1.4;
    padding: 3px 9px;
    letter-spacing:.1px;
  }
  #screen-room.theater video::cue{ font-size: 1.05em; padding: 4px 12px; }

/* =====================================================================
   MOVIESSS.FUN — v6 THEME  (flat cinema-black / paper-light, 3D accents)
   ===================================================================== */
:root{
  --bg:#0b0b0c; --bg-raised:#171719; --surface:#171719; --surface-2:#232326;
  --cream:#f5f5f1; --cream-dim:#a3a3ab; --line:rgba(255,255,255,.12);
  --teal:#2a2a2e; --teal-light:#202023; --input-bg:#0f0f11;
  --nav-solid:rgba(11,11,12,.92); --lip:rgba(0,0,0,.55); --shadow-c:rgba(0,0,0,.9);
  --red:#E50914; --red-deep:#9e0710; --red-glow:rgba(229,9,20,.5);
  --marquee:#ff4650; --marquee-bright:#ff6b73;
  --nav-h:68px; --spring:cubic-bezier(.34,1.56,.64,1);
}
html.light{
  --bg:#f4f3f0; --bg-raised:#ffffff; --surface:#ffffff; --surface-2:#ebeae6;
  --cream:#141416; --cream-dim:#5f5f67; --line:rgba(20,20,22,.14);
  --teal:#e3e1dc; --teal-light:#efeeea; --input-bg:#f0efeb;
  --nav-solid:rgba(244,243,240,.92); --lip:rgba(20,20,22,.2); --shadow-c:rgba(40,28,16,.35);
  --marquee:#d4000e; --marquee-bright:#d4000e;
}
html{ background:var(--bg); scroll-behavior:smooth; }
body{ background:var(--bg) !important; color:var(--cream); transition:background .35s, color .35s; }
[hidden]{ display:none !important; }
.app{ max-width:none; margin:0; padding:0; position:relative; }
.wordmark{ font-family:var(--display); font-size:30px; letter-spacing:2.5px; line-height:1; color:var(--red); display:inline-block;
  text-shadow:1px 1px 0 #b20710, 2px 2px 0 #9e0710, 3px 3px 0 #860610, 4px 5px 0 #6d050d, 6px 9px 14px rgba(0,0,0,.55);
  transform:perspective(420px) rotateX(10deg) rotateY(-7deg); transform-origin:left center; transition:transform .5s var(--ease-smooth), text-shadow .5s; }
.nav-logo:hover .wordmark{ transform:perspective(420px) rotateX(2deg) rotateY(5deg) translateX(3px); }

/* ---------- NAV ---------- */
.nav{ position:fixed; top:0; left:0; right:0; z-index:120; height:calc(var(--nav-h) + env(safe-area-inset-top,0px)); padding:env(safe-area-inset-top,0px) clamp(16px,4vw,56px) 0; display:flex; align-items:center; gap:34px; background:linear-gradient(180deg,rgba(0,0,0,.82),rgba(0,0,0,0)); transition:background .3s, box-shadow .3s; }
.nav.solid, body:not([data-screen="screen-home"]) .nav{ background:var(--nav-solid); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:0 1px 0 var(--line); }
.nav-logo{ text-decoration:none; flex-shrink:0; }
.nav-links{ display:flex; gap:24px; }
.nav-links a{ color:rgba(255,255,255,.8); text-decoration:none; font-size:14px; font-weight:500; padding:6px 0; transition:color .2s; }
.nav-links a:hover{ color:#fff; }
.nav.solid .nav-links a{ color:var(--cream-dim); } .nav.solid .nav-links a:hover{ color:var(--cream); }
.nav-right{ margin-left:auto; display:flex; align-items:center; gap:18px; }
.nav-cta{ appearance:none; border:0; cursor:pointer; color:#fff; font-weight:700; font-size:14px; padding:9px 18px; border-radius:4px; background:var(--red); box-shadow:0 3px 0 #8a050d; white-space:nowrap; transition:transform .12s, box-shadow .12s, filter .2s; }
.nav-cta:hover{ filter:brightness(1.1); } .nav-cta:active{ transform:translateY(3px); box-shadow:0 0 0 #8a050d; }
body:not([data-screen="screen-home"]) .nav-links, body:not([data-screen="screen-home"]) .nav-cta{ display:none; }
body:not([data-screen="screen-home"]) .nav-logo{ pointer-events:none; }
body[data-screen="screen-room"] .nav, body[data-screen="screen-solo"] .nav{ height:calc(56px + env(safe-area-inset-top,0px)); }

/* ---------- 3D THEME SWITCH ---------- */
.theme-switch{ appearance:none; border:0; background:none; padding:0; cursor:pointer; position:relative; width:68px; height:34px; flex-shrink:0; perspective:200px; -webkit-tap-highlight-color:transparent; }
.ts-track{ position:absolute; inset:0; border-radius:34px; display:flex; align-items:center; justify-content:space-between; padding:0 9px; color:rgba(255,255,255,.55);
  background:linear-gradient(180deg,#0a0a0c,#1d1d22); box-shadow:inset 0 3px 6px rgba(0,0,0,.8), inset 0 -1px 0 rgba(255,255,255,.08), 0 1px 0 rgba(255,255,255,.12), 0 6px 14px -6px rgba(0,0,0,.7); transition:background .4s, box-shadow .4s, color .4s; }
.ts-track svg{ width:15px; height:15px; transition:opacity .3s, transform .4s var(--spring); }
.ts-moon{ opacity:.35; } .ts-sun{ opacity:.9; color:#ffc94d; }
.ts-thumb{ position:absolute; top:3px; left:3px; width:28px; height:28px; border-radius:50%; transition:transform .5s var(--spring), background .4s, box-shadow .4s;
  background:radial-gradient(circle at 34% 28%, #fff 0, #dfe2ea 30%, #9aa0b3 75%, #7d8398 100%);
  box-shadow:0 4px 8px rgba(0,0,0,.6), inset -3px -4px 6px rgba(60,66,90,.45), inset 2px 2px 4px rgba(255,255,255,.7); }
.ts-thumb::before, .ts-thumb::after{ content:''; position:absolute; border-radius:50%; background:rgba(98,106,134,.38); box-shadow:inset 1px 1px 2px rgba(0,0,0,.25); transition:opacity .3s; }
.ts-thumb::before{ width:7px; height:7px; left:6px; top:7px; } .ts-thumb::after{ width:5px; height:5px; right:6px; bottom:6px; }
.theme-switch:active .ts-thumb{ width:34px; }
html.light .theme-switch:active .ts-thumb{ width:34px; transform:translateX(-6px) translateX(34px); }
.theme-switch[aria-checked="true"] .ts-thumb{ transform:translateX(34px); background:radial-gradient(circle at 34% 28%, #fff7c2 0, #ffd34d 40%, #ff9d1a 100%); box-shadow:0 4px 10px rgba(255,140,0,.55), 0 0 18px rgba(255,190,60,.7), inset -3px -4px 6px rgba(190,90,0,.4), inset 2px 2px 4px rgba(255,255,255,.8); }
.theme-switch[aria-checked="true"] .ts-thumb::before, .theme-switch[aria-checked="true"] .ts-thumb::after{ opacity:0; }
.theme-switch[aria-checked="true"] .ts-track{ background:linear-gradient(180deg,#6fb8ff,#a9dcff); color:#fff; box-shadow:inset 0 3px 6px rgba(20,70,130,.45), inset 0 -1px 0 rgba(255,255,255,.4), 0 6px 14px -6px rgba(40,100,180,.6); }
.theme-switch[aria-checked="true"] .ts-sun{ opacity:.35; color:#fff; } .theme-switch[aria-checked="true"] .ts-moon{ opacity:.95; color:#fff; }
.theme-switch:focus-visible{ outline:2px solid var(--red); outline-offset:4px; border-radius:34px; }

/* ---------- solo / room padding ---------- */
#screen-room, #screen-solo{ max-width:1240px; margin:0 auto; padding:calc(84px + env(safe-area-inset-top,0px)) calc(20px + env(safe-area-inset-right,0px)) calc(60px + env(safe-area-inset-bottom,0px)) calc(20px + env(safe-area-inset-left,0px)); }
.setup-banner{ margin:calc(80px + env(safe-area-inset-top,0px)) clamp(16px,4vw,56px) 0; }

/* ---------- HERO ---------- */
.hero{ position:relative; min-height:min(100vh,860px); min-height:min(100svh,860px); display:flex; align-items:center; overflow:hidden; isolation:isolate; padding:calc(var(--nav-h) + 30px) 0 90px; background:#0b0b0c; color:#fff; --h:350; }
.hero-bg{ position:absolute; inset:-40px; z-index:-3; background-size:cover; background-position:center 30%; filter:blur(34px) saturate(1.35) brightness(.55); transform:scale(1.12); background-color:#16090c; transition:background-image .5s; }
.hero-bg::after{ content:''; position:absolute; inset:0; background:radial-gradient(ellipse 60% 70% at 78% 45%, hsla(var(--h),70%,45%,.28), transparent 70%); }
.hero-fade{ position:absolute; inset:0; z-index:-2; background:
  linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.5) 40%, rgba(0,0,0,.05) 78%),
  linear-gradient(0deg, var(--bg) 0, rgba(0,0,0,0) 150px),
  linear-gradient(180deg, rgba(0,0,0,.65), transparent 160px); }
.hero-inner{ width:100%; max-width:1400px; margin:0 auto; padding:0 clamp(18px,4vw,56px); display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.9fr); align-items:center; gap:30px; }
.hero-copy{ max-width:620px; transition:opacity .24s, transform .24s var(--ease-smooth); }
.hero-copy.swap{ opacity:0; transform:translateY(12px); }
.hero-kicker{ display:flex; align-items:center; gap:10px; margin-bottom:14px; font-weight:800; font-size:12.5px; letter-spacing:.34em; color:rgba(255,255,255,.78); }
.hero-kicker i{ font:400 22px/1 var(--display); font-style:normal; letter-spacing:0; width:20px; height:30px; display:grid; place-items:center; color:var(--red); text-shadow:1px 1px 0 #7a0610, 2px 2px 0 #5c040c; transform:perspective(100px) rotateY(-18deg); }
.hero h1{ font-family:var(--body); font-weight:900; font-size:clamp(44px,7vw,92px); line-height:.98; letter-spacing:-.035em; margin:0 0 18px; color:#fff; text-shadow:0 4px 36px rgba(0,0,0,.55); }
.hero h1.is-title{ font-size:clamp(40px,6vw,80px); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; text-wrap:balance; }
.hero-tags{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:16px; font-size:12.5px; font-weight:700; }
.hero-tags b{ color:#46d369; font-weight:800; } .hero-tags u{ text-decoration:none; padding:2px 7px; border:1px solid rgba(255,255,255,.5); border-radius:3px; color:rgba(255,255,255,.88); font-size:11px; letter-spacing:.04em; }
.hero p{ color:rgba(255,255,255,.86); font-size:clamp(15px,1.5vw,19px); line-height:1.55; margin:0 0 26px; max-width:540px; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; text-shadow:0 2px 12px rgba(0,0,0,.6); }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; }
.btn-hero{ appearance:none; border:0; cursor:pointer; display:inline-flex; align-items:center; gap:10px; font-weight:700; font-size:clamp(15px,1.4vw,18px); padding:12px 26px 12px 20px; border-radius:5px; transition:transform .12s, box-shadow .12s, background .2s; }
.btn-hero svg{ width:26px; height:26px; flex-shrink:0; }
.btn-hero-play{ background:#fff; color:#111; box-shadow:0 4px 0 #b9b9b9; } .btn-hero-play:hover{ background:#e8e8e8; }
.btn-hero-ghost{ background:rgba(109,109,118,.7); color:#fff; box-shadow:0 4px 0 rgba(40,40,46,.8); } .btn-hero-ghost:hover{ background:rgba(109,109,118,.5); }
.btn-hero:active{ transform:translateY(4px); box-shadow:0 0 0 transparent; }
/* 3D poster stack */
.hero-poster{ --cw:290px; position:relative; justify-self:center; width:min(100%,460px); height:calc(var(--cw)*1.5 + 70px); perspective:1500px; }
.hero-poster::after{ content:''; position:absolute; left:6%; right:0; bottom:6px; height:46px; background:radial-gradient(ellipse at center, rgba(0,0,0,.7), transparent 70%); filter:blur(10px); z-index:-1; }
.stack{ position:absolute; inset:0; transform-style:preserve-3d; transform:rotateX(var(--rx,0deg)) rotateY(calc(-22deg + var(--ry,0deg))); transition:transform .25s ease-out; }
.stack-card{ position:absolute; left:42%; top:48%; width:var(--cw); aspect-ratio:2/3; margin:calc(var(--cw)*-.75) 0 0 calc(var(--cw)*-.5); padding:0; border:0; border-radius:8px; overflow:hidden; cursor:pointer; color:#fff;
  background:linear-gradient(150deg,hsl(var(--h,350),55%,26%),hsl(calc(var(--h,350) + 45),50%,11%));
  transform:translate3d(calc(var(--p,0)*var(--cw)*.27),calc(var(--p,0)*var(--cw)*-.035),calc(var(--p,0)*-130px)); filter:brightness(calc(1 - var(--p,0)*.26));
  transition:transform .9s var(--ease-smooth), filter .9s, opacity .6s; opacity:1;
  box-shadow:1px 1px 0 #2b2b2e, 2px 2px 0 #26262a, 3px 3px 0 #212124, 4px 4px 0 #1c1c1f, 14px 22px 40px -10px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.1); }
.stack-card.gone{ opacity:0; pointer-events:none; }
.stack-card img{ width:100%; height:100%; object-fit:cover; display:block; }
.stack-card.front:hover{ filter:brightness(1.08); }
.stack-gloss{ position:absolute; inset:0; background:linear-gradient(115deg,rgba(255,255,255,.22) 0,rgba(255,255,255,.05) 28%,transparent 46%); pointer-events:none; }
.stack-card.ghost{ cursor:default; display:grid; place-items:center; }
.ghost-word{ font-family:var(--display); font-size:34px; letter-spacing:3px; text-align:center; padding:0 14px; line-height:1; text-shadow:2px 2px 0 rgba(0,0,0,.45); }
.ghost-play{ position:absolute; bottom:18px; left:50%; width:38px; height:38px; margin-left:-19px; border-radius:50%; border:2px solid rgba(255,255,255,.7); }
.ghost-play::after{ content:''; position:absolute; left:15px; top:10px; border-left:12px solid #fff; border-top:8px solid transparent; border-bottom:8px solid transparent; }
.cover-initial{ position:absolute; inset:0; display:grid; place-items:center; font-family:var(--display); font-size:clamp(90px,12vw,170px); color:rgba(255,255,255,.88); text-shadow:3px 3px 0 rgba(0,0,0,.3); }
.hero-dots{ position:absolute; z-index:3; left:clamp(18px,4vw,56px); bottom:48px; display:flex; gap:7px; }
.hero-dots button{ appearance:none; border:0; padding:0; cursor:pointer; width:22px; height:3px; border-radius:2px; background:rgba(255,255,255,.3); position:relative; overflow:hidden; transition:width .35s var(--ease-smooth); }
.hero-dots button.on{ width:48px; } .hero-dots button.on::after{ content:''; position:absolute; inset:0; background:#fff; transform-origin:left; animation:dot-fill 8s linear forwards; }
@keyframes dot-fill{ from{ transform:scaleX(0);} to{ transform:scaleX(1);} }

/* ---------- LIBRARY ---------- */
.library-section{ position:relative; z-index:1; padding:46px 0 40px; margin-top:-70px; }
.library-heading{ display:flex; justify-content:space-between; align-items:flex-end; gap:18px; margin:0 clamp(18px,4vw,56px) 6px; }
.library-heading h2, .manual-screening-heading h2, .together-copy h2, .solo-heading h2{ font-family:var(--body); font-weight:900; letter-spacing:-.03em; font-size:clamp(28px,4vw,46px); line-height:1.02; margin:0 0 8px; color:var(--cream); }
.library-heading p, .manual-screening-heading p, .solo-heading p, .together-copy>p{ color:var(--cream-dim); font-size:15px; line-height:1.6; margin:0; }
.library-count{ color:var(--cream-dim); font-size:11px; font-weight:800; letter-spacing:1.6px; border:1px solid var(--line); border-radius:4px; padding:7px 11px; white-space:nowrap; }
.row{ margin-top:22px; }
.row-title{ font-size:clamp(17px,1.9vw,22px); font-weight:700; margin:0 clamp(18px,4vw,56px) 0; color:var(--cream); }
.row-scroller{ position:relative; }
.row-track{ display:flex; gap:10px; overflow-x:auto; overflow-y:visible; padding:30px clamp(18px,4vw,56px) 40px; margin:-8px 0 -22px; scroll-snap-type:x proximity; scroll-padding:0 clamp(18px,4vw,56px); scrollbar-width:none; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
.row-track::-webkit-scrollbar{ display:none; }
.row-arrow{ position:absolute; top:30px; bottom:40px; z-index:6; width:clamp(40px,4vw,58px); border:0; cursor:pointer; color:var(--cream); font-size:42px; line-height:1; display:none; align-items:center; justify-content:center; opacity:0; transition:opacity .25s; }
.row-arrow.left{ left:0; background:linear-gradient(90deg,var(--bg),transparent); } .row-arrow.right{ right:0; background:linear-gradient(-90deg,var(--bg),transparent); }
.row-scroller.has-overflow .row-arrow{ display:flex; } .row-scroller.has-overflow:hover .row-arrow{ opacity:1; }
.row-scroller.at-start .row-arrow.left, .row-scroller.at-end .row-arrow.right{ opacity:0 !important; pointer-events:none; }
@media (hover:none){ .row-arrow{ display:none !important; } }
.catalog-grid{ display:flex; }
.catalog-card{ appearance:none; padding:0; border:0; background:transparent; text-align:left; color:#fff; cursor:pointer; flex:0 0 clamp(150px,15vw,222px); min-width:0; position:relative; scroll-snap-align:start; border-radius:6px; transition:transform .35s var(--ease-smooth), filter .3s; }
.catalog-cover{ position:relative; aspect-ratio:2/3; width:100%; overflow:hidden; border-radius:6px; background:linear-gradient(150deg,hsl(var(--h,350),55%,26%),hsl(calc(var(--h,350) + 50),50%,11%)); box-shadow:0 12px 26px -14px var(--shadow-c), 0 0 0 1px var(--line);
  transform:perspective(800px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); transition:transform .3s ease-out, box-shadow .35s; will-change:transform; }
.catalog-cover.tilting{ transition:transform .08s linear, box-shadow .35s; }
.catalog-cover::after{ content:''; position:absolute; inset:0; background:radial-gradient(circle at var(--gx,50%) var(--gy,0%), rgba(255,255,255,.3), transparent 58%); opacity:0; transition:opacity .25s; pointer-events:none; }
.catalog-cover.tilting::after{ opacity:1; }
.catalog-cover .cover-initial{ font-size:clamp(70px,8vw,110px); }
.catalog-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.catalog-cover-overlay{ position:absolute; inset:0; background:linear-gradient(180deg,transparent 50%,rgba(0,0,0,.85)); }
.catalog-play{ display:none; }
.catalog-card-info{ position:absolute; left:0; right:0; bottom:0; padding:34px 11px 11px; pointer-events:none; z-index:2; }
.catalog-card-info strong{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:14px; font-weight:800; line-height:1.22; text-shadow:0 2px 10px rgba(0,0,0,.8); }
.card-actions{ display:flex; gap:7px; max-height:0; opacity:0; overflow:hidden; margin-top:0; transition:max-height .3s, opacity .25s, margin .3s; }
.card-actions i{ width:28px; height:28px; border-radius:50%; border:2px solid rgba(255,255,255,.65); display:grid; place-items:center; flex:0 0 28px; } .card-actions i svg{ width:13px; height:13px; }
.card-actions i.ca-play{ background:#fff; color:#111; border-color:#fff; padding-left:1px; } .card-actions i.ca-more{ margin-left:auto; }
.catalog-card-info span{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:rgba(255,255,255,.78); font-size:11.5px; line-height:1.4; max-height:0; opacity:0; transition:max-height .3s, opacity .25s, margin .3s; }
@media (hover:hover){
  .catalog-grid:hover .catalog-card:not(:hover), .top-track:hover .catalog-card:not(:hover){ filter:brightness(.5); }
  .catalog-card:hover{ transform:scale(1.1) translateY(-6px); z-index:5; }
  .catalog-card:hover .catalog-cover{ box-shadow:0 34px 50px -16px var(--shadow-c), 0 0 0 1px rgba(255,255,255,.35); }
  .catalog-card:hover .card-actions{ max-height:30px; opacity:1; margin-top:8px; }
  .catalog-card:hover .catalog-card-info span{ max-height:34px; opacity:1; margin-top:7px; }
}
.catalog-card:focus-visible{ outline:none; transform:scale(1.06); } .catalog-card:focus-visible .catalog-cover{ box-shadow:0 0 0 3px var(--cream); }
.catalog-card:active{ transform:scale(.97); }
.top-track{ gap:2px; }
.top-card{ flex:0 0 clamp(190px,19vw,280px); padding-left:clamp(56px,6vw,88px); }
.top-card .rank{ position:absolute; left:0; bottom:-6px; font-family:var(--display); font-size:clamp(150px,16vw,236px); line-height:.78; letter-spacing:-8px; color:var(--bg); -webkit-text-stroke:3px rgba(255,255,255,.5); pointer-events:none; z-index:0; transition:-webkit-text-stroke-color .3s; }
html.light .top-card .rank{ -webkit-text-stroke-color:rgba(20,20,22,.45); }
.top-card:hover .rank{ -webkit-text-stroke-color:var(--red); }
.top-card .catalog-cover{ position:relative; z-index:1; } .top-card .catalog-card-info{ left:clamp(56px,6vw,88px); }
.catalog-empty{ margin:14px clamp(18px,4vw,56px) 0; display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; padding:44px 18px; border:1px dashed var(--line); border-radius:8px; color:var(--cream-dim); background:var(--surface); }
.catalog-empty[hidden]{ display:none; } .catalog-empty-icon{ display:grid; place-items:center; width:48px; height:48px; border-radius:8px; color:#fff; background:var(--red); font-size:22px; box-shadow:0 4px 0 #8a050d; }
.catalog-empty strong{ color:var(--cream); font-size:17px; } .catalog-empty span{ font-size:13px; }

/* ---------- TOGETHER (3D scene) ---------- */
.together{ display:grid; grid-template-columns:.9fr 1.1fr; gap:clamp(30px,5vw,80px); align-items:center; max-width:1360px; margin:40px auto 0; padding:70px clamp(18px,4vw,56px); }
.points{ list-style:none; margin:30px 0 0; padding:0; }
.points li{ display:flex; gap:18px; padding:18px 0; border-top:1px solid var(--line); }
.points li:last-child{ border-bottom:1px solid var(--line); }
.points b{ font:400 34px/1 var(--display); letter-spacing:1px; color:transparent; -webkit-text-stroke:1.5px var(--red); min-width:44px; }
.points strong{ display:block; font-size:16px; margin-bottom:4px; } .points small{ color:var(--cream-dim); font-size:13.5px; line-height:1.5; }
.scene{ perspective:1300px; height:min(470px,62vw); position:relative; }
.scene-inner{ position:absolute; inset:0; transform-style:preserve-3d; transform:rotateX(calc(10deg + var(--rx,0deg))) rotateY(calc(-18deg + var(--ry,0deg))); transition:transform .25s ease-out; }
.s-floor{ position:absolute; left:-6%; right:-6%; bottom:-8%; height:55%; transform:translateZ(-60px) rotateX(74deg); transform-origin:50% 100%;
  background:linear-gradient(var(--line) 1px,transparent 1px) 0 0/44px 44px, linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0/44px 44px; -webkit-mask-image:radial-gradient(ellipse at 50% 70%,#000 25%,transparent 72%); mask-image:radial-gradient(ellipse at 50% 70%,#000 25%,transparent 72%); }
.s-screen{ position:absolute; left:6%; top:6%; width:80%; height:66%; border-radius:12px; border:9px solid #0a0a0b; background:#000; overflow:hidden; box-shadow:1px 1px 0 #222,2px 2px 0 #1c1c1c,3px 3px 0 #161616,4px 4px 0 #111, 30px 44px 60px -20px var(--shadow-c), 0 0 0 1px rgba(255,255,255,.12); transform:translateZ(0); }
.s-art{ position:absolute; inset:0; background:radial-gradient(circle at 72% 30%, #ff7a5c 0, transparent 40%), radial-gradient(circle at 18% 82%, #6a4bd0 0, transparent 50%), linear-gradient(140deg,#4a0d1b,#10131f); }
.s-play{ position:absolute; inset:0; margin:auto; width:62px; height:62px; border-radius:50%; display:grid; place-items:center; background:#fff; color:#111; padding-left:4px; box-shadow:0 0 0 12px rgba(255,255,255,.14); animation:play-pulse 3s ease-in-out infinite; }
.s-play svg{ width:26px; height:26px; }
@keyframes play-pulse{ 50%{ box-shadow:0 0 0 22px rgba(255,255,255,0); transform:scale(1.05);} }
.s-bar{ position:absolute; left:14px; right:14px; bottom:12px; height:4px; background:rgba(255,255,255,.3); border-radius:3px; } .s-bar i{ display:block; height:100%; background:var(--red); border-radius:3px; animation:bar-go 10s linear infinite; }
@keyframes bar-go{ from{ width:6%;} to{ width:94%;} }
.s-chat{ position:absolute; right:2%; width:min(40%,210px); font:600 12.5px/1.35 var(--chat-font); padding:10px 14px; border-radius:14px 14px 14px 3px; background:#222226; color:#fff; border:1px solid rgba(255,255,255,.14); box-shadow:0 20px 30px -12px rgba(0,0,0,.7); opacity:0; animation:bubble 10s infinite; }
.s-chat b{ display:block; font-size:9.5px; letter-spacing:1.2px; color:#ff8a92; margin-bottom:2px; }
.s-chat.me{ background:linear-gradient(135deg,#f01a26,#a8060f); border-color:transparent; border-radius:14px 14px 3px 14px; } .s-chat.me b{ color:#ffd6d9; }
.s-chat.c1{ top:54%; transform:translateZ(70px); animation-delay:.4s; } .s-chat.c2{ top:70%; right:-3%; transform:translateZ(95px); animation-delay:2.6s; } .s-chat.c3{ top:86%; right:6%; transform:translateZ(120px); animation-delay:4.8s; }
@keyframes bubble{ 0%{ opacity:0; margin-top:14px;} 6%,76%{ opacity:1; margin-top:0;} 90%,100%{ opacity:0; margin-top:-6px;} }
.s-seat{ position:absolute; bottom:4%; width:44px; height:44px; border-radius:50%; display:grid; place-items:center; font:800 15px var(--body); color:#fff; border:3px solid var(--bg); box-shadow:0 14px 20px -8px rgba(0,0,0,.7); animation:seat-bob 3.4s ease-in-out infinite; }
.s-seat.a1{ left:6%; background:linear-gradient(140deg,#ff5d6c,#b3070f); transform:translateZ(90px); } .s-seat.a2{ left:16%; background:linear-gradient(140deg,#63a4ff,#3c5fd0); transform:translateZ(90px); animation-delay:.5s; } .s-seat.a3{ left:26%; background:linear-gradient(140deg,#65b891,#2f7d5c); transform:translateZ(90px); animation-delay:1s; }
@keyframes seat-bob{ 50%{ margin-bottom:8px; } }
.s-react{ position:absolute; left:50%; top:2%; transform:translateZ(110px); padding:6px 12px; border-radius:999px; background:#222226; color:#fff; font:800 13px var(--body); border:1px solid rgba(255,255,255,.14); box-shadow:0 14px 24px -10px rgba(0,0,0,.7); animation:seat-bob 3s ease-in-out infinite; } .s-react em{ font-style:normal; color:#ff8a92; }

/* ---------- JOIN (cinema tickets) ---------- */
.join-section{ max-width:1240px; margin:0 auto; padding:70px clamp(18px,4vw,56px) 30px; }
.manual-screening-heading{ margin:0 0 34px; text-align:center; }
.cards{ display:grid; grid-template-columns:1.1fr .9fr; gap:26px; align-items:stretch; }
.ticket{ --pad:clamp(22px,3vw,36px); position:relative; overflow:hidden; padding:var(--pad); border-radius:12px; background:var(--surface); border:1px solid var(--line); box-shadow:0 30px 50px -30px var(--shadow-c); transition:transform .4s var(--ease-smooth), box-shadow .4s; }
.ticket::before{ content:''; position:absolute; left:0; top:0; bottom:0; width:6px; background:var(--red); }
.ticket:hover{ transform:translateY(-5px) rotateX(1.5deg); box-shadow:0 44px 60px -30px var(--shadow-c); }
.ticket-eyebrow{ font:800 11px var(--body); letter-spacing:.3em; color:var(--red); margin-bottom:12px; }
.ticket h2{ font-family:var(--body); font-weight:900; letter-spacing:-.03em; font-size:clamp(26px,3vw,36px); margin:0 0 8px; color:var(--cream); }
.ticket .sub{ color:var(--cream-dim); font-size:14px; line-height:1.6; }
.ticket-perf{ position:relative; height:0; margin:24px calc(var(--pad)*-1) 12px; border-top:2px dashed var(--line); }
.ticket-perf::before, .ticket-perf::after{ content:''; position:absolute; top:-15px; width:28px; height:28px; border-radius:50%; background:var(--bg); border:1px solid var(--line); }
.ticket-perf::before{ left:-14px; } .ticket-perf::after{ right:-14px; }
.field-note{ font-size:11.5px; color:var(--cream-dim); opacity:.8; margin-top:7px; line-height:1.5; }
.ticket label, .watch-choice-dialog label{ color:var(--cream-dim); font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; font-weight:700; }
input[type=text], input[type=url]{ background:var(--input-bg); border:1px solid var(--line); border-radius:6px; color:var(--cream); padding:14px 15px; }
input[type=text]:focus, input[type=url]:focus{ border-color:var(--cream); box-shadow:0 0 0 3px rgba(229,9,20,.25); }
input[type=text]::placeholder, input[type=url]::placeholder{ color:var(--cream-dim); opacity:.55; }
.code-input{ font-family:var(--display) !important; font-size:38px !important; letter-spacing:14px !important; padding:14px 10px 14px 24px !important; }
.btn{ border-radius:6px; padding:15px 22px; font-size:15px; margin-top:22px; transition:transform .12s, box-shadow .12s, filter .2s; }
.btn:hover{ transform:none; } 
.btn-primary{ background:var(--red); color:#fff; box-shadow:0 4px 0 #8a050d; } .btn-primary:hover{ filter:brightness(1.1); box-shadow:0 4px 0 #8a050d; }
.btn-secondary{ background:var(--cream); color:var(--bg); box-shadow:0 4px 0 var(--lip); } .btn-secondary:hover{ filter:none; opacity:.92; }
.btn:active{ transform:translateY(4px); box-shadow:0 0 0 transparent !important; }
.ticket-join{ display:flex; flex-direction:column; } .ticket-join .hint-error{ flex:1 1 auto; } .ticket-join .btn{ margin-top:10px; }
.howrow{ display:grid; grid-template-columns:repeat(3,1fr); gap:0; margin-top:50px; border-top:1px solid var(--line); }
.howcell{ padding:22px 24px 0 0; border:0; background:none; } .howcell:hover{ background:none; }
.howcell .num{ font:400 52px/1 var(--display); color:transparent; -webkit-text-stroke:1.5px var(--cream-dim); margin-bottom:6px; }
.howcell p{ color:var(--cream-dim); font-size:14px; line-height:1.6; margin:0; }
.site-foot{ margin-top:50px; padding:50px clamp(18px,4vw,56px) calc(40px + env(safe-area-inset-bottom,0px)); border-top:1px solid var(--line); }
.foot-grid{ max-width:1240px; margin:0 auto; display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:30px; }
.foot-brand p{ color:var(--cream-dim); font-size:13.5px; margin:14px 0 0; }
.foot-col{ display:flex; flex-direction:column; gap:10px; } .foot-col strong{ font-size:13px; margin-bottom:4px; color:var(--cream); }
.foot-col a{ color:var(--cream-dim); font-size:13.5px; text-decoration:none; } .foot-col a:hover{ color:var(--cream); text-decoration:underline; }
.foot-copy{ max-width:1240px; margin:36px auto 0; color:var(--cream-dim); font-size:12px; opacity:.8; }
.reveal{ opacity:0; transform:translateY(30px); transition:opacity .75s var(--ease-smooth), transform .75s var(--ease-smooth); } .reveal.in{ opacity:1; transform:none; }

/* ---------- MODAL ---------- */
.watch-choice-backdrop{ position:fixed; inset:0; z-index:500; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(0,0,0,.75); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); animation:fade-in .2s; overflow-y:auto; }
@keyframes fade-in{ from{ opacity:0;} to{ opacity:1;} }
.watch-choice-dialog{ width:min(100%,640px); position:relative; border-radius:10px; overflow:hidden; background:var(--surface); color:var(--cream); border:1px solid var(--line); box-shadow:0 50px 120px rgba(0,0,0,.8); animation:dialog-in .45s var(--spring); margin:auto; }
@keyframes dialog-in{ from{ opacity:0; transform:perspective(900px) rotateX(10deg) translateY(40px) scale(.94);} to{ opacity:1; transform:none;} }
.watch-choice-close{ position:absolute; right:14px; top:14px; z-index:3; width:36px; height:36px; border-radius:50%; border:0; background:#181818; color:#fff; font-size:22px; line-height:1; cursor:pointer; display:grid; place-items:center; }
.wc-cover{ position:relative; min-height:230px; display:flex; align-items:flex-end; background-color:hsl(var(--h,350),50%,18%); background-size:cover; background-position:center 20%; --h:350; }
.wc-cover-fade{ position:absolute; inset:0; background:linear-gradient(0deg,var(--surface) 2%,rgba(0,0,0,.35) 60%,rgba(0,0,0,.1)); }
.wc-cover-text{ position:relative; padding:26px 30px 14px; width:100%; }
.watch-choice-kicker{ font:800 12px var(--body); letter-spacing:.34em; color:var(--red); margin-bottom:6px; }
.watch-choice-dialog h2{ font-family:var(--body); font-weight:900; font-size:clamp(28px,5vw,44px); letter-spacing:-.03em; margin:0; line-height:1; color:var(--cream); }
.wc-body{ padding:6px 30px 30px; }
.wc-body>p{ color:var(--cream-dim); font-size:14.5px; line-height:1.6; margin:0 0 18px; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden; }
.watch-choice-dialog label{ margin:0 0 7px; display:block; } .watch-choice-dialog label span{ opacity:.6; font-weight:500; text-transform:none; letter-spacing:0; }
.watch-choice-actions{ display:grid; gap:10px; margin-top:18px; }
.watch-mode-card{ appearance:none; display:flex; align-items:center; gap:15px; width:100%; padding:14px 16px; border-radius:8px; text-align:left; cursor:pointer; color:var(--cream); border:1px solid var(--line); background:var(--surface-2); box-shadow:0 4px 0 var(--lip); transition:transform .12s, box-shadow .12s, background .2s; }
.watch-mode-card:hover{ background:var(--teal); } .watch-mode-card:active{ transform:translateY(4px); box-shadow:0 0 0 transparent; }
.watch-mode-group{ background:var(--red); color:#fff; border-color:transparent; box-shadow:0 4px 0 #8a050d; } .watch-mode-group:hover{ background:#f01a26; } .watch-mode-group small{ color:rgba(255,255,255,.8) !important; } .watch-mode-group .watch-mode-arrow{ color:#fff !important; }
.watch-mode-icon{ width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:50%; background:rgba(127,127,127,.18); font-size:17px; }
.watch-mode-card strong, .watch-mode-card small{ display:block; } .watch-mode-card strong{ font-size:15px; margin-bottom:3px; } .watch-mode-card small{ color:var(--cream-dim); font-size:12px; } .watch-mode-arrow{ margin-left:auto; font-size:20px; color:var(--cream-dim); }
.watch-choice-error{ color:#ff6b73; font-size:12.5px; min-height:16px; margin-top:12px; }

/* ---------- SOLO ---------- */
.solo-screen{ min-height:70vh; } .solo-topbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:24px; }
.solo-brand{ font:400 14px var(--display); letter-spacing:2.5px; color:var(--cream-dim); } .solo-brand span{ color:var(--red); }
.solo-heading{ margin-bottom:18px; } .solo-player-wrap{ width:100%; overflow:hidden; border-radius:10px; background:#000; border:1px solid var(--line); box-shadow:0 50px 90px -40px var(--shadow-c); }
.solo-player-wrap video{ display:block; width:100%; max-height:78vh; background:#000; }

/* ---------- ROOM: custom tactile controls ---------- */
.screen-frame{ border-radius:12px !important; box-shadow:0 40px 90px -40px var(--shadow-c) !important; }
.controls{ border-radius:0 0 12px 12px; }
.code-chip{ border-radius:10px; } .code-chip .val{ color:var(--red); letter-spacing:5px; }
.copy-btn,.leave-btn{ border-radius:6px; box-shadow:0 2px 0 var(--lip); transition:transform .1s, box-shadow .1s, background .15s; }
.copy-btn:hover,.leave-btn:hover{ transform:none; } .copy-btn:active,.leave-btn:active{ transform:translateY(2px); box-shadow:none; }
.copy-btn-ghost{ border-color:var(--red); color:var(--red); background:transparent; } .copy-btn-ghost:hover{ background:rgba(229,9,20,.1); }
.leave-btn:hover{ border-color:var(--red); color:var(--red); background:transparent; }
.icon-btn{ background:var(--surface-2); border:1px solid var(--line); color:var(--cream); border-radius:9px; box-shadow:0 3px 0 var(--lip); transition:transform .1s, box-shadow .1s, background .15s, color .15s; }
.icon-btn:hover{ background:var(--teal); transform:none; box-shadow:0 3px 0 var(--lip); }
.icon-btn:active{ transform:translateY(3px); box-shadow:0 0 0 transparent; }
.icon-btn.on, .chat-overlay-btn.on, #vkbd-toggle-btn.on{ background:var(--red) !important; border-color:transparent !important; color:#fff !important; box-shadow:0 3px 0 #8a050d !important; }
.icon-btn.on:active{ transform:translateY(3px); box-shadow:0 0 0 transparent !important; }
.security-btn{ color:var(--red); }
input[type=range]{ accent-color:var(--red); }
input[type=range]::-webkit-slider-thumb{ background:#fff; border:3px solid var(--red); width:16px; height:16px; margin-top:-5.5px; box-shadow:0 3px 6px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb{ background:#fff; border:3px solid var(--red); }
.popover{ background:var(--surface) !important; color:var(--cream); border:1px solid var(--line); box-shadow:0 24px 50px -20px var(--shadow-c); border-radius:10px; }
.speed-grid button, .ai-mode-grid button, .sticker-grid button{ background:var(--surface-2); color:var(--cream); border:1px solid var(--line); border-radius:7px; box-shadow:0 2px 0 var(--lip); }
.speed-grid button.active, .ai-mode-grid button.active{ background:var(--red); color:#fff; border-color:transparent; box-shadow:0 2px 0 #8a050d; }
.chat-panel{ border-radius:12px; background:var(--surface); }
.msg .bubble{ background:var(--surface-2); color:var(--cream); }
.send-btn, .code-submit-btn{ background:var(--red) !important; color:#fff !important; border-radius:8px; box-shadow:0 3px 0 #8a050d; }
.count-badge{ background:var(--red); color:#fff; }
.sync-dot{ background:#46d369; }
html.light .toast{ background:var(--surface); color:var(--cream); }
html.light .vkbd{ background:rgba(255,255,255,.7); }

/* ---------- responsive ---------- */
@media (max-width:980px){
  .hero-inner{ grid-template-columns:1fr; gap:18px; } .hero-poster{ --cw:190px; order:-1; width:100%; max-width:420px; height:calc(var(--cw)*1.5 + 40px); justify-self:start; }
  .stack-card{ left:34%; } .hero{ min-height:0; padding-top:calc(var(--nav-h) + 16px); padding-bottom:84px; }
  .together{ grid-template-columns:1fr; } .scene{ max-width:560px; margin:0 auto; width:100%; }
  .cards{ grid-template-columns:1fr; } .howrow{ grid-template-columns:1fr; } .howcell{ padding:18px 0; border-bottom:1px solid var(--line); }
  .nav-links{ display:none; } .foot-grid{ grid-template-columns:1fr 1fr; } .foot-brand{ grid-column:1/-1; }
}
@media (max-width:600px){
  :root{ --nav-h:60px; } .wordmark{ font-size:25px; } .nav{ gap:12px; } .nav-right{ gap:10px; } .nav-cta{ padding:8px 12px; font-size:12.5px; } .theme-switch{ width:58px; height:30px; } .ts-thumb{ width:24px; height:24px; } .theme-switch[aria-checked="true"] .ts-thumb{ transform:translateX(28px); } .ts-track{ padding:0 7px; }
  .hero h1{ font-size:clamp(40px,12.5vw,64px); } .btn-hero{ flex:1 1 auto; justify-content:center; padding:11px 16px; } .hero-dots{ bottom:36px; }
  .library-section{ padding-top:36px; } .library-heading{ flex-direction:column; align-items:flex-start; }
  .catalog-card{ flex-basis:136px; } .top-card{ flex-basis:172px; padding-left:54px; } .top-card .rank{ font-size:146px; letter-spacing:-6px; } .top-card .catalog-card-info{ left:54px; }
  .ticket{ padding:24px 20px; } .code-input{ font-size:32px !important; letter-spacing:10px !important; }
  .wc-cover{ min-height:180px; } .wc-cover-text{ padding:20px 20px 10px; } .wc-body{ padding:4px 20px 24px; }
  .s-chat{ font-size:11px; padding:8px 11px; } .solo-topbar{ align-items:flex-start; flex-direction:column; }
  #screen-room, #screen-solo{ padding-left:calc(14px + env(safe-area-inset-left,0px)); padding-right:calc(14px + env(safe-area-inset-right,0px)); padding-top:calc(72px + env(safe-area-inset-top,0px)); }
}
@media (prefers-reduced-motion:reduce){ *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } .reveal{ opacity:1; transform:none; } }

/* ---------- v6 polish ---------- */
.wordmark{ text-shadow:1px 1px 0 #b20710, 2px 2px 0 #8c0610, 3px 4px 0 #6d050d, 4px 7px 10px rgba(0,0,0,.4); transform:perspective(500px) rotateX(8deg) rotateY(-5deg); }
.hero{ padding-bottom:120px; } .hero-dots{ bottom:64px; }
.library-section{ margin-top:-30px; }
html.light .library-section{ margin-top:0; padding-top:56px; }
.hero-fade{ background:
  linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.5) 40%, rgba(0,0,0,.05) 78%),
  linear-gradient(0deg, var(--bg) 0, rgba(0,0,0,0) 90px),
  linear-gradient(180deg, rgba(0,0,0,.65), transparent 160px); }
@media (max-width:980px){ .hero{ padding-bottom:120px; } }

/* =====================================================================
   v7 — SEARCH + DAY MODE FIXES
   ===================================================================== */

/* ---------- search ---------- */
.nav-search-btn{ appearance:none; border:0; background:none; cursor:pointer; width:38px; height:38px; display:grid; place-items:center; border-radius:50%; color:rgba(255,255,255,.88); transition:background .2s, color .2s, transform .12s; }
.nav-search-btn svg{ width:20px; height:20px; }
.nav-search-btn:hover{ background:rgba(127,127,127,.22); color:#fff; }
.nav-search-btn:active{ transform:scale(.92); }
.nav.solid .nav-search-btn{ color:var(--cream-dim); } .nav.solid .nav-search-btn:hover{ color:var(--cream); }
body:not([data-screen="screen-home"]) .nav-search-btn, body.no-catalog .nav-search-btn, body.no-catalog .library-search{ display:none; }

.library-search{ position:relative; display:flex; align-items:center; gap:10px; margin:18px clamp(18px,4vw,56px) 0; max-width:560px; padding:0 14px; height:50px; border-radius:8px; background:var(--surface); border:1px solid var(--line); box-shadow:0 4px 0 var(--lip); transition:border-color .2s, box-shadow .2s; }
.library-search:focus-within{ border-color:var(--cream); box-shadow:0 4px 0 var(--lip), 0 0 0 3px rgba(229,9,20,.25); }
.library-search .ls-icon{ width:20px; height:20px; flex:0 0 20px; color:var(--cream-dim); }
.library-search input{ flex:1 1 auto; min-width:0; height:100%; border:0 !important; outline:0; background:transparent !important; box-shadow:none !important; color:var(--cream); font:500 16px var(--body); padding:0 !important; -webkit-appearance:none; appearance:none; }
.library-search input::placeholder{ color:var(--cream-dim); opacity:.7; }
.library-search input::-webkit-search-cancel-button, .library-search input::-webkit-search-decoration{ -webkit-appearance:none; display:none; }
.ls-clear{ appearance:none; border:0; cursor:pointer; width:26px; height:26px; flex:0 0 26px; border-radius:50%; background:var(--surface-2); color:var(--cream); font-size:18px; line-height:1; display:grid; place-items:center; }
.ls-clear:hover{ background:var(--red); color:#fff; } .ls-clear[hidden]{ display:none; }
.ls-key{ font:700 11px var(--body); color:var(--cream-dim); border:1px solid var(--line); border-radius:4px; padding:2px 7px; box-shadow:0 2px 0 var(--lip); }
.library-search:focus-within .ls-key, .library-search:has(.ls-clear:not([hidden])) .ls-key{ display:none; }
@media (hover:none){ .ls-key{ display:none; } }
/* results wrap into a grid instead of a one-line scroller */
#row-all .row-track{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:16px; overflow:visible; scroll-snap-type:none; }
#row-all .catalog-card{ flex:none; width:auto; }
#row-all .row-arrow{ display:none !important; }

/* ---------- day mode: hero ---------- */
html.light .hero{ background:var(--bg); color:var(--cream); }
html.light .hero-bg{ filter:blur(34px) saturate(1.2) brightness(1.2); opacity:.5; background-color:#ecd9db; }
html.light .hero-bg::after{ background:radial-gradient(ellipse 60% 70% at 78% 45%, hsla(var(--h),80%,60%,.22), transparent 70%); }
html.light .hero-fade{ background:
  linear-gradient(90deg, rgba(244,243,240,.95) 0%, rgba(244,243,240,.65) 42%, rgba(244,243,240,0) 82%),
  linear-gradient(0deg, var(--bg) 0, rgba(244,243,240,0) 90px),
  linear-gradient(180deg, rgba(244,243,240,.85), rgba(244,243,240,0) 150px); }
html.light .hero h1{ color:var(--cream); text-shadow:none; }
html.light .hero p{ color:#3b3b42; text-shadow:none; }
html.light .hero-kicker{ color:var(--cream-dim); }
html.light .hero-tags b{ color:#1a9c43; }
html.light .hero-tags u{ border-color:rgba(20,20,22,.4); color:#3b3b42; }
html.light .btn-hero-play{ background:#141416; color:#fff; box-shadow:0 4px 0 #000; } html.light .btn-hero-play:hover{ background:#2a2a2e; }
html.light .btn-hero-ghost{ background:rgba(20,20,22,.1); color:var(--cream); box-shadow:0 4px 0 var(--lip); } html.light .btn-hero-ghost:hover{ background:rgba(20,20,22,.16); }
html.light .btn-hero:active{ box-shadow:0 0 0 transparent; }
html.light .hero-dots button{ background:rgba(20,20,22,.22); } html.light .hero-dots button.on::after{ background:#141416; }
html.light .hero-poster::after{ background:radial-gradient(ellipse at center, rgba(40,28,16,.45), transparent 70%); }

/* ---------- day mode: nav over the hero ---------- */
html.light body[data-screen="screen-home"] .nav:not(.solid){ background:linear-gradient(180deg, rgba(244,243,240,.92), rgba(244,243,240,0)); }
html.light .nav-links a{ color:var(--cream-dim); } html.light .nav-links a:hover{ color:var(--cream); }
html.light .nav-search-btn{ color:var(--cream-dim); } html.light .nav-search-btn:hover{ color:var(--cream); }
html.light .wordmark{ text-shadow:1px 1px 0 #b20710, 2px 2px 0 #8c0610, 3px 4px 0 #6d050d, 4px 7px 10px rgba(40,28,16,.28); }

/* ---------- day mode: other leftovers ---------- */
html.light .library-section{ margin-top:0; }
html.light .row-arrow.left{ background:linear-gradient(90deg,var(--bg),rgba(244,243,240,0)); }
html.light .row-arrow.right{ background:linear-gradient(-90deg,var(--bg),rgba(244,243,240,0)); }
html.light .s-seat{ border-color:var(--bg); }
html.light .setup-banner code{ background:rgba(20,20,22,.1); }
/* captions sit on the video, so they stay light-on-dark in every theme */
video::cue{ color:#fff; background:rgba(11,14,20,.78); }
/* video-overlay UI (full view + floating chat) always sits on dark footage:
   give it the night palette even while the rest of the page is in day mode */
html.light #screen-room.theater,
html.light #screen-room.chat-floating .chat-panel{
  --cream:#f5f5f1; --cream-dim:#c3c3ca; --surface:#171719; --surface-2:#232326;
  --line:rgba(255,255,255,.16); --teal:#2a2a2e; --teal-light:#202023; --input-bg:#0f0f11; --lip:rgba(0,0,0,.55);
}
html.light #screen-room.theater .chat-panel{ background:rgba(18,22,31,.55); }
html.light #screen-room.chat-floating .chat-panel .chat-head,
html.light #screen-room.chat-floating .chat-panel .chat-foot{ color:var(--cream); }

/* ---------- browse-all call to action ---------- */
.browse-cta{ display:flex; flex-direction:column; align-items:center; gap:10px; margin:6px clamp(18px,4vw,56px) 0; padding-top:10px; text-align:center; }
.browse-cta[hidden]{ display:none; }
.btn-browse{ display:inline-flex; align-items:center; gap:10px; background:var(--red); color:#fff; text-decoration:none; font-weight:800; font-size:16px; padding:14px 28px; border-radius:6px; box-shadow:0 4px 0 #8a050d; transition:transform .12s, box-shadow .12s, filter .2s; }
.btn-browse:hover{ filter:brightness(1.1); } .btn-browse:active{ transform:translateY(4px); box-shadow:0 0 0 transparent; }
.btn-browse i{ font-style:normal; transition:transform .2s; } .btn-browse:hover i{ transform:translateX(4px); }
.browse-cta small{ color:var(--cream-dim); font-size:12.5px; }
.nav-links a.nav-browse{ color:var(--cream); font-weight:700; }
.nav-links a.nav-browse.current{ color:var(--red); }

/* =====================================================================
   BROWSE PAGE
   ===================================================================== */
body[data-screen="screen-browse"] .nav-logo{ pointer-events:auto; }
.nav-home-link{ display:none; color:var(--cream-dim); text-decoration:none; font-weight:700; font-size:14px; }
@media (min-width:981px){ body[data-screen="screen-browse"] .nav-links{ display:flex; } }
@media (max-width:980px){ .nav-home-link{ display:inline; } }
.browse-page{ max-width:1400px; margin:0 auto; padding:calc(var(--nav-h) + 44px + env(safe-area-inset-top,0px)) clamp(18px,4vw,56px) 40px; min-height:80vh; }
.browse-head h1{ font-family:var(--body); font-weight:900; letter-spacing:-.03em; font-size:clamp(34px,5vw,58px); line-height:1; margin:0 0 10px; color:var(--cream); }
.browse-head p{ color:var(--cream-dim); font-size:15px; line-height:1.6; margin:0; max-width:620px; }
.bh-kicker{ font:800 12px var(--body); letter-spacing:.34em; color:var(--red); margin-bottom:12px; }
.bf{ margin-top:28px; display:flex; flex-direction:column; gap:16px; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:0 30px 50px -36px var(--shadow-c); }
.bf .library-search{ margin:0; max-width:none; box-shadow:none; background:var(--input-bg); }
.bf-chips{ display:flex; gap:8px; overflow-x:auto; padding:2px 2px 6px; scrollbar-width:none; }
.bf-chips::-webkit-scrollbar{ display:none; } .bf-chips[hidden]{ display:none; }
.bf-chip{ appearance:none; flex:0 0 auto; display:inline-flex; align-items:center; gap:8px; cursor:pointer; padding:9px 16px; border-radius:999px; border:1px solid var(--line); background:var(--surface-2); color:var(--cream); font:700 13.5px var(--body); box-shadow:0 3px 0 var(--lip); transition:transform .1s, box-shadow .1s, background .15s; }
.bf-chip em{ font-style:normal; font-size:11px; opacity:.6; }
.bf-chip:hover{ background:var(--teal); } .bf-chip:active{ transform:translateY(3px); box-shadow:none; }
.bf-chip.on{ background:var(--red); border-color:transparent; color:#fff; box-shadow:0 3px 0 #8a050d; } .bf-chip.on em{ opacity:.85; }
.bf-selects{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto; gap:12px; align-items:end; }
.bf-field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.bf-field span{ color:var(--cream-dim); font-size:11px; letter-spacing:.12em; text-transform:uppercase; font-weight:700; }
.bf-field select{ width:100%; height:46px; padding:0 12px; border-radius:6px; border:1px solid var(--line); background:var(--input-bg); color:var(--cream); font:600 14px var(--body); cursor:pointer; }
.bf-field select:focus{ outline:none; border-color:var(--cream); box-shadow:0 0 0 3px rgba(229,9,20,.25); }
.bf-reset{ appearance:none; height:46px; padding:0 18px; border-radius:6px; border:1px solid var(--red); background:transparent; color:var(--red); font:700 13.5px var(--body); cursor:pointer; white-space:nowrap; }
.bf-reset:hover{ background:rgba(229,9,20,.1); } .bf-reset[hidden]{ display:none; }
.bf-count{ margin:22px 0 4px; color:var(--cream-dim); font-size:12px; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.browse-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(clamp(140px,14vw,200px),1fr)); gap:18px; padding:26px 0 40px; margin:0; overflow:visible; }
.browse-grid .catalog-card{ flex:none; width:auto; }
.browse-page .catalog-empty{ margin:14px 0 0; } .bf-reset.show{ display:inline-block; margin-top:10px; }
@media (max-width:980px){ .bf-selects{ grid-template-columns:1fr 1fr; } .bf-reset{ grid-column:1/-1; } }
@media (max-width:600px){ .bf{ padding:14px; } .browse-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }

/* =====================================================================
   v9 — NETFLIX POLISH
   ===================================================================== */
/* featured grid: 6 / 4 / 3 / 2 columns (all divide 12, so no ragged last row, no empty right edge) */
@media (max-width:1280px){ #row-all .row-track{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:900px){ #row-all .row-track{ grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; } }
@media (max-width:560px){ #row-all .row-track{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }
#row-all .row-track{ padding-top:22px; margin-top:0; }
.row-head{ display:flex; align-items:baseline; justify-content:space-between; gap:14px; margin:0 clamp(18px,4vw,56px); }
.row-head .row-title{ margin:0; }
.row-explore{ color:var(--cream-dim); font-size:13.5px; font-weight:700; text-decoration:none; white-space:nowrap; transition:color .2s; }
.row-explore i{ font-style:normal; font-size:20px; display:inline-block; vertical-align:-2px; margin-left:2px; transition:transform .25s var(--ease-smooth); }
.row-explore:hover{ color:var(--red); } .row-explore:hover i{ transform:translateX(5px); }
#row-all.searching .row-explore{ display:none; }

/* card extras */
.catalog-card-info span.cm{ color:#46d369; font-weight:700; font-size:11.5px; }
html.light .catalog-card-info span.cm{ color:#6ff08f; }
.card-badge{ position:absolute; top:0; left:0; z-index:3; padding:4px 9px 4px 8px; background:var(--red); color:#fff; font:800 10px var(--body); letter-spacing:.1em; border-radius:0 0 6px 0; box-shadow:0 4px 10px rgba(0,0,0,.45); }
.catalog-card::after{ content:''; position:absolute; left:0; right:0; bottom:0; height:3px; background:var(--red); transform:scaleX(0); transform-origin:left; transition:transform .35s var(--ease-smooth); border-radius:0 0 6px 6px; z-index:4; }
.catalog-card:hover::after, .catalog-card:focus-visible::after{ transform:scaleX(1); }

/* loading skeleton */
.sk-card{ aspect-ratio:2/3; border-radius:6px; background:linear-gradient(100deg, var(--surface-2) 30%, var(--teal-light) 50%, var(--surface-2) 70%); background-size:220% 100%; animation:sk-shimmer 1.4s linear infinite; box-shadow:0 0 0 1px var(--line); }
@keyframes sk-shimmer{ from{ background-position:120% 0; } to{ background-position:-120% 0; } }

/* hero tags: real metadata chips */
.hero-tags u{ white-space:nowrap; }

/* ---------- Netflix-style detail modal ---------- */
.watch-choice-dialog{ width:min(100%,680px); border-radius:12px; }
.wc-cover{ min-height:300px; }
.wc-cover-fade{ background:linear-gradient(0deg,var(--surface) 3%,rgba(0,0,0,.25) 55%,rgba(0,0,0,.05)); }
.wc-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; margin:2px 0 14px; font-size:13.5px; font-weight:700; color:var(--cream-dim); }
.wc-meta[hidden]{ display:none; }
.wc-meta b{ color:#1fae4b; font-weight:800; }
.wc-meta u{ text-decoration:none; font-size:11.5px; padding:3px 10px; border:1px solid var(--line); border-radius:999px; color:var(--cream); background:var(--surface-2); }
.wc-body>p{ color:var(--cream); opacity:.85; font-size:15px; }
.watch-choice-actions{ margin-top:16px; }
.watch-mode-icon svg{ width:20px; height:20px; display:block; }
.watch-mode-arrow svg{ width:20px; height:20px; display:block; }
.watch-mode-solo{ background:var(--cream); color:var(--bg); border-color:transparent; box-shadow:0 4px 0 var(--lip); }
.watch-mode-solo:hover{ background:var(--cream); filter:brightness(.93); }
.watch-mode-solo small, .watch-mode-solo .watch-mode-arrow{ color:var(--bg) !important; opacity:.7; }
.watch-mode-solo .watch-mode-icon{ background:rgba(127,127,127,.22); }
.watch-mode-group .watch-mode-icon{ background:rgba(255,255,255,.2); }
@media (max-width:600px){ .wc-cover{ min-height:210px; } }

/* moviesss.fun — longer wordmark fits nav */
.wordmark{ font-size:26px; letter-spacing:1.6px; text-transform:uppercase; }
@media (max-width:760px){ .wordmark{ font-size:19px; letter-spacing:1px; } }
