/* Base */
:root { --bg:#0b1020; --bg-elev:#0f172a; --text:#e5e7eb; --muted:#9ca3af; --card:#0b1220; --line:#334155; --brand:#5B8CFF; --brand-2:#22D3EE; --ok:#10b981; --warn:#f59e0b; }
* { box-sizing:border-box; }
html,body { height:100%; }
body { margin:0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background:linear-gradient(180deg,#070b18, #0b1020 20%, #0b1020); color:var(--text); line-height:1.6; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
svg[loading="lazy"], img[loading="lazy"] { content-visibility:auto; }

.skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { position:fixed; left:1rem; top:1rem; width:auto; height:auto; padding:.5rem .75rem; background:#111827; color:#fff; border:1px solid var(--line); border-radius:.5rem; z-index:1000; }

/* Layout */
.container { width:100%; max-width:1120px; margin:0 auto; padding:0 20px; }
.section { padding:64px 0; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity:0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-visible { opacity:1; transform:none; }
}

/* Header */
.site-header { position:sticky; top:0; z-index:50; background:rgba(11,16,32,.7); backdrop-filter:saturate(150%) blur(10px); border-bottom:1px solid rgba(51,65,85,.35); }
.nav { display:flex; align-items:center; justify-content:space-between; height:64px; }
.brand { display:flex; gap:.6rem; align-items:center; font-weight:700; letter-spacing:.5px; }
.pill { display:inline-flex; align-items:center; justify-content:center; padding:.15rem .45rem; font-size:.75rem; border-radius:.35rem; border:1px solid rgba(99,102,241,.35); margin-left:.4rem; color:#c7d2fe; background:rgba(99,102,241,.12); }
.pill-beta { border-color: rgba(34,211,238,.35); color:#a5f3fc; background:rgba(34,211,238,.12); }
.primary-nav { display:flex; gap:1rem; align-items:center; }
.primary-nav a { color:var(--muted); }
.primary-nav a.btn { color:#fff; }

/* Buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; padding:.65rem 1rem; border-radius:.75rem; border:1px solid transparent; background-image:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; font-weight:600; box-shadow:0 8px 24px rgba(99,102,241,.25); transition:transform .08s ease, box-shadow .2s ease, filter .2s ease; }
.btn:hover { transform:translateY(-1px); filter:saturate(115%); box-shadow:0 10px 28px rgba(6,182,212,.25); }
.btn:active { transform:translateY(0); }
.btn-small { padding:.5rem .75rem; font-size:.9rem; }
.btn-large { padding:.85rem 1.25rem; font-size:1.05rem; }

/* Hero */
.hero { padding-top:72px; }
.hero-grid { display:grid; grid-template-columns:1fr; gap:28px; align-items:center; }
.hero-copy h1 { font-size:2rem; line-height:1.2; margin:0 0 .5rem; letter-spacing:-.02em; }
.hero-copy p { color:var(--muted); margin:0 0 1rem; }
.cta-row { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.mini-trust { display:flex; gap:.5rem; align-items:center; color:var(--muted); font-size:.95rem; }
.stars { letter-spacing:2px; background:linear-gradient(90deg,#f59e0b,#fbbf24); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero-art { max-width:420px; margin:0 auto; }
.phone { filter:drop-shadow(0 20px 40px rgba(0,0,0,.45)); }

/* Alternating sections */
.alt { background:radial-gradient(1200px 400px at 20% -10%, rgba(99,102,241,.15), transparent), transparent; border-top:1px solid rgba(51,65,85,.35); border-bottom:1px solid rgba(51,65,85,.35); }
.alt-grid { display:grid; grid-template-columns:1fr; gap:24px; align-items:center; }
.alt-copy h2 { font-size:1.5rem; margin:.25rem 0 .5rem; letter-spacing:-.01em; }
.alt-copy p { color:var(--muted); margin:0 0 .5rem; }
.bullets { list-style:none; padding:0; margin:.25rem 0 0; }
.bullets li { position:relative; padding-left:26px; margin:.4rem 0; color:#cbd5e1; }
.bullets li::before { content:""; position:absolute; left:0; top:.4rem; width:16px; height:16px; border-radius:4px; background:linear-gradient(135deg,var(--brand),var(--brand-2)); box-shadow:0 2px 8px rgba(6,182,212,.25); }

/* Motion reduced: remove heavy shadows/transforms */
@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transition:none; transform:none; box-shadow:none; }
}

/* CTA */
.cta { background:linear-gradient(180deg, rgba(99,102,241,.08), rgba(6,182,212,.05)); }
.cta-card { display:grid; grid-template-columns:1fr; gap:16px; padding:24px; background:var(--bg-elev); border:1px solid var(--line); border-radius:16px; box-shadow:0 12px 32px rgba(0,0,0,.35); }
.cta-copy h2 { font-size:1.6rem; margin:0 0 .5rem; }
.cta-copy p { color:var(--muted); margin:0 0 1rem; }

/* Footer */
.site-footer { border-top:1px solid rgba(51,65,85,.35); background:#0a0f1e; }
.foot { display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; padding:20px 0; color:var(--muted); }
.foot-nav { display:flex; gap:12px; }
.foot-nav a { color:#94a3b8; }

/* Responsive */
@media (min-width: 720px) {
  .hero-copy h1 { font-size:2.5rem; }
  .hero-grid { grid-template-columns:1.1fr .9fr; gap:32px; }
  .alt-grid { grid-template-columns:1fr 1fr; gap:32px; }
  .cta-card { grid-template-columns:1fr; padding:32px; }
}

@media (min-width: 1024px) {
  .hero-copy h1 { font-size:3rem; }
  .cta-card { padding:40px; }
}

/* Alternating layout helper */
.alt-reverse .alt-grid { direction:rtl; }
.alt-reverse .alt-grid > * { direction:ltr; }

/* Utilities */
.visually-hidden { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }

/* App-specific styles */
.app { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 16px; 
}

@media (min-width: 960px) { 
  .app { 
    grid-template-columns: 1fr; 
  } 
}

.avatar { 
  width: 48px; 
  height: 48px; 
  border-radius: 10px; 
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); 
  display: grid; 
  place-items: center; 
  font-weight: 700; 
  color: white;
}

.levels .bar { 
  height: 8px; 
  background: #1f2937; 
  border-radius: 999px; 
  overflow: hidden; 
  margin: 6px 0; 
}

.levels .bar span { 
  display: block; 
  height: 100%; 
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); 
}

.levels ul { 
  margin: 8px 0 0; 
  padding-left: 16px; 
  color: #cbd5e1; 
}

.badges .badge-row { 
  display: flex; 
  gap: 6px; 
  flex-wrap: wrap; 
  margin-top: 6px; 
}

.badge { 
  padding: 0.25rem 0.5rem; 
  border-radius: 0.5rem; 
  font-size: 0.8rem; 
  border: 1px solid #334155; 
}

.badge.green { 
  background: rgba(16, 185, 129, 0.12); 
  border-color: rgba(16, 185, 129, 0.35); 
}

.badge.amber { 
  background: rgba(245, 158, 11, 0.12); 
  border-color: rgba(245, 158, 11, 0.35); 
}

.badge.rose { 
  background: rgba(244, 63, 94, 0.12); 
  border-color: rgba(244, 63, 94, 0.35); 
}

.content .tabs { 
  display: flex; 
  gap: 8px; 
  margin-bottom: 10px; 
}

.tab { 
  background: #0b1220; 
  border: 1px solid #334155; 
  color: #e5e7eb; 
  padding: 0.5rem 0.75rem; 
  border-radius: 0.6rem; 
  cursor: pointer; 
  transition: all 0.2s ease;
}

.tab:hover {
  background: rgba(91, 140, 255, 0.08);
}

.tab.is-active { 
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.12), rgba(34, 211, 238, 0.06)); 
}

.panel { 
  display: none; 
}

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

.card { 
  background: #0b1220; 
  border: 1px solid #334155; 
  border-radius: 12px; 
  padding: 12px; 
}

.options { 
  display: grid; 
  gap: 8px; 
  margin-top: 8px; 
}

.opt { 
  text-align: left; 
  background: #0b1220; 
  color: #e5e7eb; 
  border: 1px solid #334155; 
  border-radius: 0.6rem; 
  padding: 0.6rem 0.7rem; 
  cursor: pointer; 
  transition: all 0.2s ease;
}

.opt:hover:not(:disabled) {
  background: rgba(91, 140, 255, 0.08);
  border-color: #3b82f6;
}

.opt:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.opt-correct { 
  border-color: #10b981; 
  background: rgba(16, 185, 129, 0.12); 
}

.opt-wrong { 
  opacity: 0.7; 
}

.opt-selected { 
  border-color: #3b82f6; 
  background: rgba(59, 130, 246, 0.12); 
}

.feedback { 
  margin-top: 12px; 
  padding: 8px; 
  border-radius: 6px; 
  background: #1f2937; 
}

.feedback-correct { 
  color: #10b981; 
  font-weight: 600; 
}

.feedback-incorrect { 
  color: #ef4444; 
  font-weight: 600; 
}

.explanation { 
  color: #94a3b8; 
  font-size: 0.9rem; 
  margin-top: 4px; 
}

.results { 
  text-align: center; 
}

.score-card { 
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1)); 
  border: 1px solid #334155; 
  border-radius: 12px; 
  padding: 20px; 
  margin: 16px 0; 
}

.score-number { 
  font-size: 2.5rem; 
  font-weight: 800; 
  color: #e5e7eb; 
}

.score-label { 
  color: #94a3b8; 
  margin: 4px 0; 
}

.score-percentage { 
  font-size: 1.5rem; 
  font-weight: 700; 
  color: #3b82f6; 
}

.ex-controls { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
  margin-top: 10px; 
}

.chart { 
  display: flex; 
  gap: 6px; 
  align-items: flex-end; 
  height: 120px; 
  margin-top: 8px; 
}

.bar-mini { 
  width: 16px; 
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); 
  border-radius: 6px 6px 0 0; 
}

.stats-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 8px; 
}

.calendar { 
  display: grid; 
  grid-template-columns: repeat(7, 1fr); 
  gap: 6px; 
  margin-top: 8px; 
}

.cal-cell { 
  background: #0b1220; 
  border: 1px solid #334155; 
  border-radius: 0.4rem; 
  padding: 0.4rem; 
  text-align: center; 
  color: #94a3b8; 
  transition: all 0.2s ease;
}

.cal-cell.used { 
  border-color: #10b981; 
  color: #e5e7eb; 
}

.profile-edit { 
  display: flex; 
  gap: 20px; 
  align-items: flex-start; 
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 120px;
}

.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-photo-upload {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-photo-upload:hover {
  background: var(--bg-elev);
  border-color: var(--brand);
  color: var(--text);
}

.profile-edit .fields { 
  display: grid; 
  gap: 16px; 
  width: 100%; 
  flex: 1;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.email-display {
  position: relative;
  display: flex;
  align-items: center;
}

.email-display input {
  padding-right: 40px;
  background: var(--bg-elev);
  color: var(--muted);
  cursor: not-allowed;
}

.email-lock {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.name-change-info {
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  margin-top: 4px;
}

.name-change-info.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.name-change-info.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-edit input[type="text"], 
.profile-edit input[type="email"], 
.friends input { 
  background: #0b1220; 
  color: #e5e7eb; 
  border: 1px solid #334155; 
  border-radius: 0.65rem; 
  padding: 0.55rem 0.6rem; 
  transition: border-color 0.2s ease;
}

.profile-edit input[type="text"]:focus, 
.profile-edit input[type="email"]:focus, 
.friends input:focus {
  outline: none;
  border-color: #3b82f6;
}

.friends { 
  display: flex; 
  gap: 8px; 
  margin-top: 8px; 
}

.a2hs-btn { 
  color: #a5f3fc; 
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
  .nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0;
    flex-wrap: nowrap;
  }
  
  .brand {
    flex-shrink: 0;
    max-width: 60%;
  }
  
  .brand span:not(.pill) {
    display: none;
  }
  
  .primary-nav {
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }
  
  .primary-nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    white-space: nowrap;
  }
  
  .a2hs-btn {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.1));
    border: 1px solid rgba(34, 211, 238, 0.5);
    color: #a5f3fc !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.2);
  }
  
  .a2hs-btn:hover {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.3), rgba(34, 211, 238, 0.2));
    border-color: rgba(34, 211, 238, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
  }
}

/* Bottom nav imitation with tabs centered */
.content .tabs { 
  position: sticky; 
  bottom: 0; 
  display: flex; 
  justify-content: center; 
  gap: 10px; 
  padding: 8px; 
  background: rgba(11, 16, 32, 0.6); 
  backdrop-filter: blur(6px); 
  border-top: 1px solid #334155; 
}

.gate { 
  display: block; 
}

.gate .card { 
  max-width: 720px; 
  margin: 0 auto; 
}

.timeline { 
  list-style: none; 
  padding: 0; 
  margin: 8px 0 0; 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 8px; 
}

.timeline .level-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 8px; 
  background: #0b1220; 
  border: 1px solid #334155; 
  border-radius: 10px; 
}

