/* ==========================================================================
   DAU TRUONG O CHU TIN HOC - MODERN EDTECH CLASSROOM THEME
   - High-contrast, projection-ready aesthetic for classrooms
   - Accessible WCAG 2.1 AA compliant
   - Hardware-accelerated transitions, zero external font dependencies
   ========================================================================== */

:root {
  /* Color Palette - Tactile Studio: Warm Stone, Charcoal Ink, Terracotta & Sage */
  --page-bg: #f5f5f4;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #faf9f6;
  --surface-active: #fffbf7;

  --ink: #1c1917;
  --ink-secondary: #44403c;
  --muted: #78716c;
  --muted-light: #a8a29e;

  --action: #c2410c;
  --action-hover: #9a3412;
  --action-dark: #7c2d12;
  --action-subtle: #fff7ed;
  --action-border: #fed7aa;

  --attention: #d97706;
  --attention-light: #fef3c7;
  --attention-glow: rgba(217, 119, 6, 0.15);

  --revealed-gradient-start: #fef3c7;
  --revealed-gradient-end: #fed7aa;
  --revealed-border: #ea580c;
  --revealed-text: #1c1917;

  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --line: #e7e5e4;
  --line-strong: #d6d3d1;

  --canvas-bg: #e7e5e4;

  /* Workspace Crossword Cells Active Highlight (Zero-Neon Cobalt) */
  --cell-active-border: #3b82f6;
  --cell-active-ring: rgba(59, 130, 246, 0.3);
  --cell-active-bg: #1e3a8a;

  /* Elevation & Shadows */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 30px -6px rgba(15, 23, 42, 0.1), 0 8px 12px -4px rgba(15, 23, 42, 0.04);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Base & Resets
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background-color: var(--page-bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--page-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 14px;
  left: 14px;
  padding: 10px 18px;
  transform: translateY(-180%);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   App Header & Navigation
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-header__inner {
  display: flex;
  width: min(100% - 40px, 1480px);
  min-height: 72px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand__mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #38bdf8;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
  transition: transform var(--transition-fast);
}

.brand:hover .brand__mark {
  transform: scale(1.04);
}

.brand__mark svg {
  width: 24px;
  height: 24px;
}

.brand__eyebrow,
.section-eyebrow {
  margin: 0;
  color: var(--action);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand__title {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.role-label {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   App Shell & Hero Layout
   -------------------------------------------------------------------------- */
.app-shell {
  width: min(100% - 40px, 1480px);
  margin-inline: auto;
  padding: 28px 0 64px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.page-intro h1,
.section-heading h2,
.game-heading h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-wrap: balance;
}

.page-intro__copy,
.section-heading p,
.game-heading p {
  max-width: 68ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--action-border);
  background: var(--surface);
  color: var(--action);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--action);
  background: var(--action-subtle);
  color: var(--action-hover);
}

.btn-outline-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--muted);
  background: var(--surface-muted);
  color: var(--ink);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
  background: #047857;
  border-color: #065f46;
  color: #ffffff;
}

.btn-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Step Timeline / Wizard (Admin Page)
   -------------------------------------------------------------------------- */
.step-list {
  display: grid;
  margin: 0 0 28px;
  padding: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.step-list__number {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  transition: all var(--transition-fast);
}

.step-list li.is-current {
  background: var(--action-subtle);
  color: var(--action-hover);
  border: 1px solid var(--action-border);
}

.step-list li.is-current .step-list__number {
  border-color: var(--action);
  background: var(--action);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* --------------------------------------------------------------------------
   Containers, Workspace & Cards
   -------------------------------------------------------------------------- */
.workspace,
.game-panel,
.clues-panel,
.review-area {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.workspace:hover,
.game-panel:hover,
.clues-panel:hover {
  box-shadow: var(--shadow-md);
}

.workspace {
  overflow: hidden;
}

.workspace__header,
.game-panel__header,
.clues-panel__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, #ffffff, #fafbfe);
}

.section-heading,
.game-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Mode Tabs (Step 1)
   -------------------------------------------------------------------------- */
.mode-tabs {
  gap: 8px;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.mode-tabs .nav-link {
  min-height: 42px;
  margin-bottom: -1px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.94rem;
  background: transparent;
  transition: all var(--transition-fast);
}

.mode-tabs .nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.mode-tabs .nav-link.active {
  border-bottom-color: var(--action);
  color: var(--action);
  background: transparent;
  font-weight: 700;
}

.source-panel {
  padding: 24px;
}

.source-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.8fr) minmax(200px, 0.7fr);
  gap: 24px;
  align-items: end;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.form-control,
.form-select {
  min-height: 44px;
  padding: 9px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--ink);
  font-size: 0.94rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
  outline: none;
}

/* --------------------------------------------------------------------------
   Keyword Selection Checklist
   -------------------------------------------------------------------------- */
.keyword-checkbox-group {
  max-height: 230px;
  overflow-y: auto;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.keyword-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.keyword-list .form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.keyword-list .form-check:hover {
  border-color: var(--action-border);
  background: var(--action-subtle);
}

.keyword-list .form-check-input {
  margin: 0;
  cursor: pointer;
}

.keyword-list .form-check-input:checked + .form-check-label {
  color: var(--action-hover);
}

.keyword-list .form-check:has(.form-check-input:checked) {
  border-color: var(--action);
  background: var(--action-subtle);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.source-action .btn {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Status Message (Alert / Toast)
   -------------------------------------------------------------------------- */
.status-message {
  margin: 18px 24px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--action);
  border-radius: var(--radius-xs) var(--radius-md) var(--radius-md) var(--radius-xs);
  background: var(--action-subtle);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

.status-message.is-error {
  border-left-color: var(--danger);
  background: var(--danger-bg);
  color: #7f1d1d;
}

.status-message.is-success {
  border-left-color: var(--success);
  background: var(--success-bg);
  color: #064e3b;
}

.status-link {
  color: var(--action);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Review Table (Step 2)
   -------------------------------------------------------------------------- */
.review-area {
  margin-top: 28px;
  overflow: hidden;
}

.review-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.review-table {
  min-width: 1020px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.review-table th {
  padding: 14px 16px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 0;
}

.review-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  background-color: #ffffff;
  transition: background-color var(--transition-fast);
}

.review-table tbody tr:hover td {
  background-color: #fbfcfd;
}

.status-approved {
  opacity: 1;
}

.status-rejected td {
  opacity: 0.52;
  background-color: #f8fafc !important;
}

.review-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.review-actions .btn {
  min-width: 52px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.fact-box,
.sgk-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
}

.fact-box {
  border-left: 3.5px solid var(--action);
  background: var(--action-subtle);
  color: var(--ink-secondary);
}

.fact-box::before {
  content: "Tri thức mở rộng (ConceptNet):";
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--action);
  margin-bottom: 3px;
}

.sgk-box {
  margin-top: 8px;
  border-left: 3.5px solid var(--muted-light);
  background: var(--surface-muted);
  color: var(--ink-secondary);
}

.sgk-box::before {
  content: "Kiến thức SGK:";
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}

.col-ai-clue .form-control {
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.text-bg-success {
  background-color: var(--success-bg) !important;
  color: var(--success) !important;
  border: 1px solid var(--success-border);
}

.badge.text-bg-warning {
  background-color: var(--attention-light) !important;
  color: #92400e !important;
  border: 1px solid #fde68a;
}

.review-footer {
  display: flex;
  justify-content: flex-end;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
}

/* --------------------------------------------------------------------------
   Game Stage & Crossword Layout
   -------------------------------------------------------------------------- */
.game-stage {
  display: grid;
  gap: 24px;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.game-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.game-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 3.2fr) minmax(320px, 2fr);
  gap: 24px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Crossword Canvas Board (Admin Preview & Player)
   -------------------------------------------------------------------------- */
.crossword-container,
.grid-container {
  min-width: 0;
  height: min(72vh, 760px);
  min-height: 540px;
  overflow: auto;
  padding: 28px;
  background-color: #0f172a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Admin Table Grid */
.crossword-table {
  margin: 0 auto;
  border-spacing: 4px;
  border-collapse: separate;
}

.crossword-cell {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: transparent;
}

.crossword-cell.cell-filled {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cell-number {
  position: absolute;
  top: 1px;
  left: 3px;
  color: var(--danger);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

/* Player Grid Board */
.crossword-board {
  display: grid;
  width: max-content;
  margin: 0 auto;
  gap: 4px;
}

.cw-cell {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius-xs);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  transition: transform var(--transition-fast), background-color var(--transition-normal), color var(--transition-normal);
}

.cw-cell.empty-cell {
  background: transparent;
}

.cw-cell.letter-cell {
  border: 1.5px solid #475569;
  background: #1e293b;
  color: transparent;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.cw-cell.letter-cell:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* 3D Flip Reveal Animation */
@keyframes cellFlip {
  0% {
    transform: perspective(600px) rotateX(90deg) scale(0.9);
    opacity: 0.6;
  }
  60% {
    transform: perspective(600px) rotateX(-15deg) scale(1.08);
  }
  100% {
    transform: perspective(600px) rotateX(0deg) scale(1);
    opacity: 1;
  }
}

.cw-cell.revealed {
  animation: cellFlip 420ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-color: var(--revealed-border);
  background: linear-gradient(135deg, var(--revealed-gradient-start) 0%, var(--revealed-gradient-end) 100%);
  color: var(--revealed-text);
  box-shadow: 0 4px 14px var(--attention-glow);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cw-cell.revealed .cell-number {
  color: #b91c1c;
}

/* --------------------------------------------------------------------------
   Clues Deck (Right Column)
   -------------------------------------------------------------------------- */
.clue-list,
.clue-box {
  display: grid;
  max-height: 720px;
  overflow-y: auto;
  gap: 12px;
  padding: 20px;
}

.clue-group + .clue-group {
  margin-top: 14px;
}

.clue-type-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clue-type-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.clue-item {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--action);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-size: 0.94rem;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.clue-item strong {
  color: var(--action);
  font-weight: 800;
  margin-right: 4px;
}

.clue-item:hover {
  border-color: var(--action-border);
  background: var(--surface-muted);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.clue-item.active {
  border-color: var(--action);
  border-left-color: var(--action-hover);
  background: var(--action-subtle);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.clue-item.active strong {
  color: var(--action-hover);
}

.clue-list .list-group-item {
  padding: 12px 14px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Empty / Loading State
   -------------------------------------------------------------------------- */
.empty-state {
  width: min(100%, 480px);
  margin: auto;
  padding: 48px 24px;
  color: var(--muted-light);
  text-align: center;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted-light);
  font-size: 0.95rem;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.empty-state-actions .btn {
  padding: 8px 18px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Stitch Classroom Arena Components
   -------------------------------------------------------------------------- */
:root {
  --deep-slate-ink: #0F172A;
  --slate-tile: #1E293B;
  --slate-border: #475569;
  --academic-cobalt: #2563EB;
  --cobalt-dark: #1D4ED8;
  --cobalt-soft: #EFF6FF;
  --cobalt-ring: rgba(37, 99, 235, 0.35);
  --amber-gold: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.4);
  --amber-soft: #FEF3C7;
  --emerald-mint: #059669;
  --emerald-soft: #ECFDF5;
  --crimson-coral: #DC2626;
  --canvas-pearl: #F8FAFC;
  --pure-surface: #FFFFFF;
  --structural-line: #E2E8F0;
}

/* Header Enhancements */
.brand__text-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand__sep {
  color: var(--line-strong);
  font-size: 0.85rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-nav .nav-item {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.header-nav .nav-item:hover {
  color: var(--ink);
}

.header-nav .nav-item.active {
  color: var(--action);
  border-bottom-color: var(--action);
}

.header-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

.hint-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--attention);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.header-tool-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: #e2e8f0;
  color: #0f172a !important;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.tool-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  color: #1e293b;
}

.tool-btn:hover svg {
  color: #0f172a;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.header-session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-session-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.btn-session-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-session-secondary svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
  color: #334155;
}

.btn-session-secondary:active {
  transform: translateY(0.5px) scale(0.98);
}

.btn-session-secondary.btn-session-start {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-session-secondary.btn-session-start:hover {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}

.btn-session-secondary.btn-session-start svg {
  color: #059669;
  fill: #059669;
}

.btn-session-secondary.btn-session-end {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.btn-session-secondary.btn-session-end:hover {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}

.btn-session-secondary.btn-session-end svg {
  color: #be123c;
  fill: #be123c;
}

@keyframes btnPulseNotice {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(1);
  }
}

.pulse-highlight {
  animation: btnPulseNotice 0.6s ease-in-out 2 !important;
}

/* Classroom Notification Toast */
.classroom-toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.classroom-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.12), 0 2px 6px -1px rgba(15, 23, 42, 0.08);
  transform: translateY(-12px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.classroom-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.classroom-toast.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
}

.classroom-toast.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #22c55e;
}

.classroom-toast.info {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0284c7;
}

.btn-session-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.btn-session-primary:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.btn-session-primary:active {
  transform: translateY(0.5px) scale(0.98);
}

/* Fullscreen Transparent Canvas for Confetti */
.fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: block;
}

/* Header Sound Toggle */
#btnSoundToggle.is-muted svg {
  color: #ef4444 !important;
  stroke: #ef4444 !important;
}

/* Floating Classroom Reaction HUD (Canva-style) */
.classroom-reaction-hud {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
}

.reaction-hud-badge {
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reaction-hud-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 6px 8px;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-fast);
}

.reaction-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.reaction-btn:active {
  transform: translateY(0.5px) scale(0.96);
}

.reaction-btn.btn-confetti:hover {
  background: #fdf2f8;
  color: #be185d;
  border-color: #fbcfe8;
}

.reaction-btn.btn-applause:hover {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.reaction-btn.btn-drumroll:hover {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.reaction-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  border: 1px solid #cbd5e1;
}

@media (max-width: 768px) {
  .classroom-reaction-hud {
    bottom: 16px;
    right: 16px;
  }
  .reaction-label {
    display: none;
  }
}

.btn-teacher-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-teacher-link:hover {
  background: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Intro & Telemetry Strip (Asymmetric Editorial Minimalist - Taste-Design)
   - Unboxed, seamless masthead architecture; zero card-in-card nesting
   - High-contrast typography with track-tight headline and Monospace metrics
   - Non-pulsing, calm status dot (no radioactive ping waves)
/* ==========================================================================
   Hero Intro & Telemetry Strip (Tactile Studio - Warm Terracotta & Sage)
   - Tactile craft aesthetic; soft 12px rounding with subtle paper elevation
   - High-contrast typography with track-tight headline and Monospace metrics
   - Organic seed dot status (#15803D Botanical Sage when session active)
   - Warm Pill Capsule Dock telemetry with Terracotta (#C2410C) progress fill
   ========================================================================== */
.arena-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 18px 26px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.05);
  margin-bottom: 20px;
}

.hero-editorial-lead {
  flex: 1 1 480px;
  min-width: 0;
}

.hero-status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-indicator-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
}

.dot-core {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78716c;
  transition: background 250ms ease;
}

body.session-active .dot-core {
  background: #15803d;
}

.status-tag {
  color: #9a3412;
  font-weight: 800;
  letter-spacing: 0.06em;
}

body.session-active .status-tag {
  color: #15803d;
}

.status-sep {
  color: var(--line-strong);
  font-weight: 300;
}

.curriculum-ref {
  color: var(--muted);
  font-weight: 600;
}

.hero-editorial-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-editorial-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 600px;
}

/* Tactile Capsule Dock Telemetry (Soft Pill Container, Terracotta Fill) */
.hero-telemetry-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 18px;
  border-radius: 9999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.telemetry-unit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.telemetry-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.telemetry-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.telemetry-figure {
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.telemetry-hairline-track {
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 3px;
}

.telemetry-hairline-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--action);
  transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.telemetry-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  align-self: center;
}

.timer-unit {
  min-width: 105px;
}

.timer-figure {
  color: var(--action);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.telemetry-caption {
  font-size: 0.65rem;
  color: var(--muted-light);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Primary Content Stage Grid */
.game-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: stretch;
  height: clamp(700px, calc(100vh - 200px), 880px);
  margin-top: 20px;
}

.arena-stage-box {
  border-radius: var(--radius-xl);
  background: var(--deep-slate-ink);
  border: 1px solid rgba(71, 85, 105, 0.7);
  padding: 20px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.arena-ctrl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8);
  position: relative;
  z-index: 2;
}

.arena-topic-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topic-icon {
  color: var(--attention);
  display: grid;
  place-items: center;
}

.topic-sub {
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-title {
  margin: 1px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.015em;
}

.arena-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: #020617;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: #94a3b8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.zoom-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

.zoom-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.zoom-reset-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.zoom-reset-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

.teacher-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.teacher-mode-pill:hover,
.teacher-mode-pill.active {
  background: rgba(37, 99, 235, 0.3);
  color: #ffffff;
  border-color: var(--action);
}

.grid-container.grid-board-pattern {
  background-color: #020617;
  background-image: radial-gradient(rgba(148, 163, 184, 0.22) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 0px 0px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: var(--radius-lg);
  margin: 16px 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: grab;
  cursor: -webkit-grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.grid-container.grid-board-pattern.is-panning {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
}

.crossword-board-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  padding: 40px;
}

.crossword-board-wrapper.is-animating {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.workspace-canvas-hud {
  position: absolute;
  bottom: 12px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(51, 65, 85, 0.7);
  backdrop-filter: blur(6px);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

.workspace-canvas-hud .hud-sep {
  color: #475569;
}

.projection-watermark {
  position: absolute;
  bottom: 8px;
  right: 14px;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  user-select: none;
}

.arena-legend-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(51, 65, 85, 0.8);
  font-size: 0.8rem;
  color: #94a3b8;
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.swatch-unrevealed {
  background: #1e293b;
  border: 1.5px solid #475569;
}

.swatch-revealed {
  background: var(--attention);
  border: 1.5px solid #fde047;
}

.swatch-active {
  background: var(--cell-active-bg);
  border: 2px solid var(--cell-active-border);
}

.text-amber {
  color: var(--attention);
}

.text-cobalt {
  color: #93c5fd;
}

.text-academic-cobalt {
  color: var(--academic-cobalt);
}

.text-deep-slate-ink {
  color: var(--deep-slate-ink);
}

.legend-hotkeys {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  background: #020617;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
  color: #94a3b8;
}

.legend-hotkeys strong {
  color: #60a5fa;
}

.sep {
  color: #475569;
}

/* Cell States in Stitch Style */
.cw-cell.letter-cell {
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.cw-cell.letter-cell .cell-text {
  font-weight: 800;
}

.cw-cell.letter-cell:not(.revealed) .cell-text {
  color: #475569;
}

.cw-cell.active-word {
  border: 2px solid var(--cell-active-border) !important;
  box-shadow: 0 0 0 3px var(--cell-active-ring) !important;
  background: var(--cell-active-bg) !important;
}

.cw-cell.active-word:not(.revealed) .cell-text {
  color: #93c5fd !important;
}

.cw-cell.revealed {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%) !important;
  border-color: #d97706 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px var(--attention-glow) !important;
}

.cw-cell.revealed.active-word {
  border: 2px solid var(--cell-active-border) !important;
  box-shadow: 0 0 0 3px var(--cell-active-ring), 0 4px 14px var(--attention-glow) !important;
}

/* ==========================================================================
   Interactive Clues Deck (Asymmetric Hairline Minimalist - Taste-Design)
/* ==========================================================================
   Interactive Clues Deck (Tactile Studio - Warm Terracotta & Sage)
   - Tactile craft workshop feel; cards as discrete physical index cards (8px radius)
   - Pill badge counter with warm ochre wash (#FFF7ED / #9A3412)
   - Organic elevation on hover/active; zero neon glow
   - Pill status tags: Terracotta (#FFEDD5/#9A3412) when active, Sage (#DCFCE7/#166534) when solved
   - Warm Terracotta flip button (#C2410C)
   ========================================================================== */
.clues-panel {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.05);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 560px;
}

.clues-panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.clues-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.clues-title-cluster {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clues-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--action);
  text-transform: uppercase;
}

.clues-title {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.badge-counter {
  padding: 3px 10px;
  border-radius: 9999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9a3412;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.clues-header-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.clues-hint-text {
  color: var(--muted);
}

.clues-nav-cue {
  font-size: 0.68rem;
  color: var(--muted-light);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Scrollable Clues List Deck with Custom Slim 4px Scrollbar */
.clue-list-deck {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clue-list-deck::-webkit-scrollbar {
  width: 4px;
}

.clue-list-deck::-webkit-scrollbar-track {
  background: transparent;
}

.clue-list-deck::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.clue-list-deck::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.clue-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 10px 4px 4px;
  border-bottom: 1px solid var(--line);
}

.clue-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-across {
  background: var(--action);
}

.dot-down {
  background: var(--attention);
}

.clue-group-line {
  flex: 1;
  height: 1px;
  background: transparent;
}

/* Tactile Clue Card (Discrete Physical Card Style) */
.clue-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.clue-card:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.clue-card:active {
  transform: translateY(0);
}

.clue-card.active {
  background: #fffbf7;
  border-color: var(--action);
  border-width: 1.5px;
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.08);
  transform: translateY(-1px);
}

.clue-card.solved {
  opacity: 0.92;
  background: var(--success-bg);
  border-color: var(--success-border);
}

.clue-card.solved.active {
  border-color: var(--success);
}

.clue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.clue-card-num-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clue-num-badge {
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.clue-card.active .clue-num-badge {
  color: var(--action);
}

.clue-card-meta {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.clue-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.clue-card.active .clue-status-tag {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
  font-weight: 800;
}

.clue-card.solved .clue-status-tag {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-weight: 800;
}

.clue-text {
  margin: 6px 0 0;
  font-size: 0.96rem;
  font-weight: 550;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.clue-card.active .clue-text {
  color: var(--ink);
  font-weight: 700;
}

.clue-card.solved .clue-text {
  color: var(--muted);
  font-weight: 500;
}

.clue-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.clue-footer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.footer-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--action);
}

.clue-answer-tag {
  display: none;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--action);
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
}

body.teacher-mode-active .clue-answer-tag {
  display: inline-block;
}

/* Tactile Flip Button */
.btn-flip-word {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--action);
  border: 1px solid var(--action-hover);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 140ms ease;
  user-select: none;
}

.btn-flip-word:hover {
  background: var(--action-hover);
}

.btn-flip-word:active {
  transform: translateY(1px);
}

.btn-flip-icon {
  display: inline-flex;
  align-items: center;
}

.btn-flip-kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.6rem;
  font-weight: 750;
  color: #0f172a;
}

/* Quick Actions Strip */
.clues-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.btn-editorial-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.btn-editorial-action:hover {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--muted);
}

.btn-editorial-action:active {
  transform: translateY(1px);
}

.action-kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
}

/* Classroom FX Console (Tactile Studio) */
.classroom-fx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-lg, 12px);
  background: var(--surface-muted, #FAF9F6);
  border: 1.5px solid var(--border, #E7E5E4);
  margin-top: 18px;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fx-bar-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--action, #C2410C);
  font-weight: 800;
  flex-shrink: 0;
}

.fx-bar-lead svg {
  stroke: var(--action, #C2410C);
  flex-shrink: 0;
}

.fx-bar-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-secondary, #44403C);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fx-buttons-deck {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.fx-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink, #1C1917);
  background: #FFFFFF;
  border: 1.5px solid var(--border, #E7E5E4);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
  transition: all 0.15s ease-out;
  user-select: none;
}

.fx-btn:hover {
  border-color: var(--border-hover, #D6D3D1);
  background: #FAFAFA;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(28, 25, 23, 0.08);
}

.fx-btn:active {
  transform: translateY(1.5px);
  box-shadow: 0 0 1px rgba(28, 25, 23, 0.12);
}

.fx-btn:focus-visible {
  outline: 2px solid var(--action, #C2410C);
  outline-offset: 2px;
}

.fx-btn--applause:hover {
  border-color: #F97316;
  color: #C2410C;
}

.fx-btn--drumroll:hover {
  border-color: #EAB308;
  color: #854D0E;
}

.fx-btn--confetti:hover {
  border-color: #10B981;
  color: #047857;
}

.fx-btn--fanfare:hover {
  border-color: #3B82F6;
  color: #1D4ED8;
}

.fx-btn-label {
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.fx-kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 750;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #F5F5F4;
  color: #78716C;
  border: 1px solid #D6D3D1;
  line-height: 1.3;
}

.fx-btn:hover .fx-kbd {
  background: #E7E5E4;
  color: #44403C;
  border-color: #A8A29E;
}

.class-telemetry {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--canvas-pearl);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.class-telemetry strong {
  color: var(--ink);
}

.app-footer {
  width: 100%;
  background: #ffffff;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 14px 0;
}

.app-footer__inner {
  width: min(100% - 40px, 1480px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--canvas-pearl);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--action);
}

.footer-hotkeys {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotkey-badge kbd {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--canvas-pearl);
  border: 1px solid var(--line-strong);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  margin-right: 3px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--action);
}

/* --------------------------------------------------------------------------
   Classroom Modals (Cài đặt, Trợ giúp, Kết thúc)
   -------------------------------------------------------------------------- */
.classroom-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.classroom-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.classroom-modal {
  width: min(100%, 520px);
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  transform: scale(0.95) translateY(10px);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.classroom-modal-backdrop.is-open .classroom-modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--canvas-pearl);
  color: var(--ink);
}

.modal-body {
  padding: 22px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--canvas-pearl);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.setting-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.help-shortcut-list {
  display: grid;
  gap: 10px;
}

.help-shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.help-desc {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

.end-summary-lead {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.end-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.end-stat-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--canvas-pearl);
  border: 1px solid var(--line);
}

.end-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.end-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Responsive & Accessibility (@media rules strictly tested)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .source-grid,
  .game-layout,
  .game-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-nav {
    display: none;
  }

  .classroom-fx-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .game-stage-grid {
    height: auto;
  }

  .arena-stage-box {
    height: auto;
    min-height: 0;
  }

  .grid-container.grid-board-pattern {
    flex: 0 0 auto;
    min-height: 540px;
  }

  .fx-buttons-deck {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .source-action .btn {
    width: auto;
  }

  .step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-header__inner,
  .app-shell {
    width: min(100% - 24px, 1480px);
  }

  .app-header__inner,
  .page-intro,
  .section-heading,
  .game-heading,
  .game-toolbar {
    align-items: flex-start;
  }

  .role-label {
    display: none;
  }

  .page-intro,
  .section-heading,
  .game-heading {
    flex-direction: column;
  }

  .app-shell {
    padding-top: 20px;
  }

  .step-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .crossword-container,
  .grid-container {
    height: 60vh;
    min-height: 380px;
    padding: 16px;
  }

  .game-toolbar__actions,
  .game-toolbar__actions .btn,
  .source-action .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   CINEMA FOCUS STAGE — PRESENTATION & FULLSCREEN OPTIMIZATION
   ========================================================================== */

/* Spotlight Active Clue Card (Default: Hidden in standard view) */
.cinema-spotlight-card {
  display: none;
}

/* Floating Presentation HUD Toolbar (Default: Hidden in standard view) */
.cinema-floating-hud {
  display: none;
}

/* Active Presentation Mode State */
body.presentation-mode {
  overflow: hidden !important;
  background: #030712 !important;
}

body.presentation-mode .app-header,
body.presentation-mode .arena-hero,
body.presentation-mode .clues-panel,
body.presentation-mode .classroom-fx-bar,
body.presentation-mode .app-footer,
body.presentation-mode .classroom-reaction-hud,
body.presentation-mode .arena-legend-strip {
  display: none !important;
}

body.presentation-mode .app-shell {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.presentation-mode .game-stage-grid {
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}

body.presentation-mode .arena-stage-box {
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #070b14 !important;
  box-shadow: none !important;
}

body.presentation-mode .arena-ctrl-bar {
  padding: 10px 24px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0;
}

body.presentation-mode .grid-container {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: radial-gradient(ellipse at center, #111827 0%, #030712 100%) !important;
}

/* Cinema Spotlight Clue Card Active View */
body.presentation-mode .cinema-spotlight-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xl);
  padding: 12px 22px;
  margin: 10px 22px 0 22px;
  flex-shrink: 0;
  z-index: 40;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: cinemaFadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spotlight-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Question Selector Pills Bar in Spotlight Card */
.cinema-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.pills-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.btn-pill-scroll {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-pill-scroll:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-pill-scroll:active {
  transform: scale(0.95);
}

.cinema-pills-container {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 2px 0;
}

.cinema-pills-container::-webkit-scrollbar {
  display: none;
}

.cinema-pills-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.cinema-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.cinema-pill:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.cinema-pill.is-active {
  background: #1d4ed8 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35) !important;
  transform: scale(1.04);
}

.cinema-pill.is-solved {
  background: #065f46 !important;
  border-color: #10b981 !important;
  color: #ecfdf5 !important;
}

.cinema-pill.is-solved.is-active {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6), 0 0 0 2px #38bdf8 !important;
}

.cinema-pill .pill-dir {
  font-size: 0.68rem;
  opacity: 0.75;
  font-weight: 700;
}

.cinema-pill .pill-check-icon {
  width: 12px;
  height: 12px;
  color: #a7f3d0;
}

.spotlight-drawer-toggle-wrap {
  flex-shrink: 0;
}

.btn-cinema-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-cinema-drawer-toggle:hover {
  background: rgba(37, 99, 235, 0.35);
  color: #ffffff;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

@keyframes cinemaFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spotlight-left {
  flex: 1 1 auto;
  min-width: 0;
}

.spotlight-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spotlight-num-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 9999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.spotlight-meta-badge {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}

.spotlight-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.spotlight-status-tag.is-solved {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.32);
}

.spotlight-clue-text {
  margin: 6px 0 0 0;
  color: #f8fafc;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.spotlight-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-spotlight-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  height: 40px;
  min-width: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-spotlight-nav:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: #FFFFFF;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.btn-spotlight-nav:active {
  transform: translateY(1px) scale(0.97);
}

.btn-spotlight-nav svg {
  stroke-width: 3;
  color: #FFFFFF;
  flex-shrink: 0;
}

.spotlight-nav-text {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.btn-spotlight-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(2, 132, 199, 0.22);
  color: #38bdf8;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-spotlight-hint:hover {
  background: rgba(2, 132, 199, 0.35);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-spotlight-flip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #f59e0b;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all var(--transition-fast);
}

.btn-spotlight-flip:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.btn-spotlight-flip:active {
  transform: translateY(0.5px) scale(0.97);
}

.btn-spotlight-flip.is-solved {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
  cursor: default;
  box-shadow: none;
}

/* Floating Presentation HUD Toolbar Active View */
body.presentation-mode .cinema-floating-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 8px 18px;
  border-radius: 9999px;
  z-index: 1000;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.presentation-mode .cinema-floating-hud.is-dimmed {
  opacity: 0.28;
}

body.presentation-mode .cinema-floating-hud:hover,
body.presentation-mode .cinema-floating-hud:focus-within {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(-2px);
}

.cinema-hud-session,
.cinema-hud-controls,
.cinema-hud-exit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cinema-hud-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 4px;
}

.cinema-hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cinema-hud-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1.5px) scale(1.04);
}

.cinema-hud-btn:active {
  transform: translateY(0.5px) scale(0.96);
}

.cinema-hud-btn .hud-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 800;
}

.cinema-btn-session {
  padding: 0 14px;
}

.cinema-btn-session.btn-session-start {
  background: #065f46;
  border-color: #10b981;
  color: #ecfdf5;
}

.cinema-btn-session.btn-session-end {
  background: #881337;
  border-color: #f43f5e;
  color: #fff1f2;
}

.cinema-telemetry-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cinema-sep {
  color: rgba(255, 255, 255, 0.3);
}

.cinema-btn-exit {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0 14px;
}

.cinema-btn-exit:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

/* High-Contrast Cell Enhancements during Presentation */
body.presentation-mode .cw-cell.letter-cell {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

body.presentation-mode .cw-cell.letter-cell.revealed {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  border-color: #fde68a !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  font-size: 1.45rem !important;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4) !important;
}

body.presentation-mode .cw-cell.letter-cell.active-word {
  border: 2px solid var(--cell-active-border) !important;
  box-shadow: 0 0 0 3px var(--cell-active-border), 0 6px 18px rgba(37, 99, 235, 0.35) !important;
}

/* Slide-out Clue Drawer (Presentation Mode) */
.cinema-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cinema-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cinema-clue-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(28px);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: -14px 0 45px rgba(0, 0, 0, 0.8);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cinema-clue-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.cinema-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.4);
}

.cinema-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #38bdf8;
}

.cinema-drawer-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.cinema-drawer-badge {
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 700;
}

.btn-cinema-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cinema-drawer-close:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fca5a5;
  transform: scale(1.05);
}

.cinema-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cinema-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cinema-drawer-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.cinema-drawer-item:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1.5px);
}

