
:root{
  --bg:#0b1220;
  --bg-soft:#121b2d;
  --panel:#16233a;
  --panel-2:#1c2c49;
  --text:#eef4ff;
  --muted:#aab9d3;
  --accent:#66d9ff;
  --accent-2:#8c7dff;
  --success:#27c281;
  --warning:#ffb84d;
  --danger:#ff6b7a;
  --border:rgba(255,255,255,0.10);
  --shadow:0 20px 50px rgba(0,0,0,0.30);
  --radius:22px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Segoe UI, Arial, "Noto Sans Devanagari", sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(102,217,255,0.14), transparent 25%),
    radial-gradient(circle at top right, rgba(140,125,255,0.15), transparent 22%),
    linear-gradient(135deg, #08101d, #0f1930 55%, #0b1220);
  min-height:100vh;
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{
  width:min(1200px, calc(100% - 32px));
  margin:0 auto;
}

.site-header{
  position:sticky;
  top:0;
  z-index:100;
  backdrop-filter:blur(14px);
  background:rgba(8, 14, 25, 0.72);
  border-bottom:1px solid var(--border);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:74px;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:700;
}

.brand-badge{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#041727;
  font-size:22px;
  box-shadow:0 10px 25px rgba(102,217,255,0.24);
}

.brand-text small{
  display:block;
  color:var(--muted);
  font-weight:500;
  font-size:12px;
  margin-top:2px;
}

.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
}

.main-nav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.main-nav a{
  padding:10px 14px;
  border-radius:14px;
  color:var(--muted);
  font-weight:600;
  transition:0.2s ease;
}

.main-nav a:hover,
.main-nav a.active{
  color:var(--text);
  background:rgba(255,255,255,0.08);
}

.page-hero{
  padding:56px 0 28px;
}

.hero-grid{
  display:grid;
  grid-template-columns:1.25fr 0.85fr;
  gap:24px;
  align-items:stretch;
}

.panel{
  background:linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.hero-card{
  padding:32px;
  min-height:320px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.hero-card h1{
  margin:0 0 14px;
  font-size:clamp(32px, 5vw, 54px);
  line-height:1.05;
}

.hero-card p{
  margin:0 0 22px;
  color:var(--muted);
  font-size:17px;
  line-height:1.7;
  max-width:760px;
}

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:13px 18px;
  border-radius:16px;
  font-weight:700;
  border:1px solid transparent;
  transition:0.2s ease;
}

.btn-primary{
  color:#041727;
  background:linear-gradient(135deg, var(--accent), #9ce9ff);
  box-shadow:0 12px 24px rgba(102,217,255,0.22);
}
.btn-secondary{
  border-color:var(--border);
  background:rgba(255,255,255,0.06);
  color:var(--text);
}

.btn-danger{
  border-color:rgba(255,107,122,0.52);
  background:rgba(255,107,122,0.13);
  color:#fff;
}

.btn:hover{transform:translateY(-2px)}

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

.btn:disabled:hover{
  transform:none;
}

body.lesson-setup .lesson-stats,
body.lesson-setup #lessonInfo,
body.lesson-setup .practice-toolbar,
body.lesson-setup .typing-area,
body.lesson-setup #keyboardGuidePanel,
body.lesson-setup #restartLessonBtn,
body.lesson-setup #nextLessonBtn{
  display:none;
}

body.lesson-active .site-header,
body.lesson-active .page-hero,
body.lesson-active .sidebar-card,
body.lesson-active .lesson-catalog-panel,
body.lesson-active .site-footer{
  display:none;
}

body.lesson-active main{
  min-height:100vh;
  display:flex;
  align-items:stretch;
}

body.lesson-active .section{
  width:100%;
  padding:10px 0;
}

body.lesson-active .two-col{
  display:block;
}

body.lesson-active .stack{
  min-height:calc(100vh - 20px);
  grid-template-rows:auto auto auto minmax(0, 1fr) auto;
  gap:8px;
}

body.lesson-active .stack > *{
  min-width:0;
}

.hero-side{
  padding:24px;
  display:grid;
  gap:16px;
}

.metric-card{
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
}

.metric-card span{
  display:block;
}
.metric-label{
  color:var(--muted);
  font-size:13px;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:1px;
}
.metric-value{
  font-size:30px;
  font-weight:800;
}

.section{
  padding:14px 0 40px;
}

.section-head{
  margin-bottom:18px;
}
.section-head h2{
  margin:0 0 8px;
  font-size:30px;
}
.section-head p{
  margin:0;
  color:var(--muted);
  line-height:1.7;
}

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

.feature-card, .page-card, .placeholder-card{
  padding:22px;
}

.feature-card h3,
.page-card h3,
.placeholder-card h3{
  margin:0 0 10px;
  font-size:22px;
}

.feature-card p,
.page-card p,
.placeholder-card p{
  margin:0 0 14px;
  color:var(--muted);
  line-height:1.7;
}

.tag-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.tag{
  padding:8px 11px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  color:#dfe9fb;
  font-size:13px;
  border:1px solid var(--border);
}

.two-col{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:22px;
}

.sidebar-card{
  padding:22px;
  position:sticky;
  top:94px;
  align-self:start;
}

.field{
  margin-bottom:14px;
}
.field label{
  display:block;
  margin-bottom:7px;
  color:#dfe9fb;
  font-size:14px;
  font-weight:600;
}
.field select,
.field input,
.field textarea{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.96);
  color:#0f1b2f;
  font:inherit;
}

