/* Экран передачи на телефоне (handoff.html) и ввод кода на ТВ (/tv/). Макет Codex
   design-archive/2026-10-15/tv-handoff-v1: цвета и шрифты нынешнего каталога, ТВ — кадр 1600×900
   со сценой «Блица» под градиентом. На узком экране /tv/ — обычная колонка, без масштаба кадра.
   Автор: AlmazNurmukhametov */
:root{color-scheme:dark;--bg:#0b0b10;--ink:#f5f2ec;--muted:#b8b2c0;--gold:#ffc84a}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.45 'Golos Text',system-ui,sans-serif}
h1,p{margin:0}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,a:focus-visible,input:focus{outline:3px solid var(--gold);outline-offset:4px}
a{color:var(--gold)}
.wordmark{font-family:'Russo One',sans-serif;letter-spacing:-.4px}
.eyebrow{font-size:12px;letter-spacing:1.7px;text-transform:uppercase;color:var(--gold);font-weight:700}
.primary{border:0;background:var(--ink);color:#15131b;border-radius:12px;font-weight:700;min-height:56px;padding:14px 18px;display:flex;align-items:center;justify-content:center;gap:12px;text-decoration:none}
.primary[disabled],.secondary[disabled]{opacity:.45;cursor:default}
.secondary{background:transparent;color:var(--ink);border:1px solid #ffffff30;border-radius:12px;min-height:48px;padding:10px 12px;font-size:14px}

/* ---------- телефон ---------- */
.handoff{min-height:100svh;background:radial-gradient(ellipse at 100% 0,#3e293c66,transparent 60%),var(--bg)}
.mobile-head{padding:20px 20px 14px;border-bottom:1px solid #ffffff17;display:flex;flex-direction:column;gap:8px}
.mobile-head .wordmark{font-size:21px;color:var(--ink);text-decoration:none}
.room-state{font-size:12px;color:var(--muted)}
.room-state:before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--gold);margin-right:7px}
.phone-main{padding:25px 20px calc(16px + env(safe-area-inset-bottom));max-width:460px;margin:auto}
.phone-main h1{font-size:28px;line-height:1.16;letter-spacing:-.7px;margin:10px 0 12px;font-weight:750}
.lead{font-size:15px;color:var(--muted);line-height:1.45}
.connection{margin-top:22px;background:#19161f;border:1px solid #ffffff20;border-radius:16px;padding:18px}
.step-label{display:flex;align-items:center;gap:8px;font-size:12px;color:#d0cbd5}
.step-label b{font-weight:inherit}
.step-label span{flex:none;width:22px;height:22px;border:1px solid #ffffff30;border-radius:50%;display:grid;place-items:center;color:var(--gold);font-size:12px}
.address{font-size:21px;letter-spacing:-.6px;font-weight:650;margin:9px 0 0;overflow-wrap:anywhere}
.address span{color:var(--gold);white-space:nowrap}
.separator{height:1px;background:#ffffff1b;margin:16px 0}
.room-code{display:block;font-size:57px;font-weight:750;line-height:1.1;letter-spacing:10px;margin-top:10px}
.code-note{font-size:12px;color:var(--muted);margin-top:6px}
.alternative{font-size:13px;color:var(--muted);margin:16px 0 20px}
.actions{display:grid;gap:10px}
.actions .secondary{display:flex;align-items:center;justify-content:center;text-decoration:none}
.actions a[aria-disabled=true]{opacity:.45;pointer-events:none}
.actions .primary{font-size:15px;padding-inline:10px;white-space:nowrap}
.fine{font-size:12px;color:var(--muted);text-align:center;line-height:1.4}
.gone{margin-top:22px;padding:16px 18px;border:1px solid #ffd28c55;border-radius:16px;color:#ffd28c;font-size:15px}
.gone a{display:inline-block;margin-top:10px;font-weight:700}
@media(max-width:350px){
  .mobile-head{padding:14px 16px 10px;gap:4px}.mobile-head .wordmark{font-size:19px}
  .phone-main{padding:12px 16px calc(4px + env(safe-area-inset-bottom))}
  .phone-main h1{font-size:25px;margin:6px 0 8px}.lead{font-size:14px}
  .connection{padding:12px;margin-top:12px}.address{font-size:19px}.separator{margin:10px 0}
  .room-code{font-size:44px;letter-spacing:9px;margin-top:6px}
  .alternative{margin:10px 0;font-size:12px}.actions{gap:8px}
  .actions .primary{font-size:14px;min-height:52px}.secondary{font-size:12px;min-height:44px}.fine{font-size:12px}
}

/* ---------- ТВ: кадр 1600×900, вписанный в окно (--scale из tv.js) ---------- */
.tv-entry{overflow:hidden}
.tv-stage{position:absolute;width:1600px;height:900px;left:50%;top:50%;transform:translate(-50%,-50%) scale(var(--scale,1));overflow:hidden;background:#0b0b10}
.tv-head{position:absolute;z-index:2;left:64px;right:64px;top:40px;display:flex;justify-content:space-between;align-items:center}
.tv-head .wordmark{font-size:29px}
.tv-head>span:last-child{font-size:19px;color:#c3bdca}
.tv-art{position:absolute;right:0;top:0;bottom:0;width:1100px;background:url(/img/editions/blitz-stage.webp) 70% center/cover no-repeat;opacity:.65}
.tv-shade{position:absolute;inset:0;background:linear-gradient(90deg,#0b0b10 0%,#0b0b10f5 30%,#0b0b1080 65%,#0b0b1020),linear-gradient(0deg,#0b0b10,transparent 55%)}
.tv-copy{position:absolute;left:96px;top:200px;width:1090px}
.tv-copy .eyebrow{font-size:18px;letter-spacing:2.3px}
.tv-copy h1{font-family:'Russo One',sans-serif;font-size:66px;line-height:1.12;letter-spacing:-1px;font-weight:400;margin:20px 0}
.tv-copy>p{font-size:26px;color:#d0cbd5;line-height:1.4}
.tv-copy form{margin-top:40px}
.tv-copy label{display:block;font-size:20px;margin-bottom:12px}
.entry-row{display:flex;gap:22px;align-items:center}
.entry-row input{width:380px;height:100px;border:2px solid var(--gold);background:#17151de8;border-radius:12px;color:var(--ink);padding:12px 25px;font-size:51px;letter-spacing:15px;text-transform:uppercase;font-weight:650}
.entry-row input::placeholder{color:#827b8b;font-weight:400}
.entry-row input[aria-invalid=true]{border-color:#ff8f7a}
.entry-row .primary{height:100px;font-size:24px;padding-inline:30px}
#code-help{font-size:19px;color:#bdb7c7;margin-top:14px}
#join-status{font-size:21px;color:#ffd28c;line-height:1.35;margin-top:15px;min-height:30px}
/* «С телефона? Войти игроком» — запасной выход, если телефон не распознался (pttv.ru открывает этот экран всем) */
.tv-phone{font-size:17px;color:#bdb7c7;margin-top:6px}.tv-phone a{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.tv-footer{position:absolute;left:64px;right:64px;bottom:40px;display:flex;justify-content:space-between;gap:40px;font-size:18px;color:#bdb7c7}
.tv-footer b{font-weight:600;color:var(--ink)}

/* /tv/ открыли на телефоне или в узком окне: колонка вместо кадра, цели не сжимаются.
   Медиазапрос, а не класс из JS: без мигания кадра до скрипта */
@media (max-width:759px){
  .tv-entry{overflow:auto}
  .tv-stage{position:static;width:auto;height:auto;transform:none;min-height:100svh;padding:20px 20px calc(24px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:28px}
  .tv-head,.tv-copy,.tv-footer{position:static;width:auto}
  .tv-head{flex-direction:column;align-items:flex-start;gap:6px}
  .tv-head .wordmark{font-size:21px}.tv-head>span:last-child{font-size:13px}
  .tv-art{display:none}.tv-shade{display:none}
  .tv-copy .eyebrow{font-size:12px;letter-spacing:1.7px}
  .tv-copy h1{font-size:30px;margin:10px 0 12px}
  .tv-copy>p{font-size:15px}.tv-copy>p br{display:none}
  .tv-copy form{margin-top:24px}.tv-copy label{font-size:14px;margin-bottom:8px}
  .entry-row{flex-direction:column;align-items:stretch;gap:12px}
  .entry-row input{width:100%;height:64px;font-size:32px;letter-spacing:10px;padding:8px 16px}
  .entry-row .primary{height:56px;font-size:16px}
  #code-help{font-size:13px}#join-status{font-size:15px;min-height:22px}.tv-phone{font-size:14px}
  .tv-footer{flex-direction:column;gap:6px;font-size:13px;margin-top:auto}
}
