/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg: #f4ecde;
  --bg-deep: #dde5dd;
  --panel: rgba(255, 249, 240, 0.88);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --surface: rgba(255, 255, 255, 0.7);
  --line: rgba(16, 43, 39, 0.1);
  --line-strong: rgba(16, 43, 39, 0.2);
  --text: #16302a;
  --muted: #5a6b64;
  --primary: #184f56;
  --primary-strong: #102f38;
  --accent: #cb6f20;
  --accent-strong: #984d11;
  --success: #2f7a4b;
  --shadow: 0 20px 50px rgba(22, 48, 42, 0.1);
  --shadow-sm: 0 4px 14px rgba(22, 48, 42, 0.08);
  --radius-2xl: 32px;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(24, 79, 86, 0.13), transparent 28%),
    radial-gradient(circle at right 10% top 12%, rgba(203, 111, 32, 0.09), transparent 16%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent 80%);
}

button, input { font: inherit; }
button { appearance: none; border: 0; background: none; cursor: pointer; }

/* ─── Layout shell ───────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

body.game-page .shell {
  width: min(1700px, calc(100% - 32px));
}

/* ─── Card base ──────────────────────────────────────────── */
.hero-panel,
.panel,
.game-sidebar,
.status-ribbon,
.play-surface,
.game-over-banner,
.side-drawer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: fade-up 300ms ease-out both;
}

/* ─── Labels / kickers ───────────────────────────────────── */
.eyebrow,
.panel-kicker,
.side-drawer summary,
.context-label,
.side-drawer-label,
.play-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* ─── Typography ─────────────────────────────────────────── */
.hero-title,
.panel-head h2,
.sidebar-title,
#pais,
.game-over-banner h2,
.context-value,
.daily-featured-title,
.home-daily-title {
  margin: 0;
  font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero-title {
  margin-top: 10px;
  font-size: clamp(2.4rem, 4.2vw, 4.4rem);
  line-height: 1;
}

.hero-text,
.panel-head p,
.hero-card p,
.info-pill p,
.session-line,
.game-over-banner p,
.choice-copy small,
.mode-copy span,
.compact-option small,
.context-note {
  color: var(--muted);
  line-height: 1.6;
}

.hero-text {
  max-width: 48rem;
  margin: 12px 0 0;
  font-size: 1rem;
}

/* ─── Home page shell ────────────────────────────────────── */
.home-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

/* ─── Hero section ───────────────────────────────────────── */
.home-hero {
  padding: clamp(48px, 8vw, 104px) 0 clamp(36px, 5vw, 64px);
}

.home-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 28px);
  min-width: 0;
}

.hero-tagline {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 44em;
}

/* ─── Hero CTA button ────────────────────────────────────── */
.hero-daily-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.5vw, 26px);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fffaf2;
  border: 1.5px solid transparent;
  box-shadow: 0 16px 40px rgba(152, 77, 17, 0.28), 0 4px 12px rgba(152,77,17,0.15);
  text-align: left;
  width: 100%;
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: fade-up 380ms ease-out both;
}

.hero-daily-btn:hover,
.hero-daily-btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 56px rgba(152, 77, 17, 0.32), 0 8px 18px rgba(152,77,17,0.18);
  outline: none;
}

.hero-daily-btn--done {
  background: rgba(255,255,255,0.72);
  border-color: rgba(47,122,75,0.28);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(22,48,42,0.08);
}

.hero-daily-btn--done:hover,
.hero-daily-btn--done:focus-visible {
  box-shadow: 0 12px 32px rgba(22,48,42,0.12);
  border-color: rgba(47,122,75,0.45);
  transform: translateY(-2px);
}

.hero-daily-btn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-daily-btn-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.74;
}

.hero-daily-btn-title {
  display: block;
  font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.15rem, 1.8vw, 1.42rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 3px;
}

.hero-daily-btn-sub {
  display: block;
  font-size: 0.86rem;
  opacity: 0.76;
  line-height: 1.4;
  margin-top: 4px;
}

.hero-daily-btn-arrow {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.88;
  transition: transform 160ms ease;
}

