/* ============================================
   PalPal Web — Glass Morphism Dark Theme
   ============================================ */

:root {
  --bg: #0a0a0f;
  --bg-card: rgba(20, 20, 35, 0.7);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-hover: rgba(255, 255, 255, 0.10);
  --text: #e8e8ed;
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-subtle: rgba(255, 255, 255, 0.35);
  --accent: #6c8cff;
  --accent-glow: rgba(108, 140, 255, 0.4);
  --accent-2: #ff6b8a;
  --accent-3: #42d9a0;
  --danger: #ff4466;
  --radius: 18px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

/* Inner scroll containers: allow native touch scrolling, block refresh chaining */
.dash-content, .assess-content, .settings-content, .vocab-list,
.chat-practice-conv, .cards-container, .theme-list, .catdetail-content {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: contain; /* no pull-to-refresh (replaces the old touchmove preventDefault) */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at 50% 30%, #1a1a3a 0%, #0a0a0f 70%);
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 900px;
  position: relative;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ===== WELCOME SCREEN ===== */
.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 16px;
}

.welcome-orb {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 8px;
}
.orb-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: orb-pulse 3s ease-in-out infinite;
}
.orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(140,160,255,0.5), rgba(60,80,200,0.3) 40%, rgba(20,30,80,0.6) 100%);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.welcome-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c8d6ff, #a0b4ff, #c8d6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 24px;
}

.welcome-selects {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 320px;
}
.select-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.select-group label {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select:focus { outline: none; border-color: var(--accent); }

.welcome-hint {
  color: var(--accent-2);
  font-size: 13px;
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 320px;
}
.btn-primary:hover { background: #7b9aff; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  text-align: center;
}
.btn-secondary:hover { background: var(--glass-hover); }

.btn-danger {
  background: rgba(255,68,102,0.15);
  border: 1px solid rgba(255,68,102,0.3);
  color: var(--danger);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}
.btn-danger:hover { background: rgba(255,68,102,0.25); }

.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--glass); color: var(--text); }

/* ===== CONVERSATION SCREEN ===== */
.conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
}
.conv-theme {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}

/* ===== CONVERSATION ORB ===== */
.conv-orb-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.conv-orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.conv-orb:active { transform: scale(0.95); }

/* Orb states */
.conv-orb.idle .orb-face {
  background: radial-gradient(circle at 35% 35%, rgba(108,140,255,0.45), rgba(60,80,200,0.25) 40%, rgba(20,30,80,0.5) 100%);
  border-color: rgba(255,255,255,0.12);
}
.conv-orb.listening .orb-face {
  background: radial-gradient(circle at 35% 35%, rgba(255,107,138,0.5), rgba(200,60,100,0.3) 40%, rgba(80,20,40,0.5) 100%);
  border-color: rgba(255,107,138,0.4);
  animation: orb-breathe 0.8s ease-in-out infinite;
}
.conv-orb.speaking .orb-face {
  background: radial-gradient(circle at 35% 35%, rgba(66,217,160,0.5), rgba(40,180,120,0.3) 40%, rgba(20,80,50,0.5) 100%);
  border-color: rgba(66,217,160,0.4);
  animation: orb-breathe 1.2s ease-in-out infinite;
}
.conv-orb.thinking .orb-face {
  background: radial-gradient(circle at 35% 35%, rgba(200,180,100,0.45), rgba(150,130,50,0.25) 40%, rgba(60,50,20,0.5) 100%);
  border-color: rgba(200,180,100,0.3);
  animation: orb-spin 2s linear infinite;
}

