:root {
  color-scheme: dark;
  --base: #0c141b;
  --panel: #141f29;
  --deep: #0f1922;
  --line: #2a3a46;
  --ink: #f2f0e8;
  --muted: #a5b2be;
  --gold: #f7bc60;
  --aqua: #8fe0ca;
  --rose: #f3a493;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  font-family: Inter, 'Microsoft YaHei UI', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 50% 0%, #15232e 0%, var(--base) 55%); min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.site-header { border-bottom: 1px solid var(--line); background: #0d161ed9; }
.header-inner, .page, .site-footer { width: min(1190px, calc(100% - 64px)); margin-inline: auto; }
.header-inner { height: 73px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 19px; font-weight: 800; letter-spacing: .05em; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--gold); color: #182027; font: 800 25px/1 var(--mono); border-radius: 9px; }
.nav-link, .text-button { border: 0; background: transparent; padding: 7px 0; }
.nav-link { color: var(--muted); font-size: 14px; }
.nav-link span, .text-button { color: var(--gold); }
.nav-link span, .text-button span { margin-left: 3px; }
.page { margin-block: 42px 38px; min-height: calc(100vh - 227px); }
.lobby-grid { display: grid; grid-template-columns: 1.58fr 1fr; gap: 22px; }
.panel, .hero { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.hero { position: relative; overflow: hidden; min-height: 500px; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: 41px 39px 27px; background: radial-gradient(ellipse at 70% 65%, #243a4a, transparent 68%), #172531; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; opacity: .33; background-image: linear-gradient(#71879730 1px, transparent 1px), linear-gradient(90deg, #71879730 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(145deg, transparent, #000 76%); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: #d8d8ca; display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .14em; font-weight: 700; }
.eyebrow span { width: 7px; height: 7px; background: var(--gold); border-radius: 100%; box-shadow: 0 0 12px #f7bc605c; }
.hero h1 { font-weight: 900; font-size: clamp(48px, 5.7vw, 82px); margin: 13px 0 15px; line-height: 1.13; letter-spacing: -.075em; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 16px; line-height: 1.8; color: #b6c2c9; letter-spacing: .05em; }
.hero-table { position: absolute; inset: 25% 0 0 0; z-index: 0; pointer-events: none; }
.table-ring { position: absolute; width: min(78%, 490px); aspect-ratio: 1.55; border: 1px solid #7395a33d; border-radius: 50%; right: -6%; bottom: 10%; transform: rotate(-17deg); }
.ring-inner { transform: rotate(-17deg) scale(.79); border-style: dashed; }
.sample-card { position: absolute; width: clamp(104px, 29%, 165px); aspect-ratio: .7; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 13px; border-radius: 13px; box-shadow: 0 16px 23px #02091173; font-family: var(--mono); font-weight: 700; }
.sample-card::before { content: ''; position: absolute; inset: 8px; border: 1px solid currentColor; opacity: .28; border-radius: 8px; }
.sample-card b { align-self: center; font-size: clamp(49px, 8vw, 98px); line-height: .9; }
.sample-card span:last-child { align-self: flex-end; transform: rotate(180deg); }
.sample-back { bottom: 17%; right: 38%; background: repeating-linear-gradient(129deg, #223743, #223743 5px, #263d4a 5px, #263d4a 7px); color: #9dafb9; transform: rotate(-22deg) scale(.83); border: 1px solid #607b89; }
.sample-blue { bottom: 17%; right: 25%; background: linear-gradient(137deg, #b5cdd1, #739ca7); color: #233f4e; transform: rotate(-4deg) scale(.91); border: 1px solid #bcd1d5; }
.sample-gold { bottom: 15%; right: 10%; background: linear-gradient(137deg, #ffda90, #eeb15b); color: #49351e; transform: rotate(16deg); border: 1px solid #ffe4ad; }
.sample-token { position: absolute; display: grid; place-items: center; border-radius: 50%; aspect-ratio: 1; font: bold 19px var(--mono); box-shadow: 0 5px 0 #091821, 0 10px 15px #090e1790; }
.token-minus { bottom: 18%; right: 49%; width: 48px; border: 3px double #a2c6cf; background: #284452; color: #bee4e9; transform: rotate(-16deg); }
.token-plus { bottom: 13%; right: 8%; width: 57px; border: 3px double #6c4d2b; background: #ffcc73; color: #4c381e; transform: rotate(11deg); }
.hero-detail { position: relative; z-index: 2; color: var(--gold); font-size: 13px; font-weight: 700; }
.entry { padding: 34px; }
.entry h2 { font-size: 27px; margin: 0 0 9px; }
.entry p { font-size: 14px; }
.seat-doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 25px 0 21px; }
.seat-doors button { min-height: 44px; padding: 10px; background: var(--deep); border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.seat-doors button[aria-pressed='true'] { border-color: #b8894d; background: #2d2923; }
.seat-doors button[aria-pressed='true'] strong { color: var(--gold); }
form label { display: grid; gap: 8px; color: #d9e1e6; font-size: 13px; font-weight: 700; }
input { min-width: 0; width: 100%; color: var(--ink); background: var(--deep); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; min-height: 43px; }
input::placeholder { color: #8594a3; }
#entry-form, .stack { display: grid; gap: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 43px; padding: 10px 15px; font-size: 14px; font-weight: 800; border-radius: 9px; border: 1px solid var(--line); background: #20303c; }
.button:hover:not(:disabled), .seat-doors button:hover { filter: brightness(1.14); }
.button:disabled { opacity: .5; }
.primary { background: var(--gold); color: #211b13; border-color: #f7bc60; }
.wide { width: 100%; }
#entry-form .button { margin-top: 2px; justify-content: space-between; }
.create-line { display: flex; justify-content: center; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 20px; padding-top: 11px; }
.overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 19px; }
.overview article { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #121d26; }
.step-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; color: var(--gold); background: #242a2a; font: bold 21px var(--mono); }
.step-icon.eye { font-size: 17px; }
.overview h3 { font-size: 15px; margin-bottom: 5px; }
.overview p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.site-footer { border-top: 1px solid var(--line); padding-block: 21px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.game-layout { display: grid; gap: 17px; }
.game-heading, .section-head, .notice, .room-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.game-heading h1 { margin-top: 5px; font-size: clamp(26px, 5vw, 39px); }
.room-code { justify-content: flex-start; color: var(--muted); font-size: 13px; }
.code, .phases, .score b, .slot, .marker-count, .history-calc { font-family: var(--mono); }
.code { color: var(--gold); font-weight: 700; letter-spacing: .08em; }
.game-panel { padding: 19px 22px; }
.section-head { margin-bottom: 13px; }
.section-head h2, .game-panel h2 { font-size: 18px; }
.section-head p, .game-panel p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.score { padding: 17px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; justify-items: center; gap: 8px; }
.score-player { display: grid; justify-items: center; gap: 4px; min-width: 0; max-width: 100%; text-align: center; }
.score-player strong { overflow-wrap: anywhere; }
.score b { font-size: 39px; color: var(--gold); line-height: 1; }
.score small, .tag { color: var(--muted); }
.score-round { text-align: center; color: var(--muted); font-size: 13px; }
.score-round strong { color: var(--ink); display: block; font-size: 18px; margin-bottom: 5px; }
.phases { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.phases li, .tag { font-size: 12px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 9px; white-space: nowrap; }
.phases li { color: var(--muted); }
.phases [aria-current='step'] { color: var(--gold); border-color: #b8894d; background: #312822; }
.notice { justify-content: flex-start; border-radius: 10px; padding: 11px 14px; background: #1e303b; color: #e4edf0; font-size: 13px; line-height: 1.55; }
.notice.finish { border: 1px solid #af834d; background: #30291f; color: var(--gold); }
.notice a { text-decoration: underline; margin-left: auto; }
.board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.tile { text-align: center; min-width: 0; display: grid; gap: 4px; align-content: start; }
.slot { color: var(--muted); font-size: 11px; }
.game-card { width: 100%; padding: 3px; height: clamp(49px, 8.5vw, 105px); display: grid; place-content: center; gap: 2px; border: 1px solid #688494; border-radius: 9px; color: #e7eef0; background: linear-gradient(160deg, #3a5460, #273d4b); }
.game-card b { font: bold clamp(20px, 4vw, 44px)/.94 var(--mono); }
.game-card small { font-size: 10px; }
.game-card.back { color: #a3b4be; border-color: #415462; background: repeating-linear-gradient(135deg, #202f39, #202f39 4px, #273844 4px, #273844 6px); }
.game-card.spent { color: #b6c0c8; background: #25313a; border-color: #43515a; }
.game-card.selected, .game-card[aria-pressed='true'] { outline: 2px solid var(--gold); outline-offset: -2px; color: var(--gold); }
button.game-card:not(:disabled):hover { border-color: var(--gold); filter: brightness(1.12); }
.marker-count { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 11px; min-height: 16px; }
.positive { color: var(--aqua); }
.negative { color: var(--rose); }
.controls { margin-top: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls > .primary { margin-left: auto; }
.chip-selected { border-color: var(--gold); color: var(--gold); }
.error { color: var(--rose) !important; font-size: 13px; line-height: 1.5; }
.login-panel { max-width: 470px; margin-inline: auto; padding: 27px; }
.login-panel h1 { margin: 4px 0 14px; }
.login-panel .stack { margin-top: 15px; }
.invites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.invite { padding: 11px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 9px; }
.invite summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.invite code { display: block; margin: 7px 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: 13px; }
th, td { padding: 9px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); white-space: nowrap; }
td { min-width: 50px; line-height: 1.55; }
.history-entry { border-top: 1px solid var(--line); }
.history-entry summary { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 13px 0; cursor: pointer; font-size: 13px; }
.history-entry summary::before { content: '›'; color: var(--gold); }
.history-entry[open] summary::before { transform: rotate(90deg); }
.history-entry p { margin: 0 0 9px 14px; overflow-wrap: anywhere; }
.history-calc { color: var(--gold); }
dialog { width: min(530px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); padding: 22px; }
dialog::backdrop { background: #050b11bf; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.icon-button { background: var(--deep); border: 1px solid var(--line); font-size: 20px; border-radius: 8px; width: 35px; height: 35px; }
.rules-list { margin-bottom: 0; padding-left: 23px; color: var(--muted); line-height: 1.65; }
.rules-list li { margin-bottom: 9px; }
.rules-list strong { color: var(--ink); }
@media (max-width: 900px) {
  .hero, .entry { padding: 25px; }
  .header-inner, .page, .site-footer { width: calc(100% - 36px); }
  .lobby-grid { gap: 14px; grid-template-columns: 1.25fr 1fr; }
  .seat-doors button { padding-inline: 7px; }
}
@media (max-width: 660px) {
  .header-inner { height: 62px; }
  .page { margin-top: 16px; }
  .header-inner, .page, .site-footer { width: calc(100% - 24px); }
  .lobby-grid { grid-template-columns: 1fr; }
  .hero { min-height: 345px; }
  .hero h1 { font-size: 49px; }
  .hero p { font-size: 13px; }
  .hero-table { inset-block-start: 39%; }
  .sample-card { max-width: 104px; }
  .token-plus { width: 39px; bottom: 12%; }
  .token-minus { width: 35px; bottom: 22%; }
  .sample-token { font-size: 13px; }
  .overview { grid-template-columns: 1fr; gap: 8px; }
  .game-panel { padding: 13px 10px; }
  .board { gap: 3px; }
  .game-card { border-radius: 5px; }
  .game-card small, .marker-count { font-size: 9px; }
  .invites { grid-template-columns: 1fr; }
}
