/* ============================================================
   CityAI English Learning App — Claude Style Design System
   Warm, clean, minimal — inspired by Anthropic Claude
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;700&display=swap');

/* ── CSS Variables — Claude Palette ── */
:root {
  --bg-primary: #FAF8F5;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F3EDE5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FDF9F5;
  --bg-accent-soft: #FEF4EC;
  --bg-game: #FFF7ED;

  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --text-inverse: #FFFFFF;

  --claude-orange: #D97706;
  --claude-amber: #E8956A;
  --claude-warm: #C2956B;
  --claude-cream: #F5E6D3;
  --claude-tan: #E8D5C0;

  --accent-green: #16A34A;
  --accent-green-soft: #DCFCE7;
  --accent-red: #DC2626;
  --accent-red-soft: #FEE2E2;
  --accent-blue: #2563EB;
  --accent-blue-soft: #DBEAFE;
  --accent-purple: #7C3AED;
  --accent-purple-soft: #EDE9FE;
  --accent-cyan: #0891B2;

  --gradient-claude: linear-gradient(135deg, #D97706 0%, #E8956A 100%);
  --gradient-game: linear-gradient(135deg, #D97706 0%, #DC2626 100%);
  --gradient-success: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);

  --border-light: #E8E0D8;
  --border-medium: #D4C8BB;
  --border-focus: #D97706;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-orange: 0 4px 16px rgba(217, 119, 6, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-zh: 'Noto Sans TC', sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 68px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App Container ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* ── Pages ── */
.page {
  display: none;
  padding: 20px 16px;
  animation: pageIn 0.35s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 600;
  min-width: 52px;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon {
  font-size: 22px;
  transition: transform 0.3s ease;
}

.nav-item.active {
  color: var(--claude-orange);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-item:active .nav-icon {
  transform: scale(0.9);
}

/* ── Page Headers ── */
.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-title .title-accent {
  background: var(--gradient-claude);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── XP Bar ── */
.xp-bar-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

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

.xp-level {
  font-size: 14px;
  font-weight: 700;
  color: var(--claude-orange);
}

.xp-points {
  font-size: 13px;
  color: var(--text-secondary);
}

.xp-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--gradient-claude);
  border-radius: 4px;
  transition: width 0.8s ease;
}

.xp-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Dashboard Cards ── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.module-card {
  cursor: pointer;
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.module-card:active {
  transform: scale(0.96);
}

.module-card.game-card {
  background: var(--bg-game);
  border-color: var(--claude-cream);
}

.module-card.game-card::after {
  content: 'PLAY';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 800;
  color: var(--text-inverse);
  background: var(--gradient-claude);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.module-card .card-icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

.module-card .card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.module-card .card-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Big game card (full width) */
.module-card-big {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  margin-bottom: 10px;
}

.module-card-big:active {
  transform: scale(0.98);
}

.module-card-big.featured {
  background: var(--gradient-claude);
  border-color: transparent;
  color: white;
}

.module-card-big.featured .big-title,
.module-card-big.featured .big-desc {
  color: white;
}

.module-card-big.featured .big-desc {
  opacity: 0.85;
}

.module-card-big .big-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.module-card-big .big-title {
  font-size: 16px;
  font-weight: 700;
}

.module-card-big .big-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Chapter Tabs ── */
.chapter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}

.chapter-tabs::-webkit-scrollbar {
  display: none;
}

.chapter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  font-family: var(--font-family);
}

.chapter-tab.active {
  background: var(--claude-orange);
  color: white;
  border-color: var(--claude-orange);
  box-shadow: var(--shadow-orange);
}

.chapter-tab:active {
  transform: scale(0.95);
}

/* ── Sentence Card ── */
.sentence-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.sentence-card:active {
  transform: scale(0.99);
}

.sentence-card.playing {
  border-color: var(--claude-orange);
  box-shadow: var(--shadow-orange);
  background: var(--bg-accent-soft);
}

.sentence-card .en-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.sentence-card .zh-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font-zh);
}

.sentence-card .speak-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.sentence-card.playing .speak-icon {
  opacity: 1;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* ── TTS Controls ── */
.tts-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.tts-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-claude);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-orange);
}

.tts-btn:active {
  transform: scale(0.9);
}

.tts-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  box-shadow: none;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.speed-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.speed-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: 2px;
  outline: none;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--claude-orange);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* ── Vocabulary Cards ── */
.vocab-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.vocab-card .word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vocab-card .word-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.vocab-card .word-pos {
  font-size: 11px;
  color: var(--claude-orange);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-accent-soft);
  border-radius: var(--radius-full);
}