.hero-daily-btn:hover .hero-daily-btn-arrow { transform: translateX(4px); }

/* ─── Hero done bar ──────────────────────────────────────── */
.hero-done-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: rgba(47,122,75,0.07);
  border: 1px solid rgba(47,122,75,0.18);
  font-size: 0.9rem;
  color: var(--text);
  animation: fade-up 400ms ease-out both;
}

.hero-done-icon {
  color: var(--success);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hero-done-replay {
  margin-left: auto;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(47,122,75,0.1);
  border: 1px solid rgba(47,122,75,0.22);
  color: var(--success);
  font-size: 0.84rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 150ms ease;
}

.hero-done-replay:hover { background: rgba(47,122,75,0.17); }

/* ─── Hero feature chips ─────────────────────────────────── */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chips span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(22,48,42,0.09);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

/* ─── Flags mosaic ───────────────────────────────────────── */
.home-hero-visual {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.flags-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(8px, 1.1vw, 13px);
  width: 100%;
}

.flag-mosaic-cell {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/2;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(22,48,42,0.07);
  box-shadow: var(--shadow-sm);
  animation: fade-up 420ms ease-out both;
}

.flag-mosaic-cell:nth-child(1)  { animation-delay: 40ms; }
.flag-mosaic-cell:nth-child(2)  { animation-delay: 80ms; }
.flag-mosaic-cell:nth-child(3)  { animation-delay: 120ms; }
.flag-mosaic-cell:nth-child(4)  { animation-delay: 160ms; }
.flag-mosaic-cell:nth-child(5)  { animation-delay: 200ms; }
.flag-mosaic-cell:nth-child(6)  { animation-delay: 240ms; }
.flag-mosaic-cell:nth-child(7)  { animation-delay: 280ms; }
.flag-mosaic-cell:nth-child(8)  { animation-delay: 320ms; }
.flag-mosaic-cell:nth-child(9)  { animation-delay: 360ms; }
.flag-mosaic-cell:nth-child(10) { animation-delay: 400ms; }
.flag-mosaic-cell:nth-child(11) { animation-delay: 440ms; }
.flag-mosaic-cell:nth-child(12) { animation-delay: 480ms; }

.flag-mosaic-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms ease;
}

.flag-mosaic-cell:hover img { transform: scale(1.07); }

/* ─── Filters section ────────────────────────────────────── */
.home-filters-section {
  padding: 0 0 clamp(56px, 8vw, 96px);
}

