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

:root {
  --bg: #0a0a1a;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.12);
  --text: #e8e8f0;
  --text-dim: #8888a8;
  --accent: #6c5ce7;
  --accent-glow: rgba(108,92,231,0.4);
  --green: #00e676;
  --green-glow: rgba(0,230,118,0.3);
  --red: #ff5252;
  --red-glow: rgba(255,82,82,0.3);
  --gold: #ffd740;
  --gold-glow: rgba(255,215,64,0.3);
  --blue: #448aff;
  --cyan: #00cec9;
  --orange: #e17055;
  --radius: 16px;
  --radius-sm: 10px;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

/* Background blobs */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 500px; height: 500px;
  background: #6c5ce7;
  top: -100px; left: -100px;
}

.blob-2 {
  width: 400px; height: 400px;
  background: #00cec9;
  bottom: -50px; right: -50px;
  animation-delay: -7s;
  animation-duration: 25s;
}

.blob-3 {
  width: 350px; height: 350px;
  background: #e17055;
  top: 40%; left: 50%;
  animation-delay: -14s;
  animation-duration: 30s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.05); }
}

/* ── Navbar — overlapping layout ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
}

.nav-brand { cursor: pointer; flex-shrink: 0; z-index: 2; }

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.accent { color: var(--accent); }

/* Links centered absolutely over the row */
.nav-links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 6px;
  z-index: 1;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(108,92,231,0.1);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 2;
}

/* ── Nav XP pill ── */
.nav-xp-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,215,64,0.06);
  border: 1px solid rgba(255,215,64,0.2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-xp-pill:hover {
  border-color: rgba(255,215,64,0.4);
  box-shadow: 0 0 12px var(--gold-glow);
}

.nav-xp-pill-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,215,64,0.15), rgba(255,215,64,0.25));
  transition: width 0.6s ease;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 8px rgba(255,215,64,0.1) inset;
}

.nav-xp-pill-text {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Nav profile button ── */
.nav-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.nav-profile-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108,92,231,0.08);
}

/* ── Danger button ── */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-danger:hover {
  background: rgba(255,82,82,0.2);
  border-color: var(--red);
}

/* ── Profile settings ── */
.profile-settings-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── Main content ── */
#app {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Glass cards ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.4s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.card-flat {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Auth pages ── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.5s ease;
}

.auth-title {
  text-align: center;
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 800;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 32px;
  font-size: 14px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: #5b4bd5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

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

.btn-demo {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-demo:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108,92,231,0.06);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover { text-decoration: underline; }

.error-msg {
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.3);
  color: var(--red);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s;
}

/* ── Homepage ── */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Home sections */
.home-section {
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}

.home-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-left: 4px;
}

.home-train-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.home-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.feature-card.train-card:hover {
  box-shadow: 0 8px 30px rgba(108,92,231,0.15);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  color: var(--accent);
}

.feature-icon.icon-accent {
  background: rgba(108,92,231,0.12);
  color: var(--accent);
}

.feature-icon.icon-cyan {
  background: rgba(0,206,201,0.12);
  color: var(--cyan);
}

.feature-icon.icon-orange {
  background: rgba(225,112,85,0.12);
  color: var(--orange);
}

.feature-icon.icon-dim {
  background: var(--surface);
  color: var(--text-dim);
}

.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ── Training page ── */
.train-header {
  text-align: center;
  margin-bottom: 32px;
}