.stack{
  display:grid;
  gap:18px;
}

.lesson-stats{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
}

.stat-box{
  padding:16px;
  text-align:center;
}

.stat-box strong{
  display:block;
  font-size:28px;
  margin-top:8px;
}

.lesson-info-meta{
  display:block;
  color:var(--muted);
  font-size:14px;
  margin-top:8px;
}

.practice-toolbar{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

body.lesson-active .practice-toolbar .btn{
  padding:9px 12px;
  border-radius:12px;
}

body.lesson-active #lessonInfo{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:8px 12px;
  text-align:left;
}

body.lesson-active #lessonInfo strong{
  margin-top:0;
  font-size:16px;
}

body.lesson-active #lessonInfo .lesson-info-meta{
  margin-top:0;
  font-size:13px;
  white-space:nowrap;
}

.lesson-catalog-panel{
  padding:18px;
}

.lesson-catalog-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.lesson-catalog-head h3{
  margin:0;
  font-size:20px;
}

.lesson-count{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1px;
}

.lesson-catalog{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
  max-height:280px;
  overflow:auto;
  padding-right:4px;
}

.lesson-catalog-item{
  width:100%;
  min-height:92px;
  display:grid;
  align-content:start;
  gap:5px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.06);
  color:var(--text);
  text-align:left;
  cursor:pointer;
  font:inherit;
  transition:0.2s ease;
}

.lesson-catalog-item span,
.lesson-catalog-item small{
  color:var(--muted);
  font-size:12px;
}

.lesson-tier-badge{
  width:max-content;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.08);
  color:#dfe9fb !important;
  font-weight:800;
}

.lesson-catalog-item strong{
  display:block;
  font-size:16px;
  line-height:1.25;
}

.lesson-catalog-item:hover,
.lesson-catalog-item.active{
  border-color:rgba(102,217,255,0.55);
  background:rgba(102,217,255,0.12);
  transform:translateY(-1px);
}

.lesson-catalog-item.premium-locked{
  border-color:rgba(255,198,109,0.45);
}

.lesson-catalog-item.premium-locked .lesson-tier-badge{
  background:rgba(255,198,109,0.16);
  border-color:rgba(255,198,109,0.5);
}

.lesson-lock-message{
  display:grid;
  gap:12px;
  justify-items:start;
  padding:18px;
  border:1px solid rgba(255,198,109,0.5);
  border-radius:16px;
  background:rgba(255,198,109,0.12);
}

.lesson-lock-message strong{
  font-size:22px;
}

.lesson-lock-message p{
  margin:0;
  color:var(--muted);
  line-height:1.7;
}

.typing-area,
.game-area,
.competition-area,
.achievement-area{
  padding:22px;
}

.text-display{
  min-height:150px;
  padding:20px;
  border-radius:18px;
  background:rgba(7, 15, 28, 0.78);
  border:1px solid var(--border);
  line-height:1.8;
  font-size:25px;
  margin-bottom:16px;
}
.correct {
  color: #27c281;
}