.home-section-head {
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.home-section-title {
  margin: 8px 0 0;
  font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* ─── Choice badge (level indicator) ────────────────────── */
.choice-badge {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.choice-badge--easy {
  background: rgba(47,122,75,0.1);
  color: var(--success);
  border: 1px solid rgba(47,122,75,0.18);
}

.choice-badge--mid {
  background: rgba(203,111,32,0.1);
  color: var(--accent);
  border: 1px solid rgba(203,111,32,0.2);
}

.choice-badge--hard {
  background: rgba(200,40,40,0.08);
  color: #c53030;
  border: 1px solid rgba(200,40,40,0.15);
}

/* Utility */
.br-desktop { display: inline; }

/* ─── Hero panel (legacy / modos) ───────────────────────── */
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 24px;
  padding: 32px;
}

.hero-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-summary span {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(22,48,42,0.08);
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 22px;
  border-radius: var(--radius-xl);
  color: #f7fbfb;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.08), transparent 44%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.hero-card strong { font-size: 1.1rem; line-height: 1.35; }
.hero-card p { margin: 0; color: rgba(247,251,251,0.78); }

.hero-card-list {
  margin: 0; padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hero-card-list li {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.14);
}

/* ─── Selection / mode layouts ───────────────────────────── */
.selection-layout,
.mode-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel { padding: 26px; }

.panel-head { margin-bottom: 18px; }

.panel-head h2 {
  margin-top: 7px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.08;
}

.panel-head p { margin: 8px 0 0; font-size: 0.94rem; }

.choice-stack,
.mode-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.choice-grid,
.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.choice-row,
.mode-row,
.compact-option,
.button-secondary,
.button-primary {
  width: 100%;
  border-radius: var(--radius-lg);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.choice-row,
.mode-row,
.compact-option,
.button-secondary {
  border: 1px solid rgba(22,48,42,0.1);
  background: rgba(255,255,255,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  color: var(--text);
}

.button-primary {
  border: 1px solid transparent;
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 12px 24px rgba(152,77,17,0.2);
}

.choice-row:hover, .choice-row:focus-visible,
.mode-row:hover, .mode-row:focus-visible,
.compact-option:hover, .compact-option:focus-visible,
.button-secondary:hover, .button-secondary:focus-visible,
.button-primary:hover, .button-primary:focus-visible,
#flags button:hover, #flags button:focus-visible,
#flags img:hover, #flags img:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(24,79,86,0.28);
  box-shadow: 0 14px 28px rgba(22,48,42,0.1);
  outline: none;
}

.choice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  text-align: left;
}

.choice-copy strong { display: block; font-size: 0.97rem; font-weight: 700; }
.choice-copy small { display: block; margin-top: 2px; font-size: 0.86rem; }

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.button-secondary,
.button-primary {
  padding: 13px 18px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ─── Info pills ─────────────────────────────────────────── */
.info-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.info-pill {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(22,48,42,0.07);
}

.info-pill strong { display: block; margin-bottom: 5px; font-size: 0.97rem; }

/* ─── Context card ───────────────────────────────────────── */
.context-card {
  padding: 20px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(22,48,42,0.08);
}

.context-label { margin-bottom: 8px; }
.context-label::before { display: none; }

.context-value {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1;
}

.context-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

/* ─── Mode rows ──────────────────────────────────────────── */
.mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  text-align: left;
}

.mode-copy strong { display: block; font-size: 0.97rem; font-weight: 700; }
.mode-copy span { display: block; margin-top: 3px; font-size: 0.88rem; }

.mode-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24,79,86,0.09);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-row-accent {
  background: linear-gradient(135deg, rgba(24,79,86,0.96) 0%, rgba(16,47,56,0.98) 100%);
  border-color: transparent;
  color: #f7fbfb;
}

.mode-row-accent .mode-copy span { color: rgba(247,251,251,0.76); }
.mode-row-accent .mode-tag { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.88); }

/* ─── Daily featured (modos.html) ────────────────────────── */
.daily-featured { margin-top: 20px; }

.daily-featured-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 22px 26px;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(203,111,32,0.28);
  background:
    linear-gradient(135deg, rgba(203,111,32,0.09) 0%, rgba(152,77,17,0.05) 100%),
    rgba(255,255,255,0.72);
  backdrop-filter: blur(12px);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  animation: fade-up 300ms ease-out both;
}

.daily-featured-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(203,111,32,0.48);
  box-shadow: 0 16px 36px rgba(203,111,32,0.11);
}

.daily-featured-left { display: grid; gap: 4px; min-width: 0; }

.daily-featured-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.daily-featured-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.daily-featured-desc {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.daily-featured-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.daily-featured-date {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
  max-width: 150px;
}

.daily-featured-tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(203,111,32,0.09);
  border: 1px solid rgba(203,111,32,0.18);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-result {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47,122,75,0.09);
  border: 1px solid rgba(47,122,75,0.18);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Game shell ─────────────────────────────────────────── */
.game-shell {
  display: grid;
  grid-template-columns: clamp(260px, 19vw, 360px) minmax(0, 1fr);
  gap: clamp(14px, 1.4vw, 24px);
  align-items: start;
}

.game-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.sidebar-brand { padding-bottom: 2px; }

.sidebar-title {
  margin-top: 6px;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.context-grid { display: grid; gap: 8px; }

.context-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(22,48,42,0.07);
}

.context-row:first-child { padding-top: 0; border-top: 0; }

.context-row span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.context-row strong {
  text-align: right;
  font-size: 0.92rem;
  line-height: 1.4;
}

/* ─── Game main ──────────────────────────────────────────── */
.game-main {
  display: grid;
  gap: 14px;
  grid-template-rows: auto 1fr;
  min-height: calc(100dvh - 56px);
}

/* ─── Status ribbon ──────────────────────────────────────── */
.status-ribbon {
  padding: 18px 22px;
}

.score-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Stat pills */
.stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(22,48,42,0.07);
}