.train-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.type-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.type-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.type-card.active {
  border-color: var(--accent);
  background: rgba(108,92,231,0.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

.type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 12px;
  color: var(--accent);
}

.type-icon.icon-accent {
  background: rgba(108,92,231,0.12);
  color: var(--accent);
}

.type-icon.icon-cyan {
  background: rgba(0,206,201,0.12);
  color: var(--cyan);
}

.type-icon.icon-orange {
  background: rgba(225,112,85,0.12);
  color: var(--orange);
}

.type-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.type-count {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Exercise card ── */
.exercise-card {
  background: var(--glass);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  animation: fadeInUp 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
  /* smooth height changes */
  transition: min-height 0.35s ease, padding 0.35s ease;
}

.exercise-category {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.exercise-word {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 32px;
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}


/* ── Exercise feedback smooth reveal ── */
.exercise-feedback {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.4s ease;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exercise-feedback.revealed {
  max-height: 500px;
  opacity: 1;
  margin-top: 16px;
}

.exercise-hint {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ── Stress tiles ── */
.stress-tiles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
}

.stress-tile {
  width: 52px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  /* Use separate translate/scale to prevent animation conflicts */
  translate: 0 0;
  scale: 1;
  transition: translate 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-transform: lowercase;
}

.stress-tile.vowel {
  cursor: pointer;
  border-color: rgba(108,92,231,0.3);
  background: rgba(108,92,231,0.08);
}

.stress-tile.vowel:hover {
  border-color: var(--accent);
  background: rgba(108,92,231,0.15);
  translate: 0 -3px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.stress-tile.correct {
  background: rgba(0,230,118,0.15) !important;
  border-color: var(--green) !important;
  translate: 0 0;
  animation: correctGlow 0.6s ease forwards;
}

.stress-tile.wrong {
  background: rgba(255,82,82,0.15) !important;
  border-color: var(--red) !important;
  translate: 0 0;
  animation: wrongShake 0.4s ease;
}

.stress-tile.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* Glow-based correct animation — no transform conflict */
@keyframes correctGlow {
  0%   { box-shadow: 0 0 0 0 rgba(0,230,118,0.5); scale: 1; }
  40%  { box-shadow: 0 0 24px 4px rgba(0,230,118,0.35); scale: 1.08; }
  100% { box-shadow: 0 0 16px 0 rgba(0,230,118,0.2); scale: 1; }
}

/* Shake using translate — no transform conflict */
@keyframes wrongShake {
  0%, 100% { translate: 0 0; }
  20%  { translate: -4px 0; }
  40%  { translate: 4px 0; }
  60%  { translate: -3px 0; }
  80%  { translate: 2px 0; }
}

/* ── Answer option buttons ── */
.options-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.option-btn {
  padding: 14px 36px;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-width: 120px;
  translate: 0 0;
  scale: 1;
  transition: translate 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.option-btn:hover {
  border-color: var(--accent);
  background: rgba(108,92,231,0.1);
  translate: 0 -2px;
}

.option-btn.correct {
  background: rgba(0,230,118,0.15) !important;
  border-color: var(--green) !important;
  translate: 0 0;
  animation: correctGlow 0.6s ease forwards;
}

.option-btn.wrong {
  background: rgba(255,82,82,0.15) !important;
  border-color: var(--red) !important;
  translate: 0 0;
  animation: wrongShake 0.4s ease;
}

.option-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ── Rule box (answer hint) ── */
.rule-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
  border-radius: 2px var(--radius-sm) var(--radius-sm) 2px;
  padding: 0;
  margin-top: 24px;
  overflow: hidden;
  text-align: left;
  width: 100%;
  max-width: 520px;
  animation: ruleReveal 0.4s ease;
}

.rule-answer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(108,92,231,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rule-answer-icon {
  display: flex;
  align-items: center;
  color: var(--green);
  flex-shrink: 0;
}

.rule-answer-word {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.rule-text {
  padding: 14px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

@keyframes ruleReveal {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ── XP inline badge ── */
.xp-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255,215,64,0.12);
  border: 1px solid rgba(255,215,64,0.3);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  animation: xpBadgePop 0.5s ease;
}

.xp-below-card {
  text-align: center;
  margin-top: 16px;
  animation: xpBadgePop 0.5s ease;
}

.xp-below-card .xp-inline-badge {
  margin-left: 0;
  font-size: 15px;
  padding: 6px 16px;
}

@keyframes xpBadgePop {
  0%   { opacity: 0; scale: 0.7; }
  50%  { scale: 1.1; }
  100% { opacity: 1; scale: 1; }
}

/* ── Level up (top banner) ── */
.levelup-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 30px var(--gold-glow);
  animation: bannerSlideDown 0.4s ease, bannerSlideUp 0.4s ease 3.6s forwards;
}

.levelup-banner .levelup-icon {
  display: flex;
  align-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

.levelup-banner .levelup-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.levelup-banner .levelup-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
}

.levelup-banner .levelup-name {
  font-size: 15px;
  color: var(--text-dim);
}

@keyframes bannerSlideDown {
  from { translate: 0 -100%; opacity: 0; }
  to   { translate: 0 0; opacity: 1; }
}

@keyframes bannerSlideUp {
  from { translate: 0 0; opacity: 1; }
  to   { translate: 0 -100%; opacity: 0; }
}

/* ── Next button ── */
.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
  animation: btnNextAppear 0.35s ease forwards;
  overflow: hidden;
}

@keyframes btnNextAppear {
  from { opacity: 0; max-height: 0; margin-top: 0; }
  to   { opacity: 1; max-height: 60px; margin-top: 24px; }
}

.btn-next:hover {
  background: #5b4bd5;
  transform: translateY(-1px);
}

.btn-next svg {
  display: inline-block;
  vertical-align: middle;
}

/* ── Stats page ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Activity chart */
.chart-container { padding: 24px; }

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 10px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar {
  width: 100%;
  max-width: 30px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(108,92,231,0.3));
  transition: height 0.5s ease;
  min-height: 2px;
  margin-top: auto;
}

.chart-bar.has-data:hover {
  background: linear-gradient(180deg, #a855f7, var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
}

.chart-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  white-space: nowrap;
}

/* Accuracy breakdown */
.accuracy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accuracy-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.accuracy-name { flex: 1; font-size: 14px; font-weight: 500; }

.accuracy-bar-wrap {
  flex: 2;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.accuracy-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.accuracy-value {
  width: 48px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
}

/* ── Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-info h2 { font-size: 24px; font-weight: 700; }

.profile-level {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.xp-bar {
  height: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,64,0.12);
  border-radius: 7px;
  overflow: hidden;
  margin: 16px 0 8px;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #e6a800, var(--gold), #ffe066, var(--gold));
  background-size: 200% 100%;
  border-radius: 6px;
  transition: width 0.8s ease;
  box-shadow: 0 0 12px var(--gold-glow), 0 0 24px rgba(255,215,64,0.15), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: xpShimmer 3s ease infinite;
  position: relative;
}

.xp-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: xpGlare 2.5s ease-in-out infinite;
}

@keyframes xpShimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
}

@keyframes xpGlare {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.xp-text {
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
}

/* ── Achievements ── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.3s, background 0.3s;
}

.achievement-card.earned {
  border-color: var(--gold);
  background: rgba(255,215,64,0.05);
}

.achievement-card.locked { opacity: 0.4; }

.ach-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--text-dim);
}

.achievement-card.earned .ach-icon {
  color: var(--gold);
  background: rgba(255,215,64,0.1);
}

.ach-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.ach-info p { font-size: 12px; color: var(--text-dim); }

.ach-xp {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Achievement toast ── */
.achievement-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 250;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 30px var(--gold-glow);
  animation: toastSlide 4s ease forwards;
}

@keyframes toastSlide {
  0%   { opacity: 0; translate: 100px 0; }
  10%  { opacity: 1; translate: 0 0; }
  80%  { opacity: 1; translate: 0 0; }
  100% { opacity: 0; translate: 100px 0; }
}

.achievement-toast .achievement-icon {
  display: flex;
  color: var(--gold);
}

.achievement-toast .achievement-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
}

.achievement-toast .achievement-desc {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Weak words ── */
.weak-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weak-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.weak-word { font-size: 16px; font-weight: 600; }

.weak-accuracy {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

/* ── Rules page ── */
.rules-category {
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease;
}

.rules-category h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--accent);
}

.rule-item {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 12px;
}

.rule-item h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }

.rule-item p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 12px;
}

.rule-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-example {
  background: rgba(108,92,231,0.1);
  border: 1px solid rgba(108,92,231,0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}

/* ── Section titles ── */
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

.section-title-sm {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
}

/* ── Streak badge ── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

.streak-badge svg { flex-shrink: 0; }

.streak-badge.active {
  background: rgba(255,152,0,0.15);
  border: 1px solid rgba(255,152,0,0.3);
  color: #ff9800;
}

.streak-badge.inactive {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
}

/* ── Merge/split specific ── */
.merge-display {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
}

.merge-highlight {
  color: var(--accent);
  font-weight: 700;
}

/* ── Loading spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { rotate: 360deg; } }

/* ── Session counter ── */
.session-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-dim);
}

