/* XenoXanadu — Texas Hold'em — house style */
:root {
  --bg: #0c0d0f;
  --bg-2: #131417;
  --panel: #131417;
  --panel-2: #1a1c20;
  --panel-line: #24262b;
  --grid: #24262b;
  --line: #313338;
  --felt: #1c3327;
  --felt-2: #16271e;
  --felt-rail: #2a2c31;
  --felt-rail-2: #1a1c20;
  --text: #e7e6e0;
  --muted: #8a8d93;
  --green: #9ec27a;
  --gold: #c7a24a;
  --red: #cf5a52;
  --cyan: #5fb6b0;
  --chip: #c7a24a;
  --on-accent: #0c0d0f;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
html.hosted .ai-only { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100vh; background: var(--bg);
  color: var(--text); font-family: var(--mono); -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; }

h1 {
  text-align: center; font-size: clamp(26px, 5vw, 42px); letter-spacing: 4px;
  text-transform: uppercase; font-weight: 700;
  color: var(--text); margin-top: 6px;
}
h1 .suit-s { color: var(--text); } h1 .suit-r { color: var(--red); }
.tagline { text-align: center; color: var(--muted); margin: 4px 0 18px; font-size: 13px; }

/* ---------- setup panel ---------- */
.setup {
  background: var(--panel); border: 1px solid var(--grid); border-radius: 0;
  padding: 20px; margin-bottom: 18px;
}
.setup h2 { font-size: 15px; color: var(--green); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.setrow { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 11px; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; }
.seg { display: inline-flex; gap: 6px; }
.seg button {
  background: var(--bg-2); border: 1px solid var(--grid); color: var(--muted); padding: 8px 15px; cursor: pointer;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; border-radius: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.seg button:hover { color: var(--text); border-color: var(--green); }
.seg button.active { background: var(--panel-2); border-color: var(--green); color: var(--green); }
.setup select, .setup input[type=text] {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--grid);
  border-radius: 0; padding: 8px 10px; font-size: 13px; font-family: var(--mono); min-width: 150px;
}
.setup select:focus, .setup input[type=text]:focus { outline: none; border-color: var(--gold); }
.btn-primary {
  cursor: pointer; border: 1px solid var(--grid); border-radius: 0; padding: 12px 26px; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; font-family: var(--mono); color: var(--text);
  background: var(--panel);
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn-primary:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  cursor: pointer; border: 1px solid var(--grid); border-radius: 0; padding: 10px 18px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-family: var(--mono); color: var(--text);
  background: var(--panel); transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); }
.btn-ghost:active { transform: translateY(1px); }

/* AI connection block (local only) */
.ai-conn { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--grid); }
.ai-conn .setrow { align-items: center; }
.ai-conn .refresh {
  cursor: pointer; background: var(--panel); color: var(--text); border: 1px solid var(--grid); border-radius: 0; padding: 10px 13px;
  font-family: var(--mono); transition: background .15s, border-color .15s, color .15s;
}
.ai-conn .refresh:hover { color: var(--cyan); border-color: var(--cyan); }
.ai-statusline { display: flex; align-items: center; gap: 9px; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: #4d5057; flex: none; }
.ai-dot.on { background: var(--cyan); }
.ai-dot.err { background: var(--red); }
.ai-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 10px; }
.ai-hint a { color: var(--gold); }
.seat-models { margin-top: 14px; display: none; flex-direction: column; gap: 8px; }
.seat-models.show { display: flex; }
.seat-model-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.seat-model-row .who { min-width: 150px; color: var(--text); }
.seat-model-row select { min-width: 180px; }

/* monogram "chip" that stands in for a character (no emojis) */
.mono-chip {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  font-family: var(--mono); font-weight: 900; letter-spacing: .3px; color: var(--on-accent);
  background: hsl(var(--mhue,150) 38% 62%);
  user-select: none;
}

