@font-face {
  font-family: Golos;
  src: url('/assets/fonts/golos-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Golos;
  src: url('/assets/fonts/golos-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: dark;
  --background: #080708;
  --surface: #151217;
  --surface-raised: #211a24;
  --stroke: #392f3d;
  --text: #fff9f3;
  --muted: #beb0c0;
  --accent: #d6b7ef;
  --peach: #ffd9bf;
  --magenta: #e271d2;
  --ink: #211529;
  --mono: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-family: Golos, system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
  font-synthesis: none;
  line-height: 1.45;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { color: inherit; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--accent); }

.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--text); font-weight: 750; letter-spacing: -.025em; }
.brand-icon { display: grid; width: 35px; aspect-ratio: 1; place-items: center; border-radius: 9px; color: var(--ink); background: var(--accent); }
.eyebrow { display: flex; align-items: center; gap: .55rem; margin: 0; color: var(--muted); font: 600 .68rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.eyebrow i { width: .44rem; height: .44rem; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 12px #e271d255; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: .8rem; min-height: 48px; padding: .75rem 1.12rem; border: 1px solid transparent; border-radius: 11px; background: var(--accent); color: var(--ink); text-decoration: none; font-weight: 750; line-height: 1.2; transition: background .16s, color .16s, transform .16s; }
.primary-button:hover:not(:disabled) { background: #e7ccff; }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { opacity: .65; }

.home { background: #000; }
.home-hero { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; display: grid; align-items: center; padding: clamp(34px, 7vw, 112px) clamp(20px, 11vw, 170px); }
.home-hero::before { content: ''; position: absolute; z-index: -1; width: clamp(20px, 8vw, 150px); inset: 0 auto 0 0; background: repeating-linear-gradient(31deg, #303030 0 22px, transparent 22px 57px); opacity: .58; }
.home-copy { position: relative; z-index: 1; max-width: 640px; }
.home-partners { width: clamp(172px, 24vw, 284px); height: auto; margin: 0 0 clamp(44px, 10vh, 105px); }
.home-copy h1 { margin: .2em 0; font-size: clamp(3.6rem, 9.2vw, 9.25rem); line-height: .86; letter-spacing: -.068em; font-weight: 850; }
.home-copy h1 span { color: var(--peach); }
.home-copy h1 .home-period { color: var(--magenta); }
.home-copy > p:not(.eyebrow) { max-width: 22em; margin: 30px 0 24px; color: var(--text); font-size: clamp(1.05rem, 1.6vw, 1.36rem); }
.home-copy small { display: block; margin-top: 13px; color: var(--muted); }
.home-art { position: absolute; z-index: 0; right: 0; bottom: 0; width: min(74vw, 1260px); height: auto; max-height: 100%; object-fit: contain; object-position: right bottom; mask-image: linear-gradient(90deg, transparent 3%, #000 44%); pointer-events: none; }

.player-shell { max-width: 1220px; margin: 0 auto; padding: 20px max(clamp(16px, 4vw, 48px), env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(clamp(16px, 4vw, 48px), env(safe-area-inset-left)); }
.player-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke); }
.connection-status { display: inline-flex; align-items: center; gap: 6px; font-size: .73rem; font-weight: 600; color: var(--muted); }
.connection-status i { border-radius: 50%; width: 7px; height: 7px; background: var(--accent); }
.connection-status.is-offline i { background: var(--magenta); }
.player-content { padding-top: clamp(24px, 4vw, 58px); }
.player-failure { max-width: 520px; }
.loading-message { color: var(--muted); }

.join-layout { display: grid; align-items: stretch; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 15px; max-width: 930px; margin: 25px auto; }
.join-hero, .join-panel { border: 1px solid var(--stroke); background: var(--surface); padding: clamp(24px, 4vw, 48px); border-radius: 19px; }
.join-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 445px; background: #000; }
.join-hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(130deg, #000 21%, #0005 58%, transparent 85%), url('/assets/event/lounge.webp') right bottom / auto 88% no-repeat; }
.join-partners { display: block; width: min(180px, 90%); height: auto; margin: 0 0 clamp(18px, 3.6vw, 48px); }
.join-hero > .eyebrow { color: #e5cceb; }
.join-hero h1 { max-width: 8em; margin: .3em 0 .18em; color: var(--text); font-size: clamp(2.85rem, 5.7vw, 5rem); letter-spacing: -.061em; line-height: .97; overflow-wrap: anywhere; }
.join-hero > p:last-of-type { max-width: 17em; color: var(--text); text-shadow: 0 1px 5px #000; }
.join-panel { display: flex; flex-direction: column; justify-content: center; }
.join-panel h1, .join-panel h2 { margin: 0; font-size: clamp(1.43rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -.036em; }
.join-panel p { margin: 8px 0 20px; color: var(--muted); font-size: .9rem; }
.join-panel form { display: grid; }
.join-panel label { font-size: .82rem; font-weight: 650; margin-bottom: 5px; }
.join-panel input { width: 100%; min-height: 45px; margin-bottom: 14px; padding: .55rem .7rem; border: 1px solid #68536c; border-radius: 9px; background: var(--background); font-size: 1rem; }
.join-panel input::placeholder { color: var(--muted); }
.join-panel .primary-button { width: 100%; justify-content: space-between; margin-top: 4px; }
.join-wait-icon { display: grid; place-items: center; width: 56px; aspect-ratio: 1; border-radius: 12px; color: var(--accent); background: #2a1e2d; margin-bottom: 16px; }
.form-error, .join-panel .form-error { color: #ffa58a; }

.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.game-heading h1 { margin: 5px 0 0; font-size: clamp(2.55rem, 5.6vw, 5rem); letter-spacing: -.072em; line-height: .99; }
.player-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 48%; padding-bottom: 3px; }
.player-name > span { display: grid; place-items: center; width: 34px; flex: 0 0 34px; aspect-ratio: 1; border-radius: 50%; background: #30243c; color: #dec8ff; font-size: .7rem; text-transform: uppercase; }
.player-name > strong { word-break: break-word; font-size: .8rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(225px, .97fr); grid-template-areas: 'card current' 'card prizes' '. prizes'; grid-template-rows: auto auto 1fr; align-items: start; gap: 13px; }
.current-column { min-width: 0; grid-area: current; }
.current-panel { position: relative; overflow: hidden; padding: clamp(16px, 2.3vw, 26px); border-radius: 16px; border: 1px solid #5c4563; background: radial-gradient(ellipse at 94% -48%, #673752, transparent 75%), #211725; }
.current-panel h2 { margin: .4em 0 .75em; font-size: clamp(1.5rem, 2.7vw, 2.65rem); line-height: 1.06; letter-spacing: -.038em; overflow-wrap: anywhere; }
.current-meta, .current-footer { display: flex; align-items: center; color: #dccbef; font: 600 .73rem/1.3 var(--mono); }
.current-meta { justify-content: space-between; gap: 5px; text-transform: uppercase; }
.current-meta span { display: inline-flex; align-items: center; gap: 4px; }
.current-meta strong { color: var(--peach); white-space: nowrap; }
.current-meta small { color: #ddcbef; }
.current-footer { gap: 6px; }
.current-footer svg { color: var(--accent); }
.situation-change { animation: situation-in .45s both; }
@keyframes situation-in { from { opacity: .7; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.card-panel, .prize-panel { border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); padding: clamp(11px, 1.8vw, 23px); min-width: 0; }
.card-panel { grid-area: card; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-header h2, .prize-panel h2 { margin: 0; font-size: clamp(1.12rem, 2vw, 1.52rem); letter-spacing: -.03em; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.card-stats { display: flex; text-align: center; gap: clamp(8px, 1.6vw, 17px); }
.card-stats > span { color: var(--muted); font-size: .66rem; }
.card-stats strong { display: block; color: var(--text); font: 700 1.15rem/1.05 var(--mono); }
.card-stats small { color: var(--muted); font-size: .7rem; }
.game-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(5px, .9vw, 10px); }
.game-cell { position: relative; display: flex; flex-direction: column; gap: 5px; justify-content: space-between; width: 100%; min-width: 0; min-height: clamp(86px, 12vw, 122px); padding: clamp(6px, 1vw, 12px); border: 1px solid #453d50; border-radius: 9px; text-align: left; background: var(--surface-raised); color: #cac4d3; transition: background .16s, border-color .16s, color .16s, transform .16s; }
.cell-meta { display: flex; align-items: center; justify-content: space-between; gap: 2px; min-height: 14px; font: 500 .63rem/1 var(--mono); color: #b4a9be; }
.cell-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cell-text { font-size: clamp(.75rem, 1.25vw, 1.04rem); font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.game-cell.cell-drawn { border-color: var(--accent); color: var(--text); background: #392647; }
.game-cell.cell-drawn:not(:disabled):hover { background: #513561; }
.game-cell.cell-drawn:not(:disabled):active { transform: scale(.98); }
.game-cell.cell-marked, .game-cell.cell-marked:not(:disabled):hover { background: var(--accent); color: var(--ink); }
.game-cell.cell-marked .cell-meta { color: #4e3659; }
.game-cell.cell-line { border-color: var(--peach); box-shadow: inset 0 0 0 1px var(--peach); }
.game-cell.cell-line:not(.cell-marked) { background: #452b38; }
.game-cell.cell-pending { opacity: .72; }
.card-legend { display: flex; flex-wrap: wrap; gap: 6px 13px; padding-top: 13px; color: var(--muted); font-size: .66rem; }
.card-legend span { display: inline-flex; align-items: center; gap: 5px; }
.card-legend i { width: 8px; height: 8px; border-radius: 2px; border: 1px solid #9a8eac; }
.card-legend span:nth-child(2) i { border-color: var(--accent); }
.card-legend span:nth-child(3) i { border-color: var(--accent); background: var(--accent); }
.card-legend span:nth-child(4) i { border-color: var(--peach); }

.prize-panel { grid-area: prizes; }
.prize-panel ol { list-style: none; padding: 0; margin: 10px 0 0; }
.prize-panel li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--stroke); font-size: .86rem; }
.prize-panel li small { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.prize-panel li.prize-active { color: var(--accent); }
.prize-index { font: 600 .66rem/1 var(--mono); color: var(--muted); }
.personal-prize { display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 12px; color: var(--ink); background: var(--accent); margin-top: 10px; }
.personal-prize p { margin: 0; font-size: .77rem; }
.player-notice { display: flex; align-items: center; gap: 9px; position: fixed; z-index: 5; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 12px 15px; border: 2px solid var(--ink); border-radius: 11px; background: var(--accent); color: var(--ink); box-shadow: 0 8px 34px #0009; pointer-events: none; animation: situation-in .25s both; }

@media (max-width: 700px) {
  .home-hero { align-items: start; padding: 28px 22px min(420px, 72vw); }
  .home-hero::before { display: none; }
  .home-art { width: 100%; mask-image: linear-gradient(180deg, transparent, #000 26%); }
  .home-partners { margin-bottom: 42px; }
  .home-copy > p:not(.eyebrow) { margin-top: 22px; }
  .join-layout { grid-template-columns: 1fr; gap: 9px; margin: 0 auto; max-width: 460px; }
  .join-hero { min-height: 0; padding-right: 31%; }
  .join-hero::after { background: linear-gradient(100deg, #000 22%, #0009 52%, transparent 95%), url('/assets/event/lounge.webp') right bottom / auto 92% no-repeat; }
  .join-hero h1 { font-size: clamp(2.3rem, 8.6vw, 3.9rem); }
  .join-hero > p:last-of-type { margin-bottom: 0; font-size: .85rem; }
  .game-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'current' 'card' 'prizes'; grid-template-rows: auto; }
  .game-heading { margin-bottom: 13px; }
  .player-content { padding-top: 20px; }
}

@media (max-width: 390px) {
  .player-shell { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .player-name > span { display: none; }
  .card-header p { font-size: .68rem; }
  .game-card { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button, .game-cell { transition: none; }
  .situation-change, .player-notice { animation: none; }
}
