:root {
  /* Warm Iberia Editorial Palette */
  --bg-page: #faf7f2;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f3ede2;
  --bg-inspector: #182232;
  --text-primary: #182232;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-on-dark: #f8fafc;

  --accent-primary: #c84b31;
  --accent-primary-hover: #ad3b23;
  --accent-primary-soft: #fdece8;

  --accent-teal: #0f766e;
  --accent-teal-soft: #ccfbf1;

  --accent-amber: #d97706;
  --accent-amber-soft: #fef3c7;

  --border-light: #e5dec9;
  --border-strong: #d0c6ae;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-card: 0 4px 20px -2px rgba(24, 34, 50, 0.06), 0 2px 6px -1px rgba(24, 34, 50, 0.04);
  --shadow-floating: 0 18px 38px -6px rgba(24, 34, 50, 0.22), 0 4px 12px -2px rgba(24, 34, 50, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 1.5rem;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-primary), #e06d53);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.45rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(200, 75, 49, 0.28);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

/* Control Bar */
.control-bar {
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 1.5rem;
}

.control-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-secondary);
}

.custom-select {
  appearance: none;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23182232' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 2.25rem 0.55rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  min-height: 42px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select:hover {
  border-color: var(--text-primary);
}

.custom-select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

/* Segmented Difficulty Control */
.segmented-control {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.segment-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segment-btn .diff-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.segment-btn .diff-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.segment-btn:hover:not(.active) {
  background: var(--bg-surface-subtle);
}

.segment-btn.active {
  background: var(--text-primary);
  color: #fff;
}

.segment-btn.active .diff-name {
  color: #fff;
}

.segment-btn.active .diff-meta {
  color: #cbd5e1;
}

/* Buttons */
.control-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  min-height: 42px;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 2px 8px rgba(200, 75, 49, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-ghost:hover {
  background: var(--bg-surface-subtle);
}

/* Main Workspace Grid */
.game-workspace {
  max-width: 1320px;
  width: 100%;
  margin: 1.25rem auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(340px, 1.15fr) minmax(340px, 0.95fr);
  gap: 1.5rem;
  align-items: start;
}

/* Board Panel */
.board-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.board-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge-cefr {
  background: var(--accent-teal-soft);
  color: var(--accent-teal);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.direction-legend {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.hud-selection {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.08em;
}

.selection-placeholder {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: normal;
}

.timer-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface-subtle);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* The Letter Grid */
.grid-container-outer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem 0;
}

.letter-grid {
  --grid-cols: 10;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 5px;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1 / 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  background: var(--bg-surface-subtle);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.grid-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.85rem, 2.1vw, 1.2rem);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.letter-grid[data-size="12"] .grid-cell {
  font-size: clamp(0.8rem, 1.8vw, 1.08rem);
}

.letter-grid[data-size="14"] .grid-cell {
  font-size: clamp(0.72rem, 1.55vw, 0.96rem);
  gap: 4px;
}

.grid-cell:hover {
  border-color: var(--accent-primary);
}

/* Found state with multi-color palette support */
.grid-cell.is-found {
  background-color: var(--found-bg, #d1fae5);
  border-color: var(--found-border, #10b981);
  color: var(--found-text, #065f46);
}

/* Active drag selection state */
.grid-cell.is-selecting {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #ffffff !important;
  transform: scale(1.06);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(200, 75, 49, 0.32);
}

/* Hint pulse animation */
.grid-cell.is-hint {
  background-color: var(--accent-amber-soft);
  border-color: var(--accent-amber);
  color: #92400e;
  animation: pulseHint 1.2s ease-in-out infinite;
}

/* Hover spotlight when user hovers a found word in the list */
.grid-cell.is-word-spotlight {
  transform: scale(1.08);
  z-index: 3;
  box-shadow: 0 0 0 3px var(--text-primary);
}

@keyframes pulseHint {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.45); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Custom Toggle Switch */
.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-control input:checked + .toggle-track {
  background: var(--accent-teal);
}

.toggle-control input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.toggle-text {
  font-weight: 600;
  color: var(--text-primary);
}

/* Right Column: Vocab & Inspector Panel */
.vocab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Live Definition Inspector Card */
.inspector-card {
  background: var(--bg-inspector);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease;
}

.inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.inspector-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.inspector-word-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inspector-word {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.inspector-article {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.btn-audio {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-audio:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-audio:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.inspector-translation-row {
  margin-top: 0.55rem;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inspector-translation {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fbbf24;
}

.inspector-phonetic {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #94a3b8;
}

.inspector-definition {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.inspector-example {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}

.example-es {
  color: #ffffff;
  font-weight: 600;
}

.example-en {
  color: #94a3b8;
  font-style: italic;
  margin-top: 0.15rem;
}

/* Word List Card */
.wordlist-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-card);
}

.wordlist-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.wordlist-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-counter {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.progress-counter strong {
  color: var(--accent-teal);
  font-size: 0.95rem;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), #10b981);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 12 Word Chips Grid */
.word-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.word-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(24, 34, 50, 0.03);
}

.word-chip:hover,
.word-chip:focus-visible {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(24, 34, 50, 0.1);
  outline: none;
}

.word-chip.is-active-inspect {
  border-color: var(--text-primary);
  background: #fdfbf7;
}

.word-chip-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.word-chip-es-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.word-chip-es {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.word-chip-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.word-chip-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.chip-speak-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip-speak-btn:hover {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}

/* Found Word Chip Styling */
.word-chip.is-found {
  background: #f0fdf4;
  border-color: #86efac;
}

.word-chip.is-found .word-chip-es {
  text-decoration: line-through;
  color: var(--accent-teal);
}

.chip-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-teal);
  color: #fff;
  display: none;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.word-chip.is-found .chip-check {
  display: grid;
}

/* Floating Hover Tooltip */
.floating-tooltip {
  position: fixed;
  z-index: 1000;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: #182232;
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-floating);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.floating-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-top {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tooltip-es {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
}

.tooltip-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.tooltip-phonetic {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #94a3b8;
}

.tooltip-en {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  margin-top: 0.25rem;
}

.tooltip-def {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 0.3rem;
  line-height: 1.4;
}

.tooltip-example {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
}

.tooltip-ex-es {
  color: #fff;
  font-weight: 600;
}

.tooltip-ex-en {
  color: #94a3b8;
  font-style: italic;
}

/* Native Modal Dialogs (Modern Web Guidance compliant) */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(24, 34, 50, 0.62);
  backdrop-filter: blur(4px);
}

.app-dialog {
  margin: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  width: min(580px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  box-shadow: var(--shadow-floating);
  padding: 0;
}

.dialog-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.victory-badge {
  display: inline-block;
  background: var(--accent-teal-soft);
  color: var(--accent-teal);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.dialog-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.2;
}

.dialog-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.v-stat {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}

.v-stat-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.v-stat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* Mini Comprehension Quiz inside Victory Dialog */
.mini-quiz-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.quiz-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-teal);
}

.quiz-score {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quiz-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.quiz-option-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.quiz-option-btn.is-correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.quiz-option-btn.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.quiz-feedback {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 1.2em;
}

/* Accordion Review List */
.review-accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  background: var(--bg-page);
}

.review-accordion summary {
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
}

.review-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.review-item {
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-surface);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Help Modal Grid */
.help-grid {
  display: grid;
  gap: 1rem;
}

.help-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.help-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.help-item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.help-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive Layout */
@media (max-width: 980px) {
  .game-workspace {
    grid-template-columns: 1fr;
  }

  .letter-grid {
    max-width: 480px;
  }
}

@media (max-width: 600px) {
  .site-header,
  .control-bar {
    padding: 0.75rem 1rem;
  }

  .game-workspace {
    padding: 0 1rem 1.5rem;
  }

  .word-list {
    grid-template-columns: 1fr;
  }

  .victory-stats-grid,
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .floating-tooltip {
    display: none; /* Mobile uses the persistent top Definition Inspector card */
  }
}