.incorrect {
  color: #ff6b7a;
  text-decoration: underline;
}
.typing-input{
  width:100%;
  min-height:140px;
  padding:16px;
  border-radius:18px;
  border:1px solid var(--border);
  font:inherit;
  font-size:21px;
  resize:vertical;
}

body.lesson-active .lesson-stats{
  gap:8px;
}

body.lesson-active .metric-label{
  font-size:11px;
  letter-spacing:.6px;
  margin-bottom:3px;
}

body.lesson-active .stat-box{
  padding:8px 10px;
}

body.lesson-active .stat-box strong{
  font-size:20px;
  margin-top:3px;
}

body.lesson-active .typing-area{
  min-height:0;
  overflow:hidden;
  padding:10px;
}

body.lesson-active .typing-area h3{
  display:none;
}

body.lesson-active .text-display{
  min-height:72px;
  max-height:22vh;
  overflow:auto;
  padding:12px;
  border-radius:14px;
  font-size:20px;
  line-height:1.6;
  margin-bottom:8px;
}

body.lesson-active .typing-input{
  min-height:64px;
  resize:none;
}

.lesson-celebration{
  position:fixed;
  inset:0;
  z-index:220;
  display:grid;
  place-items:center;
  pointer-events:none;
  opacity:0;
  transform:scale(.96);
  transition:opacity .25s ease, transform .25s ease;
}

.lesson-celebration.show{
  opacity:1;
  transform:scale(1);
}

.lesson-celebration-card{
  min-width:min(420px, calc(100vw - 36px));
  max-width:min(520px, calc(100vw - 36px));
  padding:20px 24px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(8,14,25,.88);
  box-shadow:0 24px 70px rgba(0,0,0,.42);
  text-align:center;
}

.lesson-celebration.perfect .lesson-celebration-card{
  border-color:rgba(255,184,77,.72);
  background:linear-gradient(135deg, rgba(8,14,25,.92), rgba(31,50,82,.92));
}

.celebration-title{
  display:block;
  color:var(--text);
  font-size:26px;
  line-height:1.2;
}

.celebration-detail{
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-weight:700;
}

.firework-layer{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
}

.firework-spark{
  position:absolute;
  width:9px;
  height:9px;
  border-radius:999px;
  background:var(--spark-color);
  box-shadow:0 0 18px var(--spark-color);
  animation:firework-pop 980ms ease-out forwards;
}

@keyframes firework-pop{
  0%{
    opacity:0;
    transform:translate(0, 0) scale(.2);
  }
  16%{
    opacity:1;
  }
  100%{
    opacity:0;
    transform:translate(var(--spark-x), var(--spark-y)) scale(1.05);
  }
}

.list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
  line-height:1.9;
}

.leaderboard{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
}

.leaderboard th,
.leaderboard td{
  padding:14px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
}

.leaderboard th{
  color:#dce8fb;
  font-size:14px;
}
.leaderboard td{
  color:var(--muted);
}

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

.badge-card{
  padding:18px;
  text-align:center;
}

.badge-icon{
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  margin:0 auto 12px;
  border-radius:20px;
  font-size:30px;
  background:linear-gradient(135deg, rgba(102,217,255,0.18), rgba(140,125,255,0.20));
  border:1px solid var(--border);
}

.site-footer{
  padding:26px 0 42px;
  color:var(--muted);
  border-top:1px solid var(--border);
  margin-top:18px;
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}

.footer-links{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
}

.footer-links a{
  color:var(--muted);
  text-decoration:none;
  font-size:14px;
  font-weight:700;
}

.footer-links a:hover{
  color:var(--text);
}

.content-panel{
  padding:24px;
  line-height:1.8;
}

.content-panel h2,
.content-panel h3{
  margin:0 0 12px;
}

.content-panel h3{
  margin-top:22px;
}

.content-panel p,
.content-panel li{
  color:var(--muted);
}

.content-panel ul{
  margin:0 0 12px;
  padding-left:20px;
}

.policy-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}

.contact-form{
  display:grid;
  gap:14px;
}

.form-status{
  min-height:22px;
  color:var(--muted);
  font-weight:700;
}

.form-status.success{
  color:var(--success);
}

