/* ═══════════════════════════════════════════════════════
   WordQuest — Style Sheet
   Mobile-first, desktop two-column layout at ≥900px
═══════════════════════════════════════════════════════ */

:root {
  --primary: #6C63FF;
  --primary-dark: #4a44cc;
  --success: #2ECC71;
  --danger: #E74C3C;
  --warning: #F1C40F;
  --bg: #F0F4FF;
  --card: #FFFFFF;
  --text: #2C3E50;
  --muted: #95A5A6;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  /* Sidebar */
  --sidebar-bg: #1a1433;
  --sidebar-width: 250px;
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ══ DESKTOP SIDEBAR — hidden on mobile ══════════════════ */
#d-sidebar {
  display: none;
}

/* ══ GAME PANEL — transparent on mobile ═════════════════ */
#d-game-panel {
  /* On mobile, screens are position:fixed and cover everything */
  /* This div is invisible on mobile */
  height: 100%;
}

/* ══ SCREENS ════════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  transform: translateY(10px);
  background: var(--bg);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ══ DESKTOP LAYOUT — two columns ══════════════════════ */
.home-desktop-only { display: none; }

@media (min-width: 900px) {
  html, body {
    overflow: hidden;
    background: #0f0c1d;
  }

  body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
  }

  /* ── Sidebar ── */
  #d-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    padding: 24px 16px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
  }

  .d-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px;
  }
  .d-brand-icon { font-size: 34px; line-height: 1; }
  .d-brand-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.3px; }
  .d-brand-sub  { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 1px; }

  .d-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
  }
  .d-stat {
    background: rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 10px 8px;
    text-align: center;
  }
  .d-stat-num { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.1; }
  .d-stat-lbl { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 3px; }

  .d-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
  }
  .d-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    width: 100%;
  }
  .d-nav-btn:hover { background: rgba(108,99,255,0.35); color: #fff; }
  .d-nav-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
  .d-nav-icon { font-size: 16px; }
  .d-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
  }

  .d-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 0 4px;
    margin-bottom: 8px;
  }

  .d-topics-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    margin-bottom: 16px;
  }
  .d-topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    transition: background 0.12s, color 0.12s;
  }
  .d-topic-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
  .d-topic-item .d-topic-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .d-topic-item .d-topic-pct {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
  }

  .d-sidebar-footer {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
  }

  /* ── Game Panel ── */
  #d-game-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    min-width: 0;
  }

  /* All screens become absolute within game panel */
  .screen {
    position: absolute;
    inset: 0;
    transform: translateY(10px);
  }
  .screen.active {
    transform: translateY(0);
  }

  /* ── Desktop Home: hide mobile version, show desktop ── */
  .home-mobile-only { display: none; }
  .home-desktop-only {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 32px 36px;
    background: var(--bg);
  }

  .dh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
  }
  .dh-greeting {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
  }
  .dh-sub { font-size: 14px; color: var(--muted); }
  .dh-progress-badge {
    background: var(--primary);
    color: white;
    border-radius: 16px;
    padding: 14px 22px;
    text-align: center;
    flex-shrink: 0;
  }
  .dh-pct { font-size: 28px; font-weight: 800; line-height: 1; }
  .dh-pct-lbl { font-size: 11px; opacity: 0.8; margin-top: 3px; }

  .dh-section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
  }
  .dh-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding-bottom: 24px;
  }
  .dh-topic-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 16px 16px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    border: none;
    text-align: left;
    position: relative;
    overflow: hidden;
  }
  .dh-topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .dh-topic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--topic-color, var(--primary));
  }
  .dh-topic-card .tc-emoji { font-size: 28px; display: block; margin-bottom: 8px; }
  .dh-topic-card .tc-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
  .dh-topic-card .tc-count { font-size: 11px; color: var(--muted); }
  .dh-topic-card .tc-bar {
    height: 3px;
    background: #E8ECF0;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
  }
  .dh-topic-card .tc-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--topic-color, var(--primary));
    transition: width 0.5s;
  }

  /* ── Desktop Map — 3-4 col grid ── */
  #screen-map .topic-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  /* ── Desktop Topic — wider mode buttons ── */
  #screen-topic .mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* ── Desktop Flash — wider card ── */
  .flip-card-wrap { max-width: 520px; }
  .card-word { font-size: 40px; }
  .card-cn   { font-size: 32px; }

  /* ── Desktop Quiz — wider question + options ── */
  .quiz-question-card { max-width: 580px; }
  .quiz-options       { max-width: 580px; grid-template-columns: 1fr 1fr; }
  #quiz-spell-area    { max-width: 580px !important; }
  #quiz-fill-area     { max-width: 580px !important; }
  .flash-progress     { max-width: 580px; }
  .flash-nav          { max-width: 520px; }
  .quiz-info          { max-width: 580px; }

  /* Larger quiz question font */
  .quiz-question { font-size: 30px; }

  /* ── Desktop Header ── */
  .header { padding: 16px 28px; }
  .header h1 { font-size: 20px; }

  /* ── Desktop screen-body padding ── */
  .screen-body { padding: 28px 36px 40px; }
  #screen-flash .screen-body { padding: 28px 36px; }
  #screen-quiz  .screen-body { padding: 24px 36px; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE-FIRST BASE STYLES
═══════════════════════════════════════════════════════ */

/* ── Scrollable body ── */
.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: 32px;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid #E8ECF0;
  min-height: 56px;
  flex-shrink: 0;
}
.header h1 { font-size: 18px; font-weight: 700; flex: 1; }
.header .back-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.header .back-btn:hover { background: var(--bg); }

