:root {
  --bg: #12200f; --panel: #1d2e19; --panel2: #27401f; --line: #3a5a30; --text: #eef3e6; --muted: #a2b79a;
  --accent: #f2c744; --good: #7ddc7a; --bad: #ef7b6c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; padding: var(--site-bar, 0px) max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left)); }
.hidden { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 2px; max-width: 760px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 1.25rem; letter-spacing: .02em; color: var(--accent); white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 6px; }
.langs { display: inline-flex; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: .85rem; cursor: pointer; }
.langs .chip:first-child { border-radius: 999px 0 0 999px; }
.langs .chip:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.chip.active { background: var(--accent); color: #1a1a10; border-color: var(--accent); font-weight: 700; }
.conn { max-width: 760px; margin: 0 auto 6px; background: #5b3b12; border: 1px solid #a2701f; border-radius: 8px; padding: 6px 10px; font-size: .9rem; }
main { max-width: 760px; margin: 0 auto; padding-bottom: 24px; }

.tagline { color: var(--muted); margin: 4px 2px 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.card h2 { margin: 0 0 2px; font-size: 1.05rem; }
.card h3 { margin: 12px 0 4px; font-size: .95rem; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: .88rem; margin: 2px 0 8px; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 6px 0 4px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; color: var(--text); }
input[type=text], input[type=password], input[type=email], select { width: 100%; background: #0d170b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row.join { margin-top: 10px; }
.row.join input { text-transform: uppercase; letter-spacing: .2em; text-align: center; font-weight: 700; }
.btn { background: var(--accent); color: #1c1a0c; border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 700; cursor: pointer; min-height: 46px; }
.btn.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--accent); color: #1a1a10; border-color: var(--accent); }
.rooms, .seats { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.rooms .empty { color: var(--muted); font-size: .9rem; }
.rooms button { width: 100%; text-align: left; }
.plist { display: grid; gap: 8px; margin-bottom: 10px; }
.prow { display: grid; grid-template-columns: 1fr 120px auto; gap: 6px; align-items: center; }
.prow .x { background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 42px; cursor: pointer; }
.codebox { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.codebox span { font-size: 2rem; letter-spacing: .25em; font-weight: 800; color: var(--accent); flex: 1; }
.codebox .btn { flex: 0 0 auto; }
.seats li { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.seats .dot, .chip-p .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.5); flex: 0 0 auto; }
.seats .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats .tag { color: var(--muted); font-size: .8rem; }
.seats button { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
#lobby-host { margin: 8px 0; }

.hole-title { text-align: center; font-weight: 700; margin: 2px 0; }
.hole-title small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.status { text-align: center; min-height: 1.6em; margin: 2px 0 6px; font-size: .98rem; }
.status.me { color: var(--accent); font-weight: 700; }
.status .timer { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.status .timer.low { color: var(--bad); }
#board-wrap { display: flex; justify-content: center; }
#board { border-radius: 10px; touch-action: none; user-select: none; -webkit-user-select: none; background: #10200f; box-shadow: 0 2px 12px rgba(0,0,0,.5); max-width: 100%; }
.power { position: relative; height: 22px; margin: 8px auto 4px; max-width: 420px; background: #0d170b; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.power i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #6fd35f, #f2c744, #ef5b4a); }
.power span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .78rem; text-shadow: 0 1px 2px #000; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.chip-p { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: .88rem; }
.chip-p.turn { border-color: var(--accent); background: var(--panel2); }
.chip-p.done { opacity: .65; }
.chip-p b { font-size: 1.05rem; }
.chip-p small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions .btn { flex: 1 1 120px; min-height: 42px; padding: 8px 12px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 2147483001; display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; padding: 12px; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: 100%; max-width: 520px; margin: auto; display: grid; gap: 10px; }
.sheet h2 { margin: 0; }
.sheet p { margin: 0; }
.error { color: var(--bad); min-height: 1.2em; font-size: .9rem; }
.sheet .hint { margin: 0; }
.sheet .big { font-size: 1.3rem; font-weight: 800; color: var(--accent); text-align: center; }
.card-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.card-table th, .card-table td { padding: 4px 5px; border-bottom: 1px solid var(--line); text-align: center; }
.card-table th:first-child, .card-table td:first-child { text-align: left; }
.card-table .tot { font-weight: 800; color: var(--accent); }
.card-table .par td { color: var(--muted); }
.scroll-x { overflow-x: auto; }
@media (min-width: 700px) { .overlay { align-items: center; } }
@media (max-width: 420px) { .prow { grid-template-columns: 1fr 104px auto; } }
.sm { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
#lobby-host .row { margin-bottom: 10px; }