.form-status.error{
  color:var(--danger);
}

.admin-actions{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:end;
  gap:14px;
}

.message-list{
  display:grid;
  gap:14px;
}

.message-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,0.05);
  padding:18px;
}

.message-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.message-card h3{
  margin:0 0 4px;
}

.admin-metric-grid{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:14px;
}

.admin-mini-card{
  padding:18px;
}

.admin-mini-card span,
.admin-log-row span,
.admin-log-row time{
  color:var(--muted);
}

.admin-mini-card strong{
  display:block;
  margin-top:8px;
  font-size:28px;
}

.admin-log-list{
  display:grid;
  gap:10px;
}

.admin-log-row{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr auto;
  gap:12px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}

.admin-log-row:last-child{
  border-bottom:0;
}

.message-meta,
.message-body{
  color:var(--muted);
}

.message-meta{
  margin:0;
  font-size:13px;
}

.message-email{
  display:inline-flex;
  margin-bottom:10px;
  color:var(--accent);
  font-weight:700;
  overflow-wrap:anywhere;
}

.message-body{
  margin:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.note{
  color:var(--muted);
  font-size:14px;
  line-height:1.7;
}

.narrow-auth{
  max-width:560px;
}

.account-link{
  display:inline-flex;
  margin-top:12px;
  color:var(--accent);
  font-weight:800;
  text-decoration:none;
}

@media (max-width: 980px){
  .hero-grid,
  .two-col,
  .card-grid,
  .plan-grid,
  .admin-metric-grid,
  .policy-grid,
  .badge-grid,
  .admin-actions{
    grid-template-columns:1fr;
  }
  .lesson-stats{
    grid-template-columns:repeat(2,1fr);
  }
  .sidebar-card{
    position:static;
  }
  .main-nav{
    display:none;
    width:100%;
    padding-bottom:14px;
  }
  .main-nav.open{
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }
  .main-nav a{
    width:100%;
  }
  .header-inner{
    flex-wrap:wrap;
    padding:12px 0;
  }
  .nav-toggle{
    display:inline-flex;
  }
}

@media (max-width: 640px){
  .container{
    width:min(100% - 20px, 1200px);
  }
  .hero-card,
  .hero-side,
  .feature-card,
  .page-card,
  .placeholder-card,
  .typing-area,
  .game-area,
  .competition-area,
  .achievement-area,
  .sidebar-card{
    padding:18px;
  }
  .lesson-stats{
    grid-template-columns:1fr 1fr;
  }
  .admin-log-row{
    grid-template-columns:1fr;
  }
  .school-student-row{
    align-items:flex-start;
    flex-direction:column;
  }
  .school-student-actions{
    justify-content:flex-start;
  }
  .text-display{
    font-size:20px;
  }
  .typing-input{
    font-size:18px;
  }
  body.lesson-active .container{
    width:min(100% - 12px, 1200px);
  }
  body.lesson-active .stack{
    gap:7px;
  }
  body.lesson-active #lessonInfo{
    display:block;
  }
  body.lesson-active #lessonInfo .lesson-info-meta{
    display:block;
    margin-top:4px;
    white-space:normal;
  }
  body.lesson-active .practice-toolbar .btn{
    flex:1 1 110px;
    padding:10px 11px;
  }
  body.lesson-active .text-display{
    font-size:18px;
    max-height:22vh;
  }
  body.lesson-active .typing-input{
    min-height:72px;
  }
}
.virtual-keyboard {
  display: grid;
  gap: 10px;
}

body.lesson-active #keyboardGuidePanel{
  padding:8px;
}

body.lesson-active #keyboardGuidePanel h3{
  display:none;
}

body.lesson-active .virtual-keyboard{
  gap:4px;
  overflow-x:auto;
  padding-bottom:3px;
  width:100%;
}

.vk-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body.lesson-active .vk-row{
  gap:4px;
  flex-wrap:nowrap;
  min-width:max-content;
}

.vk-key {
  min-width: 48px;
  padding: 12px 10px;
  border-radius: 14px;
  background: #26384f;
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  font-size: 14px;
  color: white;
  transition: 0.2s ease;
}

body.lesson-active .vk-key{
  min-width:36px;
  min-height:36px;
  padding:6px;
  border-radius:10px;
}

