/* ============================================
   LinguaQuest v2.0 - Complete Stylesheet
   ============================================ */

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

:root {
  --bg-dark: #0a0e1a;
  --bg-card: #131830;
  --bg-card-hover: #1a2040;
  --border-glow: #2a3a6a;
  --text-primary: #e0e6ff;
  --text-secondary: #8892b0;
  --text-dim: #5a6380;
  --accent-blue: #4fc3f7;
  --accent-purple: #b388ff;
  --accent-gold: #ffd54f;
  --accent-green: #69f0ae;
  --accent-red: #ff5252;
  --accent-orange: #ffab40;
  --accent-pink: #ff80ab;
  --accent-cyan: #18ffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px rgba(79, 195, 247, 0.3);
  --shadow-glow-purple: 0 0 20px rgba(179, 136, 255, 0.3);
  --shadow-glow-gold: 0 0 20px rgba(255, 213, 79, 0.3);
  --font-display: 'Cinzel Decorative', 'Orbitron', serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-mono: 'Orbitron', monospace;
  --timer-size: 120px;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

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

/* === Particles Canvas === */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* === Header === */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0d1224 0%, #1a1f3a 100%);
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  padding: 0.6rem 1rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.header-hud {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  flex: 1;
}

.hud-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
  white-space: nowrap;
}

.btn-ai-toggle {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-weight: 900;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-ai-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow-purple);
}

/* === Navigation === */
#main-nav {
  position: sticky;
  top: 60px;
  z-index: 99;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glow);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#main-nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  font-family: var(--font-body);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(79, 195, 247, 0.05);
}

/* === Main Content === */
#content-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s;
}

.card:hover {
  border-color: rgba(79, 195, 247, 0.3);
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  color: var(--accent-blue);
}

/* === Buttons === */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s;
  font-family: var(--font-body);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-blue);
}

.btn-danger {
  background: rgba(255, 82, 82, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-body);
}

.btn-danger:hover {
  background: rgba(255, 82, 82, 0.3);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.3s;
}

.btn-icon:hover {
  color: var(--text-primary);
}

/* === Form Elements === */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.2);
}

/* ============================================
   MISSION CARDS + TIMER
   ============================================ */
.mission-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.mission-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: all 0.3s;
}