.stat-pill span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
}

.stat-pill strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.status-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.status-inline-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(22,48,42,0.07);
  min-width: 80px;
}

.status-inline-item span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#timer-panel { display: none; }

#vidas,
#timer {
  margin: 0;
  color: var(--text);
  font-size: 0.97rem;
  font-weight: 800;
  line-height: 1.3;
}

.session-line {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Play surface ───────────────────────────────────────── */
.play-surface {
  position: relative;
  overflow: hidden;
  min-height: clamp(420px, 64dvh, 860px);
  padding: clamp(18px, 1.6vw, 28px);
}

.play-frame {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
  gap: clamp(16px, 1.8vw, 28px);
  min-height: 100%;
  transition: filter 200ms ease, opacity 200ms ease;
}

body[data-game-mode="infoTable"] .play-frame {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0;
}

.play-question-panel,
.play-answer-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: clamp(14px, 1.2vw, 22px);
}

.play-answer-panel {
  padding: clamp(14px, 1vw, 20px);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.56));
  border: 1px solid rgba(22,48,42,0.07);
}

.answer-panel-head { display: grid; gap: 5px; }

.answer-helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.play-question-copy { display: grid; gap: 10px; }

.play-kicker { font-size: 0.68rem; }

#pais {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1.1;
}

/* ─── Visual stage ───────────────────────────────────────── */
.visual-stage {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  min-height: clamp(240px, 38vh, 580px);
  padding: clamp(12px, 1vw, 20px);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(24,79,86,0.07), transparent 56%),
    rgba(255,255,255,0.58);
  border: 1px solid rgba(22,48,42,0.07);
}

.visual-stage:empty { display: none; }

.visual-stage img {
  width: min(100%, 640px);
  max-height: min(52vh, 580px);
  object-fit: contain;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(22,48,42,0.07);
}

.visual-stage img.visual-map {
  width: min(100%, 1200px);
  max-height: min(74vh, 960px);
}

/* ─── Flags area ─────────────────────────────────────────── */
#flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

#flags img {
  width: min(170px, 22vw);
  max-width: 100%;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(22,48,42,0.07);
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

#flags[data-layout="image-grid"],
#flags[data-layout="map-grid"],
#flags[data-layout="button-grid"],
#flags[data-layout="timed-buttons"],
#flags[data-layout="timed-flags"],
#flags[data-layout="cascade-grid"] {
  display: grid;
  width: 100%;
  gap: clamp(10px, 0.9vw, 16px);
}

#flags[data-layout="image-grid"]     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#flags[data-layout="map-grid"]       { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; }
#flags[data-layout="button-grid"]    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#flags[data-layout="timed-buttons"]  { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; }
#flags[data-layout="timed-flags"]    { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; }
#flags[data-layout="cascade-grid"]   { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }

#flags[data-layout="form"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

#flags[data-layout="drag"] { display: block; }

#flags[data-layout="image-grid"] img,
#flags[data-layout="map-grid"] img,
#flags[data-layout="timed-flags"] img,
#flags[data-layout="cascade-grid"] img {
  width: 100%;
  max-width: none;
  min-height: clamp(110px, 14vw, 190px);
  max-height: 200px;
  object-fit: contain;
  justify-self: stretch;
}

body[data-game-mode="mapMode"] #flags[data-layout="map-grid"] img {
  min-height: clamp(100px, 9vw, 160px);
  max-height: 165px;
}

#flags button {
  min-width: 0;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #f7fbfb;
  box-shadow: 0 10px 22px rgba(16,47,56,0.18);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

#flags[data-layout="button-grid"] button {
  width: 100%;
  min-height: 62px;
}

#flags[data-layout="timed-buttons"] button {
  width: 100%;
  min-height: clamp(66px, 9vh, 96px);
  font-size: clamp(0.92rem, 1.1vw, 1.06rem);
}

#flags[data-layout="form"] button { min-width: 140px; }