.session-counter .count { font-weight: 700; color: var(--text); }
.session-counter .correct-count { color: var(--green); }
.session-counter .wrong-count { color: var(--red); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Responsive: tablets ── */
@media (max-width: 768px) {
  .nav-row {
    height: auto;
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .nav-links {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 4px;
    padding-top: 6px;
  }

  .nav-link { padding: 5px 12px; font-size: 13px; }

  #app { padding: 100px 16px 30px; }

  .home-train-grid { grid-template-columns: 1fr; }

  .type-selector { grid-template-columns: 1fr; }
  .type-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 14px 18px;
  }
  .type-card .type-icon {
    margin: 0;
    flex-shrink: 0;
  }
  .type-card .type-name { margin-bottom: 0; }
  .type-card .type-count { margin-top: 2px; }

  .home-nav-grid { grid-template-columns: 1fr 1fr; }

  .exercise-card { padding: 28px 18px; }

  .exercise-word { font-size: 28px; letter-spacing: 1px; }

  .stress-tile { width: 40px; height: 44px; font-size: 22px; }

  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

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

  .profile-header {
    flex-wrap: wrap;
    gap: 16px;
  }

  .profile-header > div:last-child {
    margin-left: 0;
    width: 100%;
  }

  .session-counter { gap: 12px; font-size: 13px; }

  .accuracy-item { gap: 10px; flex-wrap: wrap; }
  .accuracy-name { min-width: 100%; font-size: 13px; }
  .accuracy-bar-wrap { flex: 1; }
  .accuracy-value { width: 40px; font-size: 13px; }

  .card-flat { padding: 24px 18px; }

  .auth-card { padding: 32px 24px; }

  .option-btn { padding: 12px 24px; font-size: 16px; min-width: 100px; }

  .merge-display { font-size: 20px; }

  .rule-box { max-width: 100%; }
  .rule-answer { padding: 12px 16px; }
  .rule-answer-word { font-size: 15px; }
  .rule-text { padding: 12px 16px; font-size: 13px; }

  .feature-card { padding: 20px; }
  .feature-card p { font-size: 12px; }
}

/* ── Responsive: phones ── */
@media (max-width: 480px) {
  .nav-row {
    padding: 8px 10px;
    flex-wrap: nowrap;
    height: auto;
  }

  .logo-text { font-size: 18px; }

  .nav-user { gap: 8px; }

  .nav-xp-pill { padding: 0 10px; height: 32px; }
  .nav-xp-pill-text { font-size: 11px; }
  .nav-profile-btn { display: none; }

  /* Hide center nav links on phones — use bottom tab bar */
  .nav-links { display: none; }

  #app { padding: 62px 12px 60vh; }

  /* Bottom tab bar for phones */
  .mobile-tabs {
    display: flex !important;
  }

  .hero { padding: 30px 0 24px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; margin-bottom: 24px; }
  .hero .btn { font-size: 15px !important; padding: 12px 28px !important; }

  .home-section-title { font-size: 12px; }

  .home-train-grid,
  .home-nav-grid { grid-template-columns: 1fr; gap: 10px; }

  .feature-icon { width: 44px; height: 44px; }

  .type-selector { grid-template-columns: 1fr; gap: 8px; }
  .type-card { padding: 12px 14px; }

  .exercise-card { padding: 24px 14px; }
  .exercise-word { font-size: 24px; margin-bottom: 20px; }
  .exercise-category { margin-bottom: 16px; font-size: 11px; }

  .stress-tiles { gap: 4px; margin-bottom: 20px; }
  .stress-tile { width: 34px; height: 38px; font-size: 18px; border-width: 1.5px; }

  .options-grid { gap: 8px; }
  .option-btn { padding: 10px 20px; font-size: 15px; min-width: 90px; }

  .merge-display { font-size: 17px; }

  .session-counter { gap: 8px; font-size: 12px; flex-wrap: wrap; justify-content: center; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 28px; }
  .stat-label { font-size: 12px; }

  .chart-container { padding: 16px 8px; }
  .chart-bars { height: 80px; gap: 3px; }

  .profile-header { gap: 12px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 24px; }
  .profile-info h2 { font-size: 20px; }

  .card-flat { padding: 20px 14px; }

  .achievements-grid { gap: 8px; }
  .achievement-card { padding: 12px; gap: 10px; }
  .ach-icon { width: 34px; height: 34px; }
  .ach-info h4 { font-size: 13px; }
  .ach-info p { font-size: 11px; }

  .weak-item { padding: 10px 12px; }
  .weak-word { font-size: 14px; }

  .rule-item { padding: 14px; }
  .rule-item h3 { font-size: 14px; }
  .rule-item p { font-size: 13px; }
  .rule-example { padding: 4px 8px; font-size: 12px; }

  .achievement-toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    padding: 12px 14px;
  }

  .levelup-banner { padding: 12px 16px; gap: 8px; }
  .levelup-banner .levelup-title { font-size: 16px; }

  .btn-next { padding: 10px 28px; font-size: 14px; }

  .section-title { font-size: 18px; }
  .section-title-sm { font-size: 14px; }

  .auth-card { padding: 28px 18px; }
  .auth-title { font-size: 24px; }
  .auth-container { min-height: auto; align-items: flex-start; padding: 10px 12px 80px; }

  .landing-benefits-grid { grid-template-columns: 1fr !important; }
  .landing-audience-grid { grid-template-columns: 1fr !important; }
  .landing-stats-row { flex-wrap: wrap; gap: 16px !important; }
  .landing-stats-row .landing-stat { min-width: 120px; }
  .landing-footer { flex-direction: column; text-align: center; gap: 8px; }
}


