:root {
  --green: #087b3d;
  --green-dark: #07542f;
  --green-soft: #e8f6eb;
  --red: #e73535;
  --yellow: #f4b400;
  --ink: #19352a;
  --muted: #6e8078;
  --paper: #f7f5ee;
  --card: rgba(255, 255, 255, .88);
  --line: rgba(24, 66, 48, .12);
  --shadow: 0 20px 55px rgba(32, 75, 53, .11);
  --shadow-small: 0 10px 25px rgba(32, 75, 53, .09);
  --radius-xl: 32px;
  --radius-lg: 23px;
  --radius-md: 16px;
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); overflow-x: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(11, 137, 71, .28); outline-offset: 3px; }
.hidden { display: none !important; }

.ambient { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .24; pointer-events: none; z-index: -1; }
.ambient-one { background: #70d893; top: -250px; right: -170px; }
.ambient-two { background: #ffd664; left: 12%; bottom: -380px; }

.site-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: rgba(250, 249, 244, .8); backdrop-filter: blur(20px); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 4px 8px 24px; }
.brand img { width: 50px; height: 50px; filter: drop-shadow(0 7px 10px rgba(18, 87, 53, .16)); }
.brand span { display: flex; flex-direction: column; line-height: 1.06; }
.brand strong { font-size: 21px; letter-spacing: -.5px; }
.brand small { color: var(--muted); font-weight: 700; margin-top: 5px; }
.main-nav { display: grid; gap: 8px; }
.nav-button { border: 0; background: transparent; border-radius: 15px; padding: 13px 14px; display: flex; gap: 13px; align-items: center; font-weight: 800; color: #53675e; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-button span { display: grid; place-items: center; width: 28px; height: 28px; font-size: 21px; }
.nav-button:hover { background: rgba(255,255,255,.72); color: var(--ink); transform: translateX(2px); }
.nav-button.active { background: #fff; color: var(--green); box-shadow: var(--shadow-small); }
.sidebar-note { margin-top: auto; border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 20px; padding: 17px; }
.sidebar-note > span { font-size: 24px; }
.sidebar-note strong { display: block; margin: 7px 0 3px; }
.sidebar-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.app-main { min-width: 0; }
.topbar { min-height: 82px; padding: 16px clamp(24px, 4.5vw, 72px); display: flex; align-items: center; justify-content: flex-end; gap: 18px; position: sticky; top: 0; z-index: 15; background: rgba(247,245,238,.76); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(24,66,48,.07); }
.mobile-brand { display: none; border: 0; background: transparent; padding: 0; }
.mobile-brand img { width: 43px; height: 43px; }
.topbar-progress { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.tiny-label, .eyebrow, .card-kicker, .question-type { font-size: 11px; letter-spacing: .14em; font-weight: 900; color: var(--green); }
.daily-ring { --daily: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--daily) * 1%), #dce7df 0); position: relative; }
.daily-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.daily-ring b { position: relative; z-index: 1; font-size: 10px; }
.top-stats { display: flex; gap: 9px; align-items: center; }
.stat-pill, .sound-toggle, .auth-button { border: 1px solid var(--line); background: rgba(255,255,255,.8); height: 42px; border-radius: 14px; padding: 0 12px; display: flex; align-items: center; gap: 7px; box-shadow: 0 6px 18px rgba(26,66,48,.05); }
.stat-pill b { font-size: 14px; }
.stat-pill span { font-size: 16px; }
.xp-pill span { color: #6b56dd; }
.sound-toggle { width: 42px; justify-content: center; cursor: pointer; font-weight: 900; color: var(--green); }
.sound-toggle.muted { color: #9aa9a2; }
.auth-button { cursor: pointer; color: var(--green-dark); font-size: 13px; font-weight: 900; }
.auth-button.signed-in { background: var(--green); border-color: var(--green); color: #fff; }

.screen { display: none; width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 80px; animation: screen-in .25s ease both; }
.screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

.hero { min-height: 380px; background: linear-gradient(130deg, #075d33 0%, #098649 58%, #0b9550 100%); color: #fff; border-radius: var(--radius-xl); padding: clamp(30px, 5vw, 62px); display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(270px, .82fr); overflow: hidden; position: relative; box-shadow: 0 28px 65px rgba(8, 99, 54, .22); }
.hero::before { content: ""; position: absolute; width: 360px; height: 360px; border: 70px solid rgba(255,255,255,.06); border-radius: 50%; right: -100px; top: -170px; }
.hero-copy { position: relative; z-index: 2; align-self: center; }
.hero .eyebrow { color: #d2ffde; }
.hero h1 { margin: 12px 0 14px; font-size: clamp(38px, 5vw, 67px); line-height: .98; letter-spacing: -.055em; max-width: 680px; }
.hero p { font-size: clamp(16px, 1.8vw, 20px); line-height: 1.55; color: rgba(255,255,255,.82); max-width: 610px; margin: 0 0 28px; }
.primary-button, .secondary-button, .danger-button, .feedback-button { border: 0; border-radius: 15px; min-height: 52px; padding: 0 21px; font-weight: 900; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button { background: #fff; color: var(--green-dark); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.18); }
.hero .primary-button { min-width: 190px; }
.hero .primary-button span { margin-left: 12px; }
.secondary-button { background: var(--green-soft); color: var(--green-dark); }
.secondary-button:hover { transform: translateY(-2px); background: #dcf1e2; }
.small-button { min-height: 47px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero-meta span { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; }
.hero-visual { position: relative; display: grid; place-items: center; min-height: 250px; }
.hero-visual > img { width: clamp(185px, 20vw, 270px); filter: drop-shadow(0 25px 24px rgba(0,0,0,.18)); transform: rotate(3deg); }
.mascot-bubble { position: absolute; z-index: 2; top: 10px; left: -10px; color: var(--ink); background: #fff; border-radius: 24px 24px 24px 7px; padding: 14px 18px; box-shadow: var(--shadow-small); transform: rotate(-4deg); }
.mascot-bubble span { display: block; color: var(--green); font-size: 24px; font-weight: 950; }
.mascot-bubble small { font-weight: 750; color: var(--muted); }
.floating-star { position: absolute; color: var(--yellow); text-shadow: 0 8px 20px rgba(0,0,0,.16); animation: float 3.5s ease-in-out infinite; }
.star-a { font-size: 42px; right: 8px; top: 32px; }
.star-b { font-size: 30px; left: 5%; bottom: 22px; animation-delay: -1.4s; }
@keyframes float { 50% { transform: translateY(-12px) rotate(8deg); } }

.missions-card { margin-top: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-small); border-radius: var(--radius-lg); padding: 24px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-title h2 { margin: 5px 0 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.compact-title { align-items: center; }
.compact-title h2 { font-size: 23px; }
.mission-chest { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 25px; background: #fff5c8; border: 1px solid #f2dd78; }
.mission-chest.ready { animation: chest 1s ease-in-out infinite; cursor: pointer; }
@keyframes chest { 50% { transform: rotate(5deg) scale(1.06); } }
.mission-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 18px; }
.mission { border: 1px solid var(--line); border-radius: 17px; padding: 15px; background: #fff; }
.mission-head { display: flex; align-items: center; gap: 9px; }
.mission-head span { font-size: 20px; }
.mission-head strong { font-size: 14px; }
.mission small { color: var(--muted); display: block; margin: 7px 0 10px; }
.micro-track { height: 7px; background: #e8eeea; border-radius: 999px; overflow: hidden; }
.micro-track div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #2cb76a); border-radius: inherit; transition: width .3s ease; }
.mission.done { border-color: #8bd8a6; background: #f2fff6; }
.mission.done .micro-track div { background: var(--yellow); }
.path-title { margin: 40px 2px 18px; }
.overall-progress { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 10px 14px; white-space: nowrap; box-shadow: var(--shadow-small); }
.overall-progress b { color: var(--green); font-size: 18px; margin-right: 3px; }
.overall-progress span { color: var(--muted); font-size: 13px; font-weight: 750; }

.chapter-path { display: grid; gap: 18px; }
.chapter-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-small); }
.chapter-head { width: 100%; border: 0; background: transparent; padding: 21px 23px; display: grid; grid-template-columns: 57px minmax(0, 1fr) auto; gap: 15px; align-items: center; cursor: pointer; text-align: left; }
.chapter-icon { width: 57px; height: 57px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.chapter-copy small { display: block; color: var(--muted); font-weight: 800; margin-bottom: 4px; }
.chapter-copy strong { font-size: 20px; letter-spacing: -.02em; }
.chapter-copy p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.chapter-progress { min-width: 105px; text-align: right; }
.chapter-progress b { display: block; font-size: 14px; }
.chapter-progress span { color: var(--muted); font-size: 12px; }
.chapter-chevron { margin-left: 10px; display: inline-block; transition: transform .2s; }
.chapter-card.open .chapter-chevron { transform: rotate(180deg); }
.level-grid { display: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; padding: 0 22px 22px; }
.chapter-card.open .level-grid { display: grid; animation: levels-in .22s ease both; }
@keyframes levels-in { from { opacity: 0; transform: translateY(-8px); } }
.level-button { min-height: 118px; border: 1px solid var(--line); border-radius: 17px; background: #fff; padding: 14px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 5px; position: relative; transition: .16s ease; }
.level-button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-small); border-color: rgba(8,123,61,.3); }
.level-button:disabled { opacity: .58; cursor: not-allowed; }
.level-number { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; background: #eef4f0; color: var(--green-dark); font-size: 12px; font-weight: 950; }
.level-button strong { font-size: 14px; line-height: 1.15; }
.level-button small { margin-top: auto; color: var(--muted); font-weight: 750; }
.level-button.current { border: 2px solid var(--chapter-color); background: color-mix(in srgb, var(--chapter-color) 7%, white); }
.level-button.current .level-number { background: var(--chapter-color); color: #fff; }
.level-button.completed .level-number { background: var(--green); color: #fff; }
.level-button.mastery::after { content: "★"; color: var(--yellow); position: absolute; right: 12px; top: 11px; }
.level-score { font-size: 11px; color: #b67e00; font-weight: 900; }

.page-heading { padding: 30px 0 22px; max-width: 780px; }
.page-heading h1 { font-size: clamp(38px, 5vw, 64px); margin: 10px 0 13px; letter-spacing: -.055em; line-height: 1; }
.page-heading p { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0; }
.practice-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
.practice-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 25px; box-shadow: var(--shadow-small); display: flex; flex-direction: column; min-height: 275px; }
.practice-card.focus-card { background: linear-gradient(145deg, #075d33, #0b8e4b); color: #fff; }
.practice-card.focus-card .card-kicker, .practice-card.focus-card p { color: #d3f6dd; }
.practice-icon { font-size: 35px; margin-bottom: 17px; }
.practice-card h2 { font-size: 25px; margin: 7px 0 8px; }
.practice-card p { color: var(--muted); line-height: 1.5; margin: 0 0 22px; }
.practice-card button { margin-top: auto; }
.mastery-section, .badge-section { margin-top: 25px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-small); }
.soft-pill { border-radius: 999px; background: #edf3ef; color: var(--muted); padding: 8px 12px; font-size: 12px; font-weight: 850; }
.mastery-list { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 540px; overflow: auto; padding-right: 4px; }
.mastery-item { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 13px 14px; }
.mastery-item strong, .mastery-item span { display: block; }
.mastery-item span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mastery-dots { display: flex; gap: 4px; margin-top: 9px; }
.mastery-dots i { width: 17px; height: 5px; border-radius: 999px; background: #dde7e0; }
.mastery-dots i.on { background: var(--green); }

.corpus-toolbar { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-small); border-radius: 20px; padding: 14px; display: grid; grid-template-columns: minmax(240px, 1fr) 180px repeat(3, auto); gap: 10px; }
.search-box { min-height: 50px; border: 1px solid var(--line); background: #fff; border-radius: 14px; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.search-box span { font-size: 21px; color: var(--muted); }
.search-box input { border: 0; outline: 0; width: 100%; background: transparent; color: var(--ink); }
.corpus-toolbar select { border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); padding: 0 13px; font-weight: 750; }
.corpus-toolbar .primary-button { background: var(--green); color: #fff; box-shadow: none; }
.corpus-notice { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; background: #fff8d8; border: 1px solid #ebd980; border-radius: 16px; padding: 14px 16px; color: #6c5b13; }
.corpus-notice p { margin: 0; font-size: 13px; line-height: 1.5; }
.corpus-status { color: var(--muted); font-weight: 750; padding: 13px 3px; }
.corpus-results { display: grid; gap: 10px; }
.corpus-row { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 16px 18px; box-shadow: 0 7px 18px rgba(24,66,48,.05); }
.corpus-row header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.corpus-row header span { font-size: 11px; color: var(--muted); font-weight: 850; }
.corpus-row button { border: 0; background: #edf6f0; color: var(--green); width: 33px; height: 33px; border-radius: 10px; cursor: pointer; }
.corpus-row dl { display: grid; grid-template-columns: 35px 1fr; gap: 7px 10px; margin: 0; }
.corpus-row dt { color: var(--muted); font-size: 11px; font-weight: 900; padding-top: 3px; }
.corpus-row dd { margin: 0; line-height: 1.45; }
.empty-state { grid-column: 1 / -1; text-align: center; border: 1px dashed #bac9c0; border-radius: 18px; padding: 34px; color: var(--muted); }

.profile-hero { margin-top: 30px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #fff, #edf9f0); border: 1px solid var(--line); padding: 34px; display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 20px; box-shadow: var(--shadow); }
.avatar { width: 82px; height: 82px; border-radius: 27px; display: grid; place-items: center; background: linear-gradient(145deg, var(--green), #21ae63); color: #fff; font-size: 35px; font-weight: 950; box-shadow: 0 15px 28px rgba(8,123,61,.23); }
.profile-hero h1 { font-size: 35px; letter-spacing: -.04em; margin: 5px 0; }
.profile-hero p { margin: 0; color: var(--muted); }
.rank-badge { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 15px 18px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-small); }
.rank-badge span { font-size: 28px; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 17px; }
.profile-stats article { background: var(--card); border: 1px solid var(--line); border-radius: 19px; padding: 20px; text-align: center; box-shadow: var(--shadow-small); }
.profile-stats article > span { font-size: 24px; }
.profile-stats b { display: block; font-size: 25px; margin: 8px 0 2px; }
.profile-stats small { color: var(--muted); font-weight: 750; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.badge { border: 1px solid var(--line); background: #fff; border-radius: 17px; padding: 16px; min-height: 145px; }
.badge.locked { filter: grayscale(1); opacity: .45; }
.badge-icon { font-size: 30px; }
.badge strong { display: block; margin: 10px 0 5px; }
.badge small { color: var(--muted); line-height: 1.35; }
.settings-card { margin-top: 17px; border: 1px solid rgba(208,62,62,.17); background: #fff7f7; border-radius: 20px; padding: 21px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.settings-card h2 { margin: 0 0 5px; font-size: 20px; }
.settings-card p { margin: 0; color: var(--muted); }
.danger-button { color: #b72e2e; background: #ffe3e3; min-width: 150px; }

.mobile-nav { display: none; }
.lesson-overlay { position: fixed; inset: 0; z-index: 100; background: #fbfaf6; display: none; flex-direction: column; }
.lesson-overlay.active { display: flex; animation: lesson-in .22s ease both; }
@keyframes lesson-in { from { opacity: 0; transform: translateY(15px); } }
.lesson-header { width: min(930px, calc(100% - 38px)); margin: 0 auto; min-height: 82px; display: grid; grid-template-columns: 44px 1fr auto; gap: 17px; align-items: center; }
.round-button { width: 43px; height: 43px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 25px; }
.lesson-progress { height: 11px; border-radius: 999px; background: #e5ece7; overflow: hidden; }
.lesson-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #35bd72); border-radius: inherit; transition: width .25s ease; }
.hearts { min-width: 60px; color: var(--red); font-size: 18px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.hearts.hit { animation: shake .3s ease; }
@keyframes shake { 30% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.lesson-content { width: min(820px, calc(100% - 38px)); margin: auto; padding: 25px 0 175px; overflow-y: auto; }
.question-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 850; }
.context-pill { border-radius: 999px; padding: 7px 10px; background: #ecf4ef; color: var(--green); }
.question-type { display: block; margin-top: 28px; }
.lesson-content h2 { margin: 12px 0 24px; font-size: clamp(31px, 5vw, 49px); line-height: 1.12; letter-spacing: -.045em; }
.combo-badge { display: inline-flex; margin: -12px 0 20px; color: #a56700; background: #fff3bb; border: 1px solid #efd36b; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 950; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.7); } }
.answer-area { display: grid; gap: 11px; }
.answer-button { border: 2px solid #dde7e0; background: #fff; border-radius: 17px; min-height: 69px; padding: 13px 16px; text-align: left; display: flex; align-items: center; gap: 13px; cursor: pointer; font-weight: 800; transition: .15s ease; animation: answer-in .25s ease both; }
@keyframes answer-in { from { opacity: 0; transform: translateY(7px); } }
.answer-button:hover:not(:disabled) { border-color: #9fc9ad; transform: translateY(-2px); box-shadow: var(--shadow-small); }
.answer-key { width: 33px; height: 33px; border: 1px solid #dce6df; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.answer-button.correct { border-color: #54ba77; background: #effcf3; }
.answer-button.wrong { border-color: #ec7171; background: #fff1f1; }
.answer-button.reveal { border-color: #72c98f; }
.type-form { display: grid; gap: 12px; }
.type-input { min-height: 67px; border: 2px solid #dbe5de; border-radius: 17px; background: #fff; padding: 0 17px; font-size: 18px; color: var(--ink); }
.check-button { border: 0; min-height: 55px; border-radius: 15px; background: var(--green); color: #fff; font-weight: 900; cursor: pointer; }
.word-bank, .sentence-builder { min-height: 73px; padding: 12px; border: 2px dashed #cddad2; border-radius: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sentence-builder { border-style: solid; background: #fff; margin-bottom: 12px; }
.word-token { border: 1px solid #cbd9d0; background: #fff; border-radius: 12px; padding: 10px 13px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 #dce6df; }
.word-token:active { transform: translateY(2px); box-shadow: 0 1px 0 #dce6df; }
.builder-placeholder { color: #9aa9a1; font-weight: 750; }
.feedback-panel { position: fixed; z-index: 105; left: 0; right: 0; bottom: 0; min-height: 130px; padding: 20px max(calc((100vw - 820px) / 2), 20px); background: #eaf9ef; border-top: 1px solid #a9ddba; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.feedback-panel.wrong { background: #fff0f0; border-color: #f0b0b0; }
.feedback-copy { display: flex; align-items: center; gap: 14px; }
.feedback-copy > span { width: 45px; height: 45px; border-radius: 15px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 25px; font-weight: 950; }
.feedback-panel.wrong .feedback-copy > span { background: var(--red); }
.feedback-copy strong { font-size: 20px; }
.feedback-copy p { margin: 4px 0 0; color: #4e6c5a; }
.feedback-panel.wrong .feedback-copy p { color: #815858; }
.feedback-button { min-width: 180px; color: #fff; background: var(--green); position: relative; overflow: hidden; }
.feedback-panel.wrong .feedback-button { background: var(--red); }
.feedback-button.auto::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--auto, 0) * 100%); background: rgba(255,255,255,.75); }

.result-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(8,42,26,.58); backdrop-filter: blur(12px); display: none; place-items: center; padding: 20px; }
.result-overlay.active { display: grid; }
.result-card { width: min(560px, 100%); background: #fff; border-radius: 31px; padding: 35px; text-align: center; box-shadow: 0 35px 80px rgba(5,39,23,.3); animation: result-in .42s cubic-bezier(.2,.9,.2,1.15) both; }
@keyframes result-in { from { opacity: 0; transform: translateY(35px) scale(.88); } }
.result-burst { width: 87px; height: 87px; border-radius: 29px; display: grid; place-items: center; margin: -78px auto 22px; background: linear-gradient(145deg, #ffd842, #f2a900); color: #fff; font-size: 44px; border: 7px solid #fff; box-shadow: 0 15px 27px rgba(219,153,0,.25); }
.result-card h1 { font-size: 39px; margin: 8px 0; letter-spacing: -.045em; }
.result-card > p { color: var(--muted); margin: 0 auto 22px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0; }
.result-grid div { background: #f2f6f3; border-radius: 15px; padding: 14px 8px; }
.result-grid span { display: block; font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .08em; }
.result-grid b { display: block; margin-top: 5px; font-size: 20px; }
.result-card .primary-button { width: 100%; background: var(--green); color: #fff; box-shadow: none; }
.reward-chest { display: flex; align-items: center; justify-content: center; gap: 9px; background: #fff5ca; border: 1px solid #f1d763; border-radius: 16px; padding: 11px; }
.reward-chest span { font-size: 25px; }
.reward-chest small { color: #856b06; font-weight: 800; }

.surprise-overlay { position: fixed; inset: 0; z-index: 140; background: rgba(7,73,39,.9); display: none; place-items: center; padding: 20px; color: #fff; }
.surprise-overlay.show { display: grid; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } }
.surprise-card { text-align: center; }
.surprise-card > div { width: 95px; height: 95px; border-radius: 33px; display: grid; place-items: center; margin: 0 auto 20px; background: #fff; color: var(--green); font-size: 50px; font-weight: 950; animation: surprise .8s ease-in-out infinite alternate; }
@keyframes surprise { to { transform: rotate(8deg) scale(1.06); } }
.surprise-card .eyebrow { color: #caffd9; }
.surprise-card h2 { font-size: 40px; margin: 10px 0; }
.surprise-card p { color: #d2f2dd; }
.toast-layer { position: fixed; z-index: 200; top: 95px; right: 24px; display: grid; gap: 8px; pointer-events: none; }
.toast { background: #143f2b; color: #fff; border-radius: 14px; padding: 11px 15px; font-weight: 850; box-shadow: var(--shadow); animation: toast-in .3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(25px); } }
.confetti-layer { position: fixed; inset: 0; z-index: 190; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 15px; top: -25px; border-radius: 3px; animation: fall var(--duration) linear forwards; }
@keyframes fall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(760deg); } }
.noscript { position: fixed; inset: auto 20px 20px; background: #fff0c7; border: 1px solid #e4c164; padding: 15px; border-radius: 14px; z-index: 999; }

@media (max-width: 1050px) {
  .site-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .practice-grid { grid-template-columns: 1fr 1fr; }
  .focus-card { grid-row: span 2; }
  .corpus-toolbar { grid-template-columns: 1fr 180px; }
  .corpus-toolbar button { width: 100%; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .site-shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 68px; padding: 10px 15px; }
  .mobile-brand { display: block; margin-right: auto; }
  .topbar-progress { display: none; }
  .stat-pill { height: 38px; padding: 0 9px; }
  .auth-button { height: 38px; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sound-toggle { width: 38px; height: 38px; }
  .star-count { display: none; }
  .screen { width: min(100% - 26px, 680px); padding-top: 14px; }
  .hero { grid-template-columns: 1fr; padding: 30px 23px 25px; min-height: 0; }
  .hero h1 { font-size: 41px; }
  .hero p { font-size: 16px; }
  .hero-visual { min-height: 175px; margin-top: 12px; }
  .hero-visual > img { width: 160px; }
  .mascot-bubble { top: 7px; left: 3px; }
  .star-a { right: 12px; }
  .missions-card { padding: 18px; }
  .mission-list { grid-template-columns: 1fr; }
  .path-title { align-items: center; }
  .path-title h2 { font-size: 26px; }
  .overall-progress { padding: 8px 10px; }
  .overall-progress span { display: none; }
  .chapter-head { grid-template-columns: 49px 1fr; padding: 17px; }
  .chapter-icon { width: 49px; height: 49px; border-radius: 15px; font-size: 24px; }
  .chapter-progress { grid-column: 2; text-align: left; margin-top: -5px; }
  .chapter-progress b, .chapter-progress span { display: inline; }
  .chapter-chevron { display: none; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 15px 15px; gap: 9px; }
  .level-button { min-height: 110px; padding: 12px; }
  .page-heading { padding-top: 15px; }
  .page-heading h1 { font-size: 42px; }
  .page-heading p { font-size: 16px; }
  .practice-grid { grid-template-columns: 1fr; }
  .focus-card { grid-row: auto; }
  .mastery-list { grid-template-columns: 1fr; }
  .corpus-toolbar { grid-template-columns: 1fr; }
  .corpus-toolbar select { min-height: 48px; }
  .profile-hero { grid-template-columns: 65px 1fr; padding: 22px; }
  .avatar { width: 65px; height: 65px; border-radius: 21px; }
  .rank-badge { grid-column: 1 / -1; justify-content: center; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-card { align-items: stretch; flex-direction: column; }
  .mobile-nav { position: fixed; z-index: 45; left: 10px; right: 10px; bottom: max(8px, env(safe-area-inset-bottom)); min-height: 64px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 21px; border: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(20px); box-shadow: 0 16px 45px rgba(15,58,37,.18); }
  .mobile-nav-button { border: 0; background: transparent; border-radius: 15px; display: grid; place-items: center; gap: 1px; color: var(--muted); font-weight: 800; }
  .mobile-nav-button span { font-size: 20px; }
  .mobile-nav-button.active { color: var(--green); background: var(--green-soft); }
  .lesson-header { min-height: 67px; }
  .lesson-content { padding-top: 14px; padding-bottom: 195px; }
  .question-topline { align-items: flex-start; }
  .lesson-content h2 { font-size: 34px; }
  .answer-button { min-height: 63px; }
  .feedback-panel { min-height: 165px; padding: 17px; align-items: stretch; flex-direction: column; gap: 12px; }
  .feedback-copy { min-height: 56px; }
  .feedback-copy p { font-size: 13px; }
  .feedback-button { width: 100%; min-height: 50px; }
  .result-card { padding: 29px 20px 22px; }
  .result-card h1 { font-size: 34px; }
  .result-grid b { font-size: 17px; }
}

@media (max-width: 410px) {
  .top-stats { gap: 5px; }
  .stat-pill { padding: 0 7px; }
  .xp-pill { display: none; }
  .hero h1 { font-size: 36px; }
  .hero-meta span:nth-child(2) { display: none; }
  .level-grid { grid-template-columns: 1fr; }
  .level-button { min-height: 92px; }
  .badge-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