.vocab-card .phonetic {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

.vocab-card .word-details {
  max-height: 0;
  opacity: 0;
  transition: all 0.35s ease;
  overflow: hidden;
}

.vocab-card.expanded .word-details {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.vocab-card .meaning {
  font-size: 15px;
  color: var(--claude-orange);
  font-weight: 600;
  margin-bottom: 4px;
  font-family: var(--font-zh);
}

.vocab-card .example {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.vocab-card .speak-btn {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--claude-orange);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--claude-orange);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.25s;
}

.vocab-card .speak-btn:active {
  background: var(--claude-orange);
  color: white;
}

/* ── Grammar Section ── */
.grammar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.grammar-card .grammar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.grammar-card .grammar-explanation {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  font-family: var(--font-zh);
}

.grammar-card .grammar-explanation strong {
  color: var(--claude-orange);
  font-weight: 700;
}

.grammar-card .example-list {
  list-style: none;
  padding: 0;
  margin-bottom: 14px;
}

.grammar-card .example-item {
  padding: 10px 14px;
  background: var(--bg-accent-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.25s;
}

.grammar-card .example-item:active {
  background: var(--claude-cream);
}

.grammar-card .highlight {
  color: var(--claude-orange);
  font-weight: 700;
  text-decoration: underline wavy;
  text-decoration-color: rgba(217, 119, 6, 0.4);
  text-underline-offset: 3px;
}

.grammar-quiz {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
}

.grammar-quiz .quiz-question {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.grammar-quiz .quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quiz-option-btn {
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-family);
}

.quiz-option-btn:active {
  transform: scale(0.95);
}

.quiz-option-btn.correct {
  background: var(--accent-green-soft);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.quiz-option-btn.wrong {
  background: var(--accent-red-soft);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ── Quiz Arena ── */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.quiz-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--claude-orange);
}

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-claude);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.quiz-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.quiz-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.badge-fill {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.badge-tf {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.badge-mc {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
}

.badge-listen {
  background: var(--bg-accent-soft);
  color: var(--claude-orange);
}

.quiz-question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-answer-btn {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-family);
  text-align: left;
  box-shadow: var(--shadow-xs);
}

.quiz-answer-btn:active {
  transform: scale(0.98);
}

.quiz-answer-btn.correct {
  background: var(--accent-green-soft);
  border-color: var(--accent-green);
  color: var(--accent-green);
  animation: correctPop 0.4s ease;
}

.quiz-answer-btn.wrong {
  background: var(--accent-red-soft);
  border-color: var(--accent-red);
  color: var(--accent-red);
  animation: shake 0.4s ease;
}

@keyframes correctPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.quiz-result {
  text-align: center;
  padding: 32px 20px;
}

.quiz-result .result-emoji {
  font-size: 64px;
  margin-bottom: 12px;
}

.quiz-result .result-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--claude-orange);
}

.quiz-result .result-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.quiz-result .result-msg {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 12px;
}

/* ── Sentence Builder ── */
.builder-sentence-display {
  min-height: 90px;
  background: var(--bg-card);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  transition: border-color 0.3s;
}

.builder-sentence-display.drop-active {
  border-color: var(--claude-orange);
}

.builder-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.word-chip {
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  font-family: var(--font-family);
  border: none;
}

.word-chip.bank {
  background: var(--bg-accent-soft);
  color: var(--claude-orange);
  border: 1px solid var(--claude-cream);
}

.word-chip.bank:active {
  transform: scale(0.9);
}

.word-chip.placed {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border: 1px solid #BBF7D0;
}

.word-chip.placed:active {
  transform: scale(0.9);
}

.word-chip.hidden {
  opacity: 0.15;
  pointer-events: none;
}

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

.builder-timer {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--claude-orange);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

/* ── Listening Challenge ── */
.listening-big-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-claude);
  color: white;
  font-size: 40px;
  cursor: pointer;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-orange);
  transition: all 0.25s ease;
}

.listening-big-btn:active {
  transform: scale(0.9);
}

.listening-big-btn.playing {
  animation: pulse 1s ease infinite;
}

.listening-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Word Match Game ── */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.match-card {
  padding: 16px 12px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-xs);
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-card:active {
  transform: scale(0.95);
}

.match-card.selected {
  border-color: var(--claude-orange);
  background: var(--bg-accent-soft);
  box-shadow: var(--shadow-orange);
}

.match-card.matched {
  border-color: var(--accent-green);
  background: var(--accent-green-soft);
  color: var(--accent-green);
  pointer-events: none;
  opacity: 0.7;
}

.match-card.wrong {
  border-color: var(--accent-red);
  background: var(--accent-red-soft);
  animation: shake 0.4s ease;
}

.match-card.en-card {
  color: var(--text-primary);
}

.match-card.zh-card {
  font-family: var(--font-zh);
  color: var(--text-secondary);
}

/* ── Buttons ── */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--gradient-claude);
  color: white;
  box-shadow: var(--shadow-orange);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

/* ── Back Button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--claude-orange);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  margin-bottom: 10px;
  transition: opacity 0.25s;
}

.back-btn:active {
  opacity: 0.6;
}

/* ── Misc ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

.text-center {
  text-align: center;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-24 {
  margin-top: 24px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  z-index: 3000;
  transition: transform 0.4s ease;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--accent-green);
  color: white;
}

.toast.error {
  background: var(--accent-red);
  color: white;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

/* ── Selection ── */
::selection {
  background: rgba(217, 119, 6, 0.2);
}

/* ── Progress Ring ── */
.progress-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: 800;
  color: var(--claude-orange);
}

.progress-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Game Score Banner ── */
.game-score-banner {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.score-item {
  text-align: center;
}

.score-item .score-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--claude-orange);
}

.score-item .score-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Fun facts / tips ── */
.tip-banner {
  background: var(--bg-accent-soft);
  border: 1px solid var(--claude-cream);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--claude-orange);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tip-banner .tip-icon {
  font-size: 18px;
  flex-shrink: 0;
}