/* ── Mobile bottom tab bar ── */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  justify-content: center;
  gap: 0;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px 6px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: 1;
}

.mobile-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  transition: transform 0.3s ease;
}

.mobile-tab.active::before {
  transform: translateX(-50%) scaleX(1);
}

.mobile-tab:active {
  transform: scale(0.92);
}

.mobile-tab.active {
  color: var(--accent);
}

.mobile-tab svg {
  opacity: 0.5;
  transition: opacity 0.25s ease, transform 0.2s ease;
}
.mobile-tab.active svg {
  opacity: 1;
  transform: translateY(-1px);
}

/* ── Landing page ── */
.landing-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  border-radius: 2px;
  margin: 60px auto 48px;
}

.landing-section {
  margin-bottom: 56px;
  animation: fadeInUp 0.5s ease;
}

.landing-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 8px;
}

.landing-section-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.3;
}

.landing-section-desc {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.landing-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.landing-benefit {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  gap: 16px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.landing-benefit:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.landing-benefit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.landing-benefit-icon.icon-accent { background: rgba(108,92,231,0.12); color: var(--accent); }
.landing-benefit-icon.icon-green { background: rgba(0,230,118,0.1); color: var(--green); }
.landing-benefit-icon.icon-gold { background: rgba(255,215,64,0.1); color: var(--gold); }
.landing-benefit-icon.icon-cyan { background: rgba(0,206,201,0.12); color: var(--cyan); }
.landing-benefit-icon.icon-orange { background: rgba(225,112,85,0.12); color: var(--orange); }
.landing-benefit-icon.icon-blue { background: rgba(68,138,255,0.12); color: var(--blue); }

.landing-benefit h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.landing-benefit p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Audience cards */
.landing-audience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.landing-audience-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.landing-audience-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.landing-audience-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: rgba(108,92,231,0.1);
  color: var(--accent);
}

.landing-audience-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.landing-audience-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Stats row */
.landing-stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0;
}

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

