/* One dark look for every page, like a card room at night.
   This file is shared. game.css adds the seat page's game screen. */
:root {
  color-scheme: dark;
  --room: #0a1411;
  --room-glow: #12261f;
  --felt: #1d6b51;
  --felt-hi: #2b8c69;
  --felt-lo: #113f30;
  --rail: #2b1d15;
  --rail-hi: #513726;
  --ink: #eaf3ee;
  --muted: #9bb1a6;
  --line: rgba(234, 243, 238, 0.14);
  --glass: rgba(6, 22, 16, 0.62);
  --panel: #12221c;
  --panel-hi: #1a3028;
  --gold: #f2c261;
  --gold-hi: #f7d07c;
  --gold-deep: #dfa63b;
  --gold-ink: #2a1c05;
  --go: #58c58f;
  --go-bg: #1c4a3a;
  --stop: #ec7a6c;
  --stop-bg: #37221f;
  --stop-ink: #ffb9ae;
  --card: #fbfaf5;
  --card-lo: #efede3;
  --card-ink: #1a1d1b;
  --card-red: #c2332d;
  --back: #2b4d91;
  --back-lo: #24427d;
  --person: #3a6152;
  --person-lo: #172a23;
  --bot: #46598a;
  --bot-lo: #1a2340;
  --font-display: "Sora", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-suit: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--room) radial-gradient(120% 90% at 50% 40%, var(--room-glow), var(--room) 70%) fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, p { margin: 0; }
a { color: var(--gold); }

.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-block: 0.55rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand .spade { color: var(--gold); font-family: var(--font-suit); font-weight: 400; font-size: 1.2em; }
.meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.bar-buttons { display: flex; gap: 0.4rem; flex: none; }
.ghost { height: 2.1rem; padding: 0 0.8rem; border-radius: 9px; border: 1px solid var(--line); background: rgba(234, 243, 238, 0.05); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.ghost:hover { background: rgba(234, 243, 238, 0.12); }
.ghost.on { background: rgba(242, 194, 97, 0.18); border-color: rgba(242, 194, 97, 0.5); color: var(--gold); }

/* Buttons and small pieces that every page shares */
.solid, .outline, .small-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.solid { height: 2.6rem; border: 0; border-radius: 10px; background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); color: var(--gold-ink); font: 700 0.95rem var(--font-display); padding: 0 1.1rem; }
.outline { height: 2.6rem; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 600; padding: 0 1.1rem; }
.outline:hover { background: rgba(234, 243, 238, 0.08); }
.small-button { flex: none; height: 1.9rem; padding: 0 0.65rem; border-radius: 8px; border: 1px solid var(--line); background: rgba(234, 243, 238, 0.06); color: var(--ink); font-size: 0.78rem; font-weight: 600; }
.small-button:hover { background: rgba(234, 243, 238, 0.14); }
.small-button.on { background: rgba(242, 194, 97, 0.18); border-color: rgba(242, 194, 97, 0.5); color: var(--gold); }
.eyebrow { font: 600 0.7rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.note { font-size: 0.82rem; color: var(--muted); }
.error { font-size: 0.9rem; font-weight: 600; color: var(--stop-ink); }
.rows { display: grid; gap: 0.45rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.6rem; padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--panel-hi); font-size: 0.88rem; }
.row .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .kind { color: var(--muted); font-size: 0.8rem; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips { display: flex; align-items: center; justify-content: center; gap: 0.3rem; font: 600 0.8rem/1.3 var(--font-display); color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result { min-width: 2.4rem; text-align: right; font: 600 0.8rem var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); }
.result.up { color: var(--go); }
.result.down { color: var(--stop-ink); }
.chip { flex: none; display: inline-block; width: 0.85em; height: 0.85em; border-radius: 50%; background: radial-gradient(circle, var(--gold) 0 38%, #a97a22 40% 58%, var(--gold) 60%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.log { display: grid; gap: 0.3rem; font-size: 0.85rem; }
.log .line.head { margin-top: 0.4rem; color: var(--gold); font-weight: 600; }
.log .c { font-weight: 700; }
.log .c.red { color: #ff8f86; }
.log .line.why { padding-left: 0.9rem; color: var(--muted); }
.log .line.why .kind, .log .line.why .c:not(.red) { color: var(--ink); }
.log .line.why .kind { font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px); padding: 0.45rem 0.9rem; border-radius: 14px; background: rgba(6, 20, 15, 0.95); border: 1px solid var(--line); font-size: 0.85rem; text-align: center; }

/* The pages with panels: opening a room, and the owner's page */
.page main { display: grid; justify-items: center; align-content: start; gap: 1rem; padding-block: 1rem 3rem; }
.panel { width: min(34rem, 100%); display: grid; gap: 0.8rem; padding: 1.2rem 1.25rem 1.3rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.panel h1 { font: 700 1.35rem var(--font-display); }
.panel h2 { font: 600 1.05rem var(--font-display); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.field { display: grid; gap: 0.25rem; align-content: start; font-size: 0.82rem; color: var(--muted); }
.field input, .field select { height: 2.3rem; padding: 0 0.6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-hi); color: var(--ink); width: 100%; font-size: 1rem; }
.buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.buttons.end { justify-content: flex-end; }

/* The welcome page */
.bar.end { justify-content: flex-end; }
.welcome { display: grid; justify-items: center; gap: 1.1rem; padding-block: 14vh 2rem; text-align: center; }
.welcome h1 { font: 700 clamp(2.2rem, 8vw, 3.4rem) var(--font-display); }
.welcome h1 .spade { color: var(--gold); font-family: var(--font-suit); font-weight: 400; }
.welcome p { max-width: 30rem; color: var(--muted); font-size: 1.05rem; }
.welcome .buttons { justify-content: center; }

@media (max-width: 640px) {
  .brand .word, .meta { display: none; }
  .bar-buttons { gap: 0.3rem; }
  .ghost { padding: 0 0.55rem; font-size: 0.8rem; }
  .fields { grid-template-columns: minmax(0, 1fr); }
}
