/* 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; }

/* Farkle: a wooden table with a felt tray. */
:root {
  --bg: #78350f;
  --bg2: #92400e;
  --muted: #fde68a;
}
.score { font-size: 1.1rem; }
.bar { height: 6px; background: rgba(0, 0, 0, 0.3); border-radius: 3px; margin: 6px 0 2px; overflow: hidden; }
.bar div { height: 100%; background: var(--accent); }
.felt { background: #166534; border: 8px solid #451a03; border-radius: 20px; padding: 14px; margin: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 170px; }
.final { background: var(--accent); color: #1f2937; border-radius: 999px; padding: 2px 12px; font-weight: 800; }
.kept { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.group { display: inline-flex; gap: 2px; align-items: center; background: rgba(0, 0, 0, 0.2); border-radius: 8px; padding: 3px 6px; }
.group b { margin-left: 4px; color: var(--accent); }
.dice { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.turnline { font-weight: 700; }
.farkle { font-size: 2rem; font-weight: 900; color: var(--bad); text-shadow: 0 2px 0 #000; }
table.scoring td { padding: 2px 10px 2px 0; }

/* Dice */
.die {
  --s: 54px;
  width: var(--s); height: var(--s); border-radius: 12px; background: #fffbeb; padding: 7px; border: 3px solid transparent;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); box-shadow: 0 4px 0 #d6d3d1, 0 6px 10px rgba(0, 0, 0, 0.3);
}
.die.small { --s: 24px; border-radius: 5px; padding: 3px; border-width: 1px; box-shadow: none; }
.die span { display: block; }
.die .pip { background: #1c1917; border-radius: 50%; margin: 12%; }
button.die { cursor: pointer; transition: transform 0.1s; }
button.die.picked { border-color: var(--accent); transform: translateY(-8px); box-shadow: 0 4px 0 #a16207, 0 0 14px var(--accent); }
.die.bust { background: #fecaca; }