#flags input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22,48,42,0.15);
  background: rgba(255,255,255,0.94);
  color: var(--text);
  font-size: 1rem;
}

/* ─── Drag & drop ────────────────────────────────────────── */
.drag-layout {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.drag-column { display: grid; gap: 10px; }

.drop-zone {
  min-height: 68px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.68);
  border: 2px dashed rgba(22,48,42,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  transition: border-color 150ms ease, background 150ms ease;
}

.drop-zone-correct {
  border-color: rgba(47,122,75,0.42);
  background: rgba(228,241,231,0.9);
}

.draggable-flag {
  width: min(120px, 100%);
  margin: 0 auto;
  cursor: grab;
}

.draggable-flag:active { cursor: grabbing; }

/* ─── Side drawer ────────────────────────────────────────── */
.side-drawer { overflow: hidden; }
.side-drawer[open] { background: var(--panel-strong); }

.side-drawer summary {
  list-style: none;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.7rem;
}

.side-drawer summary::-webkit-details-marker { display: none; }

.side-drawer-body {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
}

.side-drawer-section {
  padding-top: 14px;
  border-top: 1px solid rgba(22,48,42,0.07);
}

.side-drawer-section:first-child { padding-top: 0; border-top: 0; }

.side-drawer-label { margin-bottom: 8px; font-size: 0.7rem; }
.side-drawer-label::before { display: none; }

.compact-option {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  text-align: left;
}

.compact-option strong { display: block; font-size: 0.9rem; font-weight: 700; }
.compact-option small { display: block; margin-top: 1px; font-size: 0.8rem; }

/* ─── Daily btn (sidebar) ────────────────────────────────── */
.daily-btn {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(203,111,32,0.3);
  background:
    linear-gradient(135deg, rgba(203,111,32,0.1) 0%, rgba(152,77,17,0.06) 100%),
    rgba(255,255,255,0.62);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.daily-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(203,111,32,0.5);
  box-shadow: 0 10px 24px rgba(203,111,32,0.12);
}

.daily-btn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daily-btn-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.daily-btn-date { font-size: 0.7rem; color: var(--muted); font-weight: 500; }

.daily-btn-title {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}

.daily-btn-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.daily-badge {
  display: block;
  margin-top: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(47,122,75,0.1);
  border: 1px solid rgba(47,122,75,0.2);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 700;
  width: fit-content;
}

/* ─── Game over banner ───────────────────────────────────── */
.game-over-banner {
  display: none;
  position: absolute;
  inset: clamp(12px, 1.4vw, 20px);
  z-index: 6;
  padding: clamp(16px, 1.4vw, 26px);
  overflow: auto;
  background: linear-gradient(160deg, rgba(255,252,246,0.97), rgba(245,237,225,0.93));
  backdrop-filter: none;
}

.game-over-banner h2 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); }

.game-over-shell {
  width: min(820px, 100%);
  min-height: 100%;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 16px;
}

.game-over-header { display: grid; gap: 8px; }

.game-over-header p,
.game-over-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.game-over-kicker {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(22,48,42,0.09);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-over-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-over-context span {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.74);
  border: 1px solid rgba(22,48,42,0.07);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.game-over-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.game-over-stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(22,48,42,0.07);
}

.game-over-stat span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-over-stat strong { font-size: clamp(1.1rem, 1.8vw, 1.6rem); line-height: 1; }

.footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ─── Mode-specific layouts ──────────────────────────────── */
body[data-game-mode="mapMode"] .play-surface {
  min-height: clamp(720px, 86dvh, 1280px);
}

body[data-game-mode="mapMode"] .play-frame {
  grid-template-columns: minmax(600px, 1.8fr) minmax(220px, 0.4fr);
  align-items: stretch;
}

body[data-game-mode="mapMode"] .visual-stage {
  min-height: clamp(440px, 65vh, 940px);
}

body[data-game-mode="mapMode"] .play-answer-panel { align-content: center; }

body[data-game-mode="mapMode"] #flags[data-layout="map-grid"] {
  grid-template-columns: 1fr;
  max-width: 300px;
  margin: 0 auto;
}

body[data-game-mode="dragDrop"] .play-frame { grid-template-columns: 1fr; }

