/* «Тик-Так» поверх общих стилей FUNBASE */
#game { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.in-3d { overflow: hidden; }
body.in-3d #game { height: 100vh; height: 100dvh; }
.card-flat { background: var(--surface); border-radius: 14px; padding: 16px; }
.muted-text { color: var(--muted); font-size: 13px; font-weight: 600; }
.muted { color: var(--muted); }
.tstage { flex: 1; padding: 10px; }

/* ---------- Лобби ---------- */
.lobby { display: grid; gap: 10px; }
.lobby h2 { font-size: 17px; margin: 0 0 10px; }
.lobby-note { margin: 8px 0 0; font-size: 14px; }
.result-banner { background: linear-gradient(135deg, #3a1111, #1c1c21); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 700; }
.result-banner b { color: #ffd84a; }
.parts { display: grid; gap: 8px; margin-bottom: 16px; }
.part { position: relative; text-align: left; border: 2px solid transparent; border-radius: 14px; padding: 14px 14px 12px 64px; cursor: pointer; color: var(--text); display: grid; gap: 3px; min-height: 96px;
  background: linear-gradient(150deg, var(--p1), var(--p2)); }
.part .ic { position: absolute; left: 14px; top: 14px; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.part .ic svg { width: 22px; height: 22px; fill: #fff; }
.part b { font: 900 18px/1.1 var(--font); }
.part small { font-size: 12.5px; color: rgba(255,255,255,.78); font-weight: 600; }
.part .who { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.part .who em { font-style: normal; color: rgba(255,255,255,.55); }
.part .ava { --s: 22px; }
.part.mine { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.part:disabled { cursor: default; }
.part-blind { --p1: #3b2a7a; --p2: #1f1742; }
.part-deaf { --p1: #11665e; --p2: #0b332f; }
.part-mute { --p1: #8a4212; --p2: #43210a; }
.lobby .modes { margin-bottom: 14px; }
.lobby .mode { background: var(--surface-2); padding: 12px; }
.queue { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.queue li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.queue .n { flex: 1; min-width: 0; font-weight: 800; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.queue .n span { overflow: hidden; text-overflow: ellipsis; }
.queue .tag, .tag { font-size: 11px; font-weight: 800; color: var(--muted); }
.queue .mv { display: flex; gap: 6px; }
.queue .mv button { border: 0; background: var(--surface-3); color: var(--text); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.queue .mv button svg { width: 16px; height: 16px; fill: currentColor; }
.queue .mv button[data-rep]:hover { color: #ff5a4f; }
.queue li.off { opacity: .45; }
.seat-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings .check { grid-column: 1 / -1; padding: 0; }
.settings input:not([type=checkbox]) { width: 100%; min-width: 0; }

/* ---------- Верхняя панель, чат, громкость ---------- */
#camBtn .on, #camBtn[aria-pressed="true"] .off, #micBtn .on, #micBtn[aria-pressed="true"] .off { display: none; }
#camBtn[aria-pressed="true"] .on, #micBtn[aria-pressed="true"] .on { display: block; color: var(--ok); }
#camBtn .off, #micBtn .off { color: var(--muted); display: block; }
#camBtn[aria-pressed="true"] .off, #micBtn[aria-pressed="true"] .off { display: none; }
#micBtn.blocked { opacity: .35; }
#chatBtn { position: relative; }
.badge-dot { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font: 900 10px/16px var(--font); text-align: center; }
.vol-wrap { position: relative; }
.vol-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.vol-pop label { margin-bottom: 10px; font-size: 12.5px; }
.vol-pop input { width: 100%; }
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: 340px; height: min(480px, calc(100dvh - 90px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto; }
.chat-msg { background: var(--surface-2); border-radius: 10px 10px 10px 3px; padding: 6px 10px; max-width: 88%; align-self: flex-start; font-size: 14px; overflow-wrap: anywhere; }
.chat-msg b { display: flex; align-items: center; font-size: 12px; color: var(--accent); }
.chat-msg.mine { align-self: flex-end; background: #3a0d14; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; }

/* ---------- 3D ---------- */
.play { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0d0d10; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hud-top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.hud-timer { font: 900 34px/1 ui-monospace, Menlo, monospace; color: #ff3b30; background: rgba(0,0,0,.72); border-radius: 10px; padding: 6px 14px; letter-spacing: .06em; text-shadow: 0 0 14px rgba(255,59,48,.7); }
.hud-timer.low { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.hud-strikes { display: flex; gap: 6px; }
.hud-strikes i { width: 14px; height: 14px; border-radius: 50%; background: #3a1616; box-shadow: inset 0 0 0 2px #5a2222; }
.hud-strikes i.on { background: #ff2a1a; box-shadow: 0 0 10px #ff2a1a; }
.hud-role { position: absolute; left: 12px; top: 12px; z-index: 6; display: grid; gap: 4px; pointer-events: none; max-width: 46%; }
.hud-role .rb { display: inline-flex; align-items: center; gap: 6px; font: 900 13px var(--font); text-transform: uppercase; letter-spacing: .06em; background: rgba(0,0,0,.7); border-radius: 99px; padding: 6px 12px 6px 8px; justify-self: start; }
.hud-role .rb svg { width: 18px; height: 18px; fill: currentColor; }
.hud-role .rb-blind { color: #b7a6ff; } .hud-role .rb-deaf { color: #6fe3d6; } .hud-role .rb-mute { color: #ffb37a; }
.hud-role small { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.75); text-shadow: 0 1px 3px #000; }

body.is-blind .hud-top { display: none; }
.blind-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; width: min(520px, calc(100% - 20px)); text-align: center; display: grid; gap: 4px; color: #8a8a8a; pointer-events: none; }
.blind-hint b { font: 900 15px var(--font); color: #aaa; }
.blind-hint span { font-size: 12.5px; font-weight: 600; }
/* Прицел в центре; у слепого — рука */
.crosshair { position: absolute; left: 50%; top: 50%; z-index: 6; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.6); pointer-events: none; }
.crosshair.blind { width: 64px; height: 64px; margin: -8px 0 0 -26px; background: none; box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M26 6a5 5 0 0 1 10 0v22l3-1a5 5 0 0 1 6 3l3-1a5 5 0 0 1 6 4l1 1a5 5 0 0 1 5 5v8c0 10-8 17-18 17h-4c-7 0-12-3-16-9L10 43a5 5 0 0 1 8-6l8 8z' fill='%23cfcfcf' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); background-size: contain; background-repeat: no-repeat; }
.lock-hint { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 6; background: rgba(0,0,0,.72); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; pointer-events: none; }

.manual { position: absolute; right: 10px; top: 10px; bottom: 150px; z-index: 6; width: min(430px, 44vw); background: rgba(248,244,232,.97); color: #1b1b1b; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.manual nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #e7e0cc; }
.manual nav button { border: 0; border-radius: 8px; padding: 6px 10px; font: 800 12.5px var(--font); background: transparent; color: #444; cursor: pointer; }
.manual nav button.on { background: #1b1b1b; color: #fff; }
.manual-body { flex: 1; overflow: auto; padding: 10px 14px 16px; font-size: 14px; line-height: 1.45; }
.manual-body h3 { margin: 0 0 8px; font: 900 18px var(--font); text-transform: uppercase; }
.manual-body h4 { margin: 12px 0 4px; font: 900 14px var(--font); }
.manual-body ol { margin: 0; padding-left: 20px; }
.manual-body .note { color: #666; font-size: 12.5px; }
.manual-body table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-bottom: 8px; }
.manual-body th, .manual-body td { border: 1px solid #cfc6ad; padding: 4px 5px; text-align: center; }
.manual-body .cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.manual-body .cols ol { list-style: none; padding: 0; display: grid; gap: 4px; }
.manual-body .cols li { background: #fff; border: 1px solid #d8cfb6; border-radius: 6px; padding: 3px 2px; text-align: center; }
.manual-body .cols li b { display: block; font-size: 24px; line-height: 1.1; font-family: "DejaVu Sans", "Segoe UI Symbol", Arial; }
.manual-body .cols li span { display: block; font-size: 9.5px; color: #666; line-height: 1.15; }

.signs { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-height: 132px; overflow: auto; padding: 8px; background: rgba(0,0,0,.6); border-radius: 12px; }
.signs button { border: 0; border-radius: 8px; padding: 8px 10px; font: 900 13px var(--font); background: #fffdf5; color: var(--c); box-shadow: inset 0 0 0 2px var(--c); cursor: pointer; }
.signs button:active, .signs button.sent { transform: scale(.94); background: var(--c); color: #fff; }
.say { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; width: min(560px, calc(100% - 20px)); }
.say input { flex: 1; min-width: 0; font-size: 15px; }
.sign-seen { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 6; background: rgba(0,0,0,.75); border-radius: 10px; padding: 8px 14px; font-weight: 700; pointer-events: none; }
.sign-seen b { font: 900 18px var(--font); }

.flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; transition: opacity .5s; }
.flash.red { background: rgba(255,20,20,.35); opacity: 1; transition: none; }
.flash.green { background: rgba(40,220,110,.28); opacity: 1; transition: none; }
.flash.boom { background: radial-gradient(circle, #fff 0%, #ffcc66 25%, #ff4400 55%, rgba(0,0,0,.9) 100%); opacity: 1; transition: none; animation: boom 1.6s ease-out forwards; }
@keyframes boom { to { opacity: 0; } }
body.shake .play { animation: shake .09s linear 10; }
@keyframes shake { 25% { transform: translate(6px, -4px); } 50% { transform: translate(-5px, 5px); } 75% { transform: translate(4px, 3px); } }

.overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); }
.overlay.end { background: rgba(0,0,0,.45); }
.ov-card { width: min(460px, 100%); background: var(--surface); border-radius: 18px; padding: 22px; text-align: center; display: grid; gap: 10px; justify-items: center; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.ov-card small { font: 800 11px var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.ov-card h2 { margin: 0; font: 900 34px/1 var(--font); text-transform: uppercase; }
.ov-card p { margin: 0; font-size: 14.5px; }
.ov-ic { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; }
.ov-ic svg { width: 38px; height: 38px; fill: #fff; }
.ic-blind { background: #5a45c8; } .ic-deaf { background: #16968a; } .ic-mute { background: #c9621e; }
.ov-big { font: 900 clamp(38px, 9vw, 64px)/1 var(--font); letter-spacing: .02em; }
.ov-big.ok { color: #2cff6a; text-shadow: 0 0 24px rgba(44,255,106,.5); }
.ov-big.bad { color: #ff4a2a; text-shadow: 0 0 24px rgba(255,74,42,.6); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.row2 .btn { width: 100%; padding: 13px; }
.btn.ghost { background: transparent; color: var(--muted); }

/* ---------- Телефон ---------- */
@media (max-width: 760px) {
  .topbar { gap: 4px; padding: 8px 8px; overflow-x: auto; scrollbar-width: none; }
  .topbar .logo.small { display: none; }
  .topbar #copyLink { font-size: 0; gap: 4px; }
  .topbar #copyLink b { font-size: 13px; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  .chat { left: 0; right: 0; bottom: 0; width: auto; height: 62dvh; border-radius: 16px 16px 0 0; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .hud-top { top: 6px; }
  .hud-timer { font-size: 26px; padding: 4px 10px; }
  .hud-role { top: 58px; max-width: 70%; }
  .manual { left: 8px; right: 8px; width: auto; top: auto; bottom: 138px; height: 42dvh; }
  .signs { max-height: 120px; }
  .signs button { padding: 7px 8px; font-size: 12px; }
  .sign-seen { top: 112px; max-width: calc(100% - 20px); text-align: center; }
}
@media (min-width: 640px) {
  .lobby { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .part { padding: 62px 14px 14px; min-height: 200px; align-content: start; }
}
@media (min-width: 1000px) { .lobby { width: min(1100px, 100%); margin: 0 auto; } }
