/* AI Kodex — games & tools pages (/penalties, /quiz, /versus, /fact).
 *
 * Ported from the legacy reader.css game styles, with the reader.css
 * semantic variables rewritten onto the unified site.css token system
 * (hsl(var(--background)) etc.) so the games share the exact light/dark
 * palette, Inter font, and theme toggle as the rest of the site.
 * Load AFTER site.css. The per-card inline custom props (--tier-color,
 * --cat-color, --bar-width, --dot-color) are set in the markup and pass
 * through unchanged.
 */
:root{
  /* UI font for game chrome (buttons, chips) — matches reader.css. */
  --font-ui:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

.pun-body { background: hsl(var(--background)); }

.pun-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.pun-hero {
  margin: 8px 0 24px;
  font-family: var(--font-ui);
}
.pun-hero h1 {
  font-size: clamp(32px, 6vw, 48px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.05;
}
.pun-hero p {
  font-size: 16px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  max-width: 640px;
  margin: 0;
}

/* Sticky control strip */
.pun-scale {
  position: sticky;
  top: 64px;
  z-index: 40;
  padding: 16px 18px 18px;
  margin: 24px 0 28px;
  border-radius: 16px;
  background: color-mix(in srgb, hsl(var(--background)) 95%, transparent);
  border: 1px solid hsl(var(--border));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-ui);
}
.pun-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground) / 0.72);
  font-weight: 600;
  margin-bottom: 10px;
  gap: 4px;
}
/* On narrow screens hide intermediate labels so only endpoints + one mid show */
@media (max-width: 560px) {
  .pun-scale-label[data-pos="20"],
  .pun-scale-label[data-pos="40"],
  .pun-scale-label[data-pos="85"] { display: none; }
}
@media (max-width: 380px) {
  .pun-scale-label[data-pos="65"] { display: none; }
}
.pun-scale-track {
  position: relative;
  height: 32px;
}
.pun-scale-fill {
  position: absolute;
  top: 13px;
  left: 0;
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    hsl(39 72% 45%) 0%,
    hsl(25 70% 45%) 45%,
    hsl(338 61% 52%) 100%
  );
  pointer-events: none;
  transition: width 80ms linear;
}
.pun-scale-track::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--secondary));
}
.pun-scale-track input[type="range"] {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 32px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.pun-scale-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  border: 3px solid hsl(var(--background));
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
  margin-top: 0px;
}
.pun-scale-track input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
.pun-scale-track input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  border: 3px solid hsl(var(--background));
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: grab;
}
.pun-scale-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.pun-scale-counter strong { color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.pun-scale-current strong { color: hsl(var(--primary)); }

/* Cards */
.pun-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pun-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-family: var(--font-ui);
  overflow: hidden;
  transition: opacity 200ms ease, filter 200ms ease, background-color 200ms;
}
.pun-card--out {
  display: none;
}
.pun-card-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--bar-width, 50%);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, hsl(var(--primary)) 18%, transparent),
    color-mix(in srgb, hsl(var(--primary)) 2%, transparent)
  );
  pointer-events: none;
  z-index: 0;
}
.pun-card > * { position: relative; z-index: 1; }
.pun-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.pun-card-article {
  font-size: 12px;
  color: hsl(var(--primary));
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pun-card-severity {
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.72);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pun-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.pun-card-penalty {
  font-size: 14px;
  color: hsl(var(--foreground));
  font-weight: 600;
  margin-bottom: 8px;
}
.pun-card-example {
  font-size: 13.5px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin: 0 0 8px;
}
.pun-card-example-label {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.pun-card-details {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.pun-card-details summary {
  cursor: pointer;
  font-weight: 600;
  color: hsl(var(--primary));
  font-size: 12.5px;
  padding: 4px 0;
  list-style: none;
}
.pun-card-details summary::-webkit-details-marker { display: none; }
.pun-card-details summary::after { content: " ›"; transition: transform 200ms; display: inline-block; }
.pun-card-details[open] summary::after { transform: rotate(90deg); }
.pun-card-details p { margin: 6px 0 8px; line-height: 1.55; }
.pun-card-link {
  display: inline-block;
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  margin-top: 4px;
}
.pun-card-link:hover { text-decoration: underline; }

/* Bottom CTA box */
.pun-cta-box {
  margin: 48px 0 40px;
  padding: 28px 24px;
  border-radius: 18px;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  text-align: center;
  font-family: var(--font-ui);
}
.pun-cta-box h2 {
  font-size: 22px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.pun-cta-box p {
  color: hsl(var(--muted-foreground));
  margin: 0 0 18px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 18px;
  line-height: 1.55;
}
.pun-cta { max-width: 360px; margin: 0 auto; }

/* ============================================================
 * Punishments — tier badges, category chips, real-case
 * ============================================================ */
.pun-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.pun-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms, border-color 150ms, transform 100ms;
}
.pun-action:hover { background: hsl(var(--secondary)); transform: translateY(-1px); }
.pun-action-primary {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}
.pun-action-primary:hover { background: hsl(var(--primary)); }
.pun-hero-link { color: hsl(var(--primary)); font-weight: 600; }

.topbar-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 12px;
}
@media (max-width: 640px) {
  .topbar-nav { display: none; }
}
.topbar-nav-link {
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: background 120ms, color 120ms;
}
.topbar-nav-link:hover { color: hsl(var(--foreground)); background: hsl(var(--card)); }
.topbar-nav-link--on { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }

.pun-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
}
.pun-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  transition: background 120ms, border-color 120ms, color 120ms, transform 80ms;
}
.pun-chip:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.pun-chip:active { transform: scale(0.97); }
.pun-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-color, hsl(var(--muted-foreground)));
}
.pun-chip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, hsl(var(--foreground)));
}
.pun-chip-count {
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.72);
  background: hsl(var(--background));
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.pun-chip--on {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}
.pun-chip--on .pun-chip-count {
  background: rgba(255,255,255,0.18);
  color: hsl(var(--background));
}
.pun-chip--on .pun-chip-icon { color: hsl(var(--background)); }
.pun-chip--on .pun-chip-dot  { background: hsl(var(--background)); }