.landing-stat-value {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-stat-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* CTA banner */
.landing-cta {
  background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(108,92,231,0.25);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 40px;
}

.landing-cta h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.landing-cta p {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 24px;
}

/* Footer */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-top: 1px solid var(--glass-border);
  margin-top: 20px;
}

.landing-footer-brand {
  font-size: 16px;
  font-weight: 700;
}

.landing-footer-credits {
  font-size: 13px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .landing-benefits-grid { grid-template-columns: 1fr; }
  .landing-audience-grid { grid-template-columns: 1fr; }
  .landing-section-title { font-size: 22px; }
  .landing-stats-row { gap: 24px; flex-wrap: wrap; }
  .landing-cta { padding: 28px 20px; }
  .landing-cta h3 { font-size: 19px; }
}

/* ── Guest navbar buttons ── */
.btn-nav-login {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}

.btn-nav-login:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-nav-register {
  background: var(--accent);
  border: none;
  color: white;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-nav-register:hover {
  background: #5b4bd5;
  transform: translateY(-1px);
}

/* ── Registration banner on homepage ── */
.register-banner {
  background: linear-gradient(135deg, rgba(108,92,231,0.12), rgba(168,85,247,0.08));
  border: 1px solid rgba(108,92,231,0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease;
}

.register-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.register-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(108,92,231,0.15);
  color: var(--accent);
  flex-shrink: 0;
}

.register-banner-text { flex: 1; }

.register-banner-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.register-banner-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ── Guest nudge — fixed bottom toast ── */
.guest-nudge {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,215,64,0.25);
  border-radius: var(--radius);
  padding: 14px 20px;
  z-index: 200;
  max-width: min(520px, calc(100vw - 32px));
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastSlideUp 0.4s ease, toastFadeOut 0.4s ease 5s forwards;
  text-align: left;
}