.vk-key small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.script-keyboard .vk-key {
  min-height: 50px;
  font-size: 20px;
}

body.lesson-active .script-keyboard .vk-key{
  min-height:38px;
  font-size:16px;
}

.script-keyboard .vk-key small {
  font-size: 12px;
}

.vk-key.wide {
  min-width: 90px;
}

body.lesson-active .vk-key.wide{
  min-width:64px;
}

.vk-key.space {
  min-width: 260px;
}

body.lesson-active .vk-key.space{
  min-width:180px;
}

.vk-key.active-key {
  background: linear-gradient(135deg, var(--accent), #9ce9ff);
  color: #052033;
  font-weight: 800;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102,217,255,0.22);
}

.vk-key.active-shift {
  background: linear-gradient(135deg, #8c7dff, #b7acff);
  color: white;
  font-weight: 800;
  transform: translateY(-2px);
}
.vk-key.active-key {
  background: linear-gradient(135deg, var(--accent), #9ce9ff);
  color: #052033;
  font-weight: 800;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102,217,255,0.22);
}

.vk-key.active-shift {
  background: linear-gradient(135deg, #8c7dff, #b7acff);
  color: white;
  font-weight: 800;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(140,125,255,0.25);
}

.vk-key.active-combo {
  outline: 2px solid rgba(255,255,255,0.55);
  outline-offset: 2px;
}
.finger-guide-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}

.finger-guide-box strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  color: #ffffff;
}

#gameWordDisplay.correct {
  color: #27c281;
}

#gameWordDisplay.incorrect {
  color: #ff6b7a;
}

.word-drop-arena {
  position: relative;
  height: 320px;
  border-radius: 18px;
  background: rgba(7, 15, 28, 0.78);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.falling-word {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  min-width: 120px;
  text-align: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  transition: 0.2s ease;
}

.falling-word.correct {
  color: var(--success);
}

.falling-word.incorrect {
  color: var(--danger);
}
.battle-card {
  display: grid;
  gap: 18px;
}

.fighter-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 14px;
}

.fighter-label {
  font-weight: 800;
  letter-spacing: 1px;
}

.life-bar-wrap {
  width: 100%;
}

.life-bar {
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  border: 1px solid var(--border);
}