/* ---------- roster / cast gallery ---------- */
.roster-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--grid); }
.roster-block h2 { font-size: 15px; color: var(--green); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.roster-count { color: var(--muted); font-weight: 400; letter-spacing: .5px; text-transform: none; }
.roster-intro { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; max-width: 64ch; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.persona-card {
  background: var(--bg-2); border: 1px solid var(--grid); border-radius: 0; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 7px; transition: border-color .15s;
}
.persona-card:hover { border-color: var(--gold); }
.persona-card .pc-head { display: flex; align-items: center; gap: 9px; }
.persona-card .pc-em.mono-chip { width: 34px; height: 34px; font-size: 12.5px; }
.persona-card .pc-name { font-size: 13.5px; font-weight: 800; color: var(--text); }
.persona-card .pc-blurb { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.persona-card .pc-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.pc-bar { display: flex; align-items: center; gap: 7px; }
.pc-bar .pc-lab { font-size: 9px; letter-spacing: .5px; text-transform: uppercase; color: var(--gold); width: 56px; flex: none; }
.pc-bar .pc-track { flex: 1; height: 5px; border-radius: 0; background: var(--panel-2); overflow: hidden; }
.pc-bar .pc-fill { display: block; height: 100%; border-radius: 0; }
.pc-fill.tight { background: var(--cyan); }
.pc-fill.aggression { background: var(--red); }
.pc-fill.bluff { background: var(--gold); }

/* ---------- table ---------- */
.table-stage { display: none; }
.table-stage.show { display: block; }
.hud { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; align-items: center; margin-bottom: 12px; font-size: 13px; }
.hud .pill { background: var(--bg-2); border: 1px solid var(--grid); border-radius: 0; padding: 6px 14px; color: var(--muted); }
.hud .pill b { color: var(--text); }
.hud .pill.blinds b { color: var(--gold); }

.felt-wrap { position: relative; width: 100%; }
.felt {
  position: relative; width: 100%; padding-bottom: 60%; max-height: 560px;
  border-radius: 46% / 50%;
  background: var(--felt);
  border: 14px solid; border-image: none; border-color: var(--felt-rail);
}
/* faux felt center logo */
.felt::after {
  content: "XENO \2660 XANADU"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--felt-2); font-weight: 800; letter-spacing: 4px; font-size: clamp(14px, 3vw, 26px);
  margin-top: -8%; pointer-events: none;
}

/* center: board + pot */
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 80%; }
.pot { font-size: clamp(13px, 2.4vw, 17px); color: var(--gold); letter-spacing: .5px; }
.pot b { color: var(--chip); }
.board { display: flex; gap: clamp(4px, 1.2vw, 9px); min-height: 1px; }

/* cards */
.card {
  width: clamp(34px, 6.4vw, 56px); aspect-ratio: 5 / 7; border-radius: 4px; background: #e7e3d9;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-weight: 800; position: relative;
  color: #1a1a1a; font-size: clamp(15px, 3vw, 24px); line-height: 1; user-select: none;
}
.card.red { color: var(--red); }
.card.dealt { animation: deal .25s ease; }
@keyframes deal { from { transform: translateY(-14px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
/* community cards pitched out onto the felt, one at a time (stagger set inline) */
.board .card.dealing { animation: dealIn .46s cubic-bezier(.2,.85,.3,1.02) backwards; }
@keyframes dealIn {
  0%   { opacity: 0; transform: translate(-105px, -62px) rotate(-24deg) scale(.6); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
}
.card.back {
  background: #1f3329;
  border: 2px solid #2a3f33; color: transparent;
}
.card .rk { font-size: 1em; } .card .st { font-size: .82em; margin-top: 1px; }

/* ---------- seats ---------- */
.seat {
  position: absolute; transform: translate(-50%, -50%); width: clamp(108px, 16vw, 150px);
  display: flex; flex-direction: column; align-items: center; gap: 5px; transition: opacity .25s;
}
.seat .holecards { display: flex; gap: 3px; height: clamp(30px, 5.5vw, 46px); }
.seat .holecards .card { width: clamp(24px, 4.2vw, 38px); font-size: clamp(11px, 2.2vw, 17px); }
.nameplate {
  width: 100%; background: var(--panel); border: 1px solid var(--grid); border-radius: 0;
  padding: 6px 8px; text-align: center; position: relative; transition: border-color .2s;
}
.nameplate .who { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nameplate .who .em.mono-chip { width: 20px; height: 20px; font-size: 8.5px; }
.nameplate .persona { font-size: 9.5px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nameplate .chips { font-size: 14px; font-weight: 800; color: var(--chip); margin-top: 3px; }
.nameplate .chips.lowstack { color: var(--red); }
.seat.active .nameplate { border-color: var(--cyan); box-shadow: inset 0 0 0 2px var(--cyan); }
.seat.folded { opacity: 0.42; }
.seat.human .nameplate { border-color: var(--green); }
.seat.busted { opacity: 0.28; filter: grayscale(0.7); }

/* dealer button + bet chips + status badge */
.dealer-btn {
  position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #e7e3d9; color: #14361f;
  font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  transform: translate(-50%,-50%); z-index: 6;
}
.bet-chip {
  position: absolute; transform: translate(-50%,-50%); background: var(--bg-2); border: 1px solid var(--chip);
  color: var(--chip); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 0; white-space: nowrap; z-index: 5;
}
.badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 9.5px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; padding: 2px 8px; border-radius: 0; white-space: nowrap; z-index: 7;
}
.badge.fold { background: #3a2024; color: var(--red); }
.badge.allin { background: #332a16; color: var(--gold); }
.badge.action { background: #16271e; color: var(--cyan); border: 1px solid #24443a; }
.badge.win { background: var(--gold); color: var(--on-accent); }
.thinking { display: inline-block; }
.thinking::after { content: "·"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0%{content:"·";} 25%{content:"··";} 50%{content:"···";} 75%{content:"····";} }

/* ---------- action bar ---------- */
.actionbar {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--grid); border-radius: 0;
  padding: 14px 16px; display: none; flex-direction: column; gap: 12px;
}
.actionbar.show { display: flex; }
.act-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.act-btn {
  cursor: pointer; border-radius: 0; padding: 12px 20px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  font-family: var(--mono); border: 1px solid var(--grid); background: var(--panel); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .08s;
  min-width: 96px;
}
.act-btn:active { transform: translateY(1px); }
.act-btn.fold:hover { border-color: var(--red); color: var(--red); }
.act-btn.check:hover { border-color: var(--cyan); color: var(--cyan); }
.act-btn.raise:hover { border-color: var(--gold); color: var(--gold); }
.act-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.raise-row { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; }
.raise-row input[type=range] { width: min(320px, 60vw); accent-color: var(--gold); }
.raise-amt { font-size: 16px; font-weight: 800; color: var(--gold); min-width: 90px; text-align: center; }
.quick-bets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.quick-bets button {
  cursor: pointer; background: var(--bg-2); border: 1px solid var(--grid); color: var(--muted);
  border-radius: 0; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-family: var(--mono);
  transition: background .15s, border-color .15s, color .15s;
}
.quick-bets button:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- side panels ---------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 760px) { .panels { grid-template-columns: 1fr; } }
.panel {
  background: var(--panel); border: 1px solid var(--grid); border-radius: 0; padding: 12px 14px;
}
.panel h3 { font-size: 11px; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.ai-think { max-height: 150px; overflow: auto; background: var(--bg-2); border: 1px solid var(--grid); border-radius: 0; padding: 9px; white-space: pre-wrap; font-size: 12px; line-height: 1.5; color: var(--text); }
.log { max-height: 150px; overflow: auto; font-size: 12px; line-height: 1.55; }
.log div { padding: 1px 0; color: var(--muted); }
.log .hl { color: var(--text); }
.log .win { color: var(--gold); }
.log .street { color: var(--cyan); font-weight: 700; }

/* between-hands + game-over overlay */
.overlay {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; z-index: 40;
  background: rgba(4,5,6,0.66); border-radius: 46% / 50%;
}
.overlay.show { display: flex; }
.overlay .card-box { text-align: center; background: var(--panel); border: 1px solid var(--gold); border-radius: 0; padding: 22px 26px; max-width: 80%; }
.overlay h2 { color: var(--gold); font-size: clamp(18px, 4vw, 26px); margin-bottom: 8px; }
.overlay p { color: var(--text); font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }

.controls-foot { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); }
