:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #201b39;
  background: #f8f6ef;
  font-synthesis: none;
  --paper: #f8f6ef;
  --ink: #201b39;
  --secondary: #5f596d;
  --purple: #5236c7;
  --border: #e6e0ef;
  --surface: #fffdfa;
  --rounding: 22px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid #7758e5; outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

.site-header {
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid #e9e3d8;
}
.header-inner, .main {
  width: min(100% - 64px, 1090px);
  margin-inline: auto;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 25px; font-weight: 800; letter-spacing: -.055em; }
.brand-icon {
  width: 39px; height: 39px; border-radius: 13px; background: var(--purple);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 3px 0 #4028a2;
}
.brand-icon i { width: 9px; height: 15px; background: #fff; border-radius: 3px 2px 1px 3px; transform: skewY(7deg); }
.brand-icon i + i { background: #dccfff; border-radius: 2px 3px 3px 1px; transform: skewY(-7deg); }
.score {
  min-width: 72px; border: 1px solid #e9d9a8; background: #fff4cf;
  border-radius: 24px; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding-inline: 12px; font-variant-numeric: tabular-nums;
}
.score span { font-size: 20px; line-height: 1; color: #875413; }
.score strong { font-size: 16px; }
.main { padding-top: 39px; padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(35px, 5vw, 56px); line-height: 1.08; letter-spacing: -.055em; font-weight: 810; }
.intro { margin-bottom: 30px; }
.intro p, .game-heading p { color: var(--secondary); margin-top: 11px; line-height: 1.45; font-size: 16px; }

.workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }
.lesson-picker {
  background: var(--surface); border: 1px solid #ebe4d8; border-radius: var(--rounding);
  padding: 14px 12px 12px;
}
.lesson-picker h2 { font-size: 16px; padding: 4px 9px 12px; }
.lesson-links { display: grid; gap: 4px; }
.lesson-link {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center;
  text-align: left; width: 100%; min-height: 44px; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 12px; background: transparent;
}
.lesson-link:hover { background: #f7f2ff; }
.lesson-link[aria-pressed="true"] { background: #eee8ff; color: #4527ab; border-color: #dfd2ff; }
.lesson-tile {
  width: 30px; height: 30px; display: grid; place-content: center;
  background: #f0ebfb; border-radius: 9px; font-weight: 750; color: var(--purple);
}
.lesson-link[aria-pressed="true"] .lesson-tile { background: var(--purple); color: #fff; }
.mini-book { width: 12px; height: 13px; border: 1.5px solid currentColor; border-radius: 3px 2px 2px 3px; position: relative; }
.mini-book::before { content: ""; position: absolute; width: 5px; height: 1.5px; background: currentColor; top: 4px; left: 2px; }
.lesson-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.lesson-count { font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }

.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 224px;
  padding: 28px 30px; border-radius: 26px; background: #e9e0ff; border: 1px solid #ddd0fb;
}
.hero-content { position: relative; z-index: 1; }
.hero h2 { font-size: clamp(35px, 4vw, 47px); line-height: 1.1; letter-spacing: -.055em; }
.hero p { margin-top: 11px; color: #54466f; font-size: 14px; }
.hero p strong { color: #3e2b77; }
.lesson-meter, .game-meter {
  display: block; border: 0; appearance: none; -webkit-appearance: none;
  border-radius: 20px; height: 7px; overflow: hidden; background: #d7c7f4;
}
.lesson-meter { width: min(190px, 100%); margin: 10px 0 19px; }
.game-meter { width: 100%; }
progress::-webkit-progress-bar { background: #d7c7f4; border-radius: 20px; }
progress::-webkit-progress-value { background: var(--purple); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--purple); border-radius: 20px; }
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 15px;
  border: 1px solid transparent; min-height: 49px; padding: 9px 17px;
  border-radius: 13px; background: var(--purple); color: #fff; font-weight: 750;
  box-shadow: 0 3px 0 #3a2497;
}
.primary-button span { font-size: 23px; line-height: 1; }
.primary-button:hover { background: #452ab8; }
.primary-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a2497; }
.hero-art { position: absolute; right: 36px; top: 12px; width: 248px; height: 200px; z-index: 0; pointer-events: none; }
.lace { position: absolute; width: 193px; height: 143px; border: 1px solid #c3acf4; border-radius: 50%; right: 8px; top: 27px; transform: rotate(-25deg); }
.art-card { display: block; position: absolute; width: 91px; height: 123px; border-radius: 17px; border: 1px solid #8a6cda; }
.back-card { right: 32px; top: 48px; background: #ad93f2; transform: rotate(23deg); box-shadow: 3px 5px 0 #8e70d315; }
.front-card {
  right: 91px; top: 47px; background: #fcf9ff; transform: rotate(-16deg);
  box-shadow: 0 7px 0 #9f82e044; padding: 37px 17px;
}
.art-line { display: block; width: 100%; height: 7px; border-radius: 10px; background: #9e81ec; margin-bottom: 9px; }
.art-line.short { width: 66%; background: #c4b2f2; }
.art-sparkle { position: absolute; right: 12px; top: 7px; color: #7753d6; font-size: 35px; }
.art-dot { position: absolute; bottom: 18px; left: 18px; width: 10px; height: 10px; border-radius: 50%; background: #a685ed; }
.section-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin: 27px 0 12px; }
.section-title h2 { font-size: 25px; letter-spacing: -.035em; }
.section-title span { color: var(--secondary); font-size: 13px; }
.dictionary { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.word-card {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; min-height: 78px; height: 100%; padding: 13px 14px; text-align: left;
  background: var(--surface); border: 1px solid #ebe4d8; border-radius: 16px;
}
.word-card:hover, .word-card:active { background: #f6f0ff; border-color: #dacef8; }
.word-text { display: grid; gap: 5px; overflow-wrap: anywhere; min-width: 0; }
.word-text strong { font-size: 17px; font-weight: 760; }
.word-text > span { color: var(--secondary); font-size: 13px; line-height: 1.35; }
.sound-icon { position: relative; display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 12px; background: #efe9ff; color: var(--purple); }
.speaker { display: block; position: relative; width: 19px; height: 16px; }
.speaker i { position: absolute; width: 11px; height: 14px; top: 1px; background: currentColor; clip-path: polygon(0 31%, 35% 31%, 100% 0, 100% 100%, 35% 69%, 0 69%); }
.speaker::after { content: ""; position: absolute; width: 10px; height: 13px; top: 1.5px; right: 0; border-right: 2px solid currentColor; border-radius: 50%; }

.game { max-width: 730px; margin-inline: auto; }
.back-button { border: 0; min-height: 44px; padding: 2px 7px; background: transparent; color: var(--purple); font-weight: 730; }
.back-button span { font-size: 21px; vertical-align: -1px; margin-right: 5px; }
.game-heading { padding: 20px 0 4px; }
.game-heading h1 { outline: none; }
.game-count { display: flex; justify-content: space-between; margin: 23px 0 9px; font-size: 14px; }
.game-feedback { min-height: 36px; display: grid; align-items: center; color: #246249; font-size: 14px; font-weight: 720; }
.game-feedback.negative { color: #9c3344; }
.game-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.game-board section { display: flex; flex-direction: column; gap: 8px; }
.game-board h2 { font-size: 14px; color: var(--secondary); margin-bottom: 3px; }
.game-card {
  width: 100%; min-height: 57px; padding: 10px 13px; border: 1px solid #e3dced;
  border-radius: 13px; background: var(--surface); text-align: center; line-height: 1.25;
  overflow-wrap: anywhere; font-size: 15px; font-weight: 660;
}
.game-card:not(:disabled):hover { border-color: #af97ef; }
.game-card.is-selected { background: #e8dfff; border-color: #7651dc; color: #4527ab; }
.game-card.is-matched { background: #e6f4e9; border-color: #b7dfc5; color: #28563c; }
.game-card.is-wrong { background: #fde3e7; border-color: #c8727e; color: #802b3a; }
.pair-check { margin-left: 4px; }
.result { background: #e9e0ff; border: 1px solid #ddd0fb; border-radius: var(--rounding); padding: 28px 12px; text-align: center; }
.result-star { color: #9b630e; font-size: 44px; display: inline-block; }
.result h2 { font-size: 29px; letter-spacing: -.045em; margin-top: 3px; }
.result p { color: var(--secondary); margin: 7px 0 21px; }
.notice { color: #81353a; font-size: 14px; background: #ffece5; padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.load-message { color: var(--secondary); margin-bottom: 12px; }
.announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 750px) {
  .header-inner, .main { width: min(100% - 36px, 570px); }
  .header-inner { min-height: 62px; }
  .main { padding-top: 25px; }
  .intro { margin-bottom: 17px; }
  .intro p { font-size: 14px; margin-top: 8px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .lesson-picker { padding: 0; border: 0; background: transparent; }
  .lesson-picker h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lesson-links { grid-auto-flow: column; grid-auto-columns: max-content; gap: 7px; overflow-x: auto; padding: 4px 4px 7px; margin-inline: -4px; scrollbar-width: thin; }
  .lesson-link { grid-template-columns: auto; border-color: #ebe4d8; width: auto; min-width: 85px; min-height: 52px; border-radius: 13px; background: var(--surface); gap: 3px; text-align: center; padding: 5px 10px; }
  .lesson-tile { display: none; }
  .lesson-name { font-size: 13px; }
  .hero { min-height: 193px; padding: 20px 17px; }
  .hero-art { transform: scale(.68); transform-origin: right center; right: 5px; top: -4px; }
  .hero-content { width: max-content; max-width: 100%; }
  .lesson-meter { width: min(145px, 100%); }
  .section-title { margin-top: 21px; }
  .section-title h2 { font-size: 23px; }
  .game-heading { padding-top: 13px; }
}
@media (max-width: 500px) {
  .dictionary { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .word-card { min-height: 66px; padding: 10px 12px; }
  .game-card { min-height: 57px; font-size: 14px; padding-inline: 7px; }
}
@media (max-width: 360px) {
  .hero-art { transform: scale(.53); right: -5px; }
  .game-board { gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .primary-button { transition: transform 120ms, background-color 120ms; }
}