.pun-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pun-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color, #a8a29e) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, #a8a29e) 28%, transparent);
}
.pun-card-cat-icon { font-size: 12px; line-height: 1; }
.pun-card-tier {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tier-color, hsl(var(--primary)));
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tier-color, hsl(var(--primary))) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color, hsl(var(--primary))) 30%, transparent);
}
.pun-card-bar {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--tier-color, hsl(var(--primary))) 22%, transparent),
    color-mix(in srgb, var(--tier-color, hsl(var(--primary))) 3%, transparent)
  );
}
.pun-card-realcase {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--secondary));
  border-left: 3px solid var(--tier-color, hsl(var(--primary)));
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin: 6px 0 8px;
  line-height: 1.5;
}
.pun-card-realcase-label {
  font-weight: 700;
  color: hsl(var(--foreground));
}

.pun-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  font-family: var(--font-ui);
}
.pun-sort-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground) / 0.72);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.pun-sort-btn {
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid hsl(var(--border));
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.pun-sort-btn:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.pun-sort-btn--on {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}

.pun-empty {
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-ui);
  padding: 36px 20px;
  background: hsl(var(--secondary));
  border-radius: 14px;
  margin-top: 16px;
}
.pun-empty-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
}
.pun-empty p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}
.pun-empty-reset {
  padding: 8px 18px;
  border-radius: 999px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 120ms, transform 80ms;
}
.pun-empty-reset:hover { background: hsl(var(--primary)); transform: translateY(-1px); }

/* Keyboard-key chip in quiz options */
.game-option {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-option-key {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.game-option--correct .game-option-key {
  background: rgba(22, 163, 74, 0.18);
  border-color: #16a34a;
  color: #14532d;
}
.game-option--wrong .game-option-key {
  background: rgba(220, 38, 38, 0.18);
  border-color: #dc2626;
  color: #7f1d1d;
}

/* ============================================================
 * Game pages — /quiz/ and /versus/
 * ============================================================ */
.game-page, .vs-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.game-hero h1, .vs-hero h1 {
  font-size: 32px;
  margin: 8px 0 8px;
  letter-spacing: -0.015em;
}
.game-hero p, .vs-hero p {
  color: hsl(var(--muted-foreground));
  margin: 0 0 24px;
  line-height: 1.55;
  font-size: 15px;
  max-width: 540px;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  margin-bottom: 20px;
  font-family: var(--font-ui);
}
.game-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.game-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground) / 0.72);
  font-weight: 600;
}
.game-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}
.game-stat-dim { color: hsl(var(--muted-foreground) / 0.72); font-weight: 500; font-size: 14px; }

