/* Shared by every page: colours, page basics, the wordmark, buttons and the rise animation.
   Each page adds its own stylesheet after this one. */

:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --line: #26262b;
  --text: #f2f1ee;
  --muted: #8b8a90;
  --accent: #ff5b3a;
  --ink: #1c0a05;
  --thumb: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* Wordmark */

.wordmark {
  justify-self: start;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.wordmark span { color: var(--accent); }

/* On a game page the wordmark links back to the list of games. */
a.wordmark {
  color: inherit;
  text-decoration: none;
}

a.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.tag {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Buttons */

button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}

button:hover { border-color: var(--muted); }
button:active { transform: scale(0.97); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

/* Click wave: a circle grows from the centre behind the label, then fades. */

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

button.is-waving { animation: wave-label 0.5s var(--ease); }
button.is-waving::after { animation: wave 0.5s var(--ease); }

@keyframes wave {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Keep the label readable while the wave is behind it. */
@keyframes wave-label {
  30%, 60% { color: var(--ink); }
}

@media (max-width: 820px) {
  .wordmark { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  button.is-waving, button.is-waving::after { animation: none; }
  button { transition: none; }
}
