/* Shared look for every game. Per-game accents can override --accent. */
:root {
  --accent: #6d28d9; --accent-2: #5b21b6;
  --bg: #f6f5fb; --surface: #fff; --text: #1f1d2b; --muted: #6b6880;
  --hit: #16a34a; --miss: #dc2626; --tile: #e6e3f2; --border: #dcd8ea;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #a78bfa; --accent-2: #c4b5fd;
    --bg: #14131c; --surface: #1f1d2b; --text: #ecebf5; --muted: #a09db5;
    --tile: #2d2a3d; --border: #36334a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
main { padding: 0 16px 32px; flex: 1; }

/* header */
.top {
  display: grid; grid-template-columns: 88px 1fr 88px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.top h1 { margin: 0; font-size: 1.25rem; text-align: center; letter-spacing: .01em; }
.top-actions { display: flex; justify-content: flex-end; gap: 4px; }
.icon-btn {
  background: none; border: 0; color: var(--text); font-size: 1.15rem;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: inline-grid; place-items: center; text-decoration: none;
}
.icon-btn:hover { background: var(--tile); }

.meta { text-align: center; color: var(--muted); font-size: .9rem; margin: 14px 0 4px; text-transform: capitalize; }

/* lives */
.lives { display: flex; justify-content: center; gap: 4px; font-size: 1.1rem; margin-bottom: 14px; }
.life.lost { opacity: .45; }

/* word tiles: --n is the word length, set inline */
.word {
  --gap: 5px;
  --size: min(44px, calc((min(100vw, 560px) - 32px - (var(--n) - 1) * var(--gap)) / var(--n)));
  display: flex; justify-content: center; gap: var(--gap); margin: 6px 0 18px;
}
.tile {
  width: var(--size); height: calc(var(--size) * 1.2);
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--size) * .55);
  background: var(--tile); border-radius: 8px; border-bottom: 3px solid var(--border);
}
.tile.filled { background: var(--accent); color: #fff; border-color: var(--accent-2); animation: pop .25s ease; }
.tile.missed { background: transparent; color: var(--miss); border: 2px dashed var(--miss); }
@keyframes pop { 50% { transform: scale(1.15); } }

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 18px;
}
.card h3 { margin: 0 0 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card p { margin: 0; font-size: 1.15rem; }

/* keyboard */
.keyboard { display: flex; flex-direction: column; gap: 7px; user-select: none; }
.kb-row { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 1; max-width: 46px; height: 54px; border: 0; border-radius: 8px;
  background: var(--tile); color: var(--text); font: 600 1.05rem system-ui, sans-serif;
  cursor: pointer; transition: transform .08s;
}
.key:active { transform: scale(.94); }
.key.hit { background: var(--hit); color: #fff; }
.key.miss { background: var(--miss); color: #fff; opacity: .55; }
.key:disabled { cursor: default; }

/* result */
.result { text-align: center; }
.verdict { font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; }
.say { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.4rem; margin: 0 0 12px; text-transform: capitalize; }
.result .card { text-align: left; }
.everyone { color: var(--muted); margin: 0 0 16px; }
.everyone strong { color: var(--text); }
.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 28px; font: 600 1rem system-ui, sans-serif; cursor: pointer;
}
.primary:hover { background: var(--accent-2); }
.countdown { color: var(--muted); margin: 18px 0 6px; }
.countdown strong { color: var(--text); font-variant-numeric: tabular-nums; }
.more a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* modal */
.backdrop {
  position: fixed; inset: 0; background: rgb(0 0 0 / .45);
  display: grid; place-items: center; padding: 16px; z-index: 10; animation: fade .15s;
}
.modal {
  position: relative; background: var(--surface); border-radius: 16px;
  width: min(420px, 100%); padding: 22px 22px 24px; text-align: center;
  box-shadow: 0 20px 50px rgb(0 0 0 / .3);
}
.modal h2 { margin: 0 0 12px; font-size: 1.2rem; }
.modal p { margin: 0 0 10px; text-align: left; }
.modal .primary { margin-top: 8px; }
.close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
@keyframes fade { from { opacity: 0; } }

/* stats */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.stat-num { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .75rem; color: var(--muted); }
.stats h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.dist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.dist-row { display: flex; align-items: center; gap: 8px; }
.dist-label { width: 1em; font-variant-numeric: tabular-nums; }
.dist-bar {
  background: var(--tile); color: var(--text); text-align: right; padding: 1px 8px;
  border-radius: 4px; font-size: .85rem; font-weight: 600; min-width: 2em;
}
.dist-bar.hl { background: var(--accent); color: #fff; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px;
  font-weight: 600; z-index: 20; animation: fade .15s;
}

/* hub */
.games { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.game-card {
  display: flex; gap: 14px; align-items: center; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.game-card:hover { border-color: var(--accent); }
.game-card small { color: var(--muted); }
.game-icon { font-size: 2rem; }

/* long-form pages (privacy, about) */
.prose { line-height: 1.65; }
.prose h2 { font-size: 1.1rem; margin: 28px 0 6px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 1.2em; }
.prose a { color: var(--accent); }
.prose .meta { text-align: left; text-transform: none; }

/* footer */
.site-footer { text-align: center; padding: 16px; font-size: .85rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* dev bar: localhost only (see kit.ui/dev-bar) */
.dev-bar {
  position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 16px); padding: 6px 10px; border-radius: 10px;
  background: #111827; color: #f9fafb; font: 12px/1.2 ui-monospace, monospace;
  box-shadow: 0 6px 20px rgb(0 0 0 / .35); opacity: .92;
}
.dev-bar button {
  background: #374151; color: #f9fafb; border: 0; border-radius: 6px;
  padding: 5px 8px; font: inherit; cursor: pointer;
}
.dev-bar button:hover { background: #4b5563; }
.dev-tag { background: #f59e0b; color: #111827; font-weight: 700; padding: 2px 5px; border-radius: 4px; }
.dev-day { font-variant-numeric: tabular-nums; }