/* ══ HOME SCREEN ════════════════════════════════════════ */
#screen-home {
  background: linear-gradient(160deg, #6C63FF 0%, #A66CFF 100%);
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 20px;
  color: white;
  text-align: center;
  flex-shrink: 0;
}
.home-hero .logo { font-size: 60px; margin-bottom: 10px; }
.home-hero h1 { font-size: 28px; font-weight: 800; margin-bottom: 5px; }
.home-hero p  { font-size: 15px; opacity: 0.85; margin-bottom: 20px; }
.streak-badge {
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 14px;
  color: white;
}

.home-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 16px 14px;
  flex-shrink: 0;
}
.stat-card {
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  color: white;
}
.stat-card .stat-num   { font-size: 22px; font-weight: 800; }
.stat-card .stat-label { font-size: 11px; opacity: 0.8; margin-top: 2px; }

.home-actions {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: var(--primary);
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-main:hover  { transform: scale(1.02); }
.btn-main:active { transform: scale(0.97); box-shadow: none; }
.btn-main.secondary {
  background: rgba(255,255,255,0.18);
  color: white;
  box-shadow: none;
  border: 2px solid rgba(255,255,255,0.35);
}
.btn-main .btn-emoji { font-size: 20px; }

/* ══ MAP SCREEN ══════════════════════════════════════════ */
#screen-map .screen-body { background: var(--bg); }
.map-title {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.topic-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  border: none;
  text-align: left;
}
.topic-card:hover  { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.topic-card:active { transform: scale(0.96); box-shadow: none; }
.topic-card .topic-emoji { font-size: 30px; display: block; margin-bottom: 7px; }
.topic-card .topic-name  { font-size: 13px; font-weight: 700; color: var(--text); }
.topic-card .topic-count { font-size: 11px; color: var(--muted); margin-top: 2px; }
.topic-card .topic-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: #E8ECF0;
  margin-top: 10px;
  overflow: hidden;
}
.topic-card .topic-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s;
}
.topic-card .topic-stars {
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 10px;
}

