:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  color: #f2eddf;
  background: #101813;
  --subtle: #b9c7bc;
  --gold: #e4c080;
  --line: #3a4c40;
  --panel: #17241d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 14% 23%, #1c3326, transparent 55%); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button { background: var(--gold); color: #242015; font-weight: 700; border: 1px solid transparent; border-radius: .5rem; padding: .75rem 1.1rem; cursor: pointer; display: inline-block; }
button:hover, .button:hover { background: #f5d59a; }
button:disabled { cursor: default; opacity: .5; }
button.quiet { color: var(--subtle); background: transparent; border-color: var(--line); }
button.quiet:hover { color: #fff; border-color: var(--gold); }
:focus-visible { outline: 2px solid #f9d493; outline-offset: 3px; }
.top { min-height: 5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem max(1rem, calc((100vw - 76rem) / 2)); background: #101813; }
.brand, .account, nav { display: flex; align-items: center; gap: .8rem; }
.brand { white-space: nowrap; font: 700 1.45rem Georgia, serif; }
.brand small { display: block; color: var(--subtle); font: .8rem system-ui, sans-serif; margin-top: .2rem; }
.mark { border: 1px solid #7b6847; color: var(--gold); border-radius: 50%; display: grid; place-items: center; width: 2.45rem; height: 2.45rem; }
nav a { padding: .5rem; color: var(--subtle); }
nav a[aria-current] { color: var(--gold); border-bottom: 1px solid; }
.account strong { color: var(--gold); white-space: nowrap; }
main { width: min(76rem, calc(100% - 2rem)); margin: 0 auto; flex: 1; padding: clamp(1.6rem, 5vw, 5rem) 0; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: .99; letter-spacing: -.045em; }
h2 { font-size: 1.6rem; }
p { line-height: 1.5; color: var(--subtle); }
.eyebrow { margin: 0 0 1rem; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: .88rem; font-weight: 700; }
.welcome { display: grid; grid-template-columns: 1.65fr 1fr; gap: clamp(1rem, 4vw, 3rem); align-items: center; }
.intro { position: relative; isolation: isolate; overflow: hidden; min-height: 28rem; padding: clamp(1.5rem, 5vw, 4rem); border-radius: 1rem; border: 1px solid #52634e; background: radial-gradient(ellipse at 68% 48%, #326049, #1b3529 60%, #13241b); }
.intro p:not(.eyebrow) { max-width: 24rem; }
.table-art { position: absolute; z-index: -1; right: -4rem; bottom: -6.5rem; opacity: .65; transform: rotate(-22deg); }
.wheel { width: clamp(15rem, 33vw, 27rem); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: .75rem solid #a67b46; outline: .35rem solid #302719; box-shadow: 0 1.5rem 4rem #09150e; background: conic-gradient(#467747 0 10deg, transparent 10deg), repeating-conic-gradient(#7d3038 0 9deg, #111c17 9deg 18deg); }
.wheel span { width: 69%; aspect-ratio: 1; border: .5rem double #a67b46; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(#365642, #131b15); font-size: 4rem; color: var(--gold); }
.panel { padding: clamp(1rem, 3vw, 2rem); border-radius: .85rem; border: 1px solid var(--line); background: var(--panel); }
.auth h2, .panel h2 { margin-bottom: 1rem; }
form, label { display: grid; gap: .6rem; }
form { gap: 1rem; }
label { color: var(--subtle); }
input, select { width: 100%; min-width: 0; padding: .7rem .75rem; color: #f2eddf; background: #111a15; border: 1px solid #526257; border-radius: .4rem; }
.auth .quiet { margin-top: 1rem; width: 100%; }
#club { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, .43fr); gap: 1.5rem; align-items: start; }
#chat { grid-column: 2; }
#chat header, .heading, .table-top, .entries li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
#chat h2 { margin: 0; }
#chat-form { grid-template-columns: 1fr auto; gap: .5rem; }
#messages { max-height: 23rem; min-height: 12rem; overflow: auto; margin: 1rem 0; display: grid; align-content: end; gap: .5rem; }
#messages li, .entries li { padding: .55rem 0; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
#messages strong { display: block; color: var(--gold); font-size: .9rem; margin-bottom: .2rem; }
ol, ul { list-style: none; padding: 0; }
.heading { margin-bottom: 1.4rem; }
#round-status { color: var(--gold); font-variant-numeric: tabular-nums; }
.table { background: #1b402d; }
.table-top { align-items: start; flex-wrap: wrap; }
.table-top p { margin: 0 0 1rem; }
#history { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
#history li { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid #b3a482; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
legend { color: var(--subtle); margin-bottom: .65rem; }
.choices { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .3rem; }
.choices label { position: relative; display: block; color: #fff; }
.choices input { position: absolute; opacity: 0; width: 1px; }
.choices span { display: grid; place-items: center; min-height: 2.5rem; padding: .2rem; border: 1px solid #b8b19a66; border-radius: .28rem; cursor: pointer; }
.choices .wide { grid-column: span 3; }
.choices .zero { grid-column: 1 / -1; }
.choices input:checked + span { box-shadow: inset 0 0 0 2px var(--gold); color: #ffdc9f; }
.choices input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.red { background: #8d323d; } .black { background: #151c19; } .green { background: #2a6547; }
.bet-controls { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.bet-controls input { max-width: 10rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.admin-ledger, #new-invite { margin-top: 1rem; }
#notice { margin-top: 0; padding: .75rem 1rem; border: 1px solid #8b7650; border-radius: .5rem; color: #ffdc9f; }
footer { width: min(76rem, calc(100% - 2rem)); margin: 0 auto; border-top: 1px solid var(--line); padding: 1rem 0; display: flex; justify-content: space-between; color: var(--subtle); }
@media (max-width: 58rem) {
  .top { flex-wrap: wrap; }
  nav { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  #club { grid-template-columns: 1fr; }
  #chat { grid-column: 1; }
}
@media (max-width: 42rem) {
  .welcome, .admin-grid { grid-template-columns: 1fr; }
  .intro { min-height: 19rem; }
  .choices { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .account { flex-wrap: wrap; }
}

.button.secondary { background: #234332; color: #f2eddf; border-color: #839b83; }
.button.secondary:hover { background: #345b46; }
.results { margin-top: 1rem; }
.results strong { white-space: nowrap; }
.roulette-wheel { position: relative; width: min(15rem, 75%); margin: 0 auto; aspect-ratio: 1; isolation: isolate; border: .4rem solid #be935a; border-radius: 50%; background: #101b14; box-shadow: 0 .5rem 1.8rem #07171080; }
#roulette-ring, #roulette-ball { position: absolute; inset: .5rem; border-radius: 50%; }
#roulette-ring { border: 2px solid #e2bc79; }
#roulette-ball { z-index: 2; }
#roulette-ball i { position: absolute; top: 4%; left: calc(50% - .32rem); width: .64rem; height: .64rem; border-radius: 50%; background: #fff5d6; box-shadow: 0 1px 5px #30230b; }
#roulette-result { position: absolute; inset: 28%; display: grid; place-items: center; border: .22rem double #cb9b61; border-radius: 50%; background: #14231b; color: var(--gold); font: 2.75rem Georgia, serif; }
#roulette-phase { text-align: center; }
.poker-table { background: radial-gradient(ellipse at center, #27583e, #1b402d 70%); }
.poker-seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .65rem; }
.poker-seats li { min-height: 6.2rem; padding: .65rem; border: 1px solid #7b9a81; border-radius: .45rem; background: #112b20; overflow-wrap: anywhere; }
.poker-seats li.active-seat { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.poker-seats small { display: block; color: var(--subtle); padding: .3rem 0; }
.cards, .poker-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.cards { margin-bottom: .4rem; }
.card { display: grid; place-items: center; min-width: 2rem; min-height: 2.8rem; padding: .24rem; border-radius: .28rem; background: #f1ebda; color: #161d18; font-weight: 700; }
.card.red-card { color: #922935; }
.card.back { background: repeating-linear-gradient(45deg, #304c3a 0 4px, #213a2b 4px 8px); color: #fff0d9; border: 1px solid #9ead9d; }
#poker-clock { color: var(--gold); white-space: nowrap; }

.poker-rooms { display: flex; flex-wrap: wrap; gap: .5rem; }
.poker-rooms [aria-pressed="true"] { color: #ffdc9f; border-color: var(--gold); }
.poker-felt { position: relative; isolation: isolate; display: grid; grid-template: auto repeat(2, minmax(4.5rem, auto)) auto / minmax(4rem, 1fr) minmax(7rem, 1.8fr) minmax(4rem, 1fr); gap: .4rem; }
.poker-felt::before { content: ""; position: absolute; z-index: -1; inset: 12% 7%; border: .55rem solid #9c7348; border-radius: 44%; background: radial-gradient(ellipse, #416748, #153d2a 72%); box-shadow: inset 0 0 0 3px #d7a56880, 0 .6rem 1.3rem #0e2317; }
.poker-center { grid-area: 2 / 2 / 4 / 3; align-self: center; text-align: center; padding: .3rem; }
.poker-center .cards { justify-content: center; margin-top: .45rem; }
.poker-seats { display: contents; }
.poker-seats li { min-height: 0; align-self: center; text-align: center; margin: 0; }
.poker-seats li:has(button) { padding: 0; }
.poker-seats li > button { width: 100%; padding: .45rem .2rem; }
.poker-seats li .cards { justify-content: center; margin: 0; }
.seat-1 { grid-area: 1 / 2; } .seat-2 { grid-area: 2 / 3; } .seat-3 { grid-area: 3 / 3; }
.seat-4 { grid-area: 4 / 2; } .seat-5 { grid-area: 3 / 1; } .seat-6 { grid-area: 2 / 1; }
@media (max-width: 42rem) {
  .poker-felt .card { min-width: 1.35rem; min-height: 2rem; padding: .08rem; font-size: .78rem; }
  .poker-felt .cards { gap: .15rem; }
  .poker-seats li { padding: .3rem; font-size: .85rem; }
}