.game-card {
  padding: 24px 22px;
  border-radius: 18px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-family: var(--font-ui);
  margin-bottom: 24px;
}
.game-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.game-card-article {
  font-size: 12px;
  color: hsl(var(--primary));
  font-weight: 700;
}
.game-card-cat {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--secondary));
}
.game-card-title {
  font-size: 22px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.game-card-scenario {
  font-size: 15px;
  color: hsl(var(--foreground));
  line-height: 1.55;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: hsl(var(--secondary));
  border-radius: 10px;
  border-left: 3px solid hsl(var(--primary));
}

.game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 480px) {
  .game-options { grid-template-columns: 1fr; }
}
.game-option {
  padding: 14px 16px;
  border-radius: 12px;
  background: hsl(var(--background));
  border: 1.5px solid hsl(var(--border));
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-align: left;
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.game-option:hover:not(:disabled) {
  background: hsl(var(--secondary));
  border-color: hsl(var(--primary));
  transform: translateY(-1px);
}
.game-option:active:not(:disabled) { transform: scale(0.98); }
.game-option:disabled { cursor: default; }
.game-option--correct {
  background: color-mix(in srgb, #16a34a 14%, hsl(var(--background)));
  border-color: #16a34a;
  color: #14532d;
}
.game-option--wrong {
  background: color-mix(in srgb, #dc2626 14%, hsl(var(--background)));
  border-color: #dc2626;
  color: #7f1d1d;
}

.game-feedback {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  animation: gameFeedbackIn 220ms ease;
}
@keyframes gameFeedbackIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.game-feedback-verdict {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.game-feedback-verdict--great { color: #15803d; }
.game-feedback-verdict--ok    { color: #ca8a04; }
.game-feedback-verdict--meh   { color: #ea580c; }
.game-feedback-verdict--bad   { color: #dc2626; }

.game-feedback-real {
  font-size: 14px;
  margin-bottom: 6px;
}
.game-feedback-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  margin-right: 4px;
}
.game-feedback-real strong {
  color: hsl(var(--foreground));
  font-size: 15px;
}
.game-feedback-full {
  font-size: 13.5px;
  color: hsl(var(--muted-foreground));
  margin: 6px 0 10px;
  line-height: 1.55;
}
.game-feedback-case {
  font-size: 13px;
  margin: 6px 0 12px;
  color: hsl(var(--muted-foreground));
}
.game-feedback-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.game-feedback-link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}
.game-feedback-link:hover { text-decoration: underline; }
.game-next {
  padding: 10px 22px;
  border-radius: 999px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  transition: background 120ms, transform 80ms;
}
.game-next:hover { background: hsl(var(--primary)); transform: translateY(-1px); }

.game-result {
  padding: 28px 24px;
  border-radius: 18px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  text-align: center;
  font-family: var(--font-ui);
}
.game-result-title {
  font-size: 22px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.game-result-score {
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
  margin: 4px 0;
}
.game-result-score-of {
  font-size: 22px;
  color: hsl(var(--muted-foreground) / 0.72);
  font-weight: 500;
}
.game-result-verdict {
  color: hsl(var(--muted-foreground));
  font-size: 15px;
  margin: 4px 0 20px;
}
.game-result-breakdown {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.game-result-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: hsl(var(--secondary));
  font-size: 13.5px;
}
.game-result-dot { font-size: 18px; }
.game-result-row--great .game-result-dot { color: #15803d; }
.game-result-row--ok    .game-result-dot { color: #ca8a04; }
.game-result-row--bad   .game-result-dot { color: #dc2626; }
.game-result-row-title { color: hsl(var(--foreground)); }
.game-result-row-points {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}
.game-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.game-restart { min-width: 180px; }
.game-share {
  padding: 12px 22px;
  border-radius: 999px;
  background: transparent;
  color: hsl(var(--foreground));
  border: 1.5px solid hsl(var(--border));
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.game-share:hover { background: hsl(var(--secondary)); border-color: hsl(var(--primary)); }
.game-result-aikodex {
  display: block;
  margin-top: 10px;
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.game-result-aikodex:hover { text-decoration: underline; }


/* ============================================================
 * Fact-of-the-day page (/fact/)
 * ============================================================ */
.fact-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.fact-hero h1 {
  font-size: 32px;
  margin: 8px 0 8px;
  letter-spacing: -0.015em;
}
.fact-hero p {
  color: hsl(var(--muted-foreground));
  margin: 0 0 24px;
  line-height: 1.55;
  font-size: 15px;
  max-width: 540px;
}
.fact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fact-card {
  padding: 28px 24px;
  border-radius: 18px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  font-family: var(--font-ui);
  margin-bottom: 24px;
}
.fact-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.fact-card-article {
  font-size: 12.5px;
  color: hsl(var(--primary));
  font-weight: 700;
}
.fact-card-cat {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--secondary));
}
.fact-card-title {
  font-size: 26px;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.fact-card-scenario {
  font-size: 16px;
  color: hsl(var(--foreground));
  line-height: 1.55;
  margin: 0 0 22px;
  padding: 14px 18px;
  background: hsl(var(--secondary));
  border-radius: 12px;
  border-left: 3px solid hsl(var(--primary));
}
.fact-prompt-text {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin: 0 0 16px;
}
.fact-prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.fact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px solid hsl(var(--border));
  background: hsl(var(--background));
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.fact-btn:hover { background: hsl(var(--secondary)); transform: translateY(-1px); }
.fact-btn:active { transform: scale(0.98); }
.fact-btn-knew {
  border-color: #16a34a;
  color: #14532d;
}
.fact-btn-knew:hover { background: color-mix(in srgb, #16a34a 10%, hsl(var(--background))); }
.fact-btn-notknew {
  border-color: #d97706;
  color: #92400e;
}
.fact-btn-notknew:hover { background: color-mix(in srgb, #d97706 10%, hsl(var(--background))); }

.fact-reveal {
  animation: gameFeedbackIn 220ms ease;
}
.fact-reveal-penalty {
  font-size: 17px;
  margin-bottom: 12px;
}
.fact-reveal-penalty strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
}
.fact-reveal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.fact-reveal-full {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  margin: 4px 0 14px;
}
.fact-reveal-case {
  padding: 12px 14px;
  background: hsl(var(--secondary));
  border-left: 3px solid hsl(var(--primary));
  border-radius: 0 8px 8px 0;
  margin: 8px 0 14px;
  font-size: 13.5px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.fact-reveal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.fact-reveal-link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
  font-size: 13.5px;
}
.fact-reveal-link:hover { text-decoration: underline; }

/* ============================================================
 * Versus arena
 * ============================================================ */
.vs-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 22px;
}
@media (max-width: 560px) {
  .vs-arena {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
  }
}
.vs-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  border-radius: 16px;
  background: hsl(var(--card));
  border: 1.5px solid hsl(var(--border));
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  transition: background 150ms, border-color 150ms, transform 100ms;
}
.vs-side:hover {
  background: hsl(var(--secondary));
  border-color: hsl(var(--primary));
  transform: translateY(-2px);
}
.vs-side:active { transform: scale(0.98); }
.vs-side-article {
  font-size: 12px;
  color: hsl(var(--primary));
  font-weight: 700;
  letter-spacing: 0.02em;
}
.vs-side-title {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
}
.vs-side-example {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.vs-side--winner {
  background: color-mix(in srgb, #16a34a 12%, hsl(var(--background)));
  border-color: #16a34a;
}
.vs-side--loser {
  opacity: 0.6;
}
.vs-arena--locked .vs-side { cursor: default; }

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
@media (max-width: 560px) {
  .vs-divider { padding: 4px 0; }
}
.vs-divider-text {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 800;
  color: hsl(var(--muted-foreground) / 0.72);
  letter-spacing: 0.1em;
  background: hsl(var(--background));
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid hsl(var(--border));
}

.vs-feedback {
  padding: 16px 18px;
  border-radius: 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  margin-bottom: 18px;
  animation: gameFeedbackIn 220ms ease;
  font-family: var(--font-ui);
}
.vs-feedback-verdict {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.vs-feedback-verdict--ok  { color: #15803d; }
.vs-feedback-verdict--bad { color: #dc2626; }
.vs-feedback-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .vs-feedback-detail { grid-template-columns: 1fr; }
}
.vs-detail {
  padding: 8px 12px;
  background: hsl(var(--secondary));
  border-radius: 8px;
}
.vs-detail-article {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--primary));
  margin-bottom: 4px;
}
.vs-detail-penalty {
  display: block;
  font-size: 13px;
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ---------- Game inter-nav (in the unified header) ---------- */
.gamenav{display:flex;gap:4px;align-items:center}
.gamenav a{padding:7px 12px;border-radius:999px;font-size:13.5px;font-weight:550;
  color:hsl(var(--muted-foreground));transition:.12s;white-space:nowrap}
.gamenav a:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}
.gamenav a[aria-current="page"]{background:hsl(var(--secondary));color:hsl(var(--foreground))}
@media(max-width:720px){.gamenav{display:none}}

/* Standalone disclaimer note above the shared footer. */
.pun-disclaimer{max-width:760px;margin:28px auto 0;font-size:12.5px;line-height:1.55;
  color:hsl(var(--muted-foreground));text-align:center}