body[data-game-mode="mode1minuto"] .play-frame {
  grid-template-columns: minmax(340px, 0.88fr) minmax(480px, 1.12fr);
  align-items: center;
}

body[data-game-mode="mode1minuto"] .play-question-panel,
body[data-game-mode="mode1minuto"] .play-answer-panel { align-content: center; }

body[data-game-mode="mode1minuto"] .visual-stage {
  min-height: clamp(300px, 48vh, 680px);
}

body[data-game-mode="mode1minuto"] .visual-stage img {
  width: min(100%, 720px);
  max-height: min(60vh, 720px);
}

body[data-game-mode="mode1minuto"] #flags[data-layout="timed-buttons"] {
  max-width: 820px;
  margin: 0 auto;
}

body[data-game-mode="countryToFlag"] .play-frame { grid-template-columns: 1fr; }

body[data-game-mode="countryToFlag"] .play-question-panel {
  max-width: 880px;
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}

body[data-game-mode="countryToFlag"] .play-question-copy {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="countryToFlag"] .play-answer-panel {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-content: start;
}

body[data-game-mode="countryToFlag"] .answer-panel-head {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="countryToFlag"] #pais {
  font-size: clamp(2.4rem, 4vw, 4.4rem);
}

body[data-game-mode="countryToFlag"] #flags[data-layout="image-grid"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1380px;
  margin: 0 auto;
}

body[data-game-mode="countryToFlag"] #flags[data-layout="image-grid"] img {
  min-height: clamp(200px, 16vw, 300px);
  max-height: 310px;
}

body[data-game-mode="mode1minutoBanderas"] .play-frame,
body[data-game-mode="countryToFlag6"] .play-frame { grid-template-columns: 1fr; }

body[data-game-mode="mode1minutoBanderas"] .play-question-panel,
body[data-game-mode="countryToFlag6"] .play-question-panel {
  max-width: 880px;
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}

body[data-game-mode="mode1minutoBanderas"] .play-question-copy,
body[data-game-mode="countryToFlag6"] .play-question-copy {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="mode1minutoBanderas"] .play-answer-panel,
body[data-game-mode="countryToFlag6"] .play-answer-panel {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

body[data-game-mode="mode1minutoBanderas"] .answer-panel-head,
body[data-game-mode="countryToFlag6"] .answer-panel-head {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="mode1minutoBanderas"] #pais,
body[data-game-mode="countryToFlag6"] #pais {
  font-size: clamp(2.2rem, 3.8vw, 4rem);
}

body[data-game-mode="mode1minutoBanderas"] #flags[data-layout="timed-flags"] {
  max-width: 980px;
  margin: 0 auto;
}

body[data-game-mode="mode1minutoBanderas"] #flags[data-layout="timed-flags"] img {
  min-height: clamp(160px, 18vw, 270px);
  max-height: 280px;
}

body[data-game-mode="countryToFlag6"] #flags[data-layout="cascade-grid"] {
  max-width: 1120px;
  margin: 0 auto;
}

body[data-game-mode="countryToFlag6"] #flags[data-layout="cascade-grid"] img {
  min-height: clamp(140px, 16vw, 230px);
  max-height: 240px;
}

/* ── Daily challenge: tipo countryToFlag (país → elegir bandera) ── */
/* Layout de columna única, nombre del país centrado grande, banderas en fila de 4 */
body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .play-frame {
  grid-template-columns: 1fr;
  align-content: center;
  gap: 32px;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .play-question-panel {
  max-width: 860px;
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .play-question-copy {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] #pais {
  font-size: clamp(2.4rem, 4vw, 4.4rem);
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .play-answer-panel {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  align-content: start;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .answer-panel-head {
  justify-items: center;
  text-align: center;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] #flags[data-layout="image-grid"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1200px;
  margin: 0 auto;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] #flags[data-layout="image-grid"] img {
  min-height: clamp(170px, 14vw, 270px);
  max-height: 280px;
}

/* ── Daily challenge: tipo flagToCountry4 (bandera → elegir país) ── */
/* Layout de dos columnas: bandera a la izquierda, botones a la derecha */
body[data-game-mode="dailyChallenge"][data-daily-qtype="flagToCountry4"] .play-frame {
  grid-template-columns: minmax(300px, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="flagToCountry4"] .play-answer-panel {
  align-content: center;
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="flagToCountry4"] .visual-stage {
  min-height: clamp(260px, 40vh, 560px);
}

body[data-game-mode="dailyChallenge"][data-daily-qtype="flagToCountry4"] #flags[data-layout="button-grid"] button {
  min-height: 70px;
  font-size: 1rem;
}

body[data-game-state="ended"] .play-question-panel,
body[data-game-state="ended"] .play-answer-panel {
  pointer-events: none;
  user-select: none;
}

/* ─── Info table ─────────────────────────────────────────── */
.info-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: auto;
  box-shadow: var(--shadow);
  table-layout: fixed;
}

