:root {
  --color-l1: #f59e0b;
  --color-l2: #10b981;
  --color-l3: #3b82f6;
  --color-l4: #8b5cf6;
  --color-bg: #f0f9ff;
  --color-card: #ffffff;
  --color-text: #1e293b;
  --color-muted: #94a3b8;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

.screen { max-width: 900px; margin: 0 auto; padding: 20px; }

/* Buttons */
.btn-primary {
  background: var(--color-l1);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.1s;
}
.btn-secondary:hover { border-color: var(--color-l1); }

.btn-back {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 12px;
}
.btn-back:hover { color: var(--color-text); }

.btn-icon {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Home Screen */
.home-header { text-align: center; padding: 40px 0 20px; }
.home-header h1 { font-size: 2.5rem; margin-bottom: 8px; }
.home-player { color: var(--color-muted); font-size: 1.1rem; }

.home-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
}
.stat-box {
  background: white;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
}

/* Practice Screen */
.practice-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: var(--color-l2);
  transition: width 0.3s;
  width: 0%;
}

.practice-body {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.practice-text {
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
  line-height: 2;
  min-height: 60px;
  margin-bottom: 16px;
}

.char { color: #94a3b8; }
.char.correct { color: #10b981; }
.char.error { color: white; background: #f87171; border-radius: 3px; }
.char.cursor {
  text-decoration: underline;
  text-decoration-color: #3b82f6;
  text-underline-offset: 4px;
  background: #3b82f6;
  color: white;
  border-radius: 2px;
}

.practice-stats {
  display: flex;
  gap: 24px;
  font-size: 1rem;
  color: var(--color-muted);
}
.practice-stats strong { color: var(--color-text); }

/* Results Screen */
.results-body {
  text-align: center;
  padding: 40px 20px;
}
.result-stars {
  font-size: 3rem;
  margin: 20px 0;
  animation: starDrop 0.5s ease;
}
@keyframes starDrop {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 1.2rem;
  margin: 16px 0;
  color: var(--color-muted);
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.badge-popup {
  display: inline-block;
  background: var(--color-l1);
  color: white;
  border-radius: 8px;
  padding: 8px 16px;
  margin: 8px 4px;
  font-weight: 700;
  animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay[hidden] { display: none; }
.overlay-box {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-muted);
}
.badge-item {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.badge-item.locked { opacity: 0.4; }
.leaderboard-entry {
  padding: 8px 0;
  font-size: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Map header */
.map-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.lang-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}

.lang-btn:hover { border-color: var(--color-l3); }

.lang-btn.active {
  background: var(--color-l3);
  color: white;
  border-color: var(--color-l3);
}

/* Input method selector (VI practice screen) */
.input-method-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.im-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}

.im-btn:hover { border-color: var(--color-l3); }

.im-btn.active {
  background: var(--color-l3);
  color: white;
  border-color: var(--color-l3);
}

.home-auth-bar { display: flex; gap: 8px; align-items: center; justify-content: center;
                  flex-wrap: wrap; margin-top: 8px; }
.home-auth-bar .auth-name { font-weight: 600; color: #374151; font-size: 0.9rem; }
.btn-auth { padding: 6px 14px; border-radius: 8px; border: none; cursor: pointer;
             font-size: 0.875rem; font-weight: 600; text-decoration: none;
             display: inline-block; }
.btn-auth-login { background: #7c3aed; color: #fff; }
.btn-auth-login:hover { background: #6d28d9; }
.btn-auth-register { background: #f3f4f6; color: #374151; }
.btn-auth-admin { background: #0f766e; color: #fff; }
.btn-auth-logout { background: #f3f4f6; color: #6b7280; }
.banner-pending { background: #fffbeb; border-bottom: 1px solid #fcd34d; color: #92400e;
                   padding: 10px 16px; text-align: center; font-size: 0.875rem; }
.lesson-btn.access-locked { opacity: 0.6; }
.lesson-btn.access-locked::after { content: '🔐'; position: absolute; top: 4px; right: 4px;
                                     font-size: 0.7rem; }

/* ── Landing Nav ── */
.landing-nav {
  background: rgba(15,23,42,0.97);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.landing-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-logo-icon {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-link {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn-nav-login {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-nav-register {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}

/* ── Landing mode: remove screen padding so hero goes edge-to-edge ── */
.screen.landing-mode { padding: 0; }

/* ── Landing Hero ── */
.landing-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #312e81 100%);
  color: white;
  padding: 52px 32px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(139,92,246,0.25) 0%, transparent 60%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,0.18);
  border: 1px solid rgba(245,158,11,0.45);
  color: #fcd34d;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 18px;
  position: relative;
}
.landing-hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  position: relative;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 1.05rem;
  color: #bfdbfe;
  margin-bottom: 6px;
  position: relative;
}
.hero-tagline {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 30px;
  position: relative;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn-hero-primary {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 13px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
}
.btn-hero-secondary {
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 13px 24px;
  font-size: 1rem;
  cursor: pointer;
}

/* ── Landing Stats Strip ── */
.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 24px 24px 0;
  margin-top: -20px;
  position: relative;
  z-index: 2;
}
.landing-stat-card {
  background: white;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.landing-stat-number { font-size: 1.8rem; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.landing-stat-label { font-size: 0.78rem; color: #64748b; font-weight: 500; }

/* ── Pricing Section ── */
.landing-section { padding: 36px 24px 0; }
.landing-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #7c3aed;
  margin-bottom: 8px;
  text-align: center;
}
.landing-section-title {
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  color: #0f172a;
}
.pricing-card {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border-radius: 20px;
  padding: 32px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(124,58,237,0.35);
}
.pricing-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}
.pricing-card-badge {
  display: inline-block;
  background: rgba(245,158,11,0.22);
  border: 1px solid rgba(245,158,11,0.55);
  color: #fcd34d;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.pricing-card-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; opacity: 0.85; }
.pricing-card-price { font-size: 3rem; font-weight: 900; line-height: 1; margin: 8px 0 4px; }
.pricing-card-note { font-size: 0.85rem; opacity: 0.75; margin-bottom: 20px; }
.pricing-card-features { list-style: none; margin-bottom: 24px; }
.pricing-card-features li {
  padding: 6px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.pricing-card-features li:last-child { border-bottom: none; }
.pricing-check { color: #4ade80; }
.btn-pricing {
  width: 100%;
  background: white;
  color: #7c3aed;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.18);
}

/* ── Registration Steps ── */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 16px; align-items: flex-start; position: relative; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step-line { position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: #e2e8f0; }
.step:last-child .step-line { display: none; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
  color: white; position: relative; z-index: 1;
}
.step-body h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; color: #0f172a; }
.step-body p { font-size: 0.85rem; color: #475569; line-height: 1.55; }
.bank-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
}
.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.bank-row:last-child { border-bottom: none; }
.bank-label { color: #94a3b8; font-size: 0.78rem; }
.bank-value { font-weight: 700; color: #1e293b; }
.bank-value-accent { color: #7c3aed; font-family: 'Courier New', monospace; font-size: 0.95rem; font-weight: 700; }
.content-note {
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.83rem;
  color: #713f12;
  line-height: 1.6;
}
.content-note code {
  background: #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* ── Contact Section ── */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.contact-card {
  background: white;
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 1.5px solid #f1f5f9;
  text-decoration: none;
  display: block;
  color: inherit;
}
.contact-card:hover { border-color: #c4b5fd; }
.contact-icon { font-size: 2rem; margin-bottom: 8px; }
.contact-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.contact-value { font-size: 0.9rem; font-weight: 700; color: #0f172a; }
.contact-info-box {
  margin-top: 14px;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.82rem;
  color: #166534;
  border: 1px solid #86efac;
}

/* ── Landing Divider ── */
.landing-divider { height: 1px; background: #f1f5f9; margin: 36px 24px 0; }

/* ── Site Footer ── */
.site-footer {
  margin-top: 48px;
  background: #0f172a;
  color: #64748b;
  text-align: center;
  padding: 28px 24px;
  font-size: 0.82rem;
}
.site-footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}
.site-footer a { color: #a78bfa; text-decoration: none; }

/* ── Mobile: collapse nav links on small screens ── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .btn-nav-login { display: none; }
  .landing-hero { padding: 40px 20px 36px; }
  .landing-hero h1 { font-size: 2rem; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .pricing-card { padding: 24px 20px; }
}
