/* BingoHall 共用樣式 */

:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #24262b;
  --muted: #6b7078;
  --line: #e2ddd0;
  --accent: #b8791b;
  --accent-ink: #ffffff;
  --good: #2f7d4f;
  --bad: #b23a3a;
  --gold: #d4a017;
  --radius: 12px;
  --shadow: 0 2px 6px rgba(30, 25, 15, 0.08), 0 10px 24px rgba(30, 25, 15, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 60px;
  width: 100%;
}

.wrap.wide { max-width: 760px; }

h1, h2, h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; }

p { margin: 0 0 12px; }

.muted { color: var(--muted); font-size: 13.5px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity .15s ease, transform .05s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13.5px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.error-box {
  background: #fbeaea;
  border: 1px solid #e3b6b6;
  color: #7a2323;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

.join-code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 14px;
  background: #fbf4e6;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  margin-bottom: 12px;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--line);
  color: var(--muted);
}
.status-badge.live { background: #e4f3ea; color: var(--good); }
.status-badge.ended { background: #f1e4e4; color: var(--bad); }

.player-list { list-style: none; margin: 0; padding: 0; }
.player-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.player-list li:last-child { border-bottom: none; }
.player-list .win-tag { color: var(--gold); font-weight: 700; }

.numbers-called {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.numbers-called .n {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: monospace;
}
.numbers-called .n.latest {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

.current-number {
  text-align: center;
  margin: 6px 0 18px;
}
.current-number .big {
  font-size: 64px;
  font-weight: 800;
  font-family: monospace;
  color: var(--accent);
  line-height: 1;
}
.current-number .label { font-size: 12.5px; color: var(--muted); }

.number-pool-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin: 12px 0;
}
.number-pool-grid .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: monospace;
  border-radius: 4px;
  background: #f0ece1;
  color: var(--muted);
}
.number-pool-grid .cell.drawn {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.bingo-card {
  display: grid;
  gap: 6px;
  margin: 16px 0;
}
.bingo-card .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(14px, 4.5vw, 22px);
  font-weight: 700;
  font-family: monospace;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.bingo-card .cell.marked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.winner-banner {
  background: linear-gradient(135deg, #fff6df, #ffe9b0);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.winner-banner .title { font-size: 20px; font-weight: 800; color: #8a6100; margin-bottom: 4px; }
.winner-banner ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14.5px; color: #6e4d00; }

.you-bingo {
  text-align: center;
  padding: 26px 16px;
  background: radial-gradient(circle at top, #fff2c9, #ffe08a);
  border-radius: var(--radius);
  border: 2px solid var(--gold);
  margin-bottom: 16px;
}
.you-bingo .word {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #a3760a;
}

footer.page-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0 30px;
}

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 420px) {
  .join-code { font-size: 26px; }
  .current-number .big { font-size: 52px; }
}
