:root { --bg: #1d1250; --card: rgba(255,255,255,.09); --line: rgba(255,255,255,.16); --text: #f4f1ff; --muted: #b7aedb; --gold: #ffd43b;
  --ok: #2ea043; --bad: #e5484d; --c0: #e5484d; --c1: #2f81f7; --c2: #e8a317; --c3: #2ea043; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: linear-gradient(170deg, #2c1a6b, var(--bg) 60%); color: var(--text); font-family: -apple-system, "SF Pro Text", Roboto, system-ui, sans-serif;
  display: flex; flex-direction: column; overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; min-height: 52px; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; min-width: 0; }
.me .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: var(--pc); flex: none; }
.score { font-weight: 800; font-size: 17px; color: var(--gold); white-space: nowrap; }
#screen { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 18px; min-height: 0; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.muted { color: var(--muted); }
h1 { font-size: 30px; font-weight: 900; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.2; }
p { font-size: 17px; line-height: 1.35; }
.huge { font-size: 92px; line-height: 1; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: spin 1s linear infinite; }

/* вход */
.join { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.join h1 { text-align: center; } .join h1 span { color: var(--gold); }
label { font-size: 15px; color: var(--muted); font-weight: 600; }
input[type=text] { width: 100%; font-size: 22px; font-weight: 700; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); outline: none; -webkit-user-select: text; user-select: text; }
input[type=text]:focus { border-color: var(--gold); }
.avs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avs button { aspect-ratio: 1; font-size: 34px; border-radius: 16px; border: 2px solid transparent; background: var(--card); }
.avs button.sel { border-color: var(--gold); background: rgba(255,212,59,.18); transform: scale(1.05); }
.avs button:disabled { opacity: .22; }
.btn { width: 100%; border: 0; border-radius: 16px; padding: 18px; font-size: 21px; font-weight: 900; background: var(--gold); color: #2a1e00; box-shadow: 0 5px 0 #b38f00; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b38f00; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: none; font-size: 16px; padding: 12px; font-weight: 700; }
.seg { display: flex; gap: 8px; } .seg button { flex: 1; padding: 12px 0; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; font-weight: 800; }
.seg button.sel { border-color: var(--gold); color: var(--gold); }
.capbox { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.bigav { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 70px; background: var(--pc); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: pop .5s cubic-bezier(.2,1.6,.4,1); }

/* голосование и ответы */
.qhead { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.qhead b { color: var(--gold); }
.tbar { height: 6px; border-radius: 6px; background: var(--card); overflow: hidden; margin-bottom: 10px; }
.tbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff922b); }
.q { font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; color: #e6e1ff; }
.pad { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; min-height: 0; }
.pad button { border: 0; border-radius: 20px; background: var(--oc); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px;
  font-size: 19px; font-weight: 800; line-height: 1.15; box-shadow: 0 6px 0 rgba(0,0,0,.28); transition: opacity .25s, transform .25s; word-break: break-word; }
.pad button .l { font-size: 30px; font-weight: 900; opacity: .9; }
.pad button .e { font-size: 38px; }
.pad button:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.pad.locked button { opacity: .25; }
.pad.locked button.sel { opacity: 1; box-shadow: 0 0 0 4px #fff; transform: scale(1.02); }
.status { text-align: center; font-size: 17px; font-weight: 700; color: var(--gold); padding-top: 12px; min-height: 36px; }

/* результат */
.res.ok { color: var(--ok); } .res.bad { color: var(--bad); }
.right { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 18px; font-weight: 700; }
.right b { color: var(--gold); }
.medal { font-size: 110px; line-height: 1; animation: pop .7s cubic-bezier(.2,1.6,.4,1); }
/* тип игрока, подсказка 50/50, «Дальше» */
.seg.kinds button { font-size: 16px; padding: 12px 0; }
.note { font-size: 14px; color: var(--muted); margin-top: -8px; }
.note.warn { color: var(--gold); font-weight: 700; }
.pad button.gone { opacity: .12 !important; filter: grayscale(1); box-shadow: none; }
.pad button.gone span:last-child { text-decoration: line-through; }
.btn.hint { margin-top: 10px; background: var(--card); color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; font-size: 18px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.hint .ei { width: 26px; height: 26px; }
.btn.hint:disabled { opacity: .4; }

.btn.ghost.danger { color: #ff9a9e; font-size: 15px; }
.btn.ghost.danger.armed { background: var(--bad); color: #fff; }

/* цвет раунда как на телевизоре */
body[data-theme="r1"] { background: linear-gradient(170deg, #1f4fb8, #0b1640 60%); }
body[data-theme="r2"] { background: linear-gradient(170deg, #7a1fa0, #1d0b3f 60%); }
body[data-theme="r3"] { background: linear-gradient(170deg, #8a2b0c, #1c0606 60%); }
body[data-theme="climb"] { background: linear-gradient(170deg, #4a3a10, #141038 60%); }
body[data-theme="final"] { background: linear-gradient(170deg, #6b4a00, #1d1250 60%); }

/* боты-соперники у капитана */
.bots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bots button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.bots button .bi { font-size: 30px; line-height: 1; }
.bots button .bi .ei { width: 36px; height: 36px; vertical-align: 0; }
.bots button b { font-size: 15px; }
.bots button small { font-size: 11px; color: var(--muted); line-height: 1.2; text-align: center; }
.bots button.sel { border-color: var(--gold); background: rgba(255,212,59,.15); }

/* знакомые игроки на экране входа */
.known { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.known button { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 30px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-size: 17px; font-weight: 800; }
.known button:active { border-color: var(--gold); transform: scale(.97); }
.known .kav { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); font-size: 20px; }
.known .kav .ei { width: 80%; height: 80%; vertical-align: 0; }

/* реакции и титулы */
.reacts { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.reacts button { flex: 1; aspect-ratio: 1; max-width: 58px; border: 0; border-radius: 16px; background: var(--card); font-size: 28px; display: grid; place-items: center; }
.reacts button .ei { width: 70%; height: 70%; vertical-align: 0; }
.reacts button.hit { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.ttl { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid rgba(255,212,59,.5); border-radius: 14px; padding: 8px 14px; text-align: left; font-size: 30px; width: 100%; }
.ttl .ei { width: 38px; height: 38px; flex: none; }
.ttl b { display: block; font-size: 17px; color: var(--gold); }
.ttl span { display: block; font-size: 14px; color: var(--muted); }
.cf { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.cf i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: cffall linear forwards; }
@keyframes cffall { to { transform: translateY(105vh) rotate(600deg); } }

/* картинки вместо эмодзи */
.ei { display: inline-block; width: 1em; height: 1em; object-fit: contain; vertical-align: -.12em; }
.huge .ei, .medal .ei { width: 1.15em; height: 1.15em; }
.me .av .ei, .bigav .ei { width: 82%; height: 82%; vertical-align: 0; }
.avs button .ei { width: 74%; height: 74%; vertical-align: 0; }
.pad button .e .ei { width: 46px; height: 46px; }
.huge { animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.res.ok { animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.res.bad { animation: shake .5s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- игра по интернету --- */
#screen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.center { justify-content: center; justify-content: safe center; }
.note { font-size: 14px; color: var(--muted); text-align: center; }
.chip { align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--card); border-radius: 999px; padding: 4px 12px 4px 8px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.chip .ei { width: 20px; height: 20px; }
.people { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pp { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 3px 12px 3px 3px; font-size: 15px; font-weight: 700; }
.pp.me { outline: 2px solid var(--gold); }
.pp .av, .mr .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: var(--pc); flex: none; }
.pp .av .ei, .mr .av .ei { width: 22px; height: 22px; }
.share { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.share .link { font-size: 20px; font-weight: 900; color: var(--gold); text-align: center; letter-spacing: .02em; user-select: all; -webkit-user-select: all; }
.share .row { display: flex; gap: 8px; }
.share .row .btn { flex: 1; padding: 12px 6px; font-size: 15px; text-align: center; text-decoration: none; }
a.btn { display: block; text-align: center; text-decoration: none; }
.cap { font-size: 18px; font-weight: 800; color: var(--gold); line-height: 1.3; max-width: 26em; }
.who { font-size: 15px; color: var(--muted); } .who b { color: var(--text); }
.mini { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mr { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 6px 12px 6px 8px; font-size: 16px; }
.mr.me { outline: 2px solid var(--gold); background: rgba(255,212,59,.12); }
.mr.off { opacity: .5; }
.mr .mp { width: 22px; text-align: center; font-weight: 900; color: var(--muted); }
.mr .mn { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr .ms { font-size: 14px; color: var(--muted); white-space: nowrap; } .mr .ms .ei { width: 16px; height: 16px; vertical-align: -3px; }
.mr b { font-size: 18px; color: var(--gold); min-width: 2ch; text-align: right; }