.life-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.bot-fill {
  background: linear-gradient(135deg, #ff9d5c, #ff5f6d);
}

.user-fill {
  background: linear-gradient(135deg, #66d9ff, #8c7dff);
}

.battle-lane {
  position: relative;
  height: 180px;
  border-radius: 20px;
  background: rgba(7, 15, 28, 0.82);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lane-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.3);
}

.lane-side {
  position: absolute;
  top: 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.lane-user {
  left: 16px;
}

.lane-bot {
  right: 16px;
}

.incoming-word {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 150px;
  text-align: center;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  font-size: 30px;
  font-weight: 800;
  transition: 0.35s ease;
}

.clash-marker {
  position: absolute;
  top: 58%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translateX(-50%) scale(0.5);
  background: #fff;
  opacity: 0;
  box-shadow: 0 0 24px rgba(255,255,255,0.6);
  transition: 0.35s ease;
}

.show-marker {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.explosion-text {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%) scale(0.8);
  font-size: 22px;
  font-weight: 800;
  opacity: 0;
  transition: 0.35s ease;
}

.show-explosion {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.incoming-word.bot-hit {
  color: var(--success);
  text-shadow: 0 0 22px rgba(39,194,129,0.5);
  transform: translate(-50%, -50%) scale(1.08);
}

.incoming-word.user-hit {
  color: var(--danger);
  text-shadow: 0 0 22px rgba(255,107,122,0.5);
  transform: translate(-50%, -50%) scale(1.08);
}

.incoming-word.perfect-hit {
  color: #ffd166;
  text-shadow: 0 0 24px rgba(255,209,102,0.65);
  transform: translate(-50%, -50%) scale(1.12);
}

.arcade-panel{
  overflow:hidden;
}

.game-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.game-panel-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.game-panel-head h3{
  margin:0 0 6px;
}

.game-fullscreen-btn{
  padding:9px 12px;
  border-radius:12px;
}

body.game-fullscreen-active{
  background:#08101d;
  overflow:hidden;
}

body.game-fullscreen-active .site-header,
body.game-fullscreen-active .page-hero,
body.game-fullscreen-active .sidebar-card,
body.game-fullscreen-active .site-footer,
body.game-fullscreen-active .stack > .placeholder-card{
  display:none;
}

body.game-fullscreen-active main{
  min-height:100vh;
  display:flex;
  align-items:stretch;
}

body.game-fullscreen-active .section{
  width:100%;
  padding:10px 0;
}

body.game-fullscreen-active .container{
  width:min(100% - 20px, 1400px);
}

body.game-fullscreen-active .two-col{
  display:block;
}

body.game-fullscreen-active .stack{
  min-height:calc(100vh - 20px);
  display:grid;
  grid-template-rows:auto minmax(0, 1fr);
  gap:10px;
}

body.game-fullscreen-active .stack > *{
  min-width:0;
}

body.game-fullscreen-active .lesson-stats{
  gap:10px;
}

body.game-fullscreen-active .stat-box{
  padding:10px 12px;
}

body.game-fullscreen-active .stat-box strong{
  font-size:22px;
  margin-top:4px;
}

body.game-fullscreen-active .game-area{
  min-height:0;
  overflow:hidden;
  padding:14px;
}

body.game-fullscreen-active .game-panel-head{
  margin-bottom:10px;
}

body.game-fullscreen-active .speed-stage{
  min-height:min(46vh, 420px);
}

body.game-fullscreen-active .word-drop-arena{
  height:min(56vh, 560px);
}

body.game-fullscreen-active .battle-lane{
  height:min(34vh, 300px);
}

body.game-fullscreen-active .race-arena{
  min-height:min(58vh, 560px);
}

body.game-fullscreen-active .typing-input{
  min-height:64px;
  resize:none;
}

.game-pill{
  flex:0 0 auto;
  padding:9px 12px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid var(--border);
  color:#dfe9fb;
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.7px;
}

.speed-stage{
  position:relative;
  display:grid;
  justify-items:center;
  gap:14px;
  min-height:270px;
  padding:18px;
  border-radius:18px;
  background:
    linear-gradient(120deg, rgba(39,194,129,0.10), transparent 34%),
    linear-gradient(240deg, rgba(255,184,77,0.10), transparent 36%),
    rgba(7, 15, 28, 0.82);
  border:1px solid var(--border);
  margin-bottom:16px;
}

.game-progress{
  width:100%;
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,0.09);
  border:1px solid var(--border);
}

.game-progress-fill{
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, var(--success), var(--accent), #ffd166);
  transition:width .16s linear;
}

.danger-fill{
  background:linear-gradient(90deg, #ffd166, #ff8a4d, var(--danger));
}

.bot-progress{
  margin-top:6px;
}

.game-callout{
  min-height:24px;
  color:#ffd166;
  font-weight:800;
  text-align:center;
}

.burst-word{
  min-height:96px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1px;
  padding:16px 22px;
  border-radius:18px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.14);
  color:#ffffff;
  font-size:clamp(34px, 6vw, 64px);
  font-weight:900;
  letter-spacing:0;
  text-align:center;
}

.burst-word.word-hit{
  animation:pop-hit .18s ease;
  color:var(--success);
}

.burst-word.word-miss{
  animation:shake-x .18s ease;
  color:var(--danger);
}

.word-queue{
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
}

.queue-chip{
  padding:8px 11px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid var(--border);
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.combo-meter{
  width:min(360px, 100%);
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,0.08);
}

.combo-fill{
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, #ffd166, var(--warning));
  transition:width .2s ease;
}

.drop-skyline{
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(102,217,255,0.10), transparent 35%),
    radial-gradient(circle at 20% 16%, rgba(255,209,102,0.18), transparent 18%),
    radial-gradient(circle at 78% 24%, rgba(39,194,129,0.16), transparent 16%);
  pointer-events:none;
}

.drop-danger-line{
  position:absolute;
  left:0;
  right:0;
  bottom:42px;
  height:2px;
  background:linear-gradient(90deg, transparent, var(--danger), transparent);
  box-shadow:0 0 18px rgba(255,107,122,0.45);
}

.drop-combo{
  position:absolute;
  right:12px;
  bottom:12px;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(7,15,28,0.78);
  border:1px solid var(--border);
  color:#ffd166;
  font-weight:800;
  font-size:13px;
}

.word-drop-arena{
  background:
    linear-gradient(180deg, rgba(102,217,255,0.08), rgba(7,15,28,0.88)),
    rgba(7,15,28,0.78);
}

.falling-word{
  z-index:2;
  min-width:auto;
  max-width:210px;
  white-space:nowrap;
  box-shadow:0 12px 28px rgba(0,0,0,0.26);
}

.falling-word.correct{
  background:rgba(39,194,129,0.18);
  border-color:rgba(39,194,129,0.5);
  transform:scale(1.08);
}

.falling-word.incorrect{
  background:rgba(255,107,122,0.16);
  border-color:rgba(255,107,122,0.5);
  transform:scale(.92);
  opacity:.7;
}

.arena-shake{
  animation:shake-x .18s ease;
}

.battle-meters{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.incoming-word span.correct,
.burst-word span.correct{
  color:var(--success);
}

.incoming-word span.incorrect,
.burst-word span.incorrect{
  color:var(--danger);
  text-decoration:underline;
}

.race-arena{
  display:grid;
  gap:14px;
  min-height:390px;
  padding:18px;
  border-radius:18px;
  background:
    linear-gradient(120deg, rgba(102,217,255,0.10), transparent 32%),
    linear-gradient(240deg, rgba(255,209,102,0.10), transparent 34%),
    rgba(7, 15, 28, 0.82);
  border:1px solid var(--border);
  margin-bottom:16px;
}

.race-track{
  position:relative;
  display:grid;
  align-content:center;
  gap:20px;
  min-height:170px;
  padding:26px 20px;
  border-radius:18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 10% 100%,
    rgba(255,255,255,0.05);
  border:1px solid var(--border);
  overflow:hidden;
}

.race-finish{
  position:absolute;
  top:0;
  right:18px;
  bottom:0;
  width:5px;
  background:linear-gradient(180deg, var(--success), #ffffff, var(--success));
  box-shadow:0 0 18px rgba(39,194,129,0.55);
}

.race-lane{
  position:relative;
  height:46px;
  border-radius:999px;
  background:rgba(7,15,28,0.62);
  border:1px solid rgba(255,255,255,0.10);
}

.race-lane-label{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.8px;
}

.race-marker{
  position:absolute;
  left:0;
  top:50%;
  transform:translate(-2px, -50%);
  min-width:58px;
  padding:8px 10px;
  border-radius:999px;
  color:#061526;
  font-weight:900;
  font-size:13px;
  text-align:center;
  transition:left .12s linear;
  box-shadow:0 12px 24px rgba(0,0,0,0.28);
}

.user-marker{
  background:linear-gradient(135deg, var(--accent), #9ce9ff);
}

.bot-marker{
  background:linear-gradient(135deg, #ffb84d, #ff6b7a);
}

.race-prompt{
  min-height:92px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:0;
  padding:16px 18px;
  border-radius:18px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.14);
  color:#ffffff;
  font-size:clamp(24px, 4vw, 42px);
  font-weight:800;
  line-height:1.45;
  text-align:center;
}

.race-prompt span{
  white-space:pre;
}

.race-prompt span.correct{
  color:var(--success);
}

.race-prompt span.incorrect{
  color:var(--danger);
  text-decoration:underline;
}

.competition-grid{
  display:grid;
  grid-template-columns:330px 1fr;
  gap:22px;
}

.account-panel{
  padding:22px;
  position:sticky;
  top:94px;
  align-self:start;
}

.account-panel h2{
  margin:0 0 14px;
}

.account-btn{
  width:100%;
}

.account-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.account-divider{
  height:1px;
  margin:18px 0;
  background:var(--border);
}

.competition-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.competition-race{
  display:grid;
  gap:14px;
}

.competition-track{
  position:relative;
  display:grid;
  align-content:center;
  gap:18px;
  min-height:160px;
  padding:24px 18px;
  border-radius:18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 10% 100%,
    rgba(7,15,28,0.72);
  border:1px solid var(--border);
  overflow:hidden;
}

.competition-progress-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.room-code{
  margin-top:14px;
  padding:14px;
  border-radius:14px;
  background:rgba(7,15,28,0.70);
  border:1px solid var(--border);
  color:#ffd166;
  font-weight:800;
}

.paypal-box{
  min-height:88px;
  margin:18px 0 8px;
  padding:14px;
  border-radius:14px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
}

.plan-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:18px;
}

.plan-card{
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,0.04);
}

.plan-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.plan-card h4{
  margin:0 0 6px;
  font-size:20px;
}

.plan-card p{
  margin:0;
  color:var(--muted);
}

.billing-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:14px;
  margin-top:16px;
}

.billing-note{
  flex:1 1 240px;
  margin:0;
  color:var(--muted);
}

.school-student-list{
  display:grid;
  gap:10px;
  margin-top:16px;
}

.school-student-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}