.timeline .level-item.locked { 
  opacity: 0.6; 
}

.menu { 
  display: flex; 
  gap: 8px; 
  margin: 8px 0; 
  flex-wrap: wrap; 
}

.unit-actions { 
  margin: 6px 0; 
}

/* Focus indicators */
.tab:focus,
.opt:focus,
.btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .tab,
  .opt,
  .cal-cell {
    transition: none;
  }
}

/* Excel Unit specific styles */
.unit-header {
  text-align: center;
  margin-bottom: 2rem;
}

.unit-header h1 {
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

.progress-bar {
  background: #1f2937;
  border-radius: 999px;
  height: 8px;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #3b82f6, #10b981);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}


.levels-container {
  margin-bottom: 2rem;
  width: 100%;
  overflow: hidden;
}

.levels-container h2 {
  margin-bottom: 1rem;
  color: #e5e7eb;
}

.snake-path {
  margin-bottom: 2rem;
  overflow-x: auto;
  padding: 2rem 0;
  width: 100%;
  max-width: 100%;
}

.path-container {
  display: flex;
  align-items: center;
  min-width: max-content;
  position: relative;
  padding: 0 2rem;
  width: fit-content;
  max-width: 100vw;
}

.level-node {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.level-node.unlocked {
  cursor: pointer;
}

.level-node.unlocked:hover {
  transform: scale(1.05);
}

.level-node.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid;
}

.level-node.completed .level-circle {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.level-node.unlocked .level-circle {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.level-node.locked .level-circle {
  background: #374151;
  border-color: #6b7280;
}

.level-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.level-info {
  margin-left: 1rem;
  min-width: 120px;
}

.level-title {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.level-status {
  font-size: 0.8rem;
  color: #94a3b8;
}

.path-connector {
  width: 80px;
  height: 4px;
  margin: 0 1rem;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease;
}

.path-connector.completed {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.path-connector.unlocked {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.path-connector:not(.completed):not(.unlocked) {
  background: #374151;
}

/* Mid-Term Exam Styling */
.exam-node {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.1));
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 8px;
  margin: 8px 0;
}

.exam-node.unlocked {
  border-color: rgba(168, 85, 247, 0.6);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.15));
}

.exam-node.completed {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
}

.exam-circle {
  background: linear-gradient(135deg, #a855f7, #8b5cf6) !important;
  border-color: #a855f7 !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3) !important;
  width: 70px !important;
  height: 70px !important;
}

.exam-node.completed .exam-circle {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3) !important;
}

.exam-node.locked .exam-circle {
  background: #374151 !important;
  border-color: #6b7280 !important;
  box-shadow: none !important;
}

.exam-connector {
  background: linear-gradient(90deg, #a855f7, #8b5cf6);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
  width: 60px;
}

.exam-connector:not(.completed):not(.unlocked) {
  background: #374151;
  box-shadow: none;
}

/* Snake path responsive design */
@media (max-width: 768px) {
  .snake-path {
    padding: 1rem 0;
    margin: 0 -20px 2rem -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .path-container {
    padding: 0 1rem;
    max-width: calc(100vw - 40px);
  }
  
  .level-circle {
    width: 50px;
    height: 50px;
  }
  
  .level-number {
    font-size: 1.2rem;
  }
  
  .level-info {
    margin-left: 0.75rem;
    min-width: 100px;
  }
  
  .path-connector {
    width: 60px;
    margin: 0 0.5rem;
  }
  
  .unit2-circle {
    width: 60px;
    height: 60px;
  }
  
  .unit2-number {
    font-size: 1.5rem;
  }
  
  .unit2-connector {
    width: 80px;
    margin: 0 0.5rem;
  }
}

.unit-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .unit-info {
    grid-template-columns: 1fr 1fr;
  }
}

.unit-info .card {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1rem;
}

.unit-info h3 {
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

.unit-info ul {
  margin: 0;
  padding-left: 1rem;
  color: #94a3b8;
}

.unit-info li {
  margin-bottom: 0.25rem;
}

.continue-section {
  margin-top: 2rem;
  text-align: center;
}

.continue-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.continue-card h3 {
  color: #e5e7eb;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.continue-card p {
  color: #94a3b8;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.btn-continue {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-continue:active {
  transform: translateY(0);
}

.unit2-node {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.unit2-node.unlocked {
  cursor: pointer;
}

.unit2-node.unlocked:hover {
  transform: scale(1.05);
}

.unit2-node.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.unit2-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  border: 4px solid;
}

.unit2-node.unlocked .unit2-circle {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

.unit2-node.locked .unit2-circle {
  background: #374151;
  border-color: #6b7280;
}

.unit2-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
}

.unit2-info {
  margin-left: 1rem;
  min-width: 120px;
}

.unit2-title {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.unit2-status {
  font-size: 0.8rem;
  color: #94a3b8;
}

.unit2-connector {
  width: 100px;
  height: 4px;
  margin: 0 1rem;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease;
}

.unit2-connector.completed {
  background: linear-gradient(90deg, #10b981, #f59e0b);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.unit2-connector:not(.completed) {
  background: #374151;
}

/* Units Popup Styles */
.units-modal-card {
  max-width: 90vw;
  width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.units-snake-path {
  margin-top: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
}

.units-path-container {
  display: flex;
  align-items: center;
  min-width: max-content;
  position: relative;
  padding: 0 1rem;
}

.unit-node {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  min-width: 200px;
}

.unit-node.unlocked {
  cursor: pointer;
}

.unit-node.unlocked:hover {
  transform: scale(1.02);
}

.unit-node.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.unit-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid;
}

.unit-node.completed .unit-circle {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.unit-node.unlocked .unit-circle {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.unit-node.locked .unit-circle {
  background: #374151;
  border-color: #6b7280;
}

.unit-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
}

.unit-info {
  margin-left: 1rem;
  min-width: 150px;
}

.unit-info .unit-title {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.unit-description {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.unit-status {
  font-size: 0.75rem;
  color: #94a3b8;
}

.units-path-connector {
  width: 60px;
  height: 3px;
  margin: 0 0.5rem;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease;
}

.units-path-connector.completed {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.units-path-connector.unlocked {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.units-path-connector:not(.completed):not(.unlocked) {
  background: #374151;
}

/* Modal */
.modal[hidden] { display:none !important; }
.modal { position:fixed; inset:0; z-index:100; display:grid; place-items:center; }
.modal-backdrop { position:absolute; inset:0; background:rgba(2,6,23,.7); backdrop-filter: blur(6px); }
.modal-card { position:relative; width:min(560px,92vw); background:var(--bg-elev); border:1px solid var(--line); border-radius:16px; padding:20px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-card h3 { margin:.25rem 0 .25rem; letter-spacing:-.01em; }
.modal-card p { color:var(--muted); margin:0 0 .75rem; }
.modal-actions { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.modal-x { position:absolute; right:10px; top:8px; font-size:22px; line-height:1; background:transparent; color:#94a3b8; border:0; cursor:pointer; }
.muted { color:#94a3b8; }

/* Level Interface Styles */
.level-modal .modal-card {
  width: min(800px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

.level-progress {
  margin: 1rem 0;
}

.level-progress .progress-bar {
  background: #374151;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.level-progress .progress-fill {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  height: 100%;
  transition: width 0.3s ease;
}


.level-content {
  margin-top: 1rem;
}

.question-card {
  margin-bottom: 1.5rem;
}

.question-card h4 {
  color: #e5e7eb;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.question-text {
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.opt {
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.opt:hover:not(:disabled) {
  background: #1e293b;
  border-color: #3b82f6;
}

.opt:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.opt-correct {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.opt-wrong {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.open-answer-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.open-answer-container input {
  flex: 1;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.open-answer-container input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feedback {
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.feedback-correct {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback-incorrect {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.level-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-secondary:hover {
  background: var(--card);
  color: var(--text);
}

.level-completion {
  text-align: center;
  padding: 2rem 0;
}

.level-completion h3 {
  color: #10b981;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: #e5e7eb;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.completion-message {
  color: var(--muted);
  font-size: 1.1rem;
}

/* Achievement and Medal Notifications */
.achievement-notification, .medal-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement-notification.show, .medal-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.achievement-content, .medal-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-icon, .medal-icon {
  font-size: 2rem;
  animation: bounce 0.6s ease;
}

.achievement-text, .medal-text {
  flex: 1;
}

.achievement-title, .medal-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 2px;
}

.achievement-name, .medal-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Medal Display in Profile */
.medals-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.medal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.medal-icon-large {
  font-size: 2.5rem;
  animation: glow 2s ease-in-out infinite alternate;
}

.medal-details {
  flex: 1;
}

.medal-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.medal-type {
  font-size: 0.85rem;
  color: var(--brand);
  font-weight: 500;
  margin-bottom: 2px;
}

.medal-date {
  font-size: 0.75rem;
  color: var(--muted);
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
  }
  to {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
  }
}

/* Enhanced Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin: 4px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.badge.green {
  background: linear-gradient(135deg, var(--ok), #22c55e);
  border-color: rgba(34, 197, 94, 0.3);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Practice Button Styles */
.btn-practice {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border-color: rgba(139, 92, 246, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  position: relative;
}

.btn-practice:hover {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  transform: translateY(-1px);
}

.btn-practice.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #6b7280;
}

.btn-practice.disabled:hover {
  transform: none;
  background: #6b7280;
}

.practice-icon {
  font-size: 1.2rem;
}

.practice-count {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Practice Modal Styles */
.practice-modal-card {
  max-width: 800px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.practice-subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
  text-align: center;
}

.practice-progress {
  margin-bottom: 2rem;
}

.practice-content {
  min-height: 400px;
}

.practice-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.question-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.question-card h4 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.question-text {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.open-answer-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.open-answer-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.practice-completion {
  text-align: center;
  padding: 2rem 0;
}

.practice-completion h3 {
  color: #8b5cf6;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Practice Progress Bar */
.practice-progress .progress-bar {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.practice-progress .progress-fill {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

/* Practice Feedback */
.practice-content .feedback-container {
  margin-top: 1rem;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
}

/* Responsive */
@media (min-width:768px) {
  .primary-nav { display:flex; }
  .hero-grid { grid-template-columns:1fr 1fr; gap:48px; }
  .hero-copy h1 { font-size:2.75rem; }
  .features-grid { grid-template-columns:repeat(3,1fr); }
  .testimonials-grid { grid-template-columns:repeat(2,1fr); }
  .footer-grid { grid-template-columns:repeat(4,1fr); }
  .stats-grid { grid-template-columns:repeat(3,1fr); }
  .levels-container { padding:0 2rem; }
  .snake-path { padding:2rem; }
  .level-item { min-width:120px; min-height:120px; }
  .level-item h4 { font-size:1rem; }
  .level-item p { font-size:0.85rem; }
  
  .practice-modal-card {
    width: 80vw;
  }
  
  .options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

/* Replay indicator styling */
.replay-indicator {
  color: var(--brand-2);
  font-size: 0.9em;
  font-weight: 500;
  opacity: 0.8;
}

/* Feedback modal styling */
.feedback-modal-card {
  max-width: 500px;
  width: 90vw;
}

.feedback-field {
  margin-bottom: 1rem;
}

.feedback-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.feedback-field select,
.feedback-field textarea,
.feedback-field input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.feedback-field select:focus,
.feedback-field textarea:focus,
.feedback-field input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.feedback-field textarea {
  resize: vertical;
  min-height: 120px;
}

.feedback-field small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.feedback-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-secondary:hover {
  background: var(--bg-elev);
  color: var(--text);
}

/* Friends system styling */
.add-friend-section {
  margin-bottom: 1.5rem;
}

.friend-search {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.friend-search input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
}

.friend-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.search-results {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}

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

.result-info {
  flex: 1;
}

.result-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.result-email {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.result-stats {
  color: var(--muted);
  font-size: 0.85rem;
}

.status-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.pending-requests-section,
.sent-requests-section {
  margin-bottom: 1.5rem;
}

.pending-requests-section h4,
.sent-requests-section h4 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.request-info {
  flex: 1;
}

.request-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.request-email {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.request-status {
  color: var(--brand-2);
  font-size: 0.85rem;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
}

.friends-section h4 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friend-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.friend-item:hover {
  background: var(--bg-elev);
  border-color: var(--brand);
}

.friend-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 0.75rem;
}

.friend-info-small {
  flex: 1;
}

.friend-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.friend-stats-small {
  color: var(--muted);
  font-size: 0.85rem;
}

.friend-status-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 0.5rem;
}

.friend-status-small.active {
  background: var(--ok);
}

.friend-status-small.inactive {
  background: var(--muted);
}

/* Friend Profile Modal */
.friend-profile-modal-card {
  max-width: 600px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.friend-profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.friend-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  margin-right: 1rem;
}

.friend-info {
  flex: 1;
}

.friend-info h3 {
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.friend-email {
  color: var(--muted);
  margin: 0 0 0.5rem 0;
}

.friend-status {
  color: var(--ok);
  font-size: 0.9rem;
  font-weight: 500;
}

.friend-stats {
  margin-bottom: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.friend-achievements-section,
.friend-medals-section {
  margin-bottom: 1.5rem;
}

.friend-achievements-section h4,
.friend-medals-section h4 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.achievements-list,
.medals-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.achievement-item,
.medal-item-small {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.achievement-icon,
.medal-icon {
  margin-right: 0.5rem;
}

.friend-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .friend-search {
    flex-direction: column;
  }
  
  .search-result-item,
  .request-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .request-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

