:root {
  --bg-deep: #0b1120;
  --bg-panel: #131d33;
  --bg-card: #1b2845;
  --bg-card-hover: #24355a;
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-bright: rgba(251, 191, 36, 0.55);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-gold: #fbbf24;
  --accent-amber: #f59e0b;
  --accent-teal: #14b8a6;
  --accent-sky: #38bdf8;
  --accent-emerald: #10b981;
  --accent-coral: #f43f5e;
  --accent-violet: #8b5cf6;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: radial-gradient(circle at 15% 15%, #172554 0%, #0b1120 55%, #070b14 100%);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

/* ── Top Navigation & Device Bar ───────────────────────────── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 18px;
}

.top-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-home-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}

.brand-home-link:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-group {
  display: inline-flex;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.pill-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pill-btn:hover {
  color: var(--text-main);
}

.pill-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #090d16;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.pill-btn.active-teal {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #041311;
}

/* ── Main App Shell & Device Viewport Modes ────────────────── */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
  transition: max-width 0.25s ease;
}

/* Explicit preview overrides so user can test Mobile / iPad / Desktop anytime */
body.preview-mobile .app-container {
  max-width: 430px;
  border-left: 2px dashed rgba(251, 191, 36, 0.3);
  border-right: 2px dashed rgba(251, 191, 36, 0.3);
  min-height: calc(100vh - 60px);
}

body.preview-ipad .app-container {
  max-width: 860px;
  border-left: 2px dashed rgba(56, 189, 248, 0.3);
  border-right: 2px dashed rgba(56, 189, 248, 0.3);
}

/* ── Global Stats Banner ───────────────────────────────────── */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  font-size: 1.45rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Mode Selector Grid (Hub View) ─────────────────────────── */
.mode-hub {
  margin-bottom: 20px;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mode-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-panel) 100%);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-lg);
}

.mode-card.active-mode {
  border-color: var(--accent-gold);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.16) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}

.mode-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
  width: fit-content;
}

