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

:root {
  --bg-primary: #0f0f11;
  --bg-secondary: #1a1a1f;
  --bg-tertiary: #242429;
  --accent: #6366f1;
  --accent-pink: #ec4899;
  --accent-purple: #a855f7;
  --text-primary: #e8e8ed;
  --text-secondary: #9898a0;
  --text-muted: #6b6b73;
  --border: #2a2a30;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 20px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.header-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== Main ===== */
.main-content {
  padding: 16px 0;
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 20px));
}

/* ===== Overview Card ===== */
.overview-card {
  position: relative;
  margin: 0 16px 20px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.overview-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(236, 72, 153, 0.12) 100%);
}
.overview-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}
.overview-content {
  position: relative;
  display: flex;
  align-items: center;
  padding: 28px 20px;
}
.overview-item {
  flex: 1;
  text-align: center;
}
.overview-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.overview-num {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.overview-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.overview-divider {
  width: 1px;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 12px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-purple));
  border-radius: 2px;
}
.section-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Tabs ===== */
.tabs-container {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 4px;
  margin: 0 16px 16px;
  border: 1px solid var(--border);
}
.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tab-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.tab-icon { font-size: 16px; }
.tab-text { font-size: 13px; }

/* ===== Tab Content ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Modes Grid ===== */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 16px 20px;
}
.mode-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 8px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.mode-card:active {
  transform: scale(0.95);
  border-color: var(--accent);
}
.mode-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 8px;
}
.mode-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Basic Words Banner ===== */
.basic-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin: 0 16px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(52, 211, 153, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}
.basic-banner:active { transform: scale(0.98); }
.basic-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 3s infinite;
}
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}
.basic-banner-icon {
  font-size: 36px;
  flex-shrink: 0;
  animation: float-icon 3s ease-in-out infinite;
}
@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.basic-banner-info { flex: 1; }
.basic-banner-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.basic-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.basic-banner-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Basic Words Stats ===== */
.basic-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 16px 20px;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.basic-stat {
  text-align: center;
  flex-shrink: 0;
}
.basic-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #10b981;
  line-height: 1.2;
}
.basic-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.basic-stat-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.basic-stat-bar-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.basic-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.basic-stat-pct {
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
  text-align: right;
}

/* ===== Levels ===== */
.levels-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 16px;
}
.level-card {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: transform 0.15s;
}
.level-card:active { transform: scale(0.99); }
.level-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.level-name {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}
.level-stats-row {
  display: flex;
  gap: 10px;
}
.level-stat-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px;
}
.level-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.level-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}
.level-stat-numbers {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.level-stat-total {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.level-stat-mini-bar {
  height: 5px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}
.level-stat-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.level-stat-pct {
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

/* ===== Light Theme ===== */
/* App is always dark themed, no light mode override */