.info-table th:nth-child(1),
.info-table th:nth-child(2),
.info-table th:nth-child(3),
.info-table td:nth-child(1),
.info-table td:nth-child(2),
.info-table td:nth-child(3) { width: 33.33%; }

.info-table th,
.info-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.info-table th {
  background: var(--panel);
  font-weight: 600;
  color: var(--primary);
  position: sticky;
  top: 0;
  font-size: 0.88rem;
}

.info-table td img {
  max-height: 100px;
  max-width: 150px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.info-table tbody tr:hover { background: var(--panel-strong); }

/* ─── Animation ──────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive: large desktop ──────────────────────────── */
@media (min-width: 1500px) {
  .game-shell {
    grid-template-columns: clamp(300px, 17vw, 400px) minmax(0, 1fr);
  }

  .play-frame {
    grid-template-columns: minmax(360px, 1fr) minmax(480px, 1fr);
  }

  body[data-game-mode="mapMode"] .play-frame {
    grid-template-columns: minmax(720px, 1.92fr) minmax(260px, 0.36fr);
  }

  body[data-game-mode="mapMode"] .visual-stage img.visual-map {
    width: min(100%, 1380px);
    max-height: min(80vh, 1180px);
  }

  body[data-game-mode="mode1minuto"] .play-frame {
    grid-template-columns: minmax(400px, 0.84fr) minmax(620px, 1.16fr);
  }

  body[data-game-mode="countryToFlag"] #flags[data-layout="image-grid"] img {
    min-height: clamp(220px, 14vw, 340px);
    max-height: 340px;
  }

  body[data-game-mode="mode1minutoBanderas"] #flags[data-layout="timed-flags"] img {
    min-height: clamp(200px, 15vw, 300px);
    max-height: 320px;
  }

  body[data-game-mode="countryToFlag6"] #flags[data-layout="cascade-grid"] img {
    min-height: clamp(170px, 13vw, 270px);
    max-height: 280px;
  }
}

/* ─── Responsive: tablet landscape ──────────────────────── */
@media (max-width: 1180px) {
  .game-shell { grid-template-columns: 1fr; }

  .game-main { order: 1; min-height: auto; }

  .game-sidebar { order: 2; position: static; }

  .play-frame,
  body[data-game-mode="mapMode"] .play-frame,
  body[data-game-mode="countryToFlag"] .play-frame,
  body[data-game-mode="mode1minuto"] .play-frame,
  body[data-game-mode="mode1minutoBanderas"] .play-frame,
  body[data-game-mode="countryToFlag6"] .play-frame,
  body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] .play-frame,
  body[data-game-mode="dailyChallenge"][data-daily-qtype="flagToCountry4"] .play-frame {
    grid-template-columns: 1fr;
  }

  .play-answer-panel { align-content: start; }

  body[data-game-mode="mapMode"] #flags[data-layout="map-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}

/* ─── Responsive: hero panel + home columns ──────────────── */
@media (max-width: 1080px) {
  .hero-panel { grid-template-columns: 1fr; }

  .home-hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: clamp(32px, 4vw, 56px);
  }

  .flags-mosaic {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }

  .flag-mosaic-cell:nth-child(n+10) { display: none; }
}

