@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:opsz,wght@9..144,700;9..144,900&display=swap');

:root { color-scheme: dark; font-family: 'DM Mono', monospace; background: #031d22; color: #ecf9ed; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: radial-gradient(circle at 50% 30%, #155863 0%, #07323b 42%, #031c22 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
.game-shell { width: min(1440px, 100%); min-height: 100dvh; margin: auto; padding: 18px clamp(16px, 3vw, 44px) 20px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; }
.topbar, .connection-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { color: #f6cc54; font-family: Fraunces, Georgia, serif; font-size: clamp(1.45rem, 3vw, 2.3rem); font-weight: 900; text-decoration: none; letter-spacing: -.08em; text-shadow: 0 2px 0 #74391c; }
.brand span { font-size: .55em; letter-spacing: -.06em; }
.top-actions { display: flex; gap: 8px; }
.primary-button, .text-button { border: 0; border-radius: 999px; padding: 10px 14px; color: #eaffef; background: transparent; }
.primary-button { background: #ef7657; box-shadow: inset 0 -2px 0 #a44437; font-weight: 500; }
.text-button { color: #bfdbd0; }
.text-button:hover { color: #fff; background: #ffffff12; }
.table-wrap { position: relative; min-height: 520px; overflow: hidden; border: 1px solid #7dd9c039; border-radius: 26px; box-shadow: 0 25px 70px #0007, inset 0 0 70px #03262d; background: #0b4b53; }
#game-canvas { position: absolute; inset: 0; }
#game-canvas canvas { width: 100%; height: 100%; display: block; }
.status-message { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 9px 13px; border-radius: 999px; background: #021c20c7; color: #d6eee0; font-size: .75rem; text-align: center; pointer-events: none; }
.connection-bar { color: #a8c9c2; font-size: .72rem; }
.connection-bar .text-button { margin-left: auto; padding-right: 0; font-size: .72rem; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #68e199; box-shadow: 0 0 10px #68e199; }
dialog { width: min(520px, calc(100% - 28px)); border: 1px solid #84c8ba66; border-radius: 20px; padding: 32px; color: #eaf8ec; background: #07363d; box-shadow: 0 22px 90px #000b; }
dialog::backdrop { background: #001316a6; backdrop-filter: blur(4px); }
dialog h1 { margin: 5px 0 18px; font-family: Fraunces, Georgia, serif; font-size: 1.9rem; line-height: 1.05; }
dialog ol { padding-left: 20px; color: #c8e0d6; font-size: .88rem; line-height: 1.55; }
dialog li + li { margin-top: 8px; }
.eyebrow { margin: 0; color: #f6cc54; font-size: .7rem; letter-spacing: .13em; }
.close-button { position: absolute; top: 10px; right: 14px; border: 0; color: #d7eee4; background: transparent; font-size: 1.8rem; }
.rule-note, .small-print { color: #9ebcb5; font-size: .76rem; line-height: 1.5; }
label { display: grid; gap: 8px; color: #cbe2d8; font-size: .8rem; }
input { width: 100%; padding: 12px; border: 1px solid #80b7aa66; border-radius: 8px; color: #edfff2; background: #021e23; }
.lobby-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; width: min(400px, calc(100% - 32px)); padding: 24px; border: 1px solid #84c8ba66; border-radius: 20px; background: #052e35f2; box-shadow: 0 22px 90px #000b; }
.lobby-panel h2 { margin: 5px 0 16px; font-family: Fraunces, Georgia, serif; font-size: 1.5rem; line-height: 1.1; }
.lobby-players { margin: 0 0 4px; padding: 0; list-style: none; display: grid; gap: 8px; }
.lobby-players li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #0a444c; font-size: .84rem; }
.lobby-players .tag { margin-left: auto; font-size: .68rem; letter-spacing: .08em; color: #9ebcb5; }
.lobby-players .tag.is-ready { color: #68e199; }
.lobby-players .you { color: #f6cc54; }
button[disabled] { opacity: .45; cursor: not-allowed; }
label + label { margin-top: 14px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
#cannot-play-button { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 2; white-space: nowrap; }
.connection-dot.is-online { background: #68e199; box-shadow: 0 0 10px #68e199; }
.connection-dot.is-offline { background: #f6cc54; box-shadow: 0 0 10px #f6cc54; }
.connection-dot.is-error { background: #ef7657; box-shadow: 0 0 10px #ef7657; }
@media (max-width: 600px) { .game-shell { padding: 12px; } .table-wrap { min-height: 570px; border-radius: 18px; } .topbar { align-items: flex-start; } .top-actions { flex-wrap: wrap; justify-content: flex-end; } .text-button, .primary-button { padding: 9px 10px; font-size: .72rem; } }
