:root{
  --bg:#eff8ff;
  --card:#fff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#dbeafe;
  --blue:#0ea5e9;
  --blue-dark:#0284c7;
  --green:#22c55e;
  --red:#ef4444;
  --shadow:0 10px 30px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

body{
  margin:0;
  min-height:100vh;
  padding:16px;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:linear-gradient(180deg,var(--bg),#fff);
  color:var(--text);
  user-select:none;
}

.app{max-width:760px;margin:0 auto}
.app.wide,
.app.index{
  max-width:940px;
}

h1,h2{letter-spacing:-.03em}
h2{margin:0 0 4px;font-size:26px}
p{color:var(--muted);line-height:1.6}

.hero{
  margin:0 0 16px;
  padding:34px 24px;
  text-align:center;
  color:#fff;
  border-radius:28px;
  background:
    radial-gradient(circle at top left,rgba(14,165,233,.25),transparent 35%),
    linear-gradient(135deg,#0f172a,#1e3a8a);
  box-shadow:0 18px 40px rgba(15,23,42,.18);
}

.badge,
.hero-badge{
  display:inline-block;
  margin-bottom:14px;
  padding:7px 13px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:13px;
  font-weight:800;
}

.badge a,
.hero-badge a{color:#fff}

.hero h1{
  margin:0 0 12px;
  font-size:clamp(30px,6vw,52px);
  line-height:.98;
  letter-spacing:-.05em;
}

.hero p,
.lead{
  max-width:660px;
  margin:0 auto;
  color:rgba(255,255,255,.82);
  font-size:18px;
  line-height:1.5;
}

.hero-points,
.controls,
.verbs,
.tools{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
}

.hero-points{margin-top:22px}
.controls,.verbs,.tools{margin-top:16px}

.hero-points span{
  padding:9px 13px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.12);
  font-size:14px;
  font-weight:800;
}

.card{
  margin-bottom:14px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:24px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.hint{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.reset,
.speakbtn,
.helpbtn,
.modebtn,
.chip,
.mini-btn,
.next{
  cursor:pointer;
  font-weight:800;
}

.reset,
.speakbtn,
.helpbtn,
.modebtn{
  border:0;
  border-radius:16px;
  white-space:nowrap;
}

.reset{
  padding:13px 16px;
  background:#0f172a;
  color:#fff;
}

.danger{background:#b91c1c}

.speakbtn,
.helpbtn,
.mini-btn{
  background:#e0f2fe;
  color:#0369a1;
}

.speakbtn,
.helpbtn{
  padding:10px 16px;
  border-radius:999px;
  font-weight:900;
}

.speakbtn{
  display:block;
  margin:0 auto 18px;
}

.speakbtn.active{
  background:var(--blue);
  color:#fff;
}

.reset:active,
.choice:active,
.speakbtn:active,
.helpbtn:active,
.modebtn:active,
.chip:active,
.mini-btn:active{
  transform:scale(.97);
}

.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-top:16px;
}

.stats.five{grid-template-columns:repeat(5,1fr)}

.stat{
  padding:10px;
  text-align:center;
  border-radius:18px;
  background:#f8fafc;
}

.stat small{
  display:block;
  margin-bottom:2px;
  color:var(--muted);
  font-size:12px;
}

.stat strong{
  font-size:22px;
  line-height:1;
}

.question,
.question-big{
  margin:8px 0 10px;
  text-align:center;
  font-size:clamp(25px,5vw,42px);
  font-weight:950;
  line-height:1.15;
  letter-spacing:-.04em;
}

.question-big{font-size:clamp(42px,10vw,76px)}

.blank{
  display:inline-block;
  min-width:100px;
  padding:0 8px;
  color:var(--blue);
  border-bottom:5px solid var(--blue);
}

.translation,
.meta,
.direction,
.infinitive,
.tense-hint{
  margin:0 0 18px;
  text-align:center;
  color:var(--muted);
  font-weight:800;
}

.infinitive,
.tense-hint{
  color:#0284c7;
  font-weight:900;
}

.choices{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.choices.single,
.word-order-choices{
  grid-template-columns:1fr;
}

.choice,
.pair-card,
.verb-card,
.word{
  width:100%;
  min-height:58px;
  padding:10px 12px;
  border-radius:18px;
  border:2px solid #e2e8f0;
  background:#fff;
  color:var(--text);
  font-size:22px;
  font-weight:950;
  text-align:center;
  cursor:pointer;
  box-shadow:0 3px 0 #cbd5e1;
}

.choice{
  min-height:64px;
  font-size:24px;
  line-height:1.25;
  transition:transform .06s ease,background .12s ease,border-color .12s ease;
}

.word-order-choices .choice{
  min-height:58px;
  font-size:22px;
}

.choice.correct,
.pair-card.correct,
.verb-card.correct,
.word.correct{
  border-color:#15803d;
  background:var(--green);
  color:#fff;
  box-shadow:0 3px 0 #166534;
}

.choice.wrong,
.pair-card.wrong,
.verb-card.wrong,
.word.wrong{
  border-color:#b91c1c;
  background:var(--red);
  color:#fff;
  animation:shake .18s linear 0s 2;
}

.choice.wrong{box-shadow:0 3px 0 #991b1b}

.pair-card.active,
.verb-card.active,
.word.selected{
  border-color:var(--blue);
  background:#e0f2fe;
  color:#0369a1;
}

.word .sub{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
}

.word.selected .sub{color:#0369a1}
.word.correct .sub,
.word.wrong .sub{color:#fff}

.explain,
.panel,
.target-info,
.translation-box,
.quiz-result{
  display:none;
  margin-top:14px;
  padding:13px;
  border-radius:18px;
  background:#f8fafc;
  color:#334155;
  font-size:15px;
  line-height:1.45;
}

.explain.show,
.panel.show,
.target-info.show,
.translation-box.show,
.quiz-result.show{
  display:block;
}

.modebtn,
.chip{
  padding:9px 13px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
}

.modebtn.active,
.chip.active{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue-dark);
}

.grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  margin-top:16px;
}

.game{
  position:relative;
  display:block;
  padding:18px;
  border:1px solid #e2e8f0;
  border-radius:22px;
  background:#fff;
  color:inherit;
  text-decoration:none;
  box-shadow:0 4px 0 #cbd5e1;
  transition:transform .08s ease,box-shadow .08s ease,border-color .08s ease;
}

.game:hover{
  transform:translateY(-2px);
  border-color:var(--blue);
  box-shadow:0 6px 0 #93c5fd;
}

.game:has(.new-badge){
  padding-right:70px;
}

.game strong{
  display:block;
  margin-bottom:5px;
  font-size:21px;
}

.game span{
  display:block;
  color:var(--muted);
  font-size:15px;
  line-height:1.45;
}

.tag,
.new-badge,
.tagline{
  display:inline-block;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.tag,
.tagline{
  margin-top:12px;
  padding:6px 10px;
  background:#e0f2fe;
  color:#0369a1;
}

.new-badge{
  position:absolute;
  top:12px;
  right:12px;
  padding:6px 10px;
  background:linear-gradient(135deg,#f59e0b,#ef4444);
  color:#fff;
  font-style:normal;
  letter-spacing:.08em;
  box-shadow:0 6px 18px rgba(239,68,68,.35);
  transform:rotate(8deg);
}

.tip-card,
.listen-box{
  text-align:center;
}

.tip-badge{
  display:inline-block;
  margin-bottom:14px;
  padding:7px 13px;
  border-radius:999px;
  background:#e0f2fe;
  color:#0369a1;
  font-size:13px;
  font-weight:800;
}

.tip-text{
  max-width:620px;
  margin:0 auto 18px;
  color:var(--muted);
  line-height:1.6;
}

.tip-link{
  display:inline-block;
  padding:12px 18px;
  border-radius:999px;
  background:var(--blue);
  color:#fff;
  text-decoration:none;
  font-weight:900;
}

.ear{
  margin-bottom:6px;
  font-size:44px;
}

.listen-title{
  margin:0;
  font-size:clamp(28px,5vw,44px);
  font-weight:950;
  letter-spacing:-.04em;
}

.listen-sub{
  max-width:560px;
  margin:8px auto 16px;
  color:var(--muted);
  font-weight:800;
  line-height:1.45;
}

.chunk{
  display:inline-block;
  margin:3px;
  padding:6px 10px;
  border-radius:999px;
  background:#e0f2fe;
  color:#0369a1;
  font-size:13px;
  font-weight:900;
}

.word-log{
  display:grid;
  gap:8px;
  margin-top:12px;
}

.word-log-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid #e2e8f0;
  border-radius:16px;
  background:#f8fafc;
}

.word-log-item strong{font-size:18px}

.word-log-item span{
  color:var(--muted);
  font-weight:800;
  text-align:right;
}

.word-log-item.wrong{
  border-color:#fecaca;
  background:#fff1f2;
}

.reading-text{
  display:grid;
  gap:14px;
}

.paragraph-card{
  position:relative;
  padding:16px;
  border:1px solid #e2e8f0;
  border-radius:20px;
  background:#fff;
}

.paragraph-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.paragraph-sv{
  flex:1;
  margin:0;
  color:var(--text);
  font-size:20px;
  font-weight:650;
  line-height:1.65;
}

.paragraph-tools{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:108px;
}

.mini-btn{
  padding:8px 10px;
  border:0;
  border-radius:999px;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

.translation-box{
  margin-top:12px;
  padding:12px;
  border:1px solid #e2e8f0;
  border-radius:16px;
  line-height:1.55;
}

.quiz-question{
  margin-bottom:12px;
  padding:14px;
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#fff;
}

.quiz-question h3{
  margin:0 0 10px;
  font-size:18px;
}

.quiz-option{
  display:block;
  margin:6px 0;
  padding:9px 10px;
  border-radius:12px;
  background:#f8fafc;
  color:#334155;
  font-weight:750;
  cursor:pointer;
}

.board{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.column{
  display:grid;
  gap:10px;
}

.column-title{
  margin:0 0 12px;
  color:var(--muted);
  font-weight:900;
  text-align:center;
}

.next{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:52px;
  margin-top:14px;
  padding:0 22px;
  border:none;
  border-radius:18px;
  background:var(--blue);
  color:#fff;
  font-size:18px;
  font-weight:900;
  box-shadow:0 4px 0 #0369a1;
  transition:transform .08s ease,opacity .15s ease;
}

.next:hover{opacity:.92}

.next:active{
  transform:translateY(2px);
  box-shadow:0 2px 0 #0369a1;
}

.next:disabled{
  opacity:.45;
  cursor:not-allowed;
  transform:none;
}

.question-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
}

.question-translation{
  margin-top:-4px;
}

.footer{
  padding:18px;
  text-align:center;
  color:var(--muted);
  font-size:14px;
}

@keyframes shake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-4px)}
  75%{transform:translateX(4px)}
  100%{transform:translateX(0)}
}

@media(max-width:680px){
  body{padding:10px}

  .hero{
    padding:34px 20px;
    border-radius:26px;
  }

  .grid{grid-template-columns:1fr}

  .card{
    padding:18px;
    border-radius:22px;
  }
}

@media(max-width:560px){
  .top{
    align-items:flex-start;
    flex-direction:column;
  }

  .stats,
  .stats.five{
    grid-template-columns:repeat(2,1fr);
  }

  .choices,
  .board{
    grid-template-columns:1fr;
  }

  .choice{
    min-height:58px;
    font-size:21px;
  }

  .word-order-choices .choice{
    font-size:19px;
  }

  .pair-card,
  .verb-card{
    min-height:54px;
    font-size:20px;
  }

  .paragraph-top{
    flex-direction:column;
  }

  .paragraph-tools{
    flex-direction:row;
    min-width:0;
  }

  .paragraph-sv{
    font-size:18px;
  }
}


.hero.hero-large{
  padding:48px 26px;
  margin-bottom:18px;
  border-radius:32px;
}

.hero.hero-large .badge{
  margin-bottom:16px;
}

.back-link{
  margin-bottom:14px;
}

.back-link .badge{
  text-decoration:none;
}

.hero.hero-large h1{
  margin:0 0 14px;
  font-size:clamp(36px,7vw,68px);
  line-height:.95;
  letter-spacing:-.06em;
}

.hero.hero-large .lead{
  max-width:720px;
  color:rgba(255,255,255,.84);
  font-size:20px;
}

.card.card-large{
  padding:22px;
  border-radius:26px;
  margin-bottom:16px;
}

.card.card-large > h2{
  margin-bottom:8px;
  font-size:28px;
}

.new-badge{
  z-index:5;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
}

.section-title{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin:42px 0 18px;
}

.section-title h2{
  margin:0 0 6px;
}

.section-title p{
  margin:0;
}

.section-icon{
  flex-shrink:0;
  margin-top:4px;
  font-size:22px;
  line-height:1;
}

.img-fluid{
  display:block;
  max-width:100%;
  height:auto;
}

.promo-image{
  margin:20px 0 18px;
  overflow:hidden;
  border-radius:28px;
  border:1px solid #dbeafe;
  background:#fff;
  box-shadow:
    0 10px 30px rgba(15,23,42,.08),
    0 4px 0 #cbd5e1;
  transform:translateZ(0);
  transition:transform .12s ease,box-shadow .12s ease;
}

.promo-image img{
  display:block;
  width:100%;
  height:auto;
}

.promo-image:hover{
  transform:translateY(-2px);
  box-shadow:
    0 18px 40px rgba(15,23,42,.12),
    0 6px 0 #bfdbfe;
}




.learning-info{
  margin-top:18px;
}

.related-games .controls{
  justify-content:flex-start;
  gap:10px;
}

.related-games .chip{
  text-decoration:none;

  background:transparent;
  border:0;

  color:#0369a1;

  padding:0;

  border-radius:0;
}

.related-games .chip:hover{
  text-decoration:underline;
}




.tts-alert{
  position:fixed;
  left:16px;
  right:16px;
  bottom:16px;
  z-index:99999;
}

.tts-alert-inner{
  max-width:820px;
  margin:0 auto;
  background:#fff7ed;
  border:2px solid #fdba74;
  color:#9a3412;
  border-radius:18px;
  padding:16px 18px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.tts-alert-text{
  flex:1;
  font-size:15px;
  line-height:1.45;
}

.tts-alert-text a{
  color:#c2410c;
  font-weight:800;
}

.tts-alert-close{
  border:none;
  background:#fed7aa;
  color:#9a3412;
  width:36px;
  height:36px;
  border-radius:999px;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  flex-shrink:0;
}

.tts-alert-close:hover{
  opacity:.9;
}



.spelling-form{
  display:flex;
  gap:10px;
  margin:20px auto 0;
  max-width:620px;
}

.spelling-input{
  flex:1;
  min-height:58px;
  border-radius:18px;
  border:2px solid #cbd5e1;
  padding:0 18px;
  font-size:24px;
  font-weight:800;
  outline:none;
}

.spelling-input:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(14,165,233,.15);
}

@media(max-width:560px){
  .spelling-form{
    flex-direction:row;
  }

  .spelling-input{
    font-size:20px;
  }
}


.soft-switch{
  margin-top:18px;
  text-align:center;
}

.soft-switch a{
  display:inline-block;
  padding:10px 16px;
  border-radius:999px;
  background:#f1f5f9;
  color:#334155;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  border:1px solid #dbe4ef;
}

.soft-switch a:hover{
  background:#e0f2fe;
  color:#075985;
}







.spelling-form{
  display:flex;
  align-items:stretch;
  gap:8px;
  max-width:620px;
  margin:22px auto 0;
}

.spelling-input{
  flex:1;
  min-width:0;
  height:58px;
  box-sizing:border-box;
  border-radius:18px;
  border:2px solid #cbd5e1;
  padding:0 18px;
  font-size:24px;
  font-weight:800;
  outline:none;
}

.spelling-input:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(14,165,233,.15);
}

.spelling-form .next{
  flex:0 0 48px;
  height:58px;
  min-height:58px;
  margin:0;
  padding:0;
}

@media(max-width:560px){
  .spelling-input{
    font-size:20px;
  }
}

@media(max-width:480px){
  .spelling-form{
    gap:8px;
  }

  .spelling-form .next{
    flex-basis:46px;
    height:46px;
    min-height:46px;
    border-radius:14px;
  }
}




.mode-tabs{
  display:flex;
  gap:6px;

  width:fit-content;
  margin:0 auto 14px;

  padding:6px;

  border:1px solid #dbeafe;
  border-radius:18px;

  background:#f8fbff;
}

.mode-tab{
  appearance:none;
  border:0;

  min-width:120px;

  padding:12px 18px;

  border-radius:14px;

  background:transparent;

  color:#64748b;

  font-size:15px;
  font-weight:900;

  cursor:pointer;

  transition:
    background .12s ease,
    color .12s ease,
    transform .06s ease,
    box-shadow .12s ease;
}

.mode-tab:hover{
  background:#e0f2fe;
  color:#0369a1;
}

.mode-tab.active{
  background:linear-gradient(180deg,#0ea5e9,#0284c7);

  color:#fff;

  box-shadow:
    0 4px 0 #0369a1,
    0 10px 20px rgba(14,165,233,.22);
}

.mode-tab:active{
  transform:translateY(1px);
}



.streak-bar{
  height:10px;
  margin-top:18px;
  margin-bottom:5px;
  overflow:hidden;

  border-radius:999px;

  background:#e2e8f0;
}

.streak-bar-fill{
  height:100%;
  width:0%;

  border-radius:999px;

  transition:
    width .25s ease,
    background .25s ease,
    box-shadow .25s ease;
}




.inline-blank-input{
  width:140px;
  min-width:90px;

  padding:2px 8px;

  border:none;
  border-bottom:5px solid var(--blue);

  background:transparent;

  color:var(--blue-dark);

  font-size:clamp(24px,5vw,42px);
  font-weight:950;
  font-family:inherit;

  text-align:center;
  vertical-align:baseline;

  outline:none;

  transition:border-color .12s ease, background .12s ease;
}

.inline-blank-input:focus{
  border-bottom-color:#f59e0b;
  background:rgba(14,165,233,.06);
}

.inline-blank-input.correct{
  color:#15803d;
  border-bottom-color:#22c55e;
}

.inline-blank-input.wrong{
  color:#b91c1c;
  border-bottom-color:#ef4444;
}


.sentence-hint{
  max-width:620px;

  margin:
    -2px auto 16px;

  padding:0 12px;

  text-align:center;

  color:#64748b;

  font-size:16px;
  line-height:1.5;
  font-weight:700;

  letter-spacing:-.01em;
}

.sentence-hint strong{
  color:#0f172a;
}

@media(max-width:560px){

  .sentence-hint{
    font-size:15px;
    line-height:1.45;
  }

}


.spelling-form{
  display:flex;
  align-items:stretch;
  gap:8px;
  width:100%;
  margin:28px auto 0;
}

.spelling-input{
  flex:1;
  min-width:0;
  height:58px;
  border-radius:18px;
}

.spelling-submit{
  flex:0 0 54px;
  width:54px;
  height:58px;
  border:0;
  border-radius:18px;
  background:var(--blue);
  color:#fff;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 4px 0 #0369a1;
}

.spelling-submit:active{
  transform:translateY(2px);
  box-shadow:0 2px 0 #0369a1;
}

@media(max-width:560px){

  .spelling-form{
    margin-top:22px;
  }

  .spelling-submit{
    flex-basis:48px;
    width:48px;
  }

}