/* ============================================================
   iGEM Bonn — shared design system
   The single source of truth for the brand look across the hub
   and every game. Palette sampled from the iGEM Bonn team logo.

   Brand samples:
     royal #014d98 · mid #194cac · sky #428ad3
     gold  #f3b400 · soft #e8c354 · black #000

   A game folder links this file first, then its own stylesheet:
     <link rel="stylesheet" href="../../css/theme.css">
     <link rel="stylesheet" href="mygame.css">
   ============================================================ */

:root {
  /* surfaces — deep navy field */
  --bg: #050a15;
  --bg-2: #081123;
  --surface: #0c1730;
  --surface-2: #112143;
  --line: #263d6b;
  --line-soft: #1a2b4e;

  /* ink */
  --ink: #eef3fb;
  --ink-2: #a8b8d6;
  --ink-3: #6b7fa3;

  /* brand accents */
  --brand-blue: #014d98;
  --brand-blue-2: #194cac;
  --accent: #3f8ad6;      /* sky blue — primary structural accent */
  --accent-2: #1f56b0;    /* deeper royal */
  --gold: #f3b400;        /* iGEM Bonn gold — CTAs, score, badges */
  --gold-soft: #e8c354;
  --bad: #ff6b81;

  /* NB: image tokens like the card-back emblem are declared in each game's
     own CSS, not here. A relative url() in a custom property resolves against
     the *using* stylesheet, so a shared path would break at other folder
     depths. See games/memory/memory.css for the pattern. */

  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 40px -18px rgb(0 0 0 / 0.85);

  --flip: 520ms cubic-bezier(.2, .8, .25, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);

  color-scheme: dark;
}

/* ------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Two slow-drifting blooms in the team colours behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(38% 42% at 20% 16%, hsl(210 98% 34% / 0.28), transparent 70%),
    radial-gradient(34% 40% at 84% 82%, hsl(43 96% 48% / 0.14), transparent 70%),
    radial-gradient(60% 60% at 50% 50%, hsl(216 70% 16% / 0.4), transparent 75%);
  filter: blur(10px);
  animation: drift 34s var(--ease) infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

button { font: inherit; color: inherit; }

/* Several toggled elements carry a `display` rule, which would beat [hidden]. */
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------ brand mark
   The team logo on a rounded white badge — reused wherever the mark
   appears against the navy field. */

.brand__mark {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 11px;
  object-fit: contain;
  padding: 3px;
  background: radial-gradient(circle at 50% 40%, #fff, #eef2f7);
  box-shadow: 0 6px 18px -7px hsl(210 90% 40% / 0.7), inset 0 0 0 1px rgb(255 255 255 / 0.6);
}

/* ------------------------------------------------------------ buttons */

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms var(--ease), background 180ms, border-color 180ms, box-shadow 180ms;
}
.btn:active { transform: translateY(1px) scale(0.99); }

/* One focus ring for every interactive element in the system. */
.btn:focus-visible,
.iconbtn:focus-visible,
.choice:focus-visible,
.card:focus-visible,
.gamecard:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  color: #241a00;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  box-shadow: 0 12px 28px -12px hsl(43 96% 48% / 0.75);
}
.btn--primary:hover { filter: brightness(1.06); }

.btn--ghost {
  color: var(--ink-2);
  background: rgb(255 255 255 / 0.04);
  border-color: var(--line);
}
.btn--ghost:hover { color: var(--ink); background: rgb(255 255 255 / 0.09); }

.btn--link {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px;
}
.btn--link:hover { color: var(--accent); }

.btn--lg { padding: 14px 30px; font-size: 1rem; border-radius: 13px; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