.cinema-drawer-item.is-active {
  background: rgba(30, 58, 138, 0.65) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35) !important;
}

.cinema-drawer-item.is-solved {
  border-left: 4px solid #10b981;
}

.cinema-drawer-item.is-active.is-solved {
  border-left: 4px solid #38bdf8;
}

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

.drawer-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-item-num {
  font-weight: 800;
  font-size: 0.85rem;
  color: #38bdf8;
}

.drawer-item-meta {
  font-size: 0.76rem;
  color: #94a3b8;
}

.drawer-item-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.drawer-item-status.is-solved {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.drawer-item-status.is-unsolved {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.drawer-item-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #f1f5f9;
}

/* Classroom Toast Notifications */
.classroom-toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

body.presentation-mode .classroom-toast-container {
  bottom: 86px;
  right: 24px;
}

.classroom-toast {
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.classroom-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.classroom-toast.success {
  border-color: #10b981;
  color: #ecfdf5;
  background: rgba(6, 95, 70, 0.95);
}

.classroom-toast.warning {
  border-color: #f59e0b;
  color: #fef3c7;
  background: rgba(180, 83, 9, 0.95);
}

/* ==========================================================================
   ADMIN & TEACHER STUDIO STYLING (TACTILE STUDIO - BENTO WORKSPACE)
   - Unified with Student Arena Design System
   - High-contrast, editorial typography & tactile components
   ========================================================================== */

.admin-page {
  background-color: var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
}

/* Header link to student arena */
.btn-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-header-link:hover {
  color: var(--action);
  border-color: var(--action-border);
  background: var(--action-subtle);
  transform: translateY(-1px);
}

/* Admin Editorial Masthead */
.admin-masthead {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.admin-masthead__lead {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--action);
  margin-bottom: 6px;
}

.admin-masthead__title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.admin-masthead__desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Stepper 4 bước (Interactive Progress Trail) */
.admin-stepper-wrap {
  margin-bottom: 28px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 768px) {
  .step-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.step-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.step-list__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: var(--page-bg);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.step-list li.is-current {
  background: var(--surface-active);
  border-color: var(--action);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.step-list li.is-current .step-list__number {
  background: var(--action);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.35);
}

/* Bento Workspace Layout */
.workspace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  padding: 30px 32px;
  margin-bottom: 28px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.workspace-card:hover {
  border-color: var(--line-strong);
}

.workspace-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.workspace-card__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px 0;
}

.workspace-card__desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* Mode Tabs - Tactile Pill Style */
.mode-tabs-wrap {
  margin-bottom: 24px;
}

.mode-tabs.nav-tabs {
  border-bottom: 2px solid var(--line);
  gap: 8px;
}

.mode-tabs .nav-link {
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 0.94rem;
  background: transparent;
  border-radius: 0;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.mode-tabs .nav-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.mode-tabs .nav-link.active {
  color: var(--action);
  border-bottom: 2px solid var(--action);
  background: transparent;
}

/* Source Panel & Bento 2-Column Grid */
.source-bento-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 992px) {
  .source-bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-subcard {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  min-height: 540px;
}

.bento-subcard--keywords {
  background: #fafaf9;
  padding: 26px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

.pedagogy-tip-box {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.bento-subcard__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.bento-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--attention-light);
  color: var(--attention);
  font-weight: 800;
  font-size: 0.84rem;
  padding: 3px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

/* Keyword Selection Area */
.keyword-checkbox-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
}

.keyword-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.keyword-tools .btn-sm {
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* 3a: Inner Canvas Panel - Bảng chọn từ vựng Studio nền trắng viền mượt */
.keyword-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 2a: Chống bè ngang dòng cuối */
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  background: #ffffff; /* 3a: Nền trắng sạch sẽ */
  border: 1.5px solid var(--line); /* 3a: Viền hairline Studio */
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(28, 25, 23, 0.02);
  align-content: start;
}

.keyword-list::-webkit-scrollbar {
  width: 6px;
}
.keyword-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.keyword-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

/* 2a: Thẻ từ khóa bên trong tỷ lệ vàng */
.keyword-list .form-check {
  display: flex;
  align-items: center;
  background: #fafaf9; /* Nền xám nhạt nổi bật trên canvas trắng */
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 40px;
  min-height: 50px;
  width: 100%;
  margin: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.keyword-list .form-check:hover {
  background: #ffffff;
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(28, 25, 23, 0.06);
}

.keyword-list .form-check:has(.form-check-input:checked) {
  background: var(--action-subtle);
  border-color: var(--action);
  box-shadow: 0 0 0 1px var(--action);
}

.keyword-list .form-check-input {
  cursor: pointer;
  margin-left: -26px;
  margin-top: 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.keyword-list .form-check-input:checked {
  background-color: var(--action);
  border-color: var(--action);
}

.keyword-list .form-check-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  display: block;
  width: 100%;
  margin-left: 8px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

/* Primary Form Controls */
.form-select, .form-control {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  background-color: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus, .form-control:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.field-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 6px;
  display: block;
}

.field-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Action CTA Buttons */
.btn-studio-primary {
  background: var(--action);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.96rem;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-studio-primary:hover {
  background: var(--action-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-studio-primary:disabled {
  background: var(--muted-light);
  cursor: not-allowed;
  transform: none;
}

/* Review Stage (Bảng Duyệt Gợi Ý AI) */
.review-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 28px;
}

.review-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 520px;
  margin-bottom: 20px;
}

.review-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.review-table-wrap::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.review-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.review-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-muted);
  z-index: 5;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.review-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.word-row {
  transition: background var(--transition-fast);
}

.word-row.status-approved {
  background: var(--surface);
  border-left: 4px solid var(--success);
}

.word-row.status-rejected {
  background: var(--surface-muted);
  border-left: 4px solid var(--danger);
  opacity: 0.65;
}

.review-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.review-actions .btn {
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.col-fact-sgk {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.fact-box {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #14532d;
  line-height: 1.4;
}

.sgk-box {
  background: var(--attention-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.4;
}

.col-ai-clue {
  min-width: 280px;
}

.final-clue.form-control {
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--surface);
}

.review-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Stage 3 & 4: Game Preview Stage */
.game-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.game-toolbar__actions {
  display: flex;
  gap: 10px;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.game-panel, .clues-panel {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}

.game-heading {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.game-heading h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

/* Crossword Board Canvas in Admin */
.admin-page .crossword-container {
  background: var(--canvas-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.admin-page .crossword-table {
  border-collapse: collapse;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.admin-page .crossword-cell {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  position: relative;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  background: #ffffff;
  user-select: none;
}

.admin-page .crossword-cell:not(.cell-filled) {
  background: #292524;
  border-color: #44403c;
}

.admin-page .crossword-cell.cell-filled {
  background: #ffffff;
}

.admin-page .cell-number {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

/* Clue list preview */
.clue-group {
  margin-bottom: 16px;
}

.clue-type-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--action);
  margin-bottom: 8px;
}

.admin-page .clue-list .list-group-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  padding: 8px 12px;
  transition: all var(--transition-fast);
}

.admin-page .admin-clue-item:hover {
  background: var(--surface-active);
  border-color: var(--action-border);
}

.admin-page .admin-clue-item.is-active-clue {
  background: var(--surface-active) !important;
  border-left: 4px solid var(--action) !important;
  color: var(--action-dark);
  font-weight: 700;
}

/* Status Messages */
.status-message {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 16px;
  background: var(--action-subtle);
  border: 1px solid var(--action-border);
  color: var(--action-dark);
}

.status-message.is-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #14532d;
}

.status-message.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #7f1d1d;
}

.status-link {
  color: var(--action);
  font-weight: 700;
  text-decoration: underline;
  margin-left: 6px;
}
