/* Fallback copies of prignano-theme's color tokens, used if the shared theme can't load. */
:root {
  --bg: #f6f7f9;
  --fg: #111418;
  --muted: #5f6873;
  --card: #ffffff;
  --border: #e3e6ea;
  --accent: #2563d6;
  --active: #17804a;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --fg: #e6edf3; --muted: #8b949e; --card: #151b23; --border: #2a313c; --accent: #58a6ff; --active: #3fb950;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --fg: #e6edf3; --muted: #8b949e; --card: #151b23; --border: #2a313c; --accent: #58a6ff; --active: #3fb950;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; height: 100dvh; }
#site-header { flex-shrink: 0; }
#site-header.collapsed { display: none; }

#app { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
}
.hud-stats { margin-right: auto; display: flex; align-items: baseline; column-gap: 12px; flex-wrap: wrap; min-width: 0; }
.hud-score { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-ball { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .hud { gap: 6px; }
  .hud button { padding: 6px 10px; }
  .hud-score { font-size: 1.2rem; }
  .hud-ball { font-size: 0.8rem; }
}
button:hover, button:focus-visible { border-color: var(--accent); outline: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.stage { position: relative; flex: 1; min-height: 0; }
#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.nudge {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  opacity: 0.75;
}
@media (hover: hover) and (pointer: fine) { .nudge { display: none; } }
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5rem;
  font-weight: 800;
  pointer-events: none;
}

.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .hud, .stage { display: none; }
  .rotate-note { display: grid; place-items: center; flex: 1; margin: 0; font-size: 1.2rem; }
}

dialog {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: min(92vw, 420px);
  box-sizing: border-box;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog h2 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
a { color: var(--accent); }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 0.85em; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.table-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.table-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
}
.table-list .best { color: var(--muted); font-variant-numeric: tabular-nums; }
.final-score { font-size: 2rem; font-weight: 800; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.high-scores { padding-left: 1.5em; margin: 8px 0; font-variant-numeric: tabular-nums; }
.high-scores li.new { color: var(--accent); font-weight: 700; }
#initials {
  font: inherit;
  font-size: 1.2rem;
  width: 5ch;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.2em;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