.mission-card:hover {
  border-color: rgba(79, 195, 247, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.mission-card.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(105, 240, 174, 0.15);
}

.mission-card.completed {
  border-color: var(--accent-gold);
  opacity: 0.7;
}

.mission-info h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.mission-info .mission-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.mission-lang {
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.lang-italian {
  background: rgba(0, 146, 70, 0.2);
  color: #69f0ae;
  border: 1px solid rgba(0, 146, 70, 0.4);
}

.lang-english {
  background: rgba(0, 82, 180, 0.2);
  color: #4fc3f7;
  border: 1px solid rgba(0, 82, 180, 0.4);
}

.lang-cantonese {
  background: rgba(255, 82, 82, 0.2);
  color: #ff8a80;
  border: 1px solid rgba(255, 82, 82, 0.4);
}

.lang-all {
  background: rgba(179, 136, 255, 0.2);
  color: #b388ff;
  border: 1px solid rgba(179, 136, 255, 0.4);
}

.mission-timer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Circular Timer */
.timer-circle {
  position: relative;
  width: var(--timer-size);
  height: var(--timer-size);
}

.timer-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-circle .timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.timer-circle .timer-progress {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-circle .timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mission-btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn-start-mission {
  background: linear-gradient(135deg, var(--accent-green), #00c853);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  font-family: var(--font-body);
}

.btn-start-mission:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(105, 240, 174, 0.4);
}

.btn-start-mission:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-stop-mission {
  background: rgba(255, 82, 82, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.3s;
}

.btn-stop-mission:hover {
  background: rgba(255, 82, 82, 0.3);
}

.btn-complete-mission {
  background: linear-gradient(135deg, var(--accent-gold), #ff8f00);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  font-family: var(--font-body);
  display: none;
}

.btn-complete-mission.show {
  display: inline-block;
}

.btn-complete-mission:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-gold);
}

.mission-today-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.mission-today-item:last-child {
  border-bottom: none;
}

.mission-count {
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

/* ============================================
   SCHEDULER
   ============================================ */
.scheduler-controls {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

#weekly-schedule {
  margin-top: 1rem;
}

.schedule-day {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.schedule-day-header {
  padding: 0.6rem 1rem;
  background: rgba(79, 195, 247, 0.08);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}

.schedule-day-header:hover {
  background: rgba(79, 195, 247, 0.12);
}

.schedule-day-header.today {
  background: rgba(105, 240, 174, 0.1);
  color: var(--accent-green);
}

.schedule-day-body {
  padding: 0.5rem 1rem;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-time {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  min-width: 50px;
}

.schedule-task {
  flex: 1;
}

.schedule-xp {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  font-size: 0.8rem;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.dash-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.dash-card h3 {
  font-size: 0.95rem;
  color: var(--accent-blue);
  margin-bottom: 0.8rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
}

.stat-value.green {
  color: var(--accent-green);
}

.stat-value.gold {
  color: var(--accent-gold);
}

.stat-value.red {
  color: var(--accent-red);
}

.stat-value.blue {
  color: var(--accent-blue);
}

/* Progress Bars */
.progress-bar-container {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  margin: 0.3rem 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.fill-green {
  background: linear-gradient(90deg, #00c853, #69f0ae);
}

.fill-blue {
  background: linear-gradient(90deg, #2196f3, #4fc3f7);
}

.fill-purple {
  background: linear-gradient(90deg, #7c4dff, #b388ff);
}

.fill-gold {
  background: linear-gradient(90deg, #ff8f00, #ffd54f);
}

.fill-red {
  background: linear-gradient(90deg, #d50000, #ff5252);
}

/* Heatmap */
#heatmap-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  transition: all 0.3s;
}

.heatmap-cell[data-level="1"] {
  background: rgba(105, 240, 174, 0.2);
}

.heatmap-cell[data-level="2"] {
  background: rgba(105, 240, 174, 0.4);
}

.heatmap-cell[data-level="3"] {
  background: rgba(105, 240, 174, 0.6);
}

.heatmap-cell[data-level="4"] {
  background: rgba(105, 240, 174, 0.8);
}

.heatmap-cell[data-level="5"] {
  background: rgba(105, 240, 174, 1.0);
}

.heatmap-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.2rem 0;
}

/* AI Insights */
#ai-insights-content {
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0.8rem;
}

/* ============================================
   SPHERE GRID (kept from v1)
   ============================================ */
.sphere-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

#sphere-grid-container {
  overflow: auto;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(20, 25, 50, 0.8), transparent);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 500px;
}

#sphere-grid {
  position: relative;
  width: 740px;
  height: 500px;
  margin: 0 auto;
}

.sphere-info-box {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  min-height: 60px;
  font-size: 0.9rem;
}

/* ============================================
   AI SIDEBAR
   ============================================ */
.ai-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: linear-gradient(180deg, #0d1224, #131830);
  border-left: 1px solid var(--border-glow);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.ai-sidebar.open {
  right: 0;
}

.ai-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-glow);
}

.ai-sidebar-header h3 {
  flex: 1;
  font-size: 1rem;
}

.ai-lang-switch select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.ai-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-msg {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  max-width: 90%;
  font-size: 0.85rem;
  line-height: 1.6;
}

.ai-msg.user {
  align-self: flex-end;
  background: rgba(79, 195, 247, 0.15);
  border: 1px solid rgba(79, 195, 247, 0.3);
}

.ai-msg.bot {
  align-self: flex-start;
  background: rgba(179, 136, 255, 0.1);
  border: 1px solid rgba(179, 136, 255, 0.2);
}

.ai-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border-glow);
}

.ai-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.ai-status {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 1.2rem;
  color: var(--accent-gold);
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
  max-width: 320px;
}

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

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

.toast.xp {
  border-color: var(--accent-gold);
}

.toast.levelup {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.15), var(--bg-card));
  font-weight: 700;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

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

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* === XP Popup Animation === */
.xp-popup {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 213, 79, 0.6);
  pointer-events: none;
  z-index: 500;
  animation: xpFloat 1.5s ease-out forwards;
}

@keyframes xpFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.5);
  }
}

/* === Level Up Full Screen Effect === */
.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: radial-gradient(circle, rgba(255, 213, 79, 0.15), transparent);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: lvupPulse 2s ease forwards;
  pointer-events: none;
}

.levelup-overlay .lvup-text {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent-gold);
  text-shadow: 0 0 40px rgba(255, 213, 79, 0.6);
  animation: lvupScale 2s ease forwards;
}

@keyframes lvupPulse {
  0% {
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes lvupScale {
  0% {
    transform: scale(0.5);
  }

  50% {
    transform: scale(1.2);
  }

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

/* === Character Display === */
.char-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.char-stat-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  text-align: center;
}

.char-stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.char-stat-item .stat-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.bonus-preview {
  background: rgba(255, 213, 79, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin: 0.8rem 0;
  font-size: 0.85rem;
  color: var(--accent-gold);
}

/* === Lang Add Row === */
.lang-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lang-add-row input {
  flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .logo-title {
    font-size: 1.2rem;
  }

  .header-hud {
    gap: 0.4rem;
  }

  .hud-item {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }

  .nav-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }

  .mission-card {
    grid-template-columns: 1fr;
  }

  .mission-timer-area {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  :root {
    --timer-size: 90px;
  }

  .timer-circle .timer-text {
    font-size: 0.85rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .ai-sidebar {
    width: 100%;
    right: -100%;
  }

  .scheduler-controls {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  :root {
    --timer-size: 80px;
  }

  .card {
    padding: 1rem;
  }

  .lvup-text {
    font-size: 2rem !important;
  }
}
