:root {
  --bg: #0c0d11;
  --panel: rgba(16, 17, 23, 0.74);
  --panel-solid: #15161d;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.07);
  --ink: #f5f4ef;
  --ink-2: rgba(245, 244, 239, 0.78);
  --muted: rgba(245, 244, 239, 0.56);
  --lime: #e6ff6a;
  --lime-ink: #161a05;
  --mu: #d8202a;
  --mu-hi: #ff6b6b;
  --rm: #8c6cff;
  --rm-hi: #b9a6ff;
  --gold: #e8b93a;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 18px 48px rgba(0, 0, 0, 0.4);
  --f-ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display: 'Unbounded', 'Rubik', 'Arial Black', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.4 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

.scrim {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(70% 70% at 50% 50%, rgba(8, 8, 12, 0.5), rgba(8, 8, 12, 0.78)),
    linear-gradient(180deg, rgba(8, 8, 12, 0.3), rgba(8, 8, 12, 0.55));
  transition: opacity 0.4s ease;
}
.scrim.off { opacity: 0; }

/* ---------- экраны ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  overflow-y: auto;
  touch-action: pan-y;
  user-select: text; -webkit-user-select: text;
  animation: fadeIn 0.25s ease;
}
.screen.top { z-index: 30; background: rgba(6, 6, 10, 0.55); }
#pause, #end { background: rgba(6, 6, 10, 0.5); z-index: 25; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* margin: auto центрирует, но не обрезает верх, если панель выше экрана */
.screen > .col, .screen > .panel { margin: auto; flex: none; }
.col { width: min(480px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 8px 0 24px; }

.panel {
  width: min(560px, 100%);
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.panel.wide { width: min(860px, 100%); }
.panel.narrow { width: min(400px, 100%); }
.panel.center { align-items: center; text-align: center; }
.panel h2 { margin: 0; font: 800 20px/1.15 var(--f-display); letter-spacing: -0.01em; }
.phead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead h2 { flex: 1 1 auto; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group h3, .eyebrow {
  margin: 0; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.hint { margin: 0; color: var(--ink-2); font-size: 14px; }
.hint.small { font-size: 12.5px; color: var(--muted); }
.hint code { font-size: 12px; background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 5px; }

/* ---------- бренд ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font: 900 46px/1 var(--f-display); letter-spacing: -0.04em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.logo { position: relative; width: 48px; height: 40px; flex: none; }
.logo i { position: absolute; border-radius: 50%; border: 3px solid #0c0d11; }
.logo i:first-child { width: 34px; height: 34px; left: 0; top: 6px; background: radial-gradient(circle at 35% 30%, #ff7a6e, var(--mu) 55%, #7d0d14); }
.logo i:last-child { width: 28px; height: 28px; left: 20px; top: 0; background: radial-gradient(circle at 35% 30%, #fff, #f3f1ea 55%, #a9a6bd); }
.tag { margin: -6px 0 0; color: var(--ink-2); font-size: 16px; text-wrap: balance; }

/* ---------- карточка матча ---------- */
.matchcard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 18px 14px;
  background: var(--panel);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
.side b { font: 700 15px/1.2 var(--f-ui); margin-top: 8px; }
.side small { color: var(--muted); font-size: 12.5px; }
.vs { font: 800 14px/1 var(--f-display); color: var(--muted); text-transform: uppercase; }
.crest {
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid #1a1218; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset -6px -8px 14px rgba(0, 0, 0, 0.18);
  position: relative;
}
.crest::after { content: ''; position: absolute; left: 14px; top: 10px; width: 16px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); transform: rotate(-38deg); }
.crest span { font: 900 22px/1 var(--f-display); letter-spacing: -0.04em; }
.crest.t0 { background: radial-gradient(circle at 35% 30%, #ff7a6e, var(--mu) 50%, #7d0d14); }
.crest.t0 span { color: #fff; text-shadow: 0 2px 0 #2a0306; }
.crest.t1 { background: radial-gradient(circle at 35% 30%, #fff, #f3f1ea 50%, #a9a6bd); border-color: #2c2546; }
.crest.t1 span { color: #4a2f9a; }

/* ---------- поля ввода и кнопки ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font: 600 11.5px/1.2 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
input {
  height: 48px; padding: 0 14px; border-radius: 14px;
  background: rgba(10, 11, 15, 0.72); border: 1px solid var(--line);
  outline: none; font-size: 16px; min-width: 0;
}
input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(230, 255, 106, 0.18); }
input::placeholder { color: rgba(245, 244, 239, 0.35); }

.actions { display: flex; flex-direction: column; gap: 10px; }
.btn {
  height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08); color: var(--ink);
  font: 700 15.5px/1 var(--f-ui); cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .icon:focus-visible, .chip-btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; box-shadow: 0 8px 28px rgba(230, 255, 106, 0.25); }
.btn.primary:hover { background: #f0ff9a; }
.btn.primary:disabled { background: rgba(230, 255, 106, 0.3); color: rgba(22, 26, 5, 0.6); box-shadow: none; cursor: default; }
.btn.big { height: 54px; font-size: 17px; }
.btn.small { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.ghost { background: transparent; }
.join { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.join input { text-transform: uppercase; letter-spacing: 0.3em; font: 800 18px/1 var(--f-display); text-align: center; }
.join input::placeholder { letter-spacing: 0.3em; }

.icon {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(16, 17, 23, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon:hover { background: rgba(40, 42, 52, 0.75); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.corner { position: absolute; top: calc(16px + var(--safe-t)); right: calc(16px + var(--safe-r)); }

.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; color: var(--muted); font-size: 13px; }
.linkbtn {
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--lime); font-weight: 600; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(230, 255, 106, 0.4);
}
.linkbtn:hover { text-decoration-color: var(--lime); }
.linkbtn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
.is-touch .kb-only, body:not(.is-touch) .touch-only { display: none; }
.fan { margin: -6px 0 0; text-align: center; color: var(--muted); font-size: 12px; opacity: 0.8; }
.rooms { display: flex; flex-direction: column; gap: 8px; }
.rooms h3 { margin: 0; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.rooms-list { display: flex; flex-direction: column; gap: 6px; }
.room-btn {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 14px; text-align: left; cursor: pointer;
  background: rgba(230, 255, 106, 0.08); border: 1px solid rgba(230, 255, 106, 0.3);
}
.room-btn:hover { background: rgba(230, 255, 106, 0.16); }
.room-btn .rc { font: 900 15px/1 var(--f-display); letter-spacing: 0.12em; color: var(--lime); }
.room-btn .rn { font-weight: 700; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-btn small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
kbd {
  font: 600 11.5px/1 var(--f-ui); padding: 4px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--ink-2);
}

/* ---------- экран управления ---------- */
.ctl, .tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.ctl li {
  display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 2px 12px;
  padding: 9px 0; border-top: 1px solid var(--line-2);
}
.ctl li:first-child { border-top: 0; }
.ctl .act { font-weight: 700; }
.ctl .how { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--ink-2); font-size: 14px; }
.ctl small { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.tips { gap: 8px; }
.tips li { position: relative; padding-left: 16px; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
.tips li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.tips b { color: var(--ink); }

/* ---------- выбор команды, игрока, опций ---------- */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1.5px solid var(--line); text-align: left; min-width: 0;
}
.team-btn .crest { width: 42px; height: 42px; flex: none; border-width: 2px; }
.team-btn .crest::after { left: 8px; top: 6px; width: 10px; height: 5px; }
.team-btn .crest span { font-size: 14px; }
.team-btn b { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.team-btn small { color: var(--muted); font-size: 12px; }
.team-btn[aria-pressed='true'].t0 { border-color: var(--mu); background: rgba(216, 32, 42, 0.16); }
.team-btn[aria-pressed='true'].t1 { border-color: var(--rm); background: rgba(140, 108, 255, 0.16); }

.squad { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 5px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.11); }
.chip-btn .no {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 800 12px/1 var(--f-ui); border: 2px solid #1a1218;
}
.chip-btn.t0 .no { background: radial-gradient(circle at 35% 30%, #ff7a6e, var(--mu) 55%, #7d0d14); color: #fff; }
.chip-btn.t1 .no { background: radial-gradient(circle at 35% 30%, #fff, #f3f1ea 55%, #a9a6bd); color: #4a2f9a; border-color: #2c2546; }
.chip-btn[aria-pressed='true'] { border-color: var(--lime); background: rgba(230, 255, 106, 0.14); }
.chip-btn:disabled { opacity: 0.35; cursor: default; }
.chip-btn .gk { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }

.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.seg button:hover { background: rgba(255, 255, 255, 0.11); }
.seg button[aria-pressed='true'] { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.seg button:disabled { opacity: 0.35; cursor: default; }
.seg.readonly button { cursor: default; }
.seg.readonly button:not([aria-pressed='true']) { opacity: 0.45; }

/* ---------- лобби ---------- */
.room { display: flex; align-items: center; gap: 10px; }
.code {
  font: 900 26px/1 var(--f-display); letter-spacing: 0.16em; padding: 8px 12px 8px 16px;
  background: rgba(230, 255, 106, 0.12); border: 1px solid rgba(230, 255, 106, 0.35); border-radius: 12px; color: var(--lime);
}
.lteams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lteam { border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lteam header { display: flex; align-items: center; gap: 10px; }
.lteam header .crest { width: 34px; height: 34px; border-width: 2px; }
.lteam header .crest::after { left: 6px; top: 5px; width: 8px; height: 4px; }
.lteam header .crest span { font-size: 11px; }
.lteam header b { font-size: 14.5px; }
.lteam header small { color: var(--muted); margin-left: auto; font-size: 12.5px; }
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); font-size: 14px; min-height: 40px; }
.slot .no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 11.5px/1 var(--f-ui); border: 2px solid #1a1218; flex: none; }
.t0 .slot .no { background: radial-gradient(circle at 35% 30%, #ff7a6e, var(--mu) 55%, #7d0d14); color: #fff; }
.t1 .slot .no { background: radial-gradient(circle at 35% 30%, #fff, #f3f1ea 55%, #a9a6bd); color: #4a2f9a; border-color: #2c2546; }
.slot .pn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .who { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.slot.human .who { color: var(--ink); font-weight: 700; }
.slot.me { outline: 1.5px solid var(--lime); }
.slot.me .who { color: var(--lime); }
.lteam .pick-title { font: 600 11px/1.2 var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.lteam .squad { gap: 6px; }
.lteam .chip-btn { height: 32px; font-size: 13px; padding-right: 10px; }
.lteam .chip-btn .no { width: 24px; height: 24px; font-size: 11px; }
.lfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.status { color: var(--muted); font-size: 14px; }
.lfoot .btn { min-width: 200px; }

/* ---------- подключение ---------- */
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--lime); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.board {
  position: absolute; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 16px;
  background: rgba(12, 13, 18, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.bt { display: flex; align-items: center; gap: 7px; padding: 0 10px; font: 700 13px/1 var(--f-ui); letter-spacing: 0.06em; color: var(--ink-2); }
.bt .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #120c10; }
.bt.t0 .dot { background: var(--mu); }
.bt.t1 .dot { background: #f3f1ea; border-color: #2c2546; }
.sc { min-width: 40px; height: 38px; display: grid; place-items: center; font: 800 23px/1 var(--f-ui); font-variant-numeric: tabular-nums; border-radius: 11px; background: rgba(255, 255, 255, 0.07); }
.sc.pop { animation: pop 0.6s ease; }
@keyframes pop { 30% { transform: scale(1.35); background: var(--lime); color: var(--lime-ink); } }
.clock { min-width: 74px; text-align: center; font: 700 17px/1 var(--f-ui); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.clock.low { color: #ff8a7a; }
.chip.ot {
  position: absolute; left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; background: var(--gold); color: #1d1503; font: 800 12px/1 var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase;
}
.hud-left { position: absolute; left: calc(14px + var(--safe-l)); top: calc(16px + var(--safe-t)); }
.hud-right { position: absolute; right: calc(14px + var(--safe-r)); top: calc(12px + var(--safe-t)); display: flex; gap: 8px; pointer-events: auto; }
.ping { font: 600 12px/1 var(--f-ui); color: var(--muted); background: rgba(12, 13, 18, 0.6); padding: 6px 8px; border-radius: 8px; }
#btnSound .mute { display: none; }
#btnSound.off .mute { display: block; }
#btnSound.off .wave { display: none; }

/* ---------- баннер гола ---------- */
.banner {
  position: fixed; left: 50%; top: 42%; z-index: 8; pointer-events: none;
  transform: translate(-50%, -50%); text-align: center;
  animation: bannerIn 2.4s cubic-bezier(.2, .9, .2, 1) both;
}
.banner .big {
  font: 900 clamp(56px, 13vw, 128px)/0.9 var(--f-display); letter-spacing: -0.05em; color: #fff;
  text-shadow: 0 0 40px var(--glow, rgba(230, 255, 106, 0.6)), 0 6px 0 rgba(0, 0, 0, 0.35);
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.15);
}
.banner .who {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(12, 13, 18, 0.78); border: 1px solid var(--line); font: 700 16px/1.1 var(--f-ui);
}
.banner .who .no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 12.5px/1 var(--f-ui); border: 2px solid #1a1218; }
.banner .who.t0 .no { background: var(--mu); color: #fff; }
.banner .who.t1 .no { background: #f3f1ea; color: #4a2f9a; border-color: #2c2546; }
.banner .who small { color: var(--muted); font-weight: 500; font-size: 13px; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-6deg); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); }
  22% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.96); }
}

/* ---------- конец матча ---------- */
.final { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.final .tm { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 700; font-size: 14px; }
.final .tm .crest { width: 52px; height: 52px; }
.final .tm .crest span { font-size: 17px; }
.final .num { font: 800 46px/1 var(--f-ui); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.final .win { color: var(--lime); }
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow: auto; }
.goals li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 14px; }
.goals li .min { font: 700 12.5px/1 var(--f-ui); color: var(--muted); min-width: 30px; }
.goals li .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.goals li.t0 .dot { background: var(--mu); }
.goals li.t1 .dot { background: #f3f1ea; }
.goals li small { color: var(--muted); }
.goals .none { color: var(--muted); justify-content: center; }
.endbtns { display: flex; flex-direction: column; gap: 10px; }
.endbtns .wait { text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- сенсорное управление ---------- */
.touch { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 55%; height: 75%; pointer-events: auto; touch-action: none; }
.stick {
  position: absolute; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(10, 10, 14, 0.25);
  opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
  left: 22%; top: 72%;
}
.stick.on { opacity: 1; }
.knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
}
.tbtn {
  position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); color: #fff; font: 800 13px/1 var(--f-ui); letter-spacing: 0.02em;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tbtn.shot { width: 92px; height: 92px; right: calc(22px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); background: rgba(230, 255, 106, 0.32); }
.tbtn.pass { width: 76px; height: 76px; right: calc(124px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); background: rgba(255, 255, 255, 0.2); }
.tbtn.boost { width: 62px; height: 62px; right: calc(50px + var(--safe-r)); bottom: calc(132px + var(--safe-b)); background: rgba(255, 255, 255, 0.12); font-size: 12px; }
.tbtn.on { transform: scale(0.92); background: rgba(230, 255, 106, 0.6); }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 40;
  padding: 10px 16px; border-radius: 12px; background: rgba(12, 13, 18, 0.9); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- узкие экраны ---------- */
@media (max-width: 640px) {
  .brand h1 { font-size: 40px; }
  .panel { padding: 16px; border-radius: 18px; gap: 14px; }
  .lteams { grid-template-columns: 1fr; }
  .teams { grid-template-columns: 1fr 1fr; }
  .team-btn { padding: 10px; gap: 8px; }
  .team-btn .crest { width: 34px; height: 34px; }
  .team-btn b { font-size: 13px; }
  .room { width: 100%; justify-content: space-between; }
  .lfoot .btn { width: 100%; }
  .board { left: calc(10px + var(--safe-l)); transform: none; top: calc(10px + var(--safe-t)); }
  .chip.ot { left: calc(10px + var(--safe-l)); transform: none; top: calc(58px + var(--safe-t)); }
  .hud-right { top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); gap: 6px; }
  .hud-left { left: auto; right: calc(12px + var(--safe-r)); top: calc(54px + var(--safe-t)); }
  .bt { padding: 0 6px; }
  .bt b { display: none; }
  .clock { min-width: 58px; font-size: 14px; }
  .sc { min-width: 34px; height: 32px; font-size: 18px; }
  .icon { width: 36px; height: 36px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .col { gap: 12px; }
  .brand h1 { font-size: 34px; }
  .matchcard { padding: 12px; }
  .crest { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .banner { animation: none; }
}

/* ---------- портреты в кружках ---------- */
/* важно: общие правила кружков задают background целиком и иначе сбросили бы масштаб портрета */
.no.face { position: relative; background-color: var(--panel-solid); background-size: 118% !important; background-position: center 35% !important; background-repeat: no-repeat !important; color: transparent; overflow: visible; }
.t0 .no.face, .chip-btn.t0 .no.face, .who.t0 .no.face { background-color: #b51a22; }
.t1 .no.face, .chip-btn.t1 .no.face, .who.t1 .no.face { background-color: #e9e6f3; }
.no.face b {
  position: absolute; right: -6px; bottom: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
  display: grid; place-items: center; font: 800 9px/1 var(--f-ui); color: #fff; background: #1a1218; border: 1.5px solid rgba(255, 255, 255, 0.85);
}
.chip-btn .no.face { width: 30px; height: 30px; }
.chip-btn { padding-left: 4px; }
.banner .who .no.face { width: 34px; height: 34px; }
