/* Убийцы богов. Мир: свинцовый витраж в разрушенном ночном храме.
   Панели — стёкла в свинцовой оправе, четыре цвета стекла принадлежат четырём игрокам. */
:root {
  --ground: #090812;
  --lead: #05040a;
  --came: #2c2838;          /* свинцовая оправа на тёмном фоне */
  --came-hi: #58526a;       /* блик на оправе, спайки */
  --pane: rgba(13, 11, 24, .86);
  --pane-solid: #100e1c;
  --bone: #f1e8d4;
  --dim: #b0a6bd;
  --faint: #968da6;
  --gold: #f5b83a;
  --azure: #5b97ff;
  --crimson: #f2505a;
  --jade: #44d38b;
  --display: 'Forum', 'Times New Roman', serif;
  --ui: 'Alegreya Sans', system-ui, sans-serif;
  --out: cubic-bezier(.16, 1, .3, 1);
  --gap: clamp(8px, 1.2vw, 16px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground) url('assets/bg-wide.webp') center / cover fixed no-repeat;
  color: var(--bone); font: 500 16px/1.4 var(--ui); overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
@media (orientation: portrait) { body { background-image: url('assets/bg-tall.webp'); } }
body::before { content: ''; position: fixed; inset: 0; background: rgba(6, 5, 12, .5); pointer-events: none; }
::selection { background: var(--gold); color: var(--lead); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
b { font-weight: 800; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#beams { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* стекло в оправе */
.pane, .vitals, .team, .controls, .board-frame, .kill-body, .rules {
  background: var(--pane); border: 3px solid var(--lead);
  box-shadow: 0 0 0 1px var(--came-hi), 0 14px 34px -10px rgba(0, 0, 0, .7);
  border-radius: 0;
}

/* ——— кнопки ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 2px solid var(--came-hi); border-radius: 3px; background: rgba(241, 232, 212, .05);
  font: 700 17px/1 var(--ui); letter-spacing: .02em;
  transition: background .2s, border-color .2s, transform .15s var(--out);
}
.btn:hover { background: rgba(241, 232, 212, .11); border-color: var(--bone); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1c1203; }
.btn.primary:hover { background: #ffc955; border-color: #ffc955; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; width: 100%; }
.link { color: var(--dim); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--faint); font-weight: 500; padding: 8px 4px; }
.link:hover { color: var(--bone); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--dim); border-radius: 3px; transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--bone); background: rgba(241, 232, 212, .08); }
#soundBtn .mute { display: none; }
#soundBtn.off .waves { display: none; }
#soundBtn.off .mute { display: initial; }

/* ——— вход ——— */
.lobby { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; overflow: hidden auto; }
.frieze { display: flex; justify-content: center; align-items: flex-start; gap: clamp(4px, 1vw, 16px); padding: clamp(10px, 2.5vh, 28px) 12px 0; overflow-x: clip; }
.frieze img { height: clamp(92px, 19vh, 230px); width: auto; flex: none; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .7)); opacity: 0; animation: rise .9s var(--out) forwards; animation-delay: calc(var(--i) * 70ms); }
.frieze img:nth-child(even) { margin-top: clamp(8px, 3vh, 34px); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: brightness(.2) drop-shadow(0 12px 22px rgba(0, 0, 0, .7)); } to { opacity: 1; transform: none; } }
.lobby-body { width: min(100%, 560px); margin: 0 auto; align-self: center; padding: clamp(14px, 3vh, 30px) 20px clamp(18px, 4vh, 40px); text-align: center; }
.lobby h1 { font-size: clamp(40px, 7vw, 70px); line-height: .95; letter-spacing: .01em; text-transform: uppercase; }
.lead { color: var(--dim); font-size: clamp(16px, 2.2vw, 18px); margin: 8px auto 14px; max-width: 46ch; }
.lobby-form { display: grid; gap: 10px; text-align: left; }
.field { display: grid; gap: 6px; }
.field span { font-size: 14px; color: var(--dim); letter-spacing: .03em; }
.field input {
  height: 50px; padding: 0 14px; background: rgba(5, 4, 10, .7); border: 2px solid var(--came-hi); border-radius: 3px;
  color: var(--bone); font: 700 18px/1 var(--ui); caret-color: var(--gold); width: 100%;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: 0; border-color: var(--gold); }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
