/* =========================================================
   Пандемия: Наследие — дизайн-система
   ========================================================= */
:root {
  --bg: #060d16;
  --glass: rgba(13, 24, 38, 0.74);
  --glass-2: rgba(22, 38, 58, 0.78);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef4fa;
  --text-2: #b9c8d6;
  --muted: #7f93a7;
  --gold: #ffcf4a;
  --gold-2: #f2a91d;
  --teal: #34e0a1;
  --sky: #6cc4ff;
  --danger: #ff5a5f;
  --orange: #ff9f43;
  --blue: #3d8bff;
  --yellow: #f5c531;
  --black: #8b93a6;
  --red: #e8484f;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --ui: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --ease: cubic-bezier(.2, .9, .25, 1);
}
* { box-sizing: border-box; }
html { font-size: clamp(14px, 0.4vw + 9px, 16px); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.good { color: var(--teal); }
.bad { color: var(--danger); }
h1, h2, h3, h4 { margin: 0; font-weight: 800; }
h3 { font-size: 1rem; letter-spacing: .01em; }
p { margin: .4em 0; line-height: 1.55; }
.eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 800; }
.ic { flex: none; display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#board { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
}

/* ---------- загрузка ---------- */
#loader { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; z-index: 50; background: var(--bg); transition: opacity .6s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-ring { width: 54px; height: 54px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.loader-text { color: var(--muted); font-weight: 700; letter-spacing: .08em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); padding: .62rem 1rem; border-radius: 12px; cursor: pointer; font-weight: 700; transition: transform .15s var(--ease), background .15s, box-shadow .2s, opacity .15s, border-color .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary, .btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold-2)); color: #2a1a00; border-color: rgba(255,220,120,.9); box-shadow: 0 8px 26px rgba(255, 180, 0, .25), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.primary:hover:not(:disabled), .btn.gold:hover:not(:disabled) { background: linear-gradient(180deg, #ffe895, #f7b72e); box-shadow: 0 10px 34px rgba(255, 180, 0, .38), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.danger { background: linear-gradient(180deg, #ff7377, #d93a40); border-color: #ff8a8e; color: #fff; box-shadow: 0 8px 26px rgba(255, 60, 60, .3); }
.btn.teal { background: linear-gradient(180deg, #5df0b8, #1fb57c); color: #022515; border-color: #7af5c7; }
.btn.ghost { background: transparent; }
.btn.small { padding: .4rem .7rem; font-size: .8rem; border-radius: 9px; }
.btn.lg { padding: .85rem 1.2rem; font-size: 1rem; }
.btn.xl { padding: 1rem 1.6rem; font-size: 1.05rem; border-radius: 14px; }
.btn.wide { width: 100%; }
.btn.pulse, .dbtn.infect { position: relative; }
.btn.pulse::before, .dbtn.infect::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid rgba(255,90,90,.6); animation: pulse 1.6s infinite; pointer-events: none; will-change: transform, opacity; }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.12, 1.35); opacity: 0; } }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.05); cursor: pointer; display: inline-grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255,255,255,.13); color: var(--text); }
.icon-btn.small { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.on { color: var(--gold); }
.icon-btn.heart { color: #ff6b8b; }
.btn-plain { border: 0; background: none; cursor: pointer; padding: 0; text-align: left; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.link:hover { color: var(--gold); }
.danger-link { margin-top: 10px; font-size: .8rem; }
.danger-link:hover { color: var(--danger); }
input, select, .input { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: .75rem .9rem; width: 100%; outline: none; transition: border-color .15s, background .15s; }
input:focus, select:focus { border-color: var(--gold); background: rgba(0,0,0,.4); }
select option { background: #13243a; }
.kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); font-size: .65rem; font-weight: 800; color: var(--text-2); }
body.busy { cursor: progress; }

/* ---------- бренд ---------- */
.brand-mark { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 25%, #ff8f93, #c0202c 60%, #6d0a12); box-shadow: 0 14px 40px rgba(220,40,50,.45), inset 0 2px 0 rgba(255,255,255,.35); }
.brand-mark.sm { width: 46px; height: 46px; border-radius: 14px; }
.brand-xl { display: flex; gap: 20px; align-items: center; }
.brand-title { font-family: var(--display); font-size: clamp(2.6rem, 4vw, 4rem); font-weight: 800; letter-spacing: .06em; line-height: 1; background: linear-gradient(180deg, #ffffff, #b9cde0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-family: var(--display); font-weight: 700; letter-spacing: .5em; color: var(--gold); margin-top: 6px; font-size: 1rem; }

/* ---------- оверлеи ---------- */
.screen.overlay { position: fixed; inset: 0; overflow: auto; z-index: 5; background: linear-gradient(90deg, rgba(4,9,16,.92) 0%, rgba(4,9,16,.55) 55%, rgba(4,9,16,.75) 100%); }

/* ---------- главный экран ---------- */
.home { min-height: 100%; display: grid; grid-template-columns: 1.15fr .85fr; gap: 6vw; align-items: center; padding: 6vh 7vw; max-width: 1500px; margin: 0 auto; }
.home-lead { font-size: 1.15rem; color: var(--text-2); max-width: 560px; margin: 26px 0; line-height: 1.6; }
.home-feats { display: grid; grid-template-columns: repeat(4, auto); gap: 40px; justify-content: start; margin: 0 0 34px; }
.home-feats b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--text); }
.home-feats span { color: var(--muted); font-size: .85rem; }
.home-right { display: grid; gap: 16px; }
.hcard { padding: 24px; }
.resume-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.resume-title { font-weight: 800; font-size: 1.1rem; }
.seg { display: flex; gap: 4px; background: rgba(0,0,0,.28); padding: 4px; border-radius: 13px; margin-bottom: 18px; }
.seg-b { flex: 1; padding: .6rem; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 800; }
.seg-b.active { background: rgba(255,255,255,.1); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 7px; font-size: .78rem; color: var(--muted); font-weight: 800; letter-spacing: .02em; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; font-size: 1.2rem; }
@media (max-width: 1000px) { .home { grid-template-columns: 1fr; } }

/* ---------- штаб ---------- */
.lobby { max-width: 1680px; margin: 0 auto; padding: 18px 24px 110px; display: grid; gap: 14px; }
.lobby-top { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.lt-title { flex: 1; min-width: 0; }
.lt-title h1 { font-family: var(--display); font-size: 1.6rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-players { display: flex; gap: 8px; }
.pl { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; }
.pl .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #2a3a4d; font-size: .75rem; position: relative; }
.pl .av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #5b6875; border: 2px solid #0e1a28; }
.pl.on .av::after { background: var(--teal); }
.lt-actions { display: flex; gap: 10px; align-items: center; }
.chip-btn { display: grid; text-align: left; gap: 0; padding: 6px 14px; border-radius: 12px; border: 1px dashed rgba(255,207,74,.5); background: rgba(255,207,74,.07); cursor: pointer; }
.chip-btn:hover { background: rgba(255,207,74,.14); }
.chip-btn .code { font-family: var(--display); font-size: 1.15rem; letter-spacing: .25em; color: var(--gold); font-weight: 700; }
.chip-sub { font-size: .68rem; color: var(--muted); font-weight: 700; }
.timeline { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; padding: 12px; }
.tl-m { position: relative; padding: 10px 8px 9px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid transparent; display: grid; gap: 4px; min-width: 0; }
.tl-m .tl-n { font-size: .78rem; font-weight: 800; color: var(--text-2); }
.tl-m .tl-s { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-m .tl-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); }
.tl-m.won .tl-bar { background: var(--teal); box-shadow: 0 0 10px rgba(52,224,161,.5); }
.tl-m.lost .tl-bar { background: var(--danger); }
.tl-m.current { background: rgba(255,207,74,.09); border-color: rgba(255,207,74,.55); }
.tl-m.current .tl-n { color: var(--gold); }
.tl-m.current .tl-bar { background: linear-gradient(90deg, var(--gold), transparent); }
.tl-m .tl-tag { position: absolute; top: 7px; right: 8px; font-size: .7rem; }
.lobby-main { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(520px, 2fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1350px) { .lobby-main { grid-template-columns: minmax(300px, 1fr) minmax(460px, 1.7fr); } .lobby-side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } }
.panel { padding: 18px 20px; }
.panel h3 { margin-bottom: 12px; }
.panel.grow { min-height: 200px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.dossier { padding: 22px; position: relative; overflow: hidden; }
.dossier::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 10px, transparent 10px 20px); pointer-events: none; }
.stamp { position: absolute; top: 18px; right: -34px; transform: rotate(32deg); background: rgba(255,90,95,.14); color: #ff8a8e; border: 2px solid rgba(255,90,95,.5); font-weight: 900; letter-spacing: .3em; font-size: .7rem; padding: 4px 40px; }
.dossier h2 { font-family: var(--display); font-size: 2.2rem; font-weight: 700; margin: 6px 0 8px; }
.dossier p { color: var(--text-2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.fact { background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; }
.fact b { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.fact span { font-weight: 700; }
.fact.goal { grid-column: 1 / -1; background: rgba(255,207,74,.07); border-color: rgba(255,207,74,.3); }
.fact.goal span { color: var(--gold); }
.team-pick { padding: 18px 20px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.char { border-radius: 16px; padding: 14px; background: linear-gradient(165deg, rgba(255,255,255,.075), rgba(255,255,255,.02)); border: 1px solid var(--line); display: grid; gap: 10px; position: relative; overflow: hidden; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.char::after { content: ""; position: absolute; inset: -40% -40% auto auto; width: 180px; height: 180px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), transparent 70%); pointer-events: none; }
.char:hover { transform: translateY(-2px); border-color: var(--line-2); }
.char.mine { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 12px 40px rgba(255,207,74,.18); }
.char.taken { opacity: .72; }
.char.lost { opacity: .4; filter: grayscale(.9); }
.char.hire { border-style: dashed; background: rgba(255,255,255,.02); }
.char-top { display: flex; gap: 12px; align-items: center; position: relative; z-index: 1; }
.char-name { font-weight: 800; font-size: 1.02rem; display: flex; gap: 6px; align-items: center; }
.char-role { color: var(--rc); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.char-text { font-size: .82rem; color: var(--text-2); line-height: 1.45; position: relative; z-index: 1; }
.char-tags, .seat-tags { display: flex; flex-wrap: wrap; gap: 5px; position: relative; z-index: 1; }
.tag { display: inline-flex; gap: 4px; align-items: center; font-size: .72rem; padding: 3px 8px; border-radius: 7px; font-weight: 800; cursor: help; }
.tag.up { background: rgba(255,207,74,.14); color: var(--gold); }
.tag.scar { background: rgba(255,90,95,.14); color: #ff9a9d; }
.scars3 { display: inline-flex; gap: 3px; }
.scars3 i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); border: 1.5px solid rgba(255,255,255,.25); }
.scars3 i.on { background: var(--danger); border-color: var(--danger); }
.char-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; position: relative; z-index: 1; }
.lost-badge { color: var(--danger); font-weight: 800; }
.portrait { position: relative; display: inline-grid; place-items: center; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.portrait svg { position: absolute; inset: 0; }
.portrait-ic { position: relative; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.lobby-side { display: grid; gap: 14px; }
.ws-row { display: grid; gap: 6px; margin-bottom: 14px; }
.ws-row b { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); margin: 0 4px 4px 0; font-size: .78rem; font-weight: 600; }
.chip i.d { width: 8px; height: 8px; border-radius: 50%; }
.chip.c-blue { border-color: rgba(61,139,255,.6); } .chip.c-yellow { border-color: rgba(245,197,49,.6); } .chip.c-black { border-color: rgba(139,147,166,.7); } .chip.c-red { border-color: rgba(232,72,79,.6); }
.chip.ev { border-color: rgba(255,207,74,.45); }
.panic-1 { border-color: #ffd54a !important; } .panic-2 { border-color: var(--orange) !important; } .panic-3 { border-color: #ff5e57 !important; } .panic-4 { border-color: #c0392b !important; background: rgba(192,57,43,.22) !important; }
.clog { max-height: 300px; overflow: auto; display: grid; gap: 8px; font-size: .85rem; color: var(--text-2); }
.clog div { padding-left: 12px; border-left: 2px solid var(--line-2); line-height: 1.45; }
.lobby-foot { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(1100px, calc(100% - 48px)); display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 14px 12px 22px; z-index: 6; }
.ready { display: flex; gap: 12px; align-items: center; color: var(--text-2); font-weight: 600; }
.ready .dots { display: flex; gap: 6px; }
.ready .dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); }
.ready .dots i.on { background: var(--teal); box-shadow: 0 0 10px var(--teal); }

/* ---------- ИГРА ---------- */
#game { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#game > * { pointer-events: auto; }
#hud { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; gap: 10px; align-items: stretch; pointer-events: none; }
#hud > * { pointer-events: auto; }
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 2px; }
.hud-l { padding: 10px 16px; min-width: 230px; max-width: 300px; display: grid; align-content: center; gap: 2px; }
.hud-month { font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: flex; gap: 8px; align-items: baseline; }
.hud-month span { color: var(--muted); font-family: var(--ui); font-weight: 700; font-size: .8rem; }
.hud-goal { font-size: .78rem; color: var(--text-2); line-height: 1.35; }
.hud-goal b { color: var(--gold); }
.hud-c { flex: 1; display: flex; gap: 14px; justify-content: center; align-items: center; padding: 8px 18px; min-width: 0; }
.trk { display: grid; gap: 6px; justify-items: start; }
.trk-l { font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 800; }
.ob { display: flex; gap: 4px; align-items: center; }
.ob i { width: 15px; height: 15px; transform: rotate(45deg) scale(.82); border: 1.6px solid rgba(255,255,255,.28); border-radius: 3px; transition: all .4s var(--ease); }
.ob i.hot { border-color: rgba(255,90,95,.55); }
.ob i.on { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 10px var(--orange); }
.ob i.on.hot { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 14px var(--danger); }
.ob b { margin-left: 8px; font-size: .9rem; font-weight: 800; }
.rate { display: flex; gap: 3px; }
.rate span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.05); font-weight: 800; font-size: .8rem; color: var(--muted); transition: all .4s var(--ease); }
.rate span.past { opacity: .35; }
.rate span.on { background: linear-gradient(180deg, #6ff0a4, #22b866); color: #03250f; box-shadow: 0 0 16px rgba(61,220,132,.55); transform: scale(1.14); }
.cures { display: flex; gap: 10px; }
.vial { position: relative; width: 26px; display: grid; justify-items: center; gap: 2px; cursor: help; }
.vial-glass { width: 18px; height: 28px; border: 2px solid rgba(255,255,255,.38); border-radius: 4px 4px 9px 9px; position: relative; overflow: hidden; background: rgba(255,255,255,.04); }
.vial-glass::before { content: ""; position: absolute; top: -2px; left: -4px; right: -4px; height: 4px; background: rgba(255,255,255,.4); border-radius: 2px; }
.vial-liquid { position: absolute; left: 0; right: 0; bottom: 0; height: 16%; transition: height 1s cubic-bezier(.2,1.6,.4,1); }
.vial.c-blue .vial-liquid { background: linear-gradient(0deg, #1f5fc4, #6aa8ff); } .vial.c-yellow .vial-liquid { background: linear-gradient(0deg, #c08f10, #ffe27a); } .vial.c-black .vial-liquid { background: linear-gradient(0deg, #3a3f4b, #a8b0c2); } .vial.c-red .vial-liquid { background: linear-gradient(0deg, #a81f26, #ff8a8f); }
.vial.cured .vial-liquid { height: 86%; }
.vial.cured .vial-glass { border-color: #fff; box-shadow: 0 0 16px rgba(255,255,255,.5); }
.vial.eradicated .vial-liquid { height: 100%; }
.vial.eradicated .vial-glass { border-color: var(--gold); box-shadow: 0 0 20px var(--gold); }
.vial.eradicated::after { content: "✦"; position: absolute; top: -8px; right: -6px; color: var(--gold); font-size: .8rem; }
.vial small { font-size: .62rem; color: var(--muted); font-weight: 800; }
.vial em { position: absolute; top: -9px; left: -8px; font-style: normal; font-size: .75rem; }
.epi { font-weight: 800; font-size: .92rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.epi.hot { color: var(--danger); animation: blink 1.2s infinite; }
.epi.warm { color: var(--orange); }
.epi.calm { color: var(--teal); }
@keyframes blink { 50% { opacity: .55; } }
.hud-r { display: flex; gap: 8px; align-items: center; padding: 8px 10px; }
.deck { display: flex; gap: 9px; align-items: center; padding: 0 6px; }
.deck b { display: block; font-size: 1.05rem; line-height: 1; font-weight: 800; }
.deck small { font-size: .64rem; color: var(--muted); font-weight: 700; }
.deck-ico { width: 22px; height: 30px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,.45); }
.deck-ico.p { background: linear-gradient(135deg, #2c6fbf, #163a66); box-shadow: 2px 2px 0 rgba(255,255,255,.15), 4px 4px 0 rgba(255,255,255,.07); }
.deck-ico.i { background: linear-gradient(135deg, #3a8c4b, #1d4a28); box-shadow: 2px 2px 0 rgba(255,255,255,.15); }

/* правая панель */
#rail { position: absolute; right: 14px; top: 92px; bottom: 262px; width: 340px; display: flex; flex-direction: column; overflow: hidden; transition: transform .35s var(--ease), opacity .3s; }
#rail.collapsed { transform: translateX(calc(100% - 58px)); }
#rail.collapsed .rail-body { opacity: 0; pointer-events: none; }
#rail.collapsed .rail-tabs { flex-direction: column; align-items: flex-start; }
.rail-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); align-items: center; }
.rtab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: none; padding: 8px; border-radius: 10px; color: var(--muted); font-weight: 800; cursor: pointer; font-size: .82rem; position: relative; }
.rtab:hover { color: var(--text); }
.rtab.active { background: rgba(255,255,255,.08); color: var(--text); }
.rtab .badge { position: absolute; top: 2px; right: 6px; }
#rail.collapsed .rtab { flex: none; width: 40px; padding: 9px; }
#rail.collapsed .rtab span.t { display: none; }
.rail-body { flex: 1; overflow: auto; padding: 12px; font-size: .86rem; transition: opacity .2s; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 6px; font-size: .62rem; font-weight: 800; }
/* сводка */
.intel-sec { margin-bottom: 16px; }
.intel-sec h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.threat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: rgba(255,90,95,.08); border: 1px solid rgba(255,90,95,.25); margin-bottom: 6px; cursor: pointer; transition: background .15s; }
.threat:hover { background: rgba(255,90,95,.16); }
.threat .cubes { display: flex; gap: 2px; margin-left: auto; }
.threat .cubes i, .cubes-mini i { width: 9px; height: 9px; border-radius: 2px; }
.threat.prot { background: rgba(108,196,255,.07); border-color: rgba(108,196,255,.25); }
.cure-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.cure-row .dot { width: 12px; height: 12px; border-radius: 4px; transform: rotate(45deg); }
.cure-row .bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 4px; }
.cure-row .bar i { display: block; height: 100%; border-radius: 6px; transition: width .6s var(--ease); }
.cure-row .nm { font-size: .8rem; font-weight: 700; display: flex; justify-content: space-between; gap: 6px; }
.cure-row .st { font-size: .72rem; font-weight: 800; }
.tip { padding: 10px 12px; border-radius: 12px; background: rgba(52,224,161,.07); border: 1px solid rgba(52,224,161,.25); color: var(--text-2); margin-bottom: 6px; line-height: 1.45; font-size: .82rem; }
.tip b { color: var(--teal); }
#rail-log { display: grid; gap: 4px; align-content: start; }
.log-l { padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,.03); color: var(--text-2); line-height: 1.4; }
.log-l.t-outbreak { background: rgba(255,90,95,.14); color: #ffb3b5; font-weight: 700; }
.log-l.t-epidemic { background: rgba(61,220,132,.14); color: #a6f5c6; font-weight: 800; }
.log-l.t-cure, .log-l.t-eradicate { background: rgba(255,207,74,.13); color: var(--gold); font-weight: 800; }
.log-l.t-turn { margin-top: 8px; color: #fff; font-weight: 800; background: none; border-top: 1px solid var(--line); border-radius: 0; padding-top: 10px; }
.log-l.t-scar { color: #ff9a9d; }
.rail-body.chat { display: flex; flex-direction: column; padding: 0; }
#chat-list { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 8px; align-content: start; }
.msg { background: rgba(255,255,255,.06); padding: 8px 12px; border-radius: 14px 14px 14px 4px; max-width: 88%; line-height: 1.4; }
.msg.me { justify-self: end; background: rgba(255,207,74,.14); border-radius: 14px 14px 4px 14px; }
.msg b { display: block; font-size: .7rem; color: var(--muted); }
#chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }

/* нижняя полоса */
#bottom { position: absolute; left: 14px; right: 14px; bottom: 0; display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; transition: right .35s var(--ease); }
#bottom > * { pointer-events: auto; }
#team { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 10px; align-items: flex-end; pointer-events: auto; }
.center-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.seat { width: 240px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; position: relative; overflow: hidden; }
.seat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc); }
.seat.active { border-color: color-mix(in srgb, var(--rc) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 60%, transparent), 0 14px 44px color-mix(in srgb, var(--rc) 25%, transparent); transform: translateY(-4px); }
.seat-head { display: flex; gap: 10px; align-items: center; }
.seat-names { flex: 1; min-width: 0; }
.seat-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.seat-role { font-size: .74rem; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5b6875; flex: none; }
.dot.on { background: var(--teal); box-shadow: 0 0 6px var(--teal); }
.pips { display: flex; gap: 4px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.pips i.off { background: rgba(255,255,255,.12); box-shadow: none; }
.mini-hand { display: flex; flex-wrap: wrap; gap: 3px; max-height: 64px; overflow: hidden; }
.mc { font-size: .66rem; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.07); border-left: 3px solid; font-weight: 700; white-space: nowrap; }
.mc.c-blue { border-color: var(--blue); } .mc.c-yellow { border-color: var(--yellow); } .mc.c-black { border-color: var(--black); } .mc.c-red { border-color: var(--red); } .mc.ev { border-color: var(--gold); }
.seat-foot { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: var(--muted); gap: 6px; font-weight: 700; }
.handbar { flex: 1; height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.handbar i { display: block; height: 100%; background: var(--sky); border-radius: 4px; }
.handbar.full i { background: var(--danger); }

#dock { display: flex; align-items: stretch; gap: 6px; padding: 7px; border-radius: 18px; }
.dock-status { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px; min-width: 200px; }
.dock-status .who { font-weight: 800; line-height: 1.2; }
.dock-status .sub { font-size: .74rem; color: var(--muted); font-weight: 700; }
.dbtn { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; width: 84px; height: 62px; border-radius: 13px; border: 1px solid transparent; background: rgba(255,255,255,.045); cursor: pointer; color: var(--text-2); font-weight: 800; font-size: .74rem; transition: background .15s, color .15s, transform .15s var(--ease), border-color .15s; }
.dbtn:hover:not(:disabled) { background: rgba(255,255,255,.12); color: var(--text); transform: translateY(-2px); }
.dbtn:disabled { opacity: .3; cursor: not-allowed; }
.dbtn .kbd { position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; font-size: .58rem; }
.dbtn.ready { color: var(--teal); border-color: rgba(52,224,161,.4); background: rgba(52,224,161,.08); }
.dbtn.ready::after { content: ""; position: absolute; inset: -1px; border-radius: 13px; box-shadow: 0 0 18px rgba(52,224,161,.35); pointer-events: none; animation: breathe 2s infinite; }
@keyframes breathe { 50% { opacity: .3; } }
.dbtn.end { width: auto; padding: 0 16px; grid-auto-flow: column; gap: 8px; color: var(--text); background: rgba(255,255,255,.08); }
.dbtn.infect { width: auto; padding: 0 22px; grid-auto-flow: column; gap: 10px; color: #fff; background: linear-gradient(180deg, #ff6f73, #d1343a); font-size: .9rem; }
.dock-sep { width: 1px; background: var(--line); margin: 6px 2px; }

#hand { display: flex; justify-content: center; align-items: flex-end; height: 150px; padding: 0 20px; perspective: 900px; }
#hand .card { margin: 0 -9px; transform: translateY(calc(30px + var(--lift))) rotate(var(--rot)); transform-origin: 50% 130%; }
#hand .card:hover { transform: translateY(-14px) rotate(0) scale(1.1); z-index: 5; }
#hand .card.new { animation: draw-in .8s var(--ease); }
#hand.discard-mode .card { box-shadow: 0 0 0 2px var(--danger), 0 10px 30px rgba(0,0,0,.5); }
#hand.discard-mode .card:hover::after { content: "Сбросить"; position: absolute; inset: auto 0 10px 0; text-align: center; font-weight: 900; color: #fff; background: var(--danger); padding: 4px; }
@keyframes draw-in { from { transform: translateY(-300px) rotate(-25deg) scale(.6); opacity: 0; } }
.spectator { padding: 12px 18px; }

/* карты */
.card { width: 118px; height: 166px; border-radius: 13px; background: linear-gradient(170deg, #fbfcfd, #dde5ec); color: #13202c; position: relative; cursor: pointer; transition: transform .25s var(--ease), box-shadow .2s; box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.7); overflow: hidden; flex: none; display: flex; flex-direction: column; }
.card.small { width: 104px; height: 146px; }
.card-art { height: 46%; position: relative; overflow: hidden; }
.card-art svg { width: 100%; height: 100%; display: block; }
.card-art .ev-ic { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.card-band { height: 5px; background: var(--cc); }
.card-body { padding: 7px 9px 8px; display: grid; gap: 2px; flex: 1; align-content: start; }
.card-title { font-weight: 900; font-size: .82rem; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.card-sub { font-size: .64rem; color: #5a6a78; line-height: 1.3; font-weight: 600; }
.card-foot { position: absolute; left: 9px; right: 9px; bottom: 7px; display: flex; justify-content: space-between; align-items: center; font-size: .6rem; font-weight: 800; color: #6b7a88; }
.card-foot .cdot { width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); background: var(--cc); }
.card.c-blue { --cc: linear-gradient(135deg, #5aa0ff, #1f5fc4); }
.card.c-yellow { --cc: linear-gradient(135deg, #ffd955, #d39b0d); }
.card.c-black { --cc: linear-gradient(135deg, #6a7080, #22252c); }
.card.c-red { --cc: linear-gradient(135deg, #ff6b70, #b8262c); }
.card.event { background: linear-gradient(170deg, #fff8df, #f2d892); --cc: linear-gradient(135deg, #ffd54a, #c58b00); }
.card.event .card-sub { font-size: .62rem; color: #6a5520; }
.card-panic { position: absolute; top: 6px; left: 6px; font-size: .55rem; font-weight: 900; color: #fff; background: rgba(192,57,43,.9); padding: 2px 5px; border-radius: 5px; text-transform: uppercase; }
.card.sel { box-shadow: 0 0 0 3px var(--gold), 0 0 28px rgba(255,207,74,.55); transform: translateY(-6px); }
.card-row { display: flex; gap: 10px; margin: 8px 0 14px; }
.card-row.wrap { flex-wrap: wrap; }

#mapctl { position: absolute; right: 372px; top: 92px; display: grid; gap: 4px; padding: 6px; border-radius: 14px; transition: right .35s var(--ease); }
body.rail-collapsed #mapctl { right: 86px; }

/* подсказка над городом */
#tooltip { position: fixed; z-index: 8; pointer-events: none; min-width: 200px; max-width: 280px; padding: 10px 12px; border-radius: 14px; background: rgba(8,16,28,.94); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0,0,0,.5); font-size: .82rem; transform: translate(14px, 14px); }
.tt-h { display: flex; gap: 8px; align-items: center; }
.tt-h .dot { width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); }
.tt-name { font-weight: 800; font-size: .95rem; }
.tt-sub { color: var(--muted); font-size: .72rem; font-weight: 700; }
.tt-row { margin-top: 6px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tt-act { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--teal); font-weight: 800; display: flex; gap: 6px; align-items: center; }
.tt-act.fly { color: var(--sky); }
.cubes-mini { display: inline-flex; gap: 2px; }
#pick-hint { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); padding: 10px 12px 10px 18px; font-weight: 800; display: flex; gap: 12px; align-items: center; color: var(--gold); z-index: 7; }

/* окно города */
#popup { position: absolute; width: 310px; padding: 14px; z-index: 7; animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.94) translateY(6px); opacity: 0; } }
.pp-head { display: flex; gap: 10px; align-items: center; }
.pp-head > div:nth-child(2) { flex: 1; min-width: 0; }
.pp-title { font-weight: 900; font-size: 1.1rem; }
.pp-sub { font-size: .76rem; color: var(--muted); font-weight: 700; }
.pp-row { margin-top: 10px; font-size: .84rem; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pp-row[class*="panic-"] { border-left: 3px solid; padding-left: 9px; display: block; }
.pp-moves { display: grid; gap: 6px; margin-top: 12px; }
.mopt { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); cursor: pointer; transition: background .15s, border-color .15s, transform .15s var(--ease); }
.mopt:hover:not(:disabled) { background: rgba(255,255,255,.11); border-color: var(--line-2); transform: translateX(2px); }
.mopt:disabled { opacity: .35; cursor: not-allowed; }
.mopt .mi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.mopt.drive .mi { background: rgba(52,224,161,.18); color: var(--teal); }
.mopt.fly .mi { background: rgba(108,196,255,.16); color: var(--sky); }
.mopt b { display: block; font-size: .86rem; }
.mopt small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.cost { display: flex; gap: 3px; }
.cost i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.pp-foot { margin-top: 10px; display: flex; justify-content: space-between; }

/* модалки */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.modal-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(3,8,14,.6); pointer-events: auto; animation: fade .2s; backdrop-filter: blur(4px); }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 94vw); max-height: 86vh; display: flex; flex-direction: column; animation: pop .25s var(--ease); }
.modal.wide { width: min(780px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; gap: 10px; }
.modal-head h3 { font-size: 1.1rem; }
.modal-body { padding: 6px 20px 12px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 4px 20px 18px; }
.modal-foot:empty { display: none; }
.choice-list { display: grid; gap: 8px; margin: 8px 0; }
.help { columns: 2; column-gap: 28px; }
.help section { break-inside: avoid; margin-bottom: 14px; }
.help ul { padding-left: 18px; line-height: 1.6; color: var(--text-2); margin: 6px 0; }
.help h4 { color: var(--gold); font-size: .9rem; }
.hotkeys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; color: var(--text-2); font-size: .85rem; }

/* итоги */
.debrief { max-width: 1280px; margin: 0 auto; padding: 32px 28px 60px; display: grid; gap: 16px; }
.result-hero { padding: 34px; position: relative; overflow: hidden; }
.result-hero::before { content: ""; position: absolute; inset: -50% auto auto -10%; width: 70%; height: 200%; background: radial-gradient(circle, var(--hero, rgba(52,224,161,.18)), transparent 60%); pointer-events: none; }
.result-hero.lose { --hero: rgba(255,90,95,.2); }
.result-hero h2 { font-family: var(--display); font-size: 3.4rem; font-weight: 800; margin: 6px 0; }
.result-hero.win h2 { color: var(--teal); }
.result-hero.lose h2 { color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.stat span { font-size: 1.15rem; font-weight: 800; }
.dotc { display: inline-block; width: 13px; height: 13px; border-radius: 4px; transform: rotate(45deg); margin-right: 6px; }
.dotc.c-blue, .cdot.c-blue { background: var(--blue); } .dotc.c-yellow, .cdot.c-yellow { background: var(--yellow); } .dotc.c-black, .cdot.c-black { background: var(--black); } .dotc.c-red, .cdot.c-red { background: var(--red); }
.scars-sum { margin-top: 14px; display: grid; gap: 4px; color: var(--text-2); }
.upg-left { font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.upg { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; background: linear-gradient(165deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); align-content: start; transition: border-color .2s, transform .2s var(--ease); }
.upg:hover { border-color: rgba(255,207,74,.4); transform: translateY(-2px); }
.upg.disabled { opacity: .4; pointer-events: none; }
.upg-h { display: flex; gap: 10px; align-items: center; }
.upg-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,207,74,.13); color: var(--gold); }
.upg-title { font-weight: 800; }
.upg-text { font-size: .8rem; color: var(--muted); }
.upg-fields { display: grid; gap: 6px; }
.upg select { padding: .55rem .7rem; font-size: .8rem; }
.upg .btn { justify-self: start; }
.debrief-foot { display: flex; justify-content: flex-end; }
.hist { display: grid; gap: 4px; margin: 14px 0; }

/* баннер */
#banner { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 25; opacity: 0; }
#banner.show { animation: banner 2s var(--ease) forwards; }
#banner.small.show, #banner.turn.show { animation-duration: 1.2s; }
.banner-inner { text-align: center; padding: 26px 80px; width: 100%; background: linear-gradient(90deg, transparent, rgba(5,12,22,.88) 18%, rgba(5,12,22,.88) 82%, transparent); display: grid; justify-items: center; gap: 4px; }
.banner-ic { color: var(--gold); }
.banner-ic:empty { display: none; }
.banner-title { font-family: var(--display); font-size: 3.6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.banner-sub { font-size: 1.05rem; color: var(--text-2); font-weight: 600; }
#banner.small .banner-title, #banner.turn .banner-title { font-size: 2rem; }
#banner.turn .banner-inner { background: linear-gradient(90deg, transparent, rgba(5,12,22,.6) 30%, rgba(5,12,22,.6) 70%, transparent); padding: 16px 60px; }
#banner.turn.mine .banner-title { color: var(--gold); }
#banner.outbreak .banner-title { color: #ff6b6b; text-shadow: 0 0 34px rgba(255,60,60,.8); }
#banner.outbreak .banner-ic { color: #ff6b6b; }
#banner.epidemic .banner-title { color: #59ff9f; text-shadow: 0 0 44px rgba(61,220,132,.9); font-size: 4.6rem; }
#banner.epidemic .banner-ic { color: #59ff9f; }
#banner.epidemic .banner-inner { background: linear-gradient(90deg, transparent, rgba(3,34,18,.92) 18%, rgba(3,34,18,.92) 82%, transparent); }
#banner.cure .banner-title { color: var(--gold); text-shadow: 0 0 34px rgba(255,207,74,.7); }
#banner.win .banner-title { color: var(--teal); font-size: 4.8rem; }
#banner.lose .banner-title { color: var(--danger); font-size: 4.8rem; }
#banner.month .banner-title { font-size: 4.2rem; color: #fff; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.15); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.98); } }

#infcard { position: fixed; top: 96px; left: 50%; width: 170px; height: 100px; margin-left: -85px; border-radius: 14px; z-index: 24; pointer-events: none; opacity: 0; transform: perspective(700px) rotateY(90deg); background: linear-gradient(140deg, #1d4a2b, #0b2414); border: 2px solid #5fd38a; box-shadow: 0 16px 44px rgba(0,0,0,.55), 0 0 34px rgba(61,220,132,.35); display: grid; place-items: center; text-align: center; overflow: hidden; }
#infcard::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 8px, transparent 8px 16px); }
#infcard.show { animation: flip 1s var(--ease) forwards; }
@keyframes flip { 0% { opacity: 0; transform: perspective(700px) rotateY(90deg) translateY(-20px); } 25% { opacity: 1; transform: perspective(700px) rotateY(0) translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: perspective(700px) rotateY(0) translateY(26px) scale(.9); } }
.inf-in { position: relative; display: grid; justify-items: center; gap: 2px; }
.inf-in .ic { color: #7dffaa; }
.inf-name { font-weight: 900; font-size: 1.05rem; }
.inf-sub { font-size: .62rem; text-transform: uppercase; letter-spacing: .18em; color: #9fe0b8; font-weight: 800; }
#infcard.c-blue { border-color: var(--blue); } #infcard.c-yellow { border-color: var(--yellow); } #infcard.c-red { border-color: var(--red); } #infcard.c-black { border-color: #b2b9c8; }

#toasts { position: fixed; left: 50%; top: 96px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 35; pointer-events: none; justify-items: center; }
.toast { display: flex; gap: 10px; align-items: center; background: rgba(8,16,28,.95); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.45); animation: toast-in .35s var(--ease); max-width: 560px; transition: opacity .4s, transform .4s; font-weight: 600; font-size: .9rem; }
.toast .ic { color: var(--sky); }
.toast.warn { border-color: rgba(255,159,67,.6); } .toast.warn .ic { color: var(--orange); }
.toast.bad { border-color: rgba(255,90,95,.6); color: #ffd0d1; } .toast.bad .ic { color: var(--danger); }
.toast.good { border-color: rgba(52,224,161,.5); } .toast.good .ic { color: var(--teal); }
.toast.chat { border-color: rgba(255,107,139,.6); } .toast.chat .ic { color: #ff6b8b; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
#hearts { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.heart { position: absolute; bottom: -40px; animation: float-up 3.2s ease-in forwards; }
@keyframes float-up { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

/* ---------- обучение ---------- */
#coach { position: fixed; inset: 0; z-index: 28; pointer-events: none; }
#coach-spot { position: fixed; border-radius: 18px; transition: all .45s var(--ease); pointer-events: none; }
#coach.dim #coach-spot { box-shadow: 0 0 0 9999px rgba(3,8,15,.62); }
#coach-spot.on { outline: 2px solid var(--gold); outline-offset: 4px; animation: spot 1.6s infinite; }
#coach-spot.round { border-radius: 50%; }
@keyframes spot { 50% { outline-offset: 9px; outline-color: rgba(255,207,74,.35); } }
#coach-card { position: fixed; width: 380px; padding: 20px 22px; pointer-events: auto; transition: left .45s var(--ease), top .45s var(--ease); border-color: rgba(255,207,74,.35); box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,207,74,.15); }
.coach-step { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.coach-dots { display: flex; gap: 4px; }
.coach-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.15); }
.coach-dots i.on { background: var(--gold); }
.coach-dots i.done { background: rgba(255,207,74,.5); }
#coach-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 6px; }
#coach-card p { color: var(--text-2); font-size: .92rem; }
#coach-card p b { color: var(--text); }
.coach-task { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,207,74,.08); border: 1px dashed rgba(255,207,74,.45); color: var(--gold); font-weight: 800; font-size: .86rem; }
.coach-task .ic { animation: nudge 1.2s infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.coach-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }
.tut-badge { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 999px; background: rgba(255,207,74,.14); color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 1280px) {
  .seat { width: 220px; }
  .dbtn { width: 72px; }
  #rail { width: 300px; }
  #mapctl { right: 330px; }
  .hud-l { min-width: 190px; }
}

/* контекстные подсказки обучения */
.coach-tip { position: fixed; top: 96px; left: 50%; width: 400px; padding: 16px 18px; z-index: 29; transform: translate(-50%, -16px); opacity: 0; transition: all .35s var(--ease); border-color: rgba(108,196,255,.4); }
.coach-tip.in { transform: translate(-50%, 0); opacity: 1; }
.coach-tip h3 { font-family: var(--display); font-weight: 700; margin: 8px 0 4px; }
.coach-tip p { color: var(--text-2); font-size: .9rem; }
.coach-tip .tut-badge { background: rgba(108,196,255,.14); color: var(--sky); }
.pp-head .dotc { width: 14px; height: 14px; margin: 0 4px; }
.pp-row .portrait { vertical-align: middle; }
body.tutorial #rail-chat { display: none; }

/* «макро» по краям кадра — эффект миниатюры */
#game > .tilt { position: absolute; left: 0; right: 0; pointer-events: none !important; display: none; }
body.q-ultra #game > .tilt { display: block; backdrop-filter: blur(2.6px); -webkit-backdrop-filter: blur(2.6px); }
#tilt-top { top: 0; height: 15vh; mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 40%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 40%, transparent 100%); }
#tilt-bot { bottom: 0; height: 30vh; mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.7) 35%, transparent 100%); -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.7) 35%, transparent 100%); }

/* ---- масштаб, мини-карта, маршрут ---- */
#mapctl { display: grid; justify-items: center; }
#zoom-slider { writing-mode: vertical-lr; direction: rtl; width: 26px; height: 110px; padding: 0; margin: 4px 0; background: none; border: 0; accent-color: var(--gold); cursor: pointer; }
#minimap { position: absolute; left: 14px; top: 92px; width: 240px; height: 107px; border-radius: 14px; border: 1px solid var(--line-2); box-shadow: var(--shadow); cursor: crosshair; background: #0b1622; }
#hand-meta { display: flex; gap: 6px; justify-content: center; min-height: 0; }
#hand-meta:empty { display: none; }
.hm { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 999px; background: rgba(8,16,28,.82); border: 1px solid var(--line); font-size: .74rem; font-weight: 800; color: var(--text-2); backdrop-filter: blur(8px); }
.hm .dotc { width: 9px; height: 9px; margin: 0 2px 0 0; }
.hm.ready { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 14px rgba(52,224,161,.35); }
.tt-act.far { color: var(--muted); }
.tt-act.danger { color: #ff8a80; }
.tt-act.warn { color: #9dffcf; }
.pp-route { margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(255,207,74,.07); border: 1px solid rgba(255,207,74,.28); display: grid; gap: 8px; }
.pp-route-desc { font-size: .8rem; color: var(--text-2); }
.portrait.bust svg { position: static; }
.portrait.bust { filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); }

/* ---- уровни качества ---- */
body.q-high .glass { backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
body.q-smooth .glass, body.q-smooth .hm, body.q-smooth .modal-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
body.q-smooth .glass { background: rgba(12,22,36,0.93); }
body.q-smooth #game .glass { box-shadow: 0 8px 24px rgba(0,0,0,.4); }
body.q-smooth .modal-wrap { background: rgba(3,8,14,.72); }
/* счётчик кадров */
#fps { position: fixed; left: 50%; top: 96px; transform: translateX(-50%); z-index: 45; font: 700 12px/1 ui-monospace, Menlo, monospace; color: #9dffcf; background: rgba(4,10,18,.88); border: 1px solid rgba(157,255,207,.35); border-radius: 8px; padding: 6px 10px; pointer-events: none; white-space: nowrap; }
#fps.bad { color: #ff9a8a; border-color: rgba(255,120,100,.5); }

/* ---- планшеты: без случайного масштаба страницы, подсветки касаний и выделения ---- */
html, body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body[data-screen="game"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .card, .mopt, .dbtn, .seat, .threat { touch-action: manipulation; }
#minimap, #zoom-slider { touch-action: none; }