.badge-quick { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-long { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-knockout { background: rgba(251, 191, 36, 0.22); color: #fbbf24; }
.badge-dojo { background: rgba(244, 63, 94, 0.22); color: #fb7185; }

.mode-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.mode-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mode-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

/* ── Main Split Workspace (Gameplay + Map/Board) ───────────── */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.panel-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

/* ── Gameplay Toolbar (Region / Question Type / Input Toggle) ─ */
.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Round Progress Bar ────────────────────────────────────── */
.round-progress-wrap {
  margin-bottom: 16px;
}

.round-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #fbbf24);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ── Question Stage Card ───────────────────────────────────── */
.question-stage {
  background: linear-gradient(145deg, #1e2d4f 0%, #152039 100%);
  border: 2px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.question-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.region-pill {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.stage-actions {
  display: flex;
  gap: 8px;
}

.mini-action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s;
}

.mini-action-btn:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: var(--accent-gold);
}

.question-prompt-label {
  font-size: 0.88rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.question-main-title {
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}

.question-sub-clue {
  font-size: 0.94rem;
  color: #cbd5e1;
  background: rgba(11, 17, 32, 0.55);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-gold);
}

/* ── Visual Mnemonic Memory Device Card ────────────────────── */
.mnemonic-drawer {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(236, 72, 153, 0.14) 100%);
  border: 2px solid rgba(167, 139, 250, 0.5);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 14px;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.97) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.mnemonic-visual-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mnemonic-anchor-box {
  background: rgba(11, 17, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  text-align: center;
  min-width: 145px;
}

.anchor-emoji {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 4px;
  display: block;
}

.anchor-word {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.anchor-sound {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.mnemonic-plus {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-sky);
}

.mnemonic-story-text {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  padding: 8px 12px;
  background: rgba(11, 17, 32, 0.55);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.mnemonic-fun-fact {
  font-size: 0.82rem;
  color: #cbd5e1;
  text-align: center;
}

/* ── Input Area 1: Multiple Choice (4 Big Touch Cards) ────── */
.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mc-option-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.16s ease;
  text-align: left;
  min-height: 62px;
}

.mc-option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-sky);
  transform: translateY(-2px);
}

.mc-option-btn.correct-choice {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
  color: #6ee7b7;
}

.mc-option-btn.wrong-choice {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-coral);
  color: #fda4af;
}

.mc-key-hint {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ── Input Area 2: Smart Filter Autocomplete (Zero Spelling Penalty) */
.autocomplete-box {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.ac-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.ac-search-input {
  flex: 1;
  background: #0b1120;
  color: #ffffff;
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1.1rem; /* >=16px prevents iOS/iPad auto-zoom */
  font-weight: 700;
  outline: none;
}

.ac-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.ac-clear-btn {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Quick Letter Tap Bar for iPad/Mobile & Fast Filtering */
.az-bar {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.az-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 8px 0;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s;
}

.az-btn:hover, .az-btn.active-letter {
  background: var(--accent-gold);
  color: #0b1120;
  border-color: var(--accent-gold);
}

.ac-helper-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ac-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 9px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.ac-suggestion-pill {
  background: #111a2e;
  color: var(--text-main);
  border: 2px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.14s;
}

.ac-suggestion-pill:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.ac-match-highlight {
  color: var(--accent-gold);
  text-decoration: underline;
  font-weight: 900;
}

/* ── Feedback Banner & Next Step Button ────────────────────── */
.feedback-banner {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  animation: popIn 0.2s ease;
}

.feedback-banner.is-correct {
  background: rgba(16, 185, 129, 0.18);
  border: 2px solid var(--accent-emerald);
}

.feedback-banner.is-wrong {
  background: rgba(244, 63, 94, 0.18);
  border: 2px solid var(--accent-coral);
}

.next-question-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #090d16;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* ── Right Column: US Map Cartogram & 50-State Attempt Board ─ */
.right-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.us-map-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(7, 42px);
  gap: 5px;
  background: #090f1d;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.map-tile {
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1b2845;
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  user-select: none;
}

.map-tile:hover {
  transform: scale(1.1);
  z-index: 5;
  border-color: var(--accent-gold);
}

.map-tile.tile-target {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #041019;
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85);
  animation: pulseTile 1.2s infinite alternate;
}

@keyframes pulseTile {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}

.map-tile.tile-knocked-clean {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #031c14;
  border-color: #6ee7b7;
}

.map-tile.tile-knocked-recovered {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1c1002;
  border-color: #fde047;
}

.map-tile.tile-missed {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border-color: #fda4af;
}

.map-tile-sub {
  font-size: 0.56rem;
  opacity: 0.85;
}

.map-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 4px;
}

/* ── 50-State Attempt & Wrong Tracker Board ────────────────── */
.board-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.attempt-board-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  max-height: 410px;
  overflow-y: auto;
  padding-right: 4px;
}

.board-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 44px 1.2fr 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.board-row.row-has-wrong {
  border-left: 4px solid var(--accent-coral);
  background: rgba(244, 63, 94, 0.08);
}

.board-row.row-mastered {
  border-left: 4px solid var(--accent-emerald);
}

.board-code-badge {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.board-stats-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-mini-pill {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pill-attempts { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.pill-correct { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.pill-wrong { background: rgba(244, 63, 94, 0.25); color: #fda4af; }

/* ── Session Wrong / Missed Quick Strip ────────────────────── */
.session-missed-box {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.session-missed-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fda4af;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.missed-chips-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.missed-chip {
  background: rgba(244, 63, 94, 0.22);
  color: #ffe4e6;
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── Modal for Mnemonic Inspector & Round Summary ──────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.82);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-panel);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* ── Responsive Breakpoints (Desktop / iPad / Mobile) ──────── */
@media (max-width: 1100px), (pointer: coarse) and (max-width: 1180px) {
  /* iPad / Tablet Portrait & Landscape Optimization */
  .mode-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .stats-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
}

body.preview-ipad .mode-cards-grid {
  grid-template-columns: repeat(2, 1fr);
}
body.preview-ipad .workspace-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 767px) {
  /* Mobile Phone Optimization */
  .stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
  .mc-grid {
    grid-template-columns: 1fr;
  }
  .az-bar {
    grid-template-columns: repeat(9, 1fr);
  }
  .us-map-grid {
    grid-template-rows: repeat(7, 32px);
    gap: 3px;
    padding: 6px;
  }
  .map-tile {
    font-size: 0.6rem;
  }
  .map-tile-sub {
    display: none;
  }
  .board-row {
    grid-template-columns: 38px 1fr;
  }
}

body.preview-mobile .stats-ribbon {
  grid-template-columns: repeat(2, 1fr);
}
body.preview-mobile .mode-cards-grid,
body.preview-mobile .mc-grid {
  grid-template-columns: 1fr;
}
body.preview-mobile .workspace-grid {
  grid-template-columns: 1fr;
}
body.preview-mobile .az-bar {
  grid-template-columns: repeat(9, 1fr);
}