.school-student-row:last-child{
  border-bottom:0;
}

.school-student-row.deactivated{
  opacity:.68;
}

.school-student-info{
  display:grid;
  gap:4px;
}

.school-student-info span{
  color:var(--muted);
}

.school-student-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.school-student-actions .btn{
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
}

.online-list,
.invite-list{
  display:grid;
  gap:10px;
}

.online-player{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,0.06);
  border:1px solid var(--border);
}

.online-player strong,
.online-player small{
  display:block;
}

.online-player small{
  color:var(--muted);
  margin-top:3px;
}

.status-dot{
  width:11px;
  height:11px;
  border-radius:50%;
  background:var(--muted);
  box-shadow:0 0 12px rgba(255,255,255,0.2);
}

.status-dot.online{
  background:var(--success);
  box-shadow:0 0 12px rgba(39,194,129,0.8);
}

.status-dot.away{
  background:var(--warning);
}

.status-dot.offline{
  background:#6d7b91;
}

.mini-btn{
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
}

.achievement-summary{
  margin-bottom:18px;
}

.achievement-board{
  align-items:stretch;
}

.achievement-card{
  position:relative;
  min-height:210px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

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

.achievement-card.unlocked{
  border-color:rgba(39,194,129,0.45);
  background:
    linear-gradient(180deg, rgba(39,194,129,0.12), rgba(255,255,255,0.05));
}

.achievement-points{
  margin-top:auto;
  color:#ffd166;
  font-weight:800;
}

.achievement-card small{
  color:var(--muted);
}

.ranking-panel,
.history-panel{
  margin-top:20px;
}

.history-timeline{
  display:grid;
  gap:12px;
}

.history-item{
  display:grid;
  grid-template-columns:1fr auto;
  gap:14px;
  padding:14px;
  border-radius:16px;
  background:rgba(255,255,255,0.06);
  border:1px solid var(--border);
}

.history-item h3{
  margin:5px 0;
}

.history-item p{
  margin:0;
  color:var(--muted);
}

.history-kind{
  display:inline-flex;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(102,217,255,0.12);
  color:#dff6ff;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.history-metrics{
  min-width:130px;
  display:grid;
  justify-items:end;
  gap:3px;
}

.history-metrics span,
.history-metrics small{
  color:var(--muted);
}

.history-empty{
  padding:26px;
  text-align:center;
  border-radius:18px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
}

@keyframes pop-hit{
  50%{transform:scale(1.06);}
}

@keyframes shake-x{
  0%, 100%{transform:translateX(0);}
  35%{transform:translateX(-7px);}
  70%{transform:translateX(7px);}
}

@media (max-width: 640px){
  .game-panel-head,
  .battle-meters,
  .competition-progress-grid,
  .competition-columns,
  .competition-grid,
  .history-item{
    grid-template-columns:1fr;
    display:grid;
  }

  .account-panel{
    position:static;
  }

  .history-metrics{
    justify-items:start;
  }

  .game-pill{
    width:max-content;
  }

  .speed-stage{
    min-height:230px;
    padding:14px;
  }

  .word-drop-arena{
    height:300px;
  }

  .race-arena{
    min-height:330px;
    padding:14px;
  }

  .race-track{
    min-height:150px;
    padding:22px 12px;
  }

  .race-marker{
    min-width:50px;
    font-size:12px;
  }

  .race-prompt{
    font-size:22px;
  }

  .falling-word{
    font-size:22px;
    padding:10px 13px;
  }
}