.guest-nudge-icon {
  display: flex;
  align-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

.guest-nudge-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }
}

/* ── Guest prompt page ── */
.guest-prompt {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.5s ease;
}

.guest-prompt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(108,92,231,0.1);
  color: var(--accent);
  margin: 0 auto 24px;
}

.guest-prompt h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.guest-prompt p {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 440px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.guest-prompt-benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.guest-benefit {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.guest-benefit svg { color: var(--accent); flex-shrink: 0; }

.guest-prompt-actions {
  margin-top: 8px;
}

/* ── Registration page perks ── */
/* ── Perk carousel ── */
.perk-carousel {
  margin-bottom: 24px;
  text-align: center;
}

.perk-carousel-track {
  position: relative;
  height: 40px;
  overflow: hidden;
}

.perk-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(108,92,231,0.06);
  border: 1px solid rgba(108,92,231,0.12);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.perk-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.perk-slide svg { color: var(--accent); flex-shrink: 0; }

.perk-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.perk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.perk-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ── Auth dismiss button ── */
.auth-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.auth-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.auth-dismiss:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── Mobile fixes for new elements ── */
@media (max-width: 768px) {
  .register-banner-content {
    flex-direction: column;
    text-align: center;
  }

  .register-banner-icon { margin: 0 auto; }

  .guest-nudge {
    padding: 12px 16px;
    gap: 10px;
  }

  .guest-prompt h2 { font-size: 20px; }
  .guest-prompt p { font-size: 14px; }

  .guest-benefit { font-size: 12px; padding: 6px 12px; }
}

@media (max-width: 480px) {
  .btn-nav-login { padding: 6px 12px; font-size: 13px; }
  .btn-nav-register { padding: 6px 12px; font-size: 13px; }

  .register-banner { padding: 16px; }
  .register-banner-title { font-size: 14px; }
  .register-banner-desc { font-size: 12px; }

  .guest-nudge { padding: 10px 14px; bottom: 64px; }
  .guest-nudge .btn { padding: 6px 12px; font-size: 12px; }

  .guest-prompt { padding: 40px 12px; }
  .guest-prompt-icon { width: 64px; height: 64px; }
  .guest-prompt h2 { font-size: 18px; }

  .perk-carousel-track { height: 36px; }
  .perk-slide { font-size: 12px; padding: 6px 12px; }
}
