/* NumberTrove page shell */
.times-table-page{display:block;min-height:100vh;padding:0;background:var(--paper);font-family:var(--sans);color:var(--ink)}
.times-table-page .site-header{font-family:var(--sans);display:flex;box-sizing:border-box;justify-content:flex-start;width:100%;height:76px;padding:0 max(24px,calc((100vw - 1160px)/2));background:rgba(247,245,239,.92);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.times-table-page .site-header .brand{display:flex;align-items:center;min-width:215px}.times-table-page .site-header .brand-logo{width:215px;height:auto}.times-table-page .main-nav{display:flex;gap:27px;margin-left:auto;align-items:center}.times-table-page .main-nav a{color:var(--muted);font:13px var(--sans);text-decoration:none}.times-table-page .main-nav a:hover{color:var(--green)}.times-table-page .header-search{width:36px;height:36px;margin-left:27px;display:grid;place-items:center;border-radius:50%;background:var(--green);color:var(--white);font-size:18px;text-decoration:none}
.times-table-intro{display:grid;grid-template-columns:1fr 360px;align-items:center;gap:40px;padding-top:72px;padding-bottom:42px}.times-table-intro h1{font:600 clamp(44px,6vw,72px)/.98 var(--display);letter-spacing:-.08em;margin:0 0 20px}.times-table-intro h1 em{font-style:normal;color:var(--green)}.times-table-intro p:not(.eyebrow){max-width:510px;color:var(--muted);font-size:17px}.back-link{display:inline-block;margin-top:22px;color:var(--green);font:600 13px var(--sans);text-decoration:none}.times-table-mark{height:260px;position:relative;display:grid;place-items:center;border:1px solid rgba(8,107,87,.16);border-radius:50%;background:radial-gradient(circle at 50% 50%,rgba(217,233,220,.85),rgba(247,245,239,0) 68%);transform:rotate(7deg)}.times-table-mark:before,.times-table-mark:after{content:'';position:absolute;border:1px solid rgba(8,107,87,.16);border-radius:50%;inset:22px;transform:rotate(28deg)}.times-table-mark:after{inset:48px;transform:rotate(-17deg)}.times-table-mark span,.times-table-mark b{position:absolute;color:var(--green);font:600 28px var(--display)}.times-table-mark span:first-child{top:24px;left:24%}.times-table-mark span:nth-child(3){right:20%;bottom:24%}.times-table-mark b{right:19%;top:25%;font-size:24px}.times-table-mark strong{z-index:1;color:var(--green-deep);font:600 76px var(--display);letter-spacing:-.1em}.times-table-shell{padding-bottom:90px}.times-table-shell #app{width:100%}.times-table-shell .game{width:min(600px,100%);max-width:none;margin:0 auto;border:1px solid var(--line);border-radius:14px;padding:32px 28px;box-shadow:var(--shadow)}.times-table-shell .app-title{font-family:var(--display)}
@media(max-width:800px){.times-table-page .site-header{height:64px;padding:0 20px}.times-table-page .site-header .brand{min-width:0}.times-table-page .site-header .brand-logo{width:190px}.times-table-page .main-nav{display:none}.times-table-page .main-nav.mobile-open{display:flex;position:absolute;top:63px;left:16px;right:16px;padding:8px;background:rgba(255,254,250,.98);border:1px solid var(--line);border-radius:0 0 10px 10px;box-shadow:var(--shadow);flex-direction:column;gap:0}.times-table-page .main-nav.mobile-open a{padding:13px 14px;border-bottom:1px solid var(--line)}.times-table-page .main-nav.mobile-open a:last-child{border-bottom:0}.times-table-page .header-search{margin-left:auto}.times-table-intro{grid-template-columns:1fr;padding-top:50px}.times-table-mark{order:-1;height:200px}.times-table-intro p:not(.eyebrow){font-size:15px}.times-table-shell{padding-bottom:70px}}

/* ═══════════════════════════════════════════════════════
   TIME TABLE PRACTICE — KID-FRIENDLY STYLES
   Palette: Coral #FF6B6B · Mint #4ECB71 · Sunshine #FFD93D
   Sky Blue #4DA8DA · Lavender #A78BFA · Warm neutrals
   ═══════════════════════════════════════════════════════ */

.hidden { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; }

.times-table-page {
  font-family: 'Fredoka', sans-serif;
  min-height: 100vh;
  display: block;
  background: var(--paper);
  padding: 0;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Game Container ── */
.game {
  background: white;
  border-radius: 32px;
  padding: 32px 28px;
  width: 600px;
  max-width: 94vw;
  box-shadow: 0 12px 48px rgba(107, 80, 180, 0.12), 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* ── Title ── */
.app-title {
  font-size: 28px;
  color: #2D3436;
  margin-bottom: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.title-icon {
  color: #FF6B6B;
  font-size: 32px;
}
.title-text {
  background: linear-gradient(135deg, #FF6B6B, #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Exercise Mode Toggle ── */
.exercise-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.exercise-mode-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 22px;
  border: 2px solid #E0E0E0;
  border-radius: 14px;
  background: white;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}
.exercise-mode-btn.active[data-mode="addition"] {
  border-color: #FF6B6B;
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  color: white;
  box-shadow: 0 3px 12px rgba(255, 107, 107, 0.3);
}
.exercise-mode-btn.active[data-mode="subtraction"] {
  border-color: #4ECB71;
  background: linear-gradient(135deg, #4ECB71, #6BE090);
  color: white;
  box-shadow: 0 3px 12px rgba(78, 203, 113, 0.3);
}
.exercise-mode-btn.active[data-mode="multiplication"] {
  border-color: #A78BFA;
  background: linear-gradient(135deg, #A78BFA, #C4B5FD);
  color: white;
  box-shadow: 0 3px 12px rgba(167, 139, 250, 0.3);
}
.exercise-mode-btn:hover:not(.active) {
  border-color: #D0D0D0;
  background: #F8F8F8;
  transform: scale(1.03);
}

/* ── Setup Section ── */
.setup-section {
  background: #F8F9FE;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}
.setup-label {
  font-size: 18px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

/* ── Table Pick Grid ── */
.table-pick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.table-pick-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  font-weight: 700;
  padding: 14px 8px;
  border: 3px solid #E0E0E0;
  border-radius: 16px;
  background: white;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-pick-btn:hover {
  border-color: #4DA8DA;
  background: #F0F8FF;
  transform: scale(1.05);
}
.table-pick-btn.selected {
  border-color: #FF6B6B;
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
  transform: scale(1.05);
}
.table-pick-btn.selected:hover {
  border-color: #FF6B6B;
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
}

/* ── Pick Mode Toggle ── */
.pick-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.pick-mode-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pick-mode-btn.active {
  border-color: #A78BFA;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.3);
}
.pick-mode-btn:hover:not(.active) {
  border-color: #B89DF0;
  color: #A78BFA;
}

/* ── Toggle Switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #E8E8E8;
}
.toggle-row label:first-child {
  font-size: 14px;
  margin: 0;
  color: #666;
}
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #D0D0D0;
  transition: 0.3s;
  border-radius: 28px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #4ECB71, #6BE090);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* ── Carry-over Row ── */
.toggle-row.carry-over-row {
  border-top: 2px dashed #FFF3E0;
}

/* ── Start Button ── */
.start-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #4ECB71, #45B863);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 6px 20px rgba(78, 203, 113, 0.3);
  letter-spacing: 0.5px;
}
.start-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(78, 203, 113, 0.4);
}
.start-btn:active:not(:disabled) {
  transform: translateY(0);
}
.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Max Number Row ── */
.max-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #E8E8E8;
}
.max-number-label {
  font-size: 14px;
  color: #666;
  font-weight: 600;
}
.max-number-input {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 600;
  width: 90px;
  padding: 8px 12px;
  border: 2px solid #A78BFA;
  border-radius: 12px;
  background: white;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.max-number-input::-webkit-outer-spin-button,
.max-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.max-number-input:focus {
  border-color: #FF6B6B;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* ── Active Session ── */
.active-session {
  margin-bottom: 24px;
}

/* ── HUD ── */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #F8F9FE, #F0F4FF);
  border-radius: 16px;
  border: 2px solid #E8ECFF;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; }
.hud-level { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.lvl-badge {
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.25);
}
.xp-bar-wrap {
  width: 70px;
  height: 10px;
  background: #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
}
.xp-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4ECB71, #6BE090);
  border-radius: 10px;
  transition: width 0.5s ease;
}
.xp-text { font-size: 11px; color: #888; font-weight: 600; }
.hud-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  color: #E65100;
  box-shadow: 0 2px 6px rgba(255, 165, 0, 0.2);
}
.streak-emoji { font-size: 18px; }
.streak-num { font-size: 15px; }
.hud-pet { font-size: 28px; line-height: 1; cursor: default; }
.pet-emoji { transition: transform 0.3s; display: inline-block; }
.pet-happy { animation: petBounce 1s ease-in-out infinite; }
.pet-sad { filter: grayscale(0.3); }
@keyframes petBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Combo Meter ── */
.combo-meter {
  text-align: center;
  margin: -4px 0 12px;
  animation: comboPopIn 0.3s ease;
}
.combo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B6B, #FFD93D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes comboPopIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Boss HUD ── */
.boss-hud {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 20px;
  padding: 14px 18px;
  margin-bottom: 12px;
  color: white;
  border: 2px solid #2a2a4e;
}
.boss-hp-row, .player-hp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}
.boss-emoji { font-size: 26px; }
.boss-name { font-weight: 700; font-size: 15px; min-width: 100px; }
.hp-bar-wrap {
  flex: 1;
  height: 14px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
}
.hp-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}
.hp-boss { width: 100%; background: linear-gradient(90deg, #FF6B6B, #E74C3C); }
.hp-player { width: 100%; background: linear-gradient(90deg, #4ECB71, #45B863); }
.hp-text { font-size: 12px; font-weight: 600; min-width: 60px; text-align: right; }

/* ── Speed HUD ── */
.speed-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #4DA8DA, #6BB8E8);
  color: white;
  padding: 12px 18px;
  border-radius: 16px;
  margin-bottom: 12px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(77, 168, 218, 0.3);
}
.speed-timer {
  font-size: 30px;
  transition: color 0.3s;
}
.speed-timer.speed-danger {
  color: #FFD93D;
  animation: pulse 0.5s ease-in-out infinite;
}
.speed-score { font-size: 18px; }

/* ── Session Header ── */
.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.progress {
  font-size: 14px;
  color: #888;
  font-weight: 600;
  margin: 0;
}
.end-session-btn {
  padding: 10px 18px;
  background: #FF6B6B;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Fredoka', sans-serif;
}
.end-session-btn:hover {
  background: #E74C3C;
  transform: translateY(-1px);
}

/* ── Timer ── */
.timer-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.timer {
  font-size: 28px;
  font-weight: 700;
  color: white;
  padding: 10px 28px;
  border-radius: 50px;
  box-shadow: 0 6px 16px rgba(78, 203, 113, 0.3);
  transition: all 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
  min-width: 120px;
  background: linear-gradient(135deg, #4ECB71, #45B863);
}
.timer.warning {
  background: linear-gradient(135deg, #FFD93D, #FFA500);
  box-shadow: 0 6px 16px rgba(255, 217, 61, 0.4);
}
.timer.danger {
  background: linear-gradient(135deg, #FF6B6B, #E74C3C);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
  animation: pulse 0.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ── Problem Display ── */
.problem {
  font-size: 72px;
  font-weight: 700;
  color: #2D3436;
  margin: 12px 0 20px;
  letter-spacing: 3px;
}
.problem .op { color: #A78BFA; margin: 0 14px; }
.problem .eq { color: #CCC; margin: 0 10px; }
.problem .shak {
  animation: shake 0.5s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-12px); }
  20%, 40%, 60%, 80% { transform: translateX(12px); }
}
.problem.bounce {
  animation: bounce 0.6s ease;
}
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15); }
  50% { transform: scale(0.92); }
  70% { transform: scale(1.08); }
}

/* ── Input Row ── */
.input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.input-row input {
  flex: 1 1 0;
  min-width: 0;
  font-size: 36px;
  padding: 16px 20px;
  border: 4px solid #E0E0E0;
  border-radius: 18px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  -moz-appearance: textfield;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  background: #FAFAFA;
}
.input-row input::-webkit-outer-spin-button,
.input-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-row input:focus {
  border-color: #A78BFA;
  background: white;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
  transform: scale(1.02);
}
.input-row input.correct {
  border-color: #4ECB71;
  background: #F0FFF4;
  box-shadow: 0 0 0 4px rgba(78, 203, 113, 0.15);
}
.input-row input.wrong {
  border-color: #FF6B6B;
  background: #FFF5F5;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}
.input-row button {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
  padding: 16px 24px;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
  min-height: 48px;
}
.input-row button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(167, 139, 250, 0.4);
}
.input-row button:active { transform: translateY(0); }
.input-row button:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ── Feedback ── */
.feedback {
  font-size: 22px;
  font-weight: 600;
  min-height: 36px;
  margin-bottom: 12px;
}
.feedback.correct { color: #4ECB71; }
.feedback.wrong { color: #FF6B6B; }

/* ── Stats ── */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 18px;
  color: #666;
  font-weight: 600;
}
.stats span { font-weight: 700; color: #2D3436; }

/* ── Next Button ── */
.next-btn {
  font-size: 20px;
  padding: 16px 48px;
  background: linear-gradient(135deg, #4ECB71, #45B863);
  color: white;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
  display: none;
  margin: 0 auto;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 6px 18px rgba(78, 203, 113, 0.3);
  min-height: 48px;
}
.next-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(78, 203, 113, 0.4);
}
.next-btn:active { transform: translateY(0); }
.show { display: inline-block !important; }

/* ── Confetti ── */
.confetti {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-radius: 3px;
}

/* ── Achievement Toast ── */
.achievement-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: linear-gradient(135deg, #FFD93D, #FFC83D);
  color: #333;
  padding: 16px 32px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 20px;
  z-index: 3000;
  box-shadow: 0 8px 32px rgba(255, 217, 61, 0.4);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  border: 3px solid #FFE082;
}
.achievement-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Game Panel ── */
.game-panel {
  margin-top: 24px;
  border-top: 3px solid #F0F0F0;
  padding-top: 20px;
}
.panel-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.panel-tabs button {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  border: 2px solid #E8E8E8;
  border-radius: 14px;
  background: white;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.panel-tabs button.active {
  border-color: #A78BFA;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  box-shadow: 0 3px 12px rgba(167, 139, 250, 0.25);
}
.panel-tabs button:hover:not(.active) {
  border-color: #D0D0D0;
  background: #F8F8F8;
}
.panel-content {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Quest Card ── */
.quest-card {
  background: linear-gradient(135deg, #F0F8FF, #E8F4FD);
  border-radius: 20px;
  padding: 20px;
  border: 2px solid #D0E8F8;
}
.quest-card h4 { font-size: 18px; color: #2D3436; margin-bottom: 10px; }
.quest-desc { font-size: 15px; color: #666; margin-bottom: 12px; }
.quest-progress-bar {
  height: 12px;
  background: #D0E8F8;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.quest-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4ECB71, #6BE090);
  border-radius: 10px;
  transition: width 0.5s ease;
}
.quest-status { font-size: 15px; font-weight: 700; color: #4ECB71; }

/* ── Boss Card ── */
.boss-card {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 20px;
  padding: 20px;
  color: white;
  border: 2px solid #2a2a4e;
}
.boss-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.boss-card-emoji { font-size: 48px; }
.boss-card-header h4 { margin: 0; font-size: 20px; }
.boss-subtitle { font-size: 14px; color: #888; }
.boss-desc { font-size: 14px; color: #AAA; margin-bottom: 14px; line-height: 1.4; }
.boss-btn {
  background: linear-gradient(135deg, #FF6B6B, #E74C3C) !important;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

/* ── Speed Card ── */
.speed-card {
  background: linear-gradient(135deg, #4DA8DA, #6BB8E8);
  border-radius: 20px;
  padding: 20px;
  color: white;
  box-shadow: 0 4px 16px rgba(77, 168, 218, 0.3);
}
.speed-card h4 { font-size: 18px; margin-bottom: 8px; }
.speed-desc { font-size: 14px; opacity: 0.9; margin-bottom: 10px; }
.speed-record { font-size: 14px; font-weight: 600; margin-bottom: 14px; opacity: 0.9; }

/* ── Collection Card ── */
.collection-card { background: linear-gradient(135deg, #F8F9FE, #F0F4FF); border-radius: 20px; padding: 20px; border: 2px solid #E8ECFF; }
.pet-section { margin-bottom: 24px; }
.pet-section h4 { font-size: 18px; color: #2D3436; margin-bottom: 10px; }
.pet-display {
  display: flex;
  align-items: center;
  gap: 20px;
}
.pet-large { font-size: 64px; line-height: 1; }
.pet-bounce { animation: petBounce 1s ease-in-out infinite; }
.pet-info { flex: 1; }
.pet-status { font-weight: 700; font-size: 18px; color: #2D3436; margin-bottom: 8px; }
.pet-happiness-bar {
  height: 14px;
  background: #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.pet-happiness-fill {
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, #FFD93D, #4ECB71);
  border-radius: 10px;
  transition: width 0.5s ease;
}
.pet-feed-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFD93D, #FFC83D);
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(255, 217, 61, 0.3);
  min-height: 44px;
}
.pet-feed-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(255, 217, 61, 0.4); }
.achievements-section h4 { font-size: 18px; color: #2D3436; margin-bottom: 14px; }
.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.achievement-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.achievement-badge.unlocked {
  background: #F0FFF4;
  color: #2D3436;
  border: 2px solid #C8E6C9;
}
.achievement-badge.locked {
  background: #F8F8F8;
  color: #CCC;
  border: 2px solid #E8E8E8;
}
.ach-icon { font-size: 22px; }
.ach-name { line-height: 1.2; }

/* ── Tool Group ── */
.tool-group {
  background: #FAFAFA;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  border: 2px solid #F0F0F0;
}
.tool-group h4 { font-size: 16px; color: #555; font-weight: 600; margin: 0 0 14px; }
.tool-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Fredoka', sans-serif;
  margin-top: 10px;
  box-shadow: 0 3px 10px rgba(167, 139, 250, 0.2);
  min-height: 44px;
}
.tool-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(167, 139, 250, 0.3);
}
.tool-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.tool-btn.secondary {
  background: linear-gradient(135deg, #4ECB71, #45B863);
  box-shadow: 0 3px 10px rgba(78, 203, 113, 0.2);
}
.tool-btn.exam {
  background: linear-gradient(135deg, #FF6B6B, #E74C3C);
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.2);
}
.exam-time-select {
  font-size: 16px;
  padding: 8px 12px;
  border: 2px solid #A78BFA;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  outline: none;
}

/* ── History ── */
.history-section {
  margin-top: 24px;
  border-top: 3px solid #F0F0F0;
  padding-top: 16px;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.history-header h3 {
  font-size: 16px;
  color: #888;
  font-weight: 600;
  margin: 0;
}
.history-header .arrow {
  font-size: 14px;
  color: #CCC;
  transition: transform 0.2s;
}
.history-header .arrow.open {
  transform: rotate(180deg);
}
.history-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.history-list.open {
  max-height: 400px;
  overflow-y: auto;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  color: #555;
  font-weight: 600;
}
.history-item:nth-child(odd) { background: #FAFAFA; }
.history-item .h-result { font-weight: 700; }
.history-item .h-result.good { color: #4ECB71; }
.history-item .h-result.bad { color: #FF6B6B; }
.history-item .h-time { color: #999; font-size: 13px; }
.clear-btn {
  font-size: 13px;
  color: #CCC;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}
.clear-btn:hover { color: #FF6B6B; }
.empty-history {
  font-size: 14px;
  color: #CCC;
  padding: 12px 0;
  font-weight: 600;
}

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}
.overlay.show {
  display: flex;
}

/* ── Result Card ── */
.result-card {
  background: white;
  border-radius: 32px;
  padding: 40px;
  width: 480px;
  max-width: 92vw;
  text-align: center;
  animation: slideUp 0.4s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.result-card h2 {
  font-size: 32px;
  color: #2D3436;
  margin-bottom: 12px;
}
.result-card .grade {
  font-size: 80px;
  font-weight: 700;
  margin: 16px 0;
  animation: bounceIn 0.6s ease 0.3s both;
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.grade.excellent { color: #4ECB71; }
.grade.good { color: #FFD93D; }
.grade.okay { color: #FFA500; }
.grade.needs-work { color: #FF6B6B; }
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.stat-box {
  background: linear-gradient(135deg, #F8F9FE, #F0F4FF);
  border-radius: 18px;
  padding: 18px;
  border: 2px solid #E8ECFF;
}
.stat-box .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #2D3436;
}
.stat-box .stat-label {
  font-size: 13px;
  color: #888;
  font-weight: 600;
  margin-top: 4px;
}
.restart-btn {
  font-size: 20px;
  padding: 16px 48px;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
  font-family: 'Fredoka', sans-serif;
  margin-top: 12px;
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.3);
  min-height: 48px;
}
.restart-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(167, 139, 250, 0.4); }

/* ── Custom Print Card ── */
.custom-print-card {
  background: white;
  border-radius: 32px;
  padding: 32px;
  width: 440px;
  max-width: 92vw;
  text-align: center;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.custom-print-card h2 {
  font-size: 26px;
  color: #2D3436;
  margin-bottom: 16px;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.table-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.2s;
}
.table-grid label:hover { background: #F0F4FF; }
.table-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #A78BFA;
  cursor: pointer;
}
.selection-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px;
}
.selection-actions button {
  font-size: 14px;
  padding: 8px 18px;
  border: 2px solid #A78BFA;
  border-radius: 12px;
  background: white;
  color: #A78BFA;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  transition: all 0.2s;
}
.selection-actions button:hover {
  background: #A78BFA;
  color: white;
}
.custom-print-card .print-summary {
  font-size: 14px;
  color: #888;
  margin-bottom: 18px;
}
.custom-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.custom-actions button {
  font-size: 18px;
  padding: 14px 32px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s;
  min-height: 48px;
}
.custom-actions .print-custom-btn {
  background: linear-gradient(135deg, #4ECB71, #45B863);
  color: white;
  box-shadow: 0 4px 14px rgba(78, 203, 113, 0.3);
}
.custom-actions .print-custom-btn:hover { transform: translateY(-2px); }
.custom-actions .cancel-btn {
  background: #F0F0F0;
  color: #888;
}
.custom-actions .cancel-btn:hover { background: #E0E0E0; }
.custom-print-card .toggle-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 18px;
}

/* ── Exam Overlay ── */
.exam-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #F5F7FF;
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Fredoka', sans-serif;
}
.exam-overlay.show { display: flex; }
.exam-header {
  background: white;
  padding: 18px 28px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.exam-header h2 { font-size: 24px; color: #2D3436; margin: 0; }
.exam-header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.exam-timer {
  font-size: 28px;
  font-weight: 700;
  color: #4ECB71;
  background: #F0FFF4;
  padding: 8px 22px;
  border-radius: 14px;
  min-width: 110px;
  text-align: center;
  border: 2px solid #C8E6C9;
}
.exam-timer.warning { color: #FFA500; background: #FFF8E1; border-color: #FFE082; }
.exam-timer.danger { color: #FF6B6B; background: #FFF0F0; border-color: #FFC8C8; }
.exam-close-btn {
  background: #F0F0F0;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: #888;
  min-height: 44px;
}
.exam-close-btn:hover { background: #E0E0E0; }
.exam-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
.exam-questions {
  column-count: 4;
  column-gap: 18px;
}
.exam-q {
  break-inside: avoid;
  background: white;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #2D3436;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.exam-q:focus-within { border-color: #A78BFA; }
.exam-q.correct { background: #F0FFF4; box-shadow: 0 0 0 3px #C8E6C9; }
.exam-q.wrong { background: #FFF5F5; box-shadow: 0 0 0 3px #FFC8C8; }
.exam-q input {
  width: 70px;
  padding: 8px 10px;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  outline: none;
  font-family: 'Fredoka', sans-serif;
  -moz-appearance: textfield;
  margin-left: auto;
  background: #FAFAFA;
}
.exam-q input::-webkit-outer-spin-button,
.exam-q input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.exam-q input:focus { border-color: #A78BFA; background: white; }
.exam-q input.correct { border-color: #4ECB71; background: #F0FFF4; }
.exam-q input.wrong { border-color: #FF6B6B; background: #FFF5F5; }
.exam-q .q-num { color: #CCC; font-weight: 400; font-size: 14px; min-width: 20px; }
.exam-q .q-correct-answer { color: #4ECB71; font-weight: 700; font-size: 15px; margin-left: auto; }
.exam-footer {
  background: white;
  padding: 18px 32px;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.exam-footer .exam-progress {
  font-size: 16px;
  color: #888;
  font-weight: 600;
}
.exam-footer button {
  font-size: 18px;
  padding: 14px 36px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s;
  min-height: 48px;
}
.exam-submit-btn {
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.3);
}
.exam-submit-btn:hover { background: #9878E8; transform: translateY(-2px); }
.exam-result-btn {
  background: linear-gradient(135deg, #4ECB71, #45B863);
  color: white;
  box-shadow: 0 4px 14px rgba(78, 203, 113, 0.3);
}
.exam-result-btn:hover { background: #45B863; transform: translateY(-2px); }

/* ── Exam Result Overlay ── */
.exam-result-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2001;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.exam-result-overlay.show { display: flex; }
.exam-result-card {
  background: white;
  border-radius: 32px;
  padding: 40px;
  width: 500px;
  max-width: 92vw;
  text-align: center;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.exam-result-card h2 { font-size: 28px; color: #2D3436; margin-bottom: 10px; }
.exam-result-card .exam-grade {
  font-size: 80px;
  font-weight: 700;
  margin: 12px 0;
  animation: bounceIn 0.6s ease 0.3s both;
}
.exam-result-card .exam-grade.excellent { color: #4ECB71; }
.exam-result-card .exam-grade.good { color: #FFD93D; }
.exam-result-card .exam-grade.okay { color: #FFA500; }
.exam-result-card .exam-grade.needs-work { color: #FF6B6B; }
.exam-result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}
.exam-result-stats .stat-box {
  background: linear-gradient(135deg, #F8F9FE, #F0F4FF);
  border-radius: 16px;
  padding: 16px;
  border: 2px solid #E8ECFF;
}
.exam-result-stats .stat-box .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #2D3436;
}
.exam-result-stats .stat-box .stat-label {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  margin-top: 2px;
}
.exam-result-card .wrong-list {
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
  margin: 14px 0;
  font-size: 15px;
}
.exam-result-card .wrong-item {
  padding: 8px 12px;
  border-radius: 8px;
  color: #FF6B6B;
  font-weight: 600;
}
.exam-result-card .wrong-item:nth-child(odd) { background: #FAFAFA; }
.exam-result-card .wrong-item .wrong-correct { color: #4ECB71; font-weight: 700; }
.exam-result-card .correct-item { color: #4ECB71; }
.exam-back-btn {
  font-size: 18px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #A78BFA, #B89DF0);
  color: white;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.3);
  min-height: 48px;
}
.exam-back-btn:hover { transform: translateY(-2px); }
.exam-empty {
  font-size: 20px;
  color: #888;
  padding: 40px;
  text-align: center;
}

/* ── Print Content ── */
.print-content {
  display: none;
}

.print-content.is-hidden {
  display: none;
}

.custom-print-help {
  margin: 0 0 4px;
  color: #888;
  font-size: 13px;
}

/* ── Responsive: Tablet ── */
@media (max-width: 768px) {
  .game {
    padding: 28px 24px;
    border-radius: 28px;
  }
  .app-title { font-size: 24px; }
  .title-icon { font-size: 28px; }
  .table-pick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .table-pick-btn { font-size: 20px; padding: 12px 6px; }
  .problem { font-size: 56px; }
  .problem .op { margin: 0 10px; }
  .problem .eq { margin: 0 6px; }
  .input-row input { font-size: 30px; padding: 14px 16px; }
  .input-row button { font-size: 18px; padding: 14px 18px; }
  .result-card { padding: 32px 28px; }
  .result-card h2 { font-size: 28px; }
  .result-card .grade { font-size: 64px; }
  .exam-questions { column-count: 2; }
  .exam-header h2 { font-size: 20px; }
  .exam-timer { font-size: 24px; min-width: 90px; padding: 6px 16px; }
  .panel-tabs button { font-size: 14px; padding: 10px 14px; }
  .pet-large { font-size: 52px; }
  .xp-bar-wrap { width: 55px; }
}

/* ── Responsive: Mobile ── */
@media (max-width: 480px) {
  .times-table-page { padding: 0; }
  .game {
    padding: 24px 18px;
    border-radius: 24px;
  }
  .app-title { font-size: 22px; }
  .title-icon { font-size: 26px; }
  .setup-label { font-size: 16px; }
  .table-pick-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .table-pick-btn {
    font-size: 18px;
    padding: 10px 4px;
    border-width: 2px;
    border-radius: 12px;
  }
  .pick-mode-btn { font-size: 13px; padding: 8px 12px; }
  .exercise-mode-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
  .max-number-row {
    flex-direction: column;
    gap: 6px;
  }
  .max-number-label {
    font-size: 13px;
  }
  .max-number-input {
    font-size: 16px;
    width: 80px;
    padding: 6px 10px;
  }
  .start-btn { font-size: 20px; padding: 16px; border-radius: 16px; }
  .problem { font-size: 48px; letter-spacing: 2px; margin: 10px 0 16px; }
  .problem .op { margin: 0 8px; }
  .problem .eq { margin: 0 6px; }
  .input-row { gap: 8px; }
  .input-row input {
    font-size: 28px;
    padding: 14px 12px;
    border-width: 3px;
    border-radius: 14px;
  }
  .input-row button {
    font-size: 18px;
    padding: 14px 16px;
    border-radius: 14px;
  }
  .feedback { font-size: 20px; }
  .stats { gap: 24px; font-size: 16px; }
  .next-btn { font-size: 18px; padding: 14px 36px; border-radius: 14px; }
  .timer { font-size: 24px; padding: 8px 22px; min-width: 100px; border-radius: 40px; }
  .hud { padding: 8px 12px; border-radius: 14px; }
  .lvl-badge { font-size: 13px; padding: 3px 10px; }
  .xp-bar-wrap { width: 50px; height: 8px; }
  .xp-text { font-size: 10px; }
  .hud-streak { padding: 3px 8px; font-size: 13px; }
  .streak-emoji { font-size: 16px; }
  .hud-pet { font-size: 24px; }
  .combo-text { font-size: 20px; }
  .speed-hud { padding: 10px 14px; border-radius: 14px; }
  .speed-timer { font-size: 24px; }
  .speed-score { font-size: 16px; }
  .boss-hud { padding: 12px 14px; border-radius: 16px; }
  .boss-emoji { font-size: 22px; }
  .boss-name { font-size: 13px; min-width: 80px; }
  .hp-bar-wrap { height: 10px; }
  .result-card { padding: 28px 20px; border-radius: 28px; }
  .result-card h2 { font-size: 24px; }
  .result-card .grade { font-size: 56px; }
  .stat-box { padding: 14px; border-radius: 14px; }
  .stat-box .stat-value { font-size: 24px; }
  .stat-box .stat-label { font-size: 11px; }
  .restart-btn { font-size: 18px; padding: 14px 36px; border-radius: 14px; }
  .custom-print-card { padding: 24px 20px; border-radius: 28px; }
  .custom-print-card h2 { font-size: 22px; }
  .table-grid { grid-template-columns: repeat(3, 1fr); }
  .custom-actions button { font-size: 16px; padding: 12px 24px; border-radius: 14px; }
  .exam-overlay { }
  .exam-header { padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
  .exam-header h2 { font-size: 18px; }
  .exam-header-right { margin-left: auto; }
  .exam-body { padding: 16px; }
  .exam-q { font-size: 16px; padding: 10px 12px; border-radius: 12px; }
  .exam-q input { width: 55px; font-size: 16px; padding: 6px 8px; border-radius: 8px; }
  .exam-footer { padding: 14px 18px; }
  .exam-footer button { font-size: 16px; padding: 12px 28px; border-radius: 14px; }
  .exam-result-card { padding: 28px 20px; border-radius: 28px; }
  .exam-result-card h2 { font-size: 22px; }
  .exam-result-card .exam-grade { font-size: 56px; }
  .exam-result-stats .stat-box { padding: 12px; border-radius: 14px; }
  .exam-result-stats .stat-box .stat-value { font-size: 22px; }
  .exam-result-stats .stat-box .stat-label { font-size: 10px; }
  .exam-back-btn { font-size: 16px; padding: 12px 28px; border-radius: 14px; }
  .panel-tabs button { font-size: 13px; padding: 8px 12px; border-radius: 12px; min-height: 40px; }
  .quest-card, .boss-card, .speed-card, .collection-card { border-radius: 16px; padding: 16px; }
  .quest-card h4, .speed-card h4, .collection-card .pet-section h4, .achievements-section h4 { font-size: 16px; }
  .quest-desc, .speed-desc, .boss-desc { font-size: 13px; }
  .boss-card-emoji { font-size: 40px; }
  .pet-large { font-size: 48px; }
  .pet-status { font-size: 16px; }
  .pet-feed-btn { font-size: 14px; padding: 8px 16px; border-radius: 12px; }
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-badge { padding: 10px; font-size: 13px; }
  .ach-icon { font-size: 20px; }
  .tool-group { padding: 14px; border-radius: 14px; }
  .tool-group h4 { font-size: 14px; }
  .tool-btn { font-size: 14px; padding: 12px; border-radius: 12px; }
  .exam-time-select { font-size: 14px; padding: 6px 10px; border-radius: 10px; }
  .history-header h3 { font-size: 14px; }
  .history-item { font-size: 13px; padding: 8px 10px; }
  .empty-history { font-size: 13px; }
  .achievement-toast { font-size: 16px; padding: 12px 24px; border-radius: 16px; }
  .speed-record { font-size: 13px; }
  .boss-desc { font-size: 13px; }
  .xp-bar-wrap { width: 40px; }
}

/* ── Print Styles ── */
@media print {
  body {
    background: white !important;
    display: block;
    padding: 0;
    margin: 0;
  }
  .game, .overlay {
    display: none !important;
  }
  .print-content {
    display: block !important;
    padding: 25px 30px;
    max-width: 100%;
  }
  .print-content h1 {
    font-size: 28px;
    margin-bottom: 18px;
    color: #2D3436;
    text-align: center;
  }
  .print-table-group {
    break-inside: avoid;
    margin-bottom: 20px;
  }
  .print-table-group .table-title {
    font-weight: 700;
    font-size: 16px;
    color: #A78BFA;
    border-bottom: 3px solid #A78BFA;
    padding-bottom: 5px;
    margin-bottom: 8px;
  }
  .print-questions {
    column-count: 3;
    column-gap: 20px;
  }
  .print-q {
    font-size: 15px;
    padding: 5px 0;
    break-inside: avoid;
    font-weight: 600;
    color: #2D3436;
    letter-spacing: 0.5px;
  }
  .print-q .blank {
    color: #BBB;
    font-weight: 400;
  }
}

.exam-all-answers-heading {
  font-weight: 700;
  margin-bottom: 6px;
  color: #2D3436;
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Accessibility: Focus Visible ── */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #A78BFA;
  outline-offset: 2px;
}