.orb-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.4s ease;
}
.orb-ripple {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.conv-orb.listening .orb-ripple {
  animation: ripple-out 1.5s ease-out infinite;
  border: 2px solid rgba(255,107,138,0.3);
}
.conv-orb.speaking .orb-ripple {
  animation: ripple-out 2s ease-out infinite;
  border: 2px solid rgba(66,217,160,0.3);
}

.orb-status {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  min-height: 20px;
}

@keyframes orb-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes orb-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ripple-out {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ===== SUBTITLES ===== */
.conv-subtitles {
  padding: 0 24px 16px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.subtitle-ai {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: opacity 0.3s;
}
.subtitle-ai:empty { display: none; }
.subtitle-meaning {
  font-size: 14px;
  color: var(--text-subtle);
  font-style: italic;
  transition: opacity 0.3s;
}
.subtitle-meaning:empty { display: none; }
.subtitle-user {
  font-size: 16px;
  color: var(--text-dim);
  opacity: 0.8;
  transition: opacity 0.3s;
}
.subtitle-user:empty { display: none; }

/* ===== CONTROLS ===== */
.conv-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 32px;
  gap: 12px;
}
.btn-ctrl {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ctrl:hover { background: var(--glass-hover); color: var(--text); }
.btn-ctrl.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.conv-actions {
  display: flex;
  gap: 8px;
}

/* ===== TYPE INPUT ===== */
.type-input-hidden {
  display: none;
  padding: 0 24px 20px;
  gap: 8px;
}
.type-input-visible {
  display: flex;
}
#type-input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#type-input:focus { outline: none; border-color: var(--accent); }
#type-input::placeholder { color: var(--text-subtle); }
#btn-send-typed {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}

/* ===== MODALS ===== */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  max-height: 70vh;
  overflow-y: auto;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
.modal-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}
.theme-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.theme-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.theme-item:hover { background: var(--glass-hover); }
.theme-item.selected { border-color: var(--accent); background: rgba(108,140,255,0.15); }

/* ===== SETTINGS SCREEN ===== */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.settings-header h2 { font-size: 18px; font-weight: 600; }

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-section h3 {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.settings-section label {
  font-size: 14px;
  color: var(--text-dim);
}
.api-key-row {
  display: flex;
  gap: 8px;
}
.api-key-row input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: monospace;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.api-key-row input:focus { outline: none; border-color: var(--accent); }
.settings-hint {
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.5;
}

input[type="password"], input[type="text"] {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
input:focus { outline: none; border-color: var(--accent); }

.vocab-count {
  font-size: 12px;
  color: var(--text-subtle);
  text-align: center;
}

/* ===== VOCABULARY SCREEN ===== */
.vocab-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vocab-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.vocab-word {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.vocab-meaning {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.vocab-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.vocab-bars {
  display: flex;
  gap: 3px;
}
.vocab-bar {
  width: 20px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s;
}
.vocab-bar.filled { background: var(--accent-3); }
.vocab-seen {
  font-size: 11px;
  color: var(--text-subtle);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .welcome-title { font-size: 28px; }
  .conv-orb { width: 140px; height: 140px; }
  .orb-face { font-size: 40px; }
  .subtitle-ai { font-size: 18px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ===== ASSESSMENT & LISTEN ===== */
.assess-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 100px;
}
.btn-submit-wide { margin-top: 24px; width: 100%; max-width: 100%; }

.assess-scenario-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.assess-play-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-play {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}
.btn-play:active { transform: scale(0.96); }
.assess-replay-hint { font-size: 12px; color: var(--text-subtle); }
.assess-quiz h3 {
  font-size: 14px;
  color: var(--text-dim);
  margin: 16px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.assess-word-choices, .assess-comp-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quiz-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.quiz-chip.selected {
  background: rgba(108,140,255,0.2);
  border-color: var(--accent);
}
.quiz-chip.correct {
  background: rgba(66,217,160,0.2);
  border-color: var(--accent-3);
}
.quiz-chip.wrong {
  background: rgba(255,68,102,0.2);
  border-color: var(--danger);
}
.quiz-chip.missed {
  background: rgba(255,180,60,0.15);
  border-color: rgba(255,180,60,0.5);
  border-style: dashed;
}

/* ===== DASHBOARD ===== */
.dash-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.dash-tier-badge {
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 16px;
}
.dash-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-cat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-at:hover { background: var(--glass-hover); }
.dash-cat.mastered { border-color: var(--accent-3); }
.dash-cat-emoji { font-size: 20px; }
.dash-cat-info { flex: 1; }
.dash-cat-name { font-size: 14px; font-weight: 500; }
.dash-cat-tier { font-size: 12px; color: var(--text-dim); }
.dash-cat-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  width: 60px;
  overflow: hidden;
}
.dash-cat-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.dash-cat-streak {
  font-size: 12px;
  color: var(--accent-3);
  min-width: 30px;
  text-align: right;
}
.dash-suggested {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(108,140,255,0.1);
  border: 1px solid rgba(108,140,255,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}

/* ===== CHAT PRACTICE ===== */
.chat-practice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-checklist {
  padding: 12px 20px;
  background: rgba(10,10,15,0.9);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}
.chat-checklist-item.done { color: var(--accent-3); }
.chat-checklist-item .check-bullet {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.chat-checklist-item.done .check-bullet {
  border-color: var(--accent-3);
  background: rgba(66,217,160,0.15);
}
.chat-practice-conv { flex: 1; overflow-y: auto; }
.chat-grammar {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,68,102,0.2);
  font-size: 13px;
  color: var(--accent-2);
  min-height: 0;
}
.chat-grammar:empty { display: none; }

.chat-checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.chat-checklist-header span { font-size: 13px; font-weight: 600; }
.chat-checklist.collapsed .chat-checklist-items { display: none; }
.chat-checklist.collapsed .chat-checklist-header { margin-bottom: 0; }

.chat-checklist-phrase {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-checklist-phrase .check-bullet {
  width: 20px; height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  transition: all 0.3s;
}
.chat-checklist-phrase.done { color: var(--accent-3); }
.chat-checklist-phrase.done .check-bullet {
  border-color: var(--accent-3);
  background: rgba(66,217,160,0.15);
  animation: checkPop 0.3s ease;
}
@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.chat-checklist-phrase .phrase-translation {
  display: none;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.chat-checklist-phrase.show-translation .phrase-translation { display: block; }

.chat-review-card { max-width: 340px; }
.chat-review-card .review-phrase { padding: 6px 0; font-size: 14px; }
.chat-review-card .review-phrase.missed { color: var(--danger); }
.chat-review-card .review-phrase.done { color: var(--accent-3); }
.chat-review-grammar { margin: 12px 0; font-size: 13px; color: var(--accent-2); }
.chat-review-score { margin: 12px 0; font-size: 16px; font-weight: 600; text-align: center; }

.chat-hint {
  padding: 8px 12px;
  margin: 8px 20px;
  background: rgba(255,180,60,0.1);
  border: 1px solid rgba(255,180,60,0.2);
  border-radius: 10px;
  font-size: 13px;
  color: #ffb43c;
  text-align: center;
}
.listen-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
}
.listen-result.pass { background: rgba(66,217,160,0.15); color: var(--accent-3); }
.listen-result.fail { background: rgba(255,68,102,0.15); color: var(--danger); }
.listen-result.hidden { display: none; }
.listen-result button {
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font);
  cursor: pointer;
}

/* ===== CARDS ===== */
.cards-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
.card-flip {
  width: 280px;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
}
.card-flip.flipped .card-inner { transform: rotateY(180deg); }
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}
.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.card-back { transform: rotateY(180deg); }
.card-word {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.card-tts {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
.card-translation {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.card-example {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}
.card-actions {
  display: flex;
  gap: 12px;
}
.card-actions button { width: 120px; }
.card-progress { font-size: 13px; color: var(--text-subtle); }

/* ===== CATEGORY DETAIL ===== */
.catdetail-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  gap: 16px;
}
.catdetail-emoji { font-size: 56px; }
.catdetail-name { font-size: 22px; font-weight: 600; }
.catdetail-tier { font-size: 14px; color: var(--accent); background: rgba(108,140,255,0.1); padding: 4px 14px; border-radius: 12px; }
.catdetail-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 280px; }
.catdetail-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.catdetail-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.catdetail-streak { font-size: 14px; color: var(--accent-3); font-weight: 600; min-width: 30px; }
#catdetail-hint { font-size: 13px; color: var(--text-dim); text-align: center; }
.catdetail-buttons { display: flex; gap: 12px; width: 100%; max-width: 300px; }
.catdetail-buttons button { flex: 1; }
.catdetail-buttons button:disabled { opacity: 0.35; }
.catdetail-last { font-size: 12px; color: var(--text-subtle); text-align: center; }

/* ===== FLOATING SETTINGS ===== */
.btn-floating-settings {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-floating-settings:hover { background: var(--glass-hover); color: var(--text); }