/* ═══════════════════════════════════════════════════════════
   Society & AI — Mini Games shared shell
   Light, calm, paper-like. No dark canvas, no scroll effects.
   Every mini game loads this first, then its own <style> block.
   ══════════════════════════════════════════════════════════ */

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

:root {
  /* Ink */
  --ink:        #1a1d24;
  --muted:      #5b6472;
  --faint:      #8a93a3;

  /* Surfaces */
  --paper:      #ffffff;
  --bg-top:     #fbfaf7;
  --bg-bottom:  #eef2f8;
  --sunk:       #f5f7fa;

  /* Lines */
  --line:       #e3e7ee;
  --line-firm:  #cdd5e1;

  /* Accents */
  --primary:      #005EA2;
  --primary-soft: #e8f1f9;
  --accent:       #e6a417;
  --accent-soft:  #fdf4de;
  --ok:           #12805c;
  --ok-soft:      #e3f4ed;
  --near:         #b07d10;
  --near-soft:    #fbeecd;
  --bad:          #b42318;
  --bad-soft:     #fdecea;

  --r:     16px;
  --r-sm:  10px;
  --r-pill: 999px;

  --font:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow:    0 10px 28px rgba(26, 35, 56, 0.07);
  --shadow-lg: 0 18px 44px rgba(26, 35, 56, 0.10);
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  line-height: 1.6;
}

/* ── Layout ────────────────────────────────────────────── */
.mini {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.6rem 1.15rem 3.5rem;
}

.mini-head { margin-bottom: 1.4rem; }

.mini-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.mini-title {
  margin: 0.55rem 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.026em;
}

.mini-sub {
  max-width: 58ch;
  font-size: 0.97rem;
  color: var(--muted);
}

/* ── Toolbar: which variant you're on + reshuffle ───────── */
.mini-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem 0 1.4rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
}

.mini-variant {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.mini-progress {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem 1.35rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}

.clue {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
}
.clue strong { font-weight: 700; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-firm);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.btn:hover { background: var(--sunk); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover { background: #004785; border-color: #004785; }

.btn-accent {
  color: #4a3505;
  background: var(--accent-soft);
  border-color: #e8cf94;
}
.btn-accent:hover { background: #fbe9c3; border-color: #d9bd76; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* ── Status line (announced to screen readers) ──────────── */
.mini-status {
  min-height: 1.5rem;
  margin-top: 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.mini-status.is-ok  { color: var(--ok); }
.mini-status.is-bad { color: var(--bad); }

/* ── "What this teaches" reflection panel ──────────────── */
.reflect {
  margin-top: 1.2rem;
  padding: 1.2rem 1.3rem;
  background: var(--accent-soft);
  border: 1px solid #eddcae;
  border-radius: var(--r);
}
.reflect h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.reflect p {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #4d3f22;
}
.reflect p:last-child { margin-bottom: 0; }

/* ── Utility ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden { display: none !important; }

/* Embedded in an Academy page: the wrapper supplies the heading. */
.is-embedded .mini-head { display: none; }
.is-embedded .mini { padding-top: 1.1rem; }
.is-embedded body,
.is-embedded { background: transparent; }

@media (max-width: 560px) {
  .mini { padding: 1.2rem 0.9rem 3rem; }
  .card { padding: 1.15rem 1rem; }
  .mini-progress { margin-left: 0; width: 100%; }
}

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