#codeInput { text-transform: uppercase; letter-spacing: .3em; }
.or { text-align: center; color: var(--faint); font-size: 14px; }
.form-error { color: #ff9aa0; font-size: 15px; }
.demo-note { color: var(--faint); font-size: 14px; margin-top: 10px; }
@media (max-width: 720px) { .frieze img:nth-child(n+5) { display: none; } .frieze img { height: clamp(96px, 22vh, 190px); } }
@media (max-height: 620px) and (orientation: landscape) { .frieze { display: none; } .lobby { grid-template-rows: 1fr; align-content: center; } }

/* ——— игра ——— */
.game {
  position: relative; height: 100%; display: grid; gap: var(--gap); padding: var(--gap);
  padding-bottom: max(var(--gap), env(safe-area-inset-bottom));
  grid-template-columns: minmax(230px, .82fr) minmax(360px, 1.3fr) minmax(210px, .56fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: 'top top top' 'altar board team' 'altar controls team';
}
.top { grid-area: top; display: flex; align-items: center; gap: 14px; min-height: 44px; }
.brand { font: 400 22px/1 var(--display); text-transform: uppercase; letter-spacing: .08em; }
.code { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 12px; border: 2px solid var(--came); border-radius: 3px; background: var(--pane); transition: border-color .2s; }
.code:hover { border-color: var(--gold); }
.code #roomCode { font: 800 17px/1 var(--ui); letter-spacing: .22em; color: var(--gold); }
.code-hint { font-size: 14px; color: var(--dim); }
.menu { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.altar { grid-area: altar; display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.window { flex: 1; min-height: 0; display: grid; place-items: center; }
.window canvas { max-width: 100%; max-height: 100%; height: 100%; width: auto; aspect-ratio: 779 / 1131; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .75)); }
.window.struck canvas { animation: struck .32s var(--out); }
.window.struck.hard canvas { animation: struck-hard .45s var(--out); }
@keyframes struck { 0% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px) rotate(-.4deg); } 55% { transform: translate(3px, -1px) rotate(.3deg); } 100% { transform: none; } }
@keyframes struck-hard { 0% { transform: none; } 18% { transform: translate(-8px, 4px) rotate(-1deg) scale(1.012); } 45% { transform: translate(7px, -3px) rotate(.8deg); } 70% { transform: translate(-3px, 1px); } 100% { transform: none; } }

