/* Shared styles (src/kit). Each game sets its colors in src/game/style.css, which comes after this. */
:root {
  --bg: #1f2937;
  --bg2: #374151;
  --panel: rgba(0, 0, 0, 0.22);
  --text: #fff;
  --muted: #d1d5db;
  --accent: #facc15;
  --good: #4ade80;
  --bad: #f87171;
  --results-bg: rgba(250, 204, 21, 0.15);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at center, var(--bg2), var(--bg) 70%) fixed;
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 980px; margin: 0 auto; padding: 12px 12px 48px; }
h1 { font-size: 2.1rem; margin: 20px 0 8px; text-align: center; }
h2 { margin: 6px 0; font-size: 1.2rem; }
h4 { margin: 12px 0 2px; color: var(--accent); }
.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: var(--bad); text-align: center; padding: 8px; font-weight: 600; }
.error { background: rgba(248, 113, 113, 0.25); border: 1px solid var(--bad); border-radius: 10px; padding: 8px 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }
.panel { background: var(--panel); border-radius: 16px; padding: 14px 16px; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  background: var(--accent); color: #1f2937; box-shadow: 0 3px 0 #a16207;
}
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a16207; }
button.secondary { background: #dcfce7; box-shadow: 0 3px 0 #15803d; }
button.danger { background: var(--bad); box-shadow: 0 3px 0 #991b1b; }
button.small { padding: 6px 10px; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: default; }
input[type='text'], input[type='number'] { font: inherit; padding: 11px; border-radius: 12px; border: 2px solid transparent; width: 100%; }
input[type='number'] { width: 110px; padding: 6px 8px; }
input:focus { outline: none; border-color: var(--accent); }
.code { font-size: 2.4rem; font-weight: 900; letter-spacing: 0.3em; }
label.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
ul.players { list-style: none; padding: 0; margin: 0; }
ul.players li { padding: 4px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-right: 6px; }
.dot.off { background: #9ca3af; }
details summary { cursor: pointer; font-weight: 700; }
details ul, details ol { padding-left: 20px; margin: 4px 0; }


/* ---------- shared game screen ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.95rem; }
.timer { display: inline-block; margin-left: 8px; font-weight: 800; color: var(--accent); }
.timer.urgent { color: var(--bad); }
.seatctl { justify-content: flex-end; margin-top: 10px; }
.results { background: var(--results-bg); border: 2px solid var(--accent); border-radius: 16px; padding: 12px; margin: 10px 0; text-align: center; }
.results .msg { font-size: 1.1rem; font-weight: 800; margin: 4px 0; }
.results table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.results td, .results th { padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); text-align: left; }
.results tr.win { color: var(--accent); font-weight: 800; }
.results button { margin-top: 8px; }
.log { font-size: 0.9rem; color: var(--muted); margin-top: 12px; }
.log div:first-child { color: var(--text); font-weight: 600; }
.madeby { position: fixed; bottom: 4px; left: 8px; font-size: 0.75rem; color: var(--muted); opacity: 0.7; }
.madeby a { color: inherit; }
.version { position: fixed; bottom: 4px; right: 8px; font-size: 0.75rem; color: var(--muted); opacity: 0.7; pointer-events: none; }
.updatebar { position: fixed; top: 0; left: 0; right: 0; z-index: 11; background: var(--accent); color: #1f2937; display: flex; gap: 12px; justify-content: center; align-items: center; padding: 6px; font-weight: 700; }
.updatebar button { background: #1f2937; color: #fff; box-shadow: none; }
.timerpick { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; }
select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--muted); background: transparent; color: inherit; }
option { color: #000; }
.lobbybtns { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 16px 0; }
.lobbybtns p { margin: 0; }
/* Players around the table (games may use these). */
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.seat { background: var(--panel); border-radius: 14px; padding: 8px 10px; border: 3px solid transparent; }
.seat.turn { border-color: var(--accent); box-shadow: 0 0 16px rgba(250, 204, 21, 0.4); }
.seat.dim { opacity: 0.55; }
.who { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 700; }
.sub { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.controls { background: rgba(0, 0, 0, 0.3); border-radius: 16px; padding: 12px; margin: 10px 0; }
.controls .msg { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* Crazy Eights: a red card table. */
:root {
  --bg: #7f1d1d;
  --bg2: #991b1b;
  --muted: #fecaca;
}
.score { font-size: 0.95rem; }
.middle { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0; }
.pile { display: flex; gap: 22px; align-items: flex-start; }
.deck { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.small { font-size: 0.8rem; }
.called { text-align: center; font-weight: 800; margin-top: 4px; background: #fff; color: #111827; border-radius: 8px; padding: 1px 6px; }
.called.red, .suit.red { color: #dc2626; }
.hand { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.hand.small { justify-content: flex-start; margin: 0; gap: 3px; }
.suits .suit { background: #fff; color: #111827; box-shadow: 0 3px 0 #9ca3af; }

/* Cards */
.card {
  --w: 58px;
  width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * 0.12); padding: 0;
  background: #fff; color: #111827; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35); border: 3px solid transparent; line-height: 1;
}
@media (min-width: 640px) { .card { --w: 70px; } }
.card.sm { --w: 30px; border-width: 1px; }
.card .r { font-size: calc(var(--w) * 0.42); }
.card .s { font-size: calc(var(--w) * 0.36); }
.card.red { color: #dc2626; }
.card.back { background: repeating-linear-gradient(45deg, #1e3a8a 0 5px, #1e40af 5px 10px); border-color: #fff; }
button.card { cursor: pointer; transition: transform 0.1s; }
button.card.playable { border-color: var(--accent); transform: translateY(-6px); }
button.card.dull { opacity: 0.55; cursor: default; }
button.card:active { transform: translateY(-2px); }