/* ══ TOPIC SCREEN ════════════════════════════════════════ */
.topic-header-banner {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: white;
}
.topic-header-banner .th-emoji { font-size: 44px; display: block; margin-bottom: 7px; }
.topic-header-banner h2 { font-size: 20px; font-weight: 800; }
.topic-header-banner p  { font-size: 13px; opacity: 0.85; margin-top: 3px; }

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.mode-btn {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mode-btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mode-btn:active { transform: scale(0.95); }
.mode-btn .mode-emoji { font-size: 24px; display: block; margin-bottom: 5px; }
.mode-btn .mode-name  { font-size: 13px; font-weight: 700; }
.mode-btn .mode-desc  { font-size: 11px; color: var(--muted); margin-top: 2px; }

.word-list-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.word-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  background: var(--card);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.word-chip:hover { border-color: var(--primary); }
.word-chip.mastered { border-color: var(--success); }
.word-chip .chip-star { font-size: 10px; color: var(--warning); }

/* ══ FLASHCARD SCREEN ════════════════════════════════════ */
#screen-flash .screen-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px;
}
.flash-progress {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.flash-progress-bar {
  flex: 1;
  height: 8px;
  background: #E8ECF0;
  border-radius: 4px;
  overflow: hidden;
}
.flash-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.flash-progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Flip card */
.flip-card-wrap {
  width: 100%;
  max-width: 380px;
  perspective: 1000px;
  margin-bottom: 22px;
}
.flip-card {
  width: 100%;
  aspect-ratio: 3 / 2;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 20px;
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.flip-card-front { background: white; }
.flip-card-back  { background: var(--primary); color: white; transform: rotateY(180deg); }

.card-word     { font-size: 32px; font-weight: 800; margin-bottom: 6px; }
.card-phonetic { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.card-pos {
  font-size: 12px;
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 10px;
  color: var(--muted);
}
.card-hint { font-size: 13px; color: var(--muted); margin-top: 14px; }
.card-cn      { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.card-example { font-size: 13px; opacity: 0.85; text-align: center; line-height: 1.5; }
.card-level-badge {
  position: absolute;
  top: 13px; right: 13px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--primary);
}
.flip-card-back .card-level-badge { background: rgba(255,255,255,0.2); color: white; }

.speak-btn {
  background: none;
  border: 2px solid #E8ECF0;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  margin-top: 8px;
}
.speak-btn:hover { background: var(--bg); }

.flash-nav {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}
.flash-nav button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}
.flash-nav button:hover  { filter: brightness(1.05); }
.flash-nav button:active { transform: scale(0.96); }
.btn-knew   { background: var(--success); color: white; }
.btn-review { background: #E8ECF0; color: var(--text); }

/* ══ QUIZ SCREEN ═════════════════════════════════════════ */
#screen-quiz .screen-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}
.quiz-info {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.quiz-score-badge {
  background: var(--warning);
  color: white;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
}
.quiz-lives { font-size: 18px; letter-spacing: 2px; }

.quiz-question-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 24px 20px;
  margin-bottom: 14px;
  text-align: center;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.quiz-mode-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}
.quiz-question  { font-size: 26px; font-weight: 800; margin-bottom: 5px; }
.quiz-question.cn { font-size: 22px; }
.quiz-phonetic  { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.quiz-speak-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px; height: 50px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  transition: filter 0.15s;
}
.quiz-speak-btn:hover { filter: brightness(1.1); }

.quiz-options {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.quiz-opt {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  text-align: center;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-opt:hover  { border-color: var(--primary); }
.quiz-opt:active { transform: scale(0.96); }
.quiz-opt.correct { background: #D5F5E3; border-color: var(--success); color: #1A7A44; }
.quiz-opt.wrong   { background: #FDECEA; border-color: var(--danger); color: #9B2335; }
.quiz-opt.reveal  { border-color: var(--success); background: #D5F5E3; color: #1A7A44; }

/* Spell mode */
.spell-input-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.spell-input {
  flex: 1;
  border: 2px solid #E8ECF0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 2px;
  background: var(--card);
}
.spell-input:focus   { border-color: var(--primary); }
.spell-input.correct { border-color: var(--success); background: #D5F5E3; }
.spell-input.wrong   { border-color: var(--danger); background: #FDECEA; }
.spell-submit {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}
.spell-submit:hover { filter: brightness(1.1); }

/* Fill blank */
.fillblank-sentence {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.8;
  text-align: center;
}
.blank-underline {
  display: inline-block;
  min-width: 80px;
  border-bottom: 3px solid var(--primary);
  margin: 0 4px;
  text-align: center;
  font-weight: 800;
  color: var(--primary);
}

/* ══ FEEDBACK OVERLAY ════════════════════════════════════ */
.feedback-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.feedback-overlay.show { opacity: 1; }
.feedback-bubble {
  background: var(--success);
  color: white;
  border-radius: 20px;
  padding: 14px 30px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  transform: scale(0.85);
  transition: transform 0.18s;
}
.feedback-overlay.show .feedback-bubble { transform: scale(1); }
.feedback-overlay.wrong .feedback-bubble { background: var(--danger); }

/* ══ RESULTS SCREEN ══════════════════════════════════════ */
#screen-results {
  background: linear-gradient(160deg, #43E97B 0%, #38F9D7 100%);
}
.results-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  color: white;
  text-align: center;
  gap: 18px;
}
.results-emoji { font-size: 68px; }
.results-title { font-size: 28px; font-weight: 800; }
.results-sub   { font-size: 16px; opacity: 0.85; }
.results-score-ring {
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(255,255,255,0.55);
}
.results-score-num   { font-size: 36px; font-weight: 800; }
.results-score-label { font-size: 13px; opacity: 0.8; }
.results-stars { font-size: 30px; letter-spacing: 4px; }
.results-actions {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-result {
  background: white;
  color: var(--success);
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transition: transform 0.1s;
}
.btn-result:hover  { filter: brightness(0.97); }
.btn-result:active { transform: scale(0.97); }
.btn-result.outline {
  background: rgba(255,255,255,0.18);
  color: white;
  border: 2px solid rgba(255,255,255,0.45);
  box-shadow: none;
}

/* ══ WORD MODAL ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 800;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: white;
  width: 100%;
  border-radius: 22px 22px 0 0;
  padding: 20px 24px 40px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  max-width: 560px;
  margin: 0 auto;
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 40px; height: 4px;
  background: #E8ECF0;
  border-radius: 2px;
  margin: 0 auto 18px;
}
.modal-word     { font-size: 26px; font-weight: 800; margin-bottom: 3px; }
.modal-phonetic { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.modal-cn       { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 7px; }
.modal-example  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.modal-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-tag {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
}
.modal-speak-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s;
}
.modal-speak-btn:hover { filter: brightness(1.1); }

/* ══ UTILITY ═════════════════════════════════════════════ */
.text-center { text-align: center; }
.review-badge {
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* ══ ANIMATIONS ══════════════════════════════════════════ */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.shake { animation: shake 0.32s ease; }

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.22s ease; }

@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
.bounce-in { animation: bounce-in 0.38s ease forwards; }

@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall 1.5s ease-in forwards;
  z-index: 999;
}

/* ══ TABLET (480-899px) ══════════════════════════════════ */
@media (min-width: 480px) and (max-width: 899px) {
  .topic-grid { grid-template-columns: repeat(3,1fr); }
}

/* ═══════════════════════════════════════════════════════
   ⚔️  BATTLE SCREEN — 打怪兽模式
═══════════════════════════════════════════════════════ */

/* Dark battle arena background */
#screen-battle {
  background: linear-gradient(180deg, #1a0a2e 0%, #16213e 55%, #0f3460 100%);
  color: #fff;
}

/* ── Header ── */
.bt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bt-back {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 20px;
  border-radius: 8px;
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bt-back:hover { background: rgba(255,255,255,0.16); }
.bt-wave {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.bt-score {
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.4);
  color: #ffd700;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Body layout (mobile: column, desktop: row) ── */
.bt-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── Monster panel ── */
.bt-monster-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 8px;
  flex-shrink: 0;
  gap: 4px;
}
.bt-monster-meta {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bt-monster-name {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  min-width: 60px;
}
.bt-hp-wrap {
  flex: 1;
  height: 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.bt-hp-fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1), background 0.3s;
}
.bt-hp-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bt-hp-fill.low    { background: linear-gradient(90deg, #ef4444, #f87171); }
.bt-hp-text {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* ── Monster sprite ── */
.bt-sprite-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
}
.bt-sprite {
  font-size: 88px;
  line-height: 1;
  user-select: none;
  animation: bt-float 2.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  transition: filter 0.3s;
  display: inline-block;
}
.bt-sprite.phase-1 { filter: drop-shadow(0 4px 16px rgba(255,140,0,0.6)); }
.bt-sprite.phase-2 { filter: drop-shadow(0 4px 20px rgba(255,50,50,0.8)); animation: bt-float-angry 1s ease-in-out infinite; }

@keyframes bt-float {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-12px) rotate(2deg); }
}
@keyframes bt-float-angry {
  0%,100% { transform: translateY(0) rotate(-4deg) scale(1.02); }
  50%      { transform: translateY(-8px) rotate(4deg) scale(1.02); }
}

/* ── Floating damage numbers ── */
.bt-floats {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  width: 0; height: 0;
}
.bt-float-num {
  position: absolute;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
  animation: bt-float-up 1s ease-out forwards;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.bt-float-num.dmg  { color: #ff4444; }
.bt-float-num.miss { color: #facc15; }
.bt-float-num.crit { color: #f97316; font-size: 28px; }
@keyframes bt-float-up {
  0%   { transform: translate(-50%, 0);    opacity: 1; }
  100% { transform: translate(-50%, -70px); opacity: 0; }
}

/* ── Player bar ── */
.bt-player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  width: 100%;
  max-width: 380px;
  justify-content: center;
}
.bt-lives {
  font-size: 20px;
  letter-spacing: 1px;
}
.bt-combo {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  animation: bt-combo-pop 0.3s ease;
  letter-spacing: 0.5px;
}
@keyframes bt-combo-pop {
  0%   { transform: scale(0.6) rotate(-6deg); }
  70%  { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Right panel: question + options ── */
.bt-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px 12px;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Question card ── */
.bt-question-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
}
.bt-mode-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
}
.bt-question {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.bt-question.cn { font-size: 22px; }
.bt-speak {
  background: rgba(108,99,255,0.4);
  border: 1px solid rgba(108,99,255,0.6);
  color: #fff;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.bt-speak:hover { background: rgba(108,99,255,0.65); }

/* ── Attack options ── */
.bt-options {
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bt-opt {
  position: relative;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 10px 14px 34px;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-height: 62px;
  display: flex;
  align-items: center;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  backdrop-filter: blur(2px);
  line-height: 1.3;
  word-break: break-word;
}
.bt-opt::before {
  content: '⚔️';
  position: absolute;
  left: 10px;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.bt-opt:hover {
  background: rgba(108,99,255,0.3);
  border-color: rgba(108,99,255,0.6);
  transform: translateY(-2px);
}
.bt-opt:hover::before { opacity: 1; }
.bt-opt:active { transform: scale(0.95); }

/* Answer states */
.bt-opt.hit {
  background: rgba(34,197,94,0.25);
  border-color: #22c55e;
  color: #86efac;
}
.bt-opt.hit::before { content: '✅'; opacity: 1; }

.bt-opt.miss {
  background: rgba(239,68,68,0.25);
  border-color: #ef4444;
  color: #fca5a5;
}
.bt-opt.miss::before { content: '❌'; opacity: 1; }

.bt-opt.reveal {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.5);
  color: #86efac;
  animation: bt-reveal-pulse 0.4s ease;
}
.bt-opt.reveal::before { content: '💡'; opacity: 1; }

@keyframes bt-reveal-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── Progress bar at bottom ── */
.bt-progress-row {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bt-progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.bt-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.bt-progress-text {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

/* ── Monster hit animation ── */
@keyframes bt-hit {
  0%          { transform: translateX(0); filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); }
  20%         { transform: translateX(-12px) scale(0.88); filter: drop-shadow(0 0 24px rgba(255,255,255,0.9)) brightness(2.5); }
  45%         { transform: translateX(10px) scale(1.06); }
  70%         { transform: translateX(-5px); }
  100%        { transform: translateX(0); }
}
.bt-sprite.anim-hit { animation: bt-hit 0.4s ease both, bt-float 2.4s ease-in-out infinite 0.4s; }

/* ── Monster attack animation ── */
@keyframes bt-attack {
  0%,100% { transform: scale(1) rotate(0deg); }
  25%     { transform: scale(1.35) rotate(-8deg); filter: drop-shadow(0 0 20px rgba(255,80,0,1)); }
  50%     { transform: scale(1.2) rotate(6deg); }
  75%     { transform: scale(1.1) rotate(-3deg); }
}
.bt-sprite.anim-attack { animation: bt-attack 0.45s ease both, bt-float 2.4s ease-in-out infinite 0.45s; }

/* ── Monster die ── */
@keyframes bt-die {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  40%  { transform: scale(1.5) rotate(15deg); opacity: 0.8; filter: brightness(3) drop-shadow(0 0 30px gold); }
  100% { transform: scale(0) rotate(60deg); opacity: 0; }
}
.bt-sprite.anim-die {
  animation: bt-die 0.7s ease-out forwards;
}

/* ── Screen red flash (player damaged) ── */
.bt-dmg-flash {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 450;
  animation: bt-flash-out 0.4s ease-out forwards;
}
@keyframes bt-flash-out {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Victory / Defeat overlay ── */
.bt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.bt-overlay.show { opacity: 1; pointer-events: all; }
.bt-overlay-content {
  text-align: center;
  animation: bounce-in 0.5s ease;
}
.bt-overlay-emoji { font-size: 80px; margin-bottom: 12px; }
.bt-overlay-title {
  font-size: 28px;
  font-weight: 900;
  color: gold;
  text-shadow: 0 0 20px rgba(255,215,0,0.6);
  margin-bottom: 8px;
}
.bt-overlay-sub { font-size: 16px; color: rgba(255,255,255,0.7); }

/* ── Particle burst (victory) ── */
.bt-particle {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 600;
  animation: bt-particle-fly var(--dur, 0.9s) ease-out forwards;
}
@keyframes bt-particle-fly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx,0px), var(--ty,-120px)) scale(0.3); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════
   BATTLE DESKTOP OVERRIDES (≥ 900px)
═══════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  /* Two-column layout: monster left, question+options right */
  .bt-body {
    flex-direction: row;
    align-items: stretch;
  }

  .bt-monster-panel {
    width: 300px;
    flex-shrink: 0;
    padding: 24px 20px 20px;
    border-right: 1px solid rgba(255,255,255,0.06);
    justify-content: center;
    gap: 12px;
  }

  .bt-sprite-wrap { height: 160px; }
  .bt-sprite { font-size: 130px; }

  .bt-right-panel {
    padding: 28px 36px;
    justify-content: center;
  }

  .bt-question-card { padding: 24px 28px; }
  .bt-question { font-size: 36px; }
  .bt-question.cn { font-size: 28px; }
  .bt-options { gap: 12px; }
  .bt-opt {
    font-size: 16px;
    min-height: 68px;
    padding: 16px 12px 16px 38px;
  }
  .bt-header { padding: 14px 28px; }
  .bt-wave { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════
   ARCADE MODE — #screen-arcade
═══════════════════════════════════════════════════════ */

/* ── Header bar ─────────────────────────────────────── */
.arc-hdr {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
  z-index: 20;
}
.arc-back-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.arc-back-btn:hover { background: rgba(255,255,255,0.28); }
.arc-progress {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}
.arc-combo {
  font-size: 14px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 0 8px #FFD700;
  animation: arc-combo-pop 0.35s ease;
}
@keyframes arc-combo-pop {
  0%   { transform: scale(0.6); opacity: 0.4; }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1);   opacity: 1; }
}
.arc-score {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: #FFD700;
}
.arc-lives {
  font-size: 16px;
  letter-spacing: 2px;
}

/* ── Timer bar ──────────────────────────────────────── */
.arc-timer-track {
  height: 6px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  flex-shrink: 0;
  z-index: 20;
}
.arc-timer-fill {
  height: 100%;
  width: 100%;
  background: #2ECC71;
  transform-origin: left;
  transition: width linear;
}
.arc-timer-fill.warn  { background: #F1C40F; }
.arc-timer-fill.crit  { background: #E74C3C; }

/* ── Question area ──────────────────────────────────── */
.arc-qarea {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 6px;
  gap: 6px;
  flex-shrink: 0;
  z-index: 20;
}
.arc-mode-tag {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.18);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.arc-word {
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
  text-align: center;
  line-height: 1.15;
}
.arc-word.cn { font-size: 32px; }
.arc-speak {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 20px;
  cursor: pointer;
}
.arc-speak:hover { background: rgba(255,255,255,0.32); }

/* ── Game stage ─────────────────────────────────────── */
.arc-game {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ── Shared option label ────────────────────────────── */
.arc-opt {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.arc-reveal    { outline: 3px solid #2ECC71 !important; }
.arc-wrong     { outline: 3px solid #E74C3C !important; }
.arc-wrong-dim { opacity: 0.3 !important; pointer-events: none; }

/* ── Feedback overlay ───────────────────────────────── */
.arc-dmg-flash {
  position: fixed;
  inset: 0;
  background: rgba(231,76,60,0.35);
  pointer-events: none;
  z-index: 900;
  animation: arc-flash 0.4s ease forwards;
}
@keyframes arc-flash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ════════════════════════════════════════════════════
   MODE A — ☄️ METEOR RAIN
════════════════════════════════════════════════════ */
.mtr-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0010 0%, #1a0a30 60%, #2d0a50 100%);
  overflow: hidden;
}
/* Twinkling star dots via box-shadow trick */
.mtr-stars {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  top: 10%; left: 20%;
  box-shadow:
    30px 40px 0 0 rgba(255,255,255,0.8),
    80px 15px 0 0 rgba(255,255,255,0.6),
    140px 55px 0 0 rgba(255,255,255,0.9),
    200px 30px 0 0 rgba(255,255,255,0.5),
    260px 70px 0 0 rgba(255,255,255,0.7),
    320px 20px 0 0 rgba(255,255,255,0.4),
    50px 100px 0 0 rgba(255,255,255,0.6),
    110px 120px 0 0 rgba(255,255,255,0.8),
    170px 90px 0 0 rgba(255,255,255,0.5),
    230px 110px 0 0 rgba(255,255,255,0.7);
  animation: mtr-twinkle 2s ease-in-out infinite alternate;
}
@keyframes mtr-twinkle {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}
.mtr-ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(180deg, #3a1a6e 0%, #1a0a30 100%);
  border-top: 2px solid rgba(255,255,255,0.1);
}
.mtr-wrap {
  position: absolute;
  top: 0; bottom: 32px; left: 0; right: 0;
  overflow: hidden;
}
/* Each meteor */
.arc-meteor {
  position: absolute;
  top: -160px;
  left: var(--x, 25%);
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  animation: mtr-fall var(--dur, 4s) var(--delay, 0s) linear forwards;
  z-index: 10;
}
@keyframes mtr-fall {
  0%   { top: -120px; opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0.4; }
}
.mtr-trail {
  width: 4px;
  height: 44px;
  background: linear-gradient(180deg, transparent, var(--col, #a78bfa));
  border-radius: 2px;
  filter: blur(1px);
  opacity: 0.8;
}
.mtr-rock {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--col, #a78bfa), #1a0a30 75%);
  box-shadow: 0 0 22px var(--col, #a78bfa), inset 0 -4px 10px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  padding: 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  transition: transform 0.15s;
  word-break: break-word;
}
.arc-meteor:active .mtr-rock { transform: scale(1.15); }

/* Answer label — displayed below the rock on its own contrasting tag */
.mtr-label {
  background: rgba(255, 255, 255, 0.95);
  color: #1a0a2e;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
  padding: 5px 12px;
  border-radius: 20px;
  max-width: 110px;
  word-break: break-word;
  box-shadow: 0 2px 10px rgba(0,0,0,0.55);
  pointer-events: none;   /* clicks go to the parent arc-meteor */
}

.mtr-rock.mtr-hit {
  animation: mtr-explode 0.4s ease forwards;
}
.mtr-rock.mtr-miss {
  animation: mtr-dim 0.5s ease forwards;
}
@keyframes mtr-explode {
  0%   { transform: scale(1); opacity: 1; }
  40%  { transform: scale(1.6); filter: brightness(2.5); }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes mtr-dim {
  0%   { opacity: 1; }
  100% { opacity: 0.15; filter: grayscale(1); }
}

/* ════════════════════════════════════════════════════
   MODE B — 🎈 BALLOON ESCAPE
════════════════════════════════════════════════════ */
.bal-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #87CEEB 0%, #B0E2FF 50%, #E0F7FA 100%);
  overflow: hidden;
}
.bal-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* Decorative clouds */
.bal-cloud {
  position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 50px;
  filter: blur(2px);
}
.bal-cloud::before, .bal-cloud::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
}
.bal-cloud-1 { width: 90px; height: 28px; top: 18%; left: 5%; }
.bal-cloud-1::before { width: 50px; height: 40px; top: -18px; left: 14px; }
.bal-cloud-1::after  { width: 38px; height: 32px; top: -12px; left: 42px; }
.bal-cloud-2 { width: 70px; height: 22px; top: 35%; right: 8%; }
.bal-cloud-2::before { width: 40px; height: 32px; top: -15px; left: 10px; }
.bal-cloud-2::after  { width: 28px; height: 26px; top: -10px; left: 34px; }
.bal-cloud-3 { width: 55px; height: 18px; top: 55%; left: 30%; }
.bal-cloud-3::before { width: 32px; height: 26px; top: -12px; left: 8px; }

/* Each balloon */
.arc-balloon {
  position: absolute;
  bottom: -180px;
  left: var(--x, 20%);
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  animation: bal-rise var(--dur, 5s) var(--delay, 0s) linear forwards;
  z-index: 10;
}
@keyframes bal-rise {
  0%   { bottom: -180px; opacity: 1; transform: translateX(0); }
  50%  { transform: translateX(var(--sway, 12px)); }
  100% { bottom: 105%; opacity: 0.3; transform: translateX(0); }
}
.bal-body {
  width: 90px; height: 108px;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.45), transparent 55%),
              var(--col, #FF6B6B);
  box-shadow: inset -8px -8px 20px rgba(0,0,0,0.25),
              0 0 24px var(--col, #FF6B6B);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  padding: 14px 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  position: relative;
  transition: transform 0.12s;
  word-break: break-word;
}
.arc-balloon:active .bal-body { transform: scale(1.1); }
.bal-knot {
  width: 10px; height: 10px;
  background: var(--col, #FF6B6B);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  filter: brightness(0.7);
}
.bal-string {
  width: 1.5px;
  height: 40px;
  background: rgba(0,0,0,0.35);
}
.bal-body.bal-pop {
  animation: bal-burst 0.4s ease forwards;
}
.bal-body.bal-wrong {
  animation: bal-shrink 0.5s ease forwards;
}
@keyframes bal-burst {
  0%   { transform: scale(1); opacity: 1; }
  30%  { transform: scale(1.5); filter: brightness(2); }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes bal-shrink {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.4); opacity: 0.15; filter: grayscale(1); }
}

/* ════════════════════════════════════════════════════
   MODE C — 🎣 FISHING
════════════════════════════════════════════════════ */
.sea-wrap {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 28%, #006994 28%, #004E7C 100%);
  overflow: hidden;
}
/* Sky strip with decorative clouds */
.sea-sky {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28%;
  pointer-events: none;
}
.sea-sky::before {
  content: '☁️   ⛅   ☁️';
  position: absolute;
  top: 10px; left: 10px;
  font-size: 22px;
  opacity: 0.85;
}
.sea-surface {
  position: absolute;
  top: calc(28% - 4px);
  left: 0; right: 0;
  height: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.08));
  animation: sea-ripple 2s ease-in-out infinite;
}
@keyframes sea-ripple {
  0%,100% { transform: scaleX(1) translateY(0); }
  50%      { transform: scaleX(1.01) translateY(1px); }
}
/* Fish container — covers the water area (below 28%) */
.sea-fish-wrap {
  position: absolute;
  top: 28%; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}
.arc-fish {
  position: absolute;
  top: var(--y, 30%);
  width: 130px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 10;
}
.fish-ltr {
  animation: fish-swim-ltr var(--dur, 5s) linear forwards;
}
.fish-rtl {
  animation: fish-swim-rtl var(--dur, 5s) linear forwards;
  flex-direction: row-reverse;
}
@keyframes fish-swim-ltr {
  0%   { left: -140px; }
  100% { left: 110%; }
}
@keyframes fish-swim-rtl {
  0%   { left: 110%; }
  100% { left: -140px; }
}
.fish-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fish-emoji {
  font-size: 42px;
  display: block;
}
.fish-flip {
  display: inline-block;
  transform: scaleX(-1);
}
.fish-tag {
  background: rgba(0,30,60,0.82);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  max-width: 110px;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.arc-fish.fish-caught .fish-emoji {
  animation: fish-jump 0.5s ease forwards;
}
.arc-fish.fish-fled {
  opacity: 0.2;
  transition: opacity 0.4s;
}
@keyframes fish-jump {
  0%   { transform: translateY(0) rotate(0deg); }
  40%  { transform: translateY(-28px) rotate(-20deg); }
  100% { transform: translateY(0) scale(0.2); opacity: 0; }
}

/* Fishing line */
.sea-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 28%;
  background: rgba(255,255,255,0.55);
  transform-origin: top center;
  z-index: 5;
}
.sea-hook {
  position: absolute;
  top: 24%;
  left: calc(50% - 8px);
  font-size: 20px;
  z-index: 5;
  animation: sea-hook-sway 1.8s ease-in-out infinite;
}
@keyframes sea-hook-sway {
  0%,100% { transform: translateX(0) rotate(-5deg); }
  50%      { transform: translateX(6px) rotate(5deg); }
}

/* ════════════════════════════════════════════════════
   MODE D — 🔫 SPACE SHOOTER
════════════════════════════════════════════════════ */
.space-wrap {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}
.space-stars-cvs {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.space-ufos {
  position: absolute;
  inset: 0;
}
/* Individual UFO */
.arc-ufo {
  position: absolute;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  z-index: 10;
  transform-origin: center center;
  animation: ufo-orbit var(--odur, 4s) linear infinite;
}
@keyframes ufo-orbit {
  0%   { transform: translateX(0)     translateY(0); }
  25%  { transform: translateX(var(--orb, 14px)) translateY(-8px); }
  50%  { transform: translateX(0)     translateY(-14px); }
  75%  { transform: translateX(calc(-1 * var(--orb, 14px))) translateY(-8px); }
  100% { transform: translateX(0)     translateY(0); }
}
.ufo-glow {
  position: absolute;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--col, #00f5ff) 0%, transparent 70%);
  opacity: 0.22;
  pointer-events: none;
}
.ufo-body {
  width: 64px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, var(--col, #00f5ff) 50%, #003030 100%);
  box-shadow: 0 0 16px var(--col, #00f5ff), inset 0 2px 8px rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  position: relative;
}
.ufo-dome {
  width: 34px; height: 22px;
  border-radius: 50% 50% 0 0;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.5), var(--col, #00f5ff) 80%);
  position: absolute;
  top: -18px;
  box-shadow: 0 0 10px var(--col, #00f5ff);
}
.ufo-beam {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid rgba(255,255,255,0.12);
  margin-top: -1px;
  pointer-events: none;
}
.ufo-label {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 8px var(--col, #00f5ff), 0 1px 3px rgba(0,0,0,0.8);
  text-align: center;
  line-height: 1.3;
  max-width: 90px;
  word-break: break-word;
  padding: 2px 4px;
  background: rgba(0,0,0,0.45);
  border-radius: 6px;
}
/* Laser */
#space-laser {
  position: absolute;
  bottom: 60px;
  left: 50%;
  width: 3px;
  background: linear-gradient(0deg, #FF0080, #FFD700);
  border-radius: 2px;
  transform-origin: bottom center;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 0 8px #FF0080, 0 0 20px #FFD700;
  opacity: 0;
  transition: opacity 0.12s;
}
#space-laser.firing {
  opacity: 1;
  animation: laser-flash 0.3s ease forwards;
}
@keyframes laser-flash {
  0%   { opacity: 1; }
  80%  { opacity: 0.9; }
  100% { opacity: 0; }
}
/* Player cannon */
.space-cannon {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  z-index: 20;
  filter: drop-shadow(0 0 10px #FF0080);
  animation: cannon-idle 2s ease-in-out infinite;
}
@keyframes cannon-idle {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}
/* Hit / miss states */
.arc-ufo.ufo-boom .ufo-body {
  animation: ufo-explode 0.5s ease forwards;
}
@keyframes ufo-explode {
  0%   { transform: scale(1); opacity: 1; filter: brightness(1); }
  40%  { transform: scale(1.8); filter: brightness(3); }
  100% { transform: scale(0.1); opacity: 0; }
}
.arc-ufo.ufo-miss .ufo-body {
  animation: ufo-dim 0.5s ease forwards;
}
@keyframes ufo-dim {
  0%   { opacity: 1; }
  100% { opacity: 0.1; filter: grayscale(1); }
}

/* ════════════════════════════════════════════════════
   MODE E — 🔨 WHACK-A-MOLE
════════════════════════════════════════════════════ */
.mole-scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #87CEEB 0%, #a8e063 60%, #6b8e23 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mole-sky-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(180deg, #4fc3f7 0%, #87CEEB 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 20px;
  font-size: 24px;
}
.mole-ground-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 65%;
  background: linear-gradient(180deg, #8BC34A 0%, #558B2F 30%, #33691E 100%);
}
.mole-grid {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 10px;
}
.mole-cell {
  position: relative;
  width: 120px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
/* Dirt hole */
.mole-dirt {
  position: absolute;
  bottom: 0;
  width: 100px; height: 38px;
  background: radial-gradient(ellipse at 50% 60%, #3e2005 0%, #6b3a0a 50%, #8B4513 100%);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
/* Mole */
.arc-mole {
  position: absolute;
  bottom: 10px;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
  /* Pop up on initial render using --delay CSS variable */
  animation: mole-popup 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay, 0s) both;
}
.arc-mole.mole-peek {
  animation: mole-popup 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.arc-mole.mole-hide {
  animation: mole-hide-anim 0.25s ease-in forwards;
}
@keyframes mole-popup {
  0%   { transform: translateY(100%); }
  100% { transform: translateY(0%); }
}
@keyframes mole-hide-anim {
  0%   { transform: translateY(0%); }
  100% { transform: translateY(100%); }
}
/* Peek animation (wiggle to draw attention) */
.arc-mole.mole-wiggle {
  animation: mole-peek-wiggle 0.6s ease infinite alternate;
}
@keyframes mole-peek-wiggle {
  0%   { transform: translateY(0%)    rotate(-4deg); }
  100% { transform: translateY(-5px)  rotate(4deg); }
}
.mole-face {
  font-size: 46px;
  display: block;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  transition: transform 0.1s;
}
.arc-mole:active .mole-face { transform: scale(0.85); }
.mole-sign {
  background: #1a3a1a;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  max-width: 110px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Hit state */
.arc-mole.mole-hit .mole-face {
  animation: mole-smack 0.4s ease forwards;
}
@keyframes mole-smack {
  0%   { transform: scale(1) translateY(0); filter: brightness(1); }
  25%  { transform: scale(1.4) translateY(-10px); filter: brightness(2); }
  100% { transform: scale(0.5) translateY(30px); opacity: 0; }
}
/* Wrong mole */
.arc-mole.mole-angry .mole-face {
  animation: mole-shake 0.5s ease;
}
@keyframes mole-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px) rotate(-8deg); }
  40%     { transform: translateX(6px)  rotate(8deg); }
  60%     { transform: translateX(-4px) rotate(-4deg); }
  80%     { transform: translateX(4px)  rotate(4deg); }
}

/* ════════════════════════════════════════════════════
   ARCADE — DESKTOP OVERRIDES (≥ 900px)
════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .arc-word { font-size: 42px; }
  .arc-word.cn { font-size: 34px; }
  .arc-hdr { padding: 10px 20px; gap: 12px; }
  .arc-back-btn { width: 40px; height: 40px; font-size: 20px; }
  .arc-progress { font-size: 14px; }
  .arc-score { font-size: 16px; }
  .arc-lives { font-size: 18px; }
  .arc-timer-track { height: 8px; }
  .mole-grid { gap: 24px; }
  .mole-cell { width: 150px; height: 130px; }
  .arc-mole { width: 110px; }
  .mole-face { font-size: 62px; }
  .mole-sign { font-size: 15px; max-width: 120px; }
  .mtr-rock { width: 100px; height: 100px; font-size: 15px; }
  .bal-body { width: 100px; height: 120px; font-size: 16px; }
  .arc-ufo { width: 100px; }
  .ufo-body { width: 80px; height: 34px; }
  .ufo-label { font-size: 15px; max-width: 100px; }
  .fish-tag { font-size: 16px; }
  .fish-emoji { font-size: 48px; }
}

/* ═══════════════════════════════════════════════════════
   AUTH — 登录 / 注册页面
═══════════════════════════════════════════════════════ */

/* ── 登录注册屏幕背景 ─────────────────────────────────── */
.auth-screen {
  background: linear-gradient(135deg, #1a1433 0%, #2d1b69 50%, #0f3460 100%);
  align-items: center;
  justify-content: center;
}
.auth-back-btn {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(255,255,255,0.15);
  border: none; color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%; font-size: 18px;
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.auth-back-btn:hover { background: rgba(255,255,255,0.28); }

/* ── 卡片 ──────────────────────────────────────────────── */
.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 32px;
  width: 92%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-logo {
  font-size: 48px;
  text-align: center;
  margin-bottom: 4px;
}
.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a1433;
  text-align: center;
  margin-bottom: 10px;
}

/* ── 表单 ──────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-top: 8px;
}
.auth-input {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-input:focus { border-color: #6C63FF; }
.auth-err {
  font-size: 13px;
  color: #e74c3c;
  min-height: 18px;
  margin: 2px 0;
}
.auth-btn {
  background: linear-gradient(135deg, #6C63FF, #4a44cc);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.15s, opacity 0.15s;
  letter-spacing: 2px;
}
.auth-btn:hover  { transform: translateY(-1px); }
.auth-btn:active { transform: scale(0.97); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── 底部切换链接 ──────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: #888;
  margin-top: 12px;
}
.auth-link {
  background: none; border: none;
  color: #6C63FF;
  font-size: 14px; font-weight: 700;
  cursor: pointer; padding: 0;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   AUTH — 侧边栏用户信息区域
═══════════════════════════════════════════════════════ */
.auth-user-info {
  margin: 8px 12px 4px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
}

/* 已登录状态 */
.au-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.au-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C63FF, #a78bfa);
  color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.au-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.au-name {
  font-size: 14px; font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.au-email {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.au-logout {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.au-logout:hover { background: rgba(231,76,60,0.3); color: #fff; }

/* 未登录状态 */
.au-login-btn {
  width: 100%;
  background: linear-gradient(135deg, #6C63FF, #4a44cc);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.au-login-btn:hover { opacity: 0.88; }

/* ── 手机首页登录区域 ─────────────────────────────────── */
.mobile-auth-area {
  padding: 0 20px 8px;
  width: 100%;
}
.mobile-login-btn {
  width: 100%;
  background: linear-gradient(135deg, #6C63FF, #4a44cc);
  border: none;
  color: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 14px rgba(108,99,255,0.35);
}
.mobile-login-btn:hover { opacity: 0.88; }

.mobile-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(108, 99, 255, 0.08);
  border: 1.5px solid rgba(108, 99, 255, 0.2);
  border-radius: 14px;
  padding: 10px 14px;
}
.mobile-user-bar .au-meta { flex: 1; min-width: 0; }
.mobile-user-bar .au-name { color: var(--text); }
.mobile-user-bar .au-email { color: var(--muted); }
.mobile-user-bar .au-logout {
  background: none;
  border: 1px solid #ddd;
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