/* ─── Responsive: tablet ─────────────────────────────────── */
@media (max-width: 860px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-hero-visual { order: -1; }

  .flags-mosaic {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }

  .flag-mosaic-cell:nth-child(n+9) { display: none; }

  .br-desktop { display: none; }

  .selection-layout,
  .mode-layout,
  .info-ribbon,
  .drag-layout {
    grid-template-columns: 1fr;
  }

  .mode-row { grid-template-columns: 1fr; }

  .play-surface,
  body[data-game-mode="mapMode"] .play-surface {
    min-height: auto;
  }

  .visual-stage,
  body[data-game-mode="mapMode"] .visual-stage {
    min-height: clamp(220px, 40vh, 480px);
  }

  body[data-game-mode="mode1minuto"] .visual-stage {
    min-height: clamp(240px, 42vh, 520px);
  }

  body[data-game-mode="countryToFlag"] #flags[data-layout="image-grid"],
  body[data-game-mode="dailyChallenge"][data-daily-qtype="countryToFlag"] #flags[data-layout="image-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #flags[data-layout="cascade-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-over-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Responsive: mobile ─────────────────────────────────── */
@media (max-width: 640px) {
  .shell {
    width: calc(100% - 20px);
    padding-top: 16px;
    padding-bottom: 28px;
  }

  body.game-page .shell { width: calc(100% - 16px); }

  .hero-panel,
  .panel,
  .game-sidebar,
  .status-ribbon,
  .play-surface {
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 22px;
  }

  .side-drawer summary,
  .side-drawer-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-title { font-size: clamp(2rem, 10vw, 3rem); }

  .sidebar-title,
  #pais { font-size: clamp(1.5rem, 8vw, 2.2rem); }

  /* Scoreboard en móvil: se compacta */
  .score-line {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .stat-grid { gap: 6px; }

  .stat-pill {
    padding: 6px 10px;
    min-width: 42px;
  }

  .stat-pill strong { font-size: 0.9rem; }

  .status-inline { width: 100%; }

  .status-inline-item {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Game over */
  .game-over-banner { inset: 8px; padding: 14px; border-radius: 20px; }
  .game-over-shell { gap: 12px; }
  .game-over-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

  /* Flags grid */
  #flags[data-layout="button-grid"],
  #flags[data-layout="form"],
  #flags[data-layout="timed-buttons"] {
    grid-template-columns: 1fr;
  }

  #flags[data-layout="image-grid"],
  #flags[data-layout="map-grid"],
  #flags[data-layout="timed-flags"],
  #flags[data-layout="cascade-grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #flags[data-layout="image-grid"] img,
  #flags[data-layout="map-grid"] img,
  #flags[data-layout="timed-flags"] img,
  #flags[data-layout="cascade-grid"] img {
    min-height: clamp(90px, 26vw, 140px);
    max-height: 145px;
  }

  body[data-game-mode="mode1minutoBanderas"] #flags[data-layout="timed-flags"] img,
  body[data-game-mode="countryToFlag"] #flags[data-layout="image-grid"] img,
  body[data-game-mode="countryToFlag6"] #flags[data-layout="cascade-grid"] img {
    min-height: clamp(100px, 26vw, 155px);
    max-height: 160px;
  }

  #flags img { width: min(120px, 38vw); }

  .play-surface { padding: 12px; }
  .play-answer-panel { padding: 12px; }
  .play-frame { gap: 14px; }

  .visual-stage { min-height: clamp(180px, 36vh, 380px); }
  .visual-stage img { padding: 10px; }
  .visual-stage img.visual-map { max-height: min(48vh, 480px); }

  /* Choice grid 1 column on mobile */
  .choice-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Daily */
  .daily-featured-btn { flex-direction: column; align-items: flex-start; gap: 12px; }
  .daily-featured-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 6px; }

  /* Home landing mobile */
  .home-shell { width: calc(100% - 28px); }
  .home-hero { padding-top: clamp(32px, 10vw, 56px); }
  .home-hero-visual { display: none; }
  .br-desktop { display: none; }
  .hero-chips span { font-size: 0.82rem; padding: 5px 12px; }
  .home-section-title { font-size: clamp(1.5rem, 7vw, 2rem); }
}