.vitals { padding: 12px 14px 12px; }
.vitals h2 { font-size: clamp(26px, 2.6vw, 40px); line-height: 1; text-transform: uppercase; letter-spacing: .04em; }
.god-title { color: var(--dim); font-size: 15px; margin-top: 2px; }
.hp { position: relative; height: 16px; margin-top: 10px; background: var(--lead); border: 2px solid var(--came-hi); border-radius: 2px; overflow: hidden; }
.hp-left { position: absolute; inset: 0; z-index: 1; background: #f3e6c4; transform-origin: left; transition: transform .45s var(--out); }
.hp-lost { position: absolute; top: 0; bottom: 0; right: 0; display: flex; }
.hp-lost i { display: block; height: 100%; flex: 0 0 auto; opacity: .85; border-left: 1px solid var(--lead); }
.hp-num { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.hp-num b { color: var(--bone); font-size: 16px; }
.temper { margin-left: auto; text-align: right; }

.board { grid-area: board; min-height: 0; min-width: 0; display: grid; place-items: center; container-type: size; }
.board-frame { position: relative; width: min(100cqw, 100cqh * 1.2); aspect-ratio: 6 / 5; padding: clamp(5px, 1cqw, 10px); background: rgba(9, 8, 17, .9); }
.grid { position: relative; width: 100%; height: 100%; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), var(--came) calc(100% / 6 - 1px) calc(100% / 6)) 0 0 / 100% 100%,
    repeating-linear-gradient(0deg, transparent 0 calc(100% / 5 - 1px), var(--came) calc(100% / 5 - 1px) calc(100% / 5)) 0 0 / 100% 100%;
}
.cell { position: absolute; width: calc(100% / 6); height: 20%; left: calc(var(--c) * 100% / 6); top: calc(var(--r) * 20%); display: grid; place-items: center; will-change: transform; }
.cell img { width: 86%; height: 86%; object-fit: contain; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .6)); user-select: none; -webkit-user-drag: none; }
.grid.dim .cell:not(.hit) img { filter: brightness(.38) saturate(.6); transition: filter .25s; }
.cell.hit img { animation: lit .45s var(--out) both; }
@keyframes lit { 0% { transform: scale(1); filter: brightness(1); } 45% { transform: scale(1.16); filter: brightness(1.9) drop-shadow(0 0 14px rgba(255, 244, 214, .9)); } 100% { transform: scale(1.08); filter: brightness(1.45) drop-shadow(0 0 10px rgba(255, 244, 214, .7)); } }
.cell.gone img { animation: gone .3s cubic-bezier(.5, 0, 1, .6) both; }
@keyframes gone { from { transform: scale(1.08); filter: brightness(1.6) blur(0); opacity: 1; } to { transform: scale(1.5) rotate(9deg); filter: brightness(3) blur(5px); opacity: 0; } }
.cell.lance-go img { animation: lance-go .5s var(--out) both; }
@keyframes lance-go { 0% { transform: none; filter: brightness(1); } 40% { transform: scale(1.25) rotate(-8deg); filter: brightness(2.2) drop-shadow(0 0 16px #fff); } 100% { transform: scale(1.05); filter: brightness(1.2); } }

.relic { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 4; width: clamp(110px, 30cqw, 190px); aspect-ratio: 1; display: grid; place-content: center; text-align: center;
  background: var(--gold); border: 5px solid var(--lead); outline: 1px solid var(--came-hi); border-radius: 50%; color: #241503;
  box-shadow: inset 0 0 0 7px var(--gold), inset 0 0 0 10px var(--lead), 0 18px 40px rgba(0, 0, 0, .7); animation: relic-in .55s var(--out) both; pointer-events: none; }
.relic small { display: none; }
.relic b { font: 400 clamp(40px, 12cqw, 76px)/1 var(--display); }
.relic.docked { left: 50%; top: 0; translate: -50% -50%; width: clamp(46px, 11cqw, 70px); border-width: 3px; box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px var(--lead), 0 8px 18px rgba(0, 0, 0, .6); transition: all .5s var(--out); animation: none; }
.relic.docked small { display: none; }
.relic.docked b { font-size: clamp(20px, 5cqw, 30px); }
@keyframes relic-in { from { transform: scale(.3) rotate(-25deg); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }
.step-pay { position: absolute; left: 50%; bottom: 9%; translate: -50% 0; z-index: 3; font: 400 clamp(24px, 6.5cqw, 44px)/1 var(--display); color: var(--bone); text-shadow: 0 3px 0 var(--lead), 0 0 10px var(--lead); pointer-events: none; opacity: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.step-pay.real { font-size: clamp(28px, 8cqw, 54px); color: #ffe9b3; text-shadow: 0 3px 0 var(--lead), 0 2px 18px rgba(245, 184, 58, .55); }
.step-pay.show { animation: pay 1s var(--out) both; }
@keyframes pay { 0% { opacity: 0; transform: translateY(18px) scale(.8); } 20% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

/* роли */
.roles { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.roles legend { font-size: 14px; color: var(--dim); letter-spacing: .03em; padding: 0 0 6px; }
.role-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 9px; text-align: center; border: 3px solid var(--lead); outline: 1px solid var(--came-hi); outline-offset: -4px; background: rgba(5, 4, 10, .6); cursor: pointer; transition: background .2s, outline-color .2s, transform .2s var(--out); min-width: 0; }
.role-card:hover { transform: translateY(-3px); outline-color: var(--bone); }
.role-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-card img { width: clamp(40px, 9vw, 64px); aspect-ratio: 1; object-fit: contain; }
.role-card strong { font: 400 19px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.role-card span { font-size: 12.5px; line-height: 1.2; color: var(--dim); }
.lobby .role-card { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 8px; padding: 8px 10px; }
.lobby .role-card img { grid-row: 1 / 3; width: 44px; align-self: center; }
.lobby .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-card:has(input:checked) { outline: 2px solid var(--gold); background: rgba(245, 184, 58, .12); }
.role-card:has(input:checked) strong { color: var(--gold); }
.role-card:has(input:focus-visible) { outline: 2px solid var(--bone); }
.role-dlg .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.role-dlg .role-card span { font-size: 14px; }
@media (max-width: 560px) { .lobby .role-card span { display: none; } .lobby .role-card img { grid-row: auto; width: 34px; } }
.hero-role { font-weight: 500; color: var(--dim); font-size: 13px; margin-left: 6px; }

.ability { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 5; margin: 0; padding: .22em .7em .28em; white-space: nowrap; pointer-events: none;
  font: 400 clamp(26px, 8cqw, 58px)/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--lead); background: var(--tone, var(--gold)); border: 4px solid var(--lead); outline: 1px solid var(--came-hi);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .7); animation: ability 1.5s var(--out) both; }
@keyframes ability { 0% { opacity: 0; transform: scale(1.6); filter: blur(8px); } 14% { opacity: 1; transform: none; filter: none; } 72% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-18px) scale(.96); } }
.cell.morph img { animation: morph .7s var(--out) both; }
@keyframes morph { 0% { transform: none; filter: brightness(1); } 45% { transform: scale(.2) rotate(140deg); filter: brightness(3.2) blur(2px); } 100% { transform: none; filter: brightness(1.25); } }

/* отряд */
.team { grid-area: team; display: flex; flex-direction: column; gap: 0; padding: 0; min-height: 0; align-self: start; max-height: 100%; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hero { --tone: var(--gold); display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 5px; align-items: center; padding: 11px 12px; border-bottom: 3px solid var(--lead); transition: background .25s; }
.hero[data-color='azure'] { --tone: var(--azure); } .hero[data-color='crimson'] { --tone: var(--crimson); } .hero[data-color='jade'] { --tone: var(--jade); }
.hero.me { background: color-mix(in srgb, var(--tone) 13%, transparent); }
.hero.me .hero-name { color: var(--tone); }
.hero.offline { opacity: .5; }
.lozenge { width: 20px; height: 20px; rotate: 45deg; background: var(--tone); border: 2px solid var(--lead); outline: 1px solid var(--came-hi); justify-self: center; transition: scale .2s var(--out); }
.hero.spinning .lozenge { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { scale: .72; filter: brightness(1.5); } }
.hero-name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-name small { font-weight: 500; color: var(--dim); font-size: 13px; margin-left: 6px; }
.hero-dmg { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--dim); text-align: right; white-space: nowrap; }
.hero-dmg b { color: var(--bone); font-size: 16px; }
.charge { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.charge-bar { flex: 1; height: 5px; background: var(--lead); border: 1px solid var(--came); }
.charge-bar i { display: block; height: 100%; background: var(--tone); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--out); }
.loot-badge { color: var(--lead); background: var(--tone); font-weight: 800; padding: 1px 7px; border-radius: 2px; font-size: 13px; }
.team-actions { display: grid; gap: 8px; padding: 10px 12px; }
.feed { list-style: none; margin: 0; padding: 10px 12px 12px; border-top: 3px solid var(--lead); display: flex; flex-direction: column; gap: 4px; overflow: hidden; min-height: 0; font-size: 14px; color: var(--dim); }
.feed:empty { display: none; }
.feed li { animation: feed-in .4s var(--out); }
.feed li b { color: var(--tone, var(--bone)); font-weight: 700; }
@keyframes feed-in { from { opacity: 0; transform: translateX(10px); } }

/* управление */
.controls { grid-area: controls; display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: clamp(8px, 1.6vw, 22px); padding: 10px clamp(10px, 1.6vw, 22px); }
.stat { display: grid; gap: 1px; font-variant-numeric: tabular-nums; min-width: 0; }
.stat span { font-size: 13px; color: var(--dim); letter-spacing: .04em; white-space: nowrap; }
.stat b { font: 400 clamp(20px, 2.2vw, 28px)/1.05 var(--display); white-space: nowrap; }
.stat.win { text-align: right; }
.stat.win.up b { color: var(--gold); }
.bet { display: flex; align-items: center; gap: 8px; }
.bet .stat { text-align: center; min-width: 74px; }
.step { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--came-hi); border-radius: 3px; transition: border-color .2s, background .2s; }
.step:hover:not(:disabled) { border-color: var(--bone); background: rgba(241, 232, 212, .08); }
.step:disabled { opacity: .35; }
.spin { position: relative; width: clamp(92px, 9vw, 124px); aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; gap: 2px; text-align: center;
  --glass: var(--gold); background: var(--glass); color: #1c1203; border: 5px solid var(--lead); outline: 1px solid var(--came-hi);
  box-shadow: inset 0 0 0 6px var(--glass), inset 0 0 0 9px var(--lead), 0 10px 24px rgba(0, 0, 0, .6); transition: transform .18s var(--out), filter .2s, background .3s; margin-block: -22px -6px; }
.spin span { font: 400 clamp(19px, 2vw, 25px)/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.spin small { font: 700 12px/1.1 var(--ui); max-width: 9ch; margin-inline: auto; }
.spin small:empty { display: none; }
.spin:hover:not(:disabled) { transform: scale(1.04); filter: brightness(1.08); }
.spin:active:not(:disabled) { transform: scale(.96); }
.spin:disabled { filter: saturate(.25) brightness(.62); }
.spin.loot { --glass: var(--jade); }

/* победа и выбор бога */
.veil { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 10, .78); animation: veil .5s var(--out); overflow: auto; }
@keyframes veil { from { opacity: 0; } }
.kill-body { width: min(100%, 860px); padding: clamp(16px, 3vw, 32px); text-align: center; background: var(--pane-solid); animation: kill-in .7s var(--out) both; }
@keyframes kill-in { from { opacity: 0; transform: translateY(24px) scale(.97); filter: blur(4px); } }
.kill-body h2 { font-size: clamp(38px, 7vw, 76px); line-height: 1; text-transform: uppercase; letter-spacing: .03em; color: var(--gold); }
.kill-by { color: var(--dim); margin-top: 8px; font-size: 17px; }
.kill-by b { color: var(--tone, var(--bone)); }
.kill-share { margin-top: 10px; font-size: 19px; font-weight: 700; }
.vote { margin-top: clamp(16px, 3vh, 30px); }
.vote h3 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 14px; }
.vote-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); }
.god-card { display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; gap: 6px; padding: 12px 8px 10px; min-width: 0; overflow: hidden; border: 3px solid var(--lead); outline: 1px solid var(--came-hi); outline-offset: -4px; border-radius: 0; background: rgba(5, 4, 10, .55); transition: border-color .2s, transform .25s var(--out), background .2s; text-align: center; }
.god-card:hover { transform: translateY(-4px); outline-color: var(--bone); }
.god-card.mine { outline: 2px solid var(--gold); background: rgba(245, 184, 58, .1); }
.god-card img { height: clamp(96px, 22vh, 200px); width: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)); }
.god-card strong { font: 400 clamp(19px, 2.4vw, 26px)/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.god-card span { font-size: 14px; color: var(--dim); line-height: 1.3; overflow-wrap: anywhere; }
.god-card em { font-style: normal; display: block; }
.god-card span b { color: var(--bone); }
.votes { display: flex; gap: 6px; min-height: 16px; align-items: center; justify-content: center; }
.votes i { width: 12px; height: 12px; rotate: 45deg; background: var(--tone); border: 1px solid var(--lead); animation: pop .35s var(--out); }
@keyframes pop { from { scale: 0; } }
.vote-timer { height: 4px; background: var(--lead); margin-top: 14px; border: 1px solid var(--came); }
.vote-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
.vote-note { color: var(--faint); font-size: 14px; margin-top: 10px; }

.big { position: fixed; inset: 0; z-index: 35; display: grid; place-content: center; text-align: center; pointer-events: none; background: radial-gradient(circle, rgba(245, 184, 58, .2), transparent 62%); animation: veil .4s var(--out); }
.big p { font: 400 clamp(22px, 4vw, 38px)/1 var(--display); text-transform: uppercase; letter-spacing: .14em; }
.big b { font: 400 clamp(64px, 15vw, 150px)/1 var(--display); color: var(--gold); text-shadow: 0 5px 0 var(--lead), 0 0 60px rgba(245, 184, 58, .6); animation: big-in .7s var(--out) both; font-variant-numeric: tabular-nums; }
@keyframes big-in { from { transform: scale(.4); filter: blur(10px); opacity: 0; } }

.rules { width: min(680px, calc(100vw - 24px)); max-height: min(86vh, 900px); padding: 0; color: var(--bone); overflow: hidden; }
.rules[open] { display: flex; flex-direction: column; }
.rules::backdrop { background: rgba(5, 4, 10, .78); }
.rules header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 22px; border-bottom: 1px solid var(--came); }
.rules header h2 { font-size: 28px; text-transform: uppercase; letter-spacing: .05em; }
.rules-body { padding: 6px 22px 24px; overflow: auto; scrollbar-color: var(--came-hi) transparent; scrollbar-width: thin; }
.rules-body h3 { font-size: 21px; margin: 22px 0 6px; color: var(--gold); }
.rules-body p { color: #d9cfe0; max-width: 68ch; margin-bottom: 8px; }
.paytable { display: grid; grid-template-columns: 44px repeat(3, 1fr); gap: 4px 10px; align-items: center; font-variant-numeric: tabular-nums; margin-top: 8px; }
.paytable img { width: 40px; height: 40px; }
.paytable .hd { color: var(--dim); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 50; padding: 10px 16px; background: var(--pane-solid); border: 2px solid var(--gold); border-radius: 3px; font-weight: 700; animation: feed-in .3s var(--out); }

/* ——— телефон в руке ——— */
@media (max-width: 860px), (orientation: portrait) {
  .game { grid-template-columns: minmax(96px, 31vw) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 8px; padding: 8px;
    grid-template-areas: 'top top' 'window vitals' 'window team' 'board board' 'controls controls'; }
  .altar { display: contents; }
  .window { grid-area: window; align-self: start; }
  .window canvas { width: 100%; height: auto; }
  .vitals { grid-area: vitals; padding: 8px 10px; }
  .vitals h2 { font-size: 24px; }
  .god-title { font-size: 13px; }
  .hp { height: 13px; margin-top: 6px; }
  .hp-num { font-size: 12.5px; margin-top: 4px; }
  .temper { display: none; }
  .team-actions { padding: 6px 8px; }
  .hero { grid-template-columns: 16px minmax(0, auto) minmax(28px, 1fr) auto; padding: 6px 8px; column-gap: 8px; border-bottom-width: 2px; }
  .charge { grid-column: 3; grid-row: 1; }
  .hero-dmg { grid-column: 4; grid-row: 1; }
  .lozenge { width: 13px; height: 13px; border-width: 1px; }
  .hero-name { font-size: 14px; } .hero-name small { display: none; }
  .hero-dmg { font-size: 12px; } .hero-dmg b { font-size: 14px; }
  .charge { font-size: 11.5px; gap: 6px; } .charge .lbl { display: none; } .charge .loot-badge { font-size: 11px; }
  .charge-bar { height: 3px; }
  .feed { display: none; }
  .team-actions .btn { min-height: 32px; font-size: 13px; }
  .brand { display: none; }
  .code-hint { font-size: 13px; }
  .controls { grid-template-columns: 1fr auto 1fr; grid-template-areas: 'bal spin win' 'bet bet bet'; padding: 8px 10px; row-gap: 6px; }
  .controls > .stat:first-child { grid-area: bal; } .controls .bet { grid-area: bet; justify-content: center; } .controls .spin { grid-area: spin; margin-block: -18px 0; width: 88px; } .controls .stat.win { grid-area: win; }
  .step { width: 40px; height: 36px; }
  .vote-cards { gap: 6px; }
  .god-card { padding: 8px 4px; } .god-card span { font-size: 12.5px; } .god-card em.desc { display: none; }
  .god-card strong { font-size: 17px; letter-spacing: 0; }
  .god-card img { height: clamp(96px, 20vh, 170px); }
  .relic.docked { width: 44px; }
  .spin span { font-size: 16px; letter-spacing: 0; }
  .kill-share { font-size: 16px; }
}
/* лежащий телефон: витраж слева, поле в центре, отряд справа — всё ниже и плотнее */
@media (orientation: landscape) and (max-height: 520px) {
  .game { grid-template-columns: minmax(120px, .5fr) minmax(0, 1.2fr) minmax(170px, .5fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: 'altar board top' 'altar board team' 'altar controls team'; gap: 6px; padding: 6px; }
  .altar { display: flex; gap: 6px; }
  .window { grid-area: auto; } .window canvas { height: 100%; width: auto; }
  .vitals { grid-area: auto; padding: 6px 8px; } .vitals h2 { font-size: 20px; } .god-title, .temper { display: none; }
  .brand, .code-hint, .feed { display: none; }
  .top { gap: 4px; min-height: 36px; }
  .team-actions { padding: 6px 8px; }
  .controls { grid-template-columns: auto auto auto 1fr; grid-template-areas: none; padding: 4px 10px; }
  .controls > .stat:first-child, .controls .bet, .controls .spin, .controls .stat.win { grid-area: auto; }
  .spin { width: 66px; margin-block: -10px -2px; border-width: 3px; } .spin small { display: none; }
  .stat b { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
