:root {
  --ink: #23283f;
  --muted: #51586f;
  --primary: #3d3aa5;
  --primary-dark: #2d2a82;
  --line: #dce0eb;
  --lavender: #eeedff;
  --mint: #e6f7ee;
  color: var(--ink);
  background: #f3f5fb;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(circle,#7764aa3d 1px,transparent 1.3px) 0 0 / 21px 21px,
    radial-gradient(ellipse clamp(170px,28vw,450px) 350px at -45px 120px,#dfcafa 0 72%,transparent 72.5%),
    radial-gradient(ellipse clamp(160px,26vw,410px) 310px at calc(100% + 35px) 160px,#c1ebff 0 70%,transparent 70.5%),
    radial-gradient(ellipse clamp(190px,32vw,540px) 260px at 106% 95%,#ffded0 0 73%,transparent 73.5%),
    radial-gradient(ellipse clamp(170px,27vw,420px) 300px at -2% 90%,#e7f0aa 0 68%,transparent 68.5%),
    #f8f6ff;
  background-attachment: fixed;
}
@media (max-width: 620px) {
  body { background-attachment: scroll; }
}
main { max-width: 854px; padding-top: clamp(16px,4vw,38px); }
header {
  min-height: 81px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(14px,3vw,22px);
  border-radius: 17px;
  background: #242944;
}
.wordmark { display: flex; align-items: center; gap: 13px; }
.wordmark-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  color: #252945;
  background: #dff47a;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -.08em;
  transform: rotate(-5deg);
}
h1,h2,h3 { font-family: ui-rounded,"Avenir Next",system-ui,sans-serif; letter-spacing: -.025em; }
h1 { font-weight: 820; font-size: clamp(1.58rem,5vw,2.3rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.25rem,3vw,1.52rem); line-height: 1.18; }
header .restart {
  margin: 0;
  flex: none;
  padding: 6px 11px;
  font-size: .875rem;
  color: #fff;
  border: 1px solid #ffffff66;
  border-radius: 9px;
  background: transparent;
}
header .restart:hover { background: #ffffff19; }
section, form { border-color: var(--line); border-radius: 17px; }
section, #form { box-shadow: 0 3px 12px #29375a0a; }
.hour-plan {
  padding-block: 13px;
  border-left: 4px solid #9e9de7;
  background: #fff;
}
.hour-plan h2 { font-size: 1.05rem; }
.practice-menu { margin-top: 8px; }
.practice-menu > summary { color: var(--muted); font-size: .91rem; }
.practice-menu[open] { border-top: 1px solid var(--line); padding-top: 8px; }
button:not(.secondary):not(.restart) { border-color: var(--primary); background: var(--primary); }
button:not(.secondary):not(.restart):enabled:hover { background: var(--primary-dark); }
button.secondary { color: var(--primary-dark); border-color: #cfd3e4; background: white; }
button.secondary:enabled:hover { background: var(--lavender); }
button, .translation-answer, textarea, select { border-radius: 9px; }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #5b55d6;
  outline-offset: 3px;
}
nav button[aria-pressed="true"] { background: var(--primary-dark); color: white; border-color: var(--primary-dark); }
a, output, .steps, .confidence-headings, .confidence-language { color: var(--primary-dark); }
progress, .confidence-control input { accent-color: var(--primary); }
small, .profile-intro { color: var(--muted); }
#word-course, #lesson, #form, #grammar, #reading, #memory, #guide { background: #fff; }
#grammar-heading, #hour-grammar strong { color: #4b3da1; }
#reading-heading, #hour-reading strong { color: #1d607c; }
#memory-heading { color: #24674e; }
.passage { background: #eaf6fc; border: 1px solid #cae4f0; padding: 16px; }
.translation-answer, textarea, select { background: #fff; border-color: #a6adc3; color: var(--ink); }
.gap-answer { background: var(--lavender); border-color: var(--primary); color: var(--ink); }
.gap-answer:focus-visible { outline-color: var(--primary); }
.options button { min-height: 44px; }
.options button[aria-pressed="true"] { border-color: var(--primary); background: var(--lavender); }
.round-tag { background: var(--lavender); color: #38337d; }
.score { background: #ecf8bc; color: #424d1d; }
.memory-card { background: #f2f1ff; border-color: #dcdbf4; }
.sentence-line { background: var(--lavender); }
.lesson-feedback { background: var(--mint); border-color: #248263; }
.lesson-feedback[data-correct="false"] { background: #fff3e4; border-color: #9e5d16; }
.confidence-row { border-color: #e1e4ee; }
.confidence-row:nth-child(odd) { background: #f7f8fc; }
.profile-grid { justify-items: stretch; }
.profile-intro { margin: .55rem 0 1.15rem; }
.profile-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr));
  gap: 10px;
  padding: 2px 14px 14px;
}
.profile-section {
  --group-icon: #eeeaff;
  grid-column: 1 / -1;
  margin: 0;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.profile-hobbies { --group-icon:#eff7cf; }
.profile-appearance { --group-icon:#f8e6f0; }
.profile-home { --group-icon:#e5f3fa; }
.profile-section summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
}
.profile-section summary::-webkit-details-marker { display:none; }
.profile-section summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.profile-section[open] summary::after { transform: rotate(225deg); }
.profile-icon { display:grid; place-items:center; width:29px; height:29px; background:var(--group-icon); border-radius:7px; }
.profile-grid input,.profile-grid select { border-color:#a6adc3; color:var(--ink); }
.profile-checklist { margin:4px 0 0; background:#fff; border-color:var(--line); }
.profile-checklist input[type="checkbox"] { accent-color:var(--primary); }
.profile-start { grid-column:1 / -1; justify-self:start; padding-inline:20px; }
.point-reaction {
  display:flex;
  align-items:center;
  min-height:88px;
  gap:12px;
  border:1px solid #dce7b6;
  background:#f6fae8;
  color:#252945;
  padding:9px 12px;
  border-radius:11px;
  margin:10px 0 12px;
}
.point-reaction p { margin:0; }
.point-reaction strong { color:#343b18; }
.reaction-media { display:grid; place-items:center; flex:0 0 70px; height:70px; background:#fff; border-radius:8px; }
.reaction-media img { display:block; width:62px; height:62px; object-fit:contain; }
.confetti-burst { z-index:2; }
.confetti-burst i { border-radius:1px; animation-duration: .86s; }
@media (min-width: 621px) {
  .profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .profile-section { grid-column:auto; }
  .profile-section[open] { grid-column:1 / -1; }
}
@media (max-width: 460px) {
  main { padding-inline:12px; }
  .wordmark { gap:8px; }
  .wordmark-badge { width:29px; height:29px; border-radius:7px; }
  header .restart { padding-inline:8px; }
  .hour-plan .top { gap:8px 14px; }
  .hour-plan .top > button { padding:8px 10px; }
  .profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.profile-support { --group-icon:#e4ecff; }
.support-intro { grid-column:1 / -1; color:var(--muted); margin:2px 0 0; }
.support-group { grid-column:1 / -1; padding:8px 10px; border:1px solid var(--line); border-radius:9px; margin:0; background:#fff; }
.support-group legend { padding-inline:4px; font-weight:700; }
.support-group .support-choice { display:flex; align-items:center; gap:8px; margin:5px 0; }
.support-choice input[type="checkbox"] { inline-size:1.1rem; block-size:1.1rem; accent-color:var(--primary); flex:none; }
.support-sequence { border-left:3px solid #9e9de7; padding-left:10px; margin-block:9px 4px; color:var(--muted); }
.support-settings-link { margin-top:8px; }
#support-dialog { width:min(540px,calc(100% - 30px)); max-height:calc(100dvh - 24px); }
#support-form { border:0; padding:0; margin-top:10px; }
#support-dialog-fields { display:grid; gap:10px; }
.study-clear { font-family:Arial,sans-serif; }
.study-clear h1,.study-clear h2,.study-clear h3 { font-family:Arial,sans-serif; letter-spacing:0; }
.study-clear p,.study-clear li,.study-clear label,.study-clear button,.study-clear input,.study-clear textarea,.study-clear select {
  line-height:1.65; letter-spacing:.025em; word-spacing:.09em;
}
.study-clear .passage,.study-clear .question,.study-clear .review { font-size:1.15rem; }
.study-calm body { background:#f3f5fb; }
.study-calm .point-reaction,.study-calm .confetti-burst { display:none; }
.study-calm *, .study-calm *::before, .study-calm *::after { animation:none!important; transition:none!important; }
.study-clear .lesson-feedback,.study-clear #word-body>p,.study-clear .passage { font-size:1.12rem; }
