:root {
  color-scheme: light;
  font-family: Nunito, "Segoe UI", system-ui, sans-serif;
  color: #10243e;
  background: #eef4f8;
  font-synthesis: none;
  --navy: #10243e;
  --blue: #1a73e8;
  --mint: #2abf9e;
  --cream: #fffaf0;
  --orange: #ff9d42;
  --card: rgba(255,255,255,.9);
  --shadow: 0 18px 50px rgba(24, 51, 81, .12);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #dff8ee 0, transparent 30%), radial-gradient(circle at 90% 5%, #dbe9ff 0, transparent 32%), #f4f7fb; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 4px solid rgba(26,115,232,.25); outline-offset: 3px; }

.shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom)); }
.shell.focus { display: grid; align-content: center; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.brand { font-family: "Arial Rounded MT Bold", Nunito, sans-serif; font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: "Arial Rounded MT Bold", Nunito, sans-serif; font-size: clamp(2.1rem, 8vw, 4rem); line-height: .98; letter-spacing: -.035em; margin-bottom: 12px; }
h2 { font-size: clamp(1.45rem, 5vw, 2.1rem); line-height: 1.1; }
.muted { color: #617287; }
.eyebrow { color: var(--blue); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.panel { background: var(--card); border: 1px solid rgba(24, 51, 81, .08); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 16px; }
.hero { margin: 28px 0 22px; padding: clamp(24px, 7vw, 44px); background: linear-gradient(145deg, #10243e, #183f68); color: white; border-radius: 34px; box-shadow: 0 25px 65px rgba(16,36,62,.25); overflow: hidden; position: relative; }
.hero::after { content: "+  −"; position: absolute; right: 20px; top: -20px; font: 700 7rem "Arial Rounded MT Bold"; opacity: .08; transform: rotate(-8deg); }
.hero p { color: rgba(255,255,255,.72); }
.primary, .secondary, .quiet { min-height: 54px; border-radius: 18px; padding: 14px 20px; font-weight: 900; }
.primary { background: linear-gradient(135deg, #49d2ad, #20aa8e); color: #082f28; box-shadow: 0 10px 25px rgba(42,191,158,.25); }
.secondary { background: #e8f1ff; color: #164f9b; }
.quiet { background: transparent; color: #617287; }
.wide { width: 100%; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; }
.day { display: grid; gap: 7px; justify-items: center; color: #718196; font-size: .78rem; font-weight: 800; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: #e4ebf1; border: 4px solid white; box-shadow: 0 2px 8px rgba(16,36,62,.12); }
.dot.done { background: var(--mint); }
.mode-grid { display: grid; gap: 12px; margin-top: 24px; }
.mode { text-align: left; padding: 20px; border-radius: 22px; background: white; border: 2px solid transparent; box-shadow: var(--shadow); color: var(--navy); }
.mode:hover { border-color: var(--mint); transform: translateY(-1px); }
.mode strong { display: block; font-size: 1.18rem; }
.mode span { color: #718196; }
.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.icon-button { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--navy); box-shadow: 0 8px 22px rgba(16,36,62,.12); font-weight: 900; }
.problem { text-align: center; display: grid; gap: 28px; }
.expression { font: 700 clamp(3.8rem, 18vw, 7rem) "Arial Rounded MT Bold", Nunito, "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; }
.answer-display { width: min(230px, 70vw); min-height: 76px; margin: 0 auto; display: grid; place-items: center; border-radius: 22px; background: white; border: 3px solid #d9e4ec; font-size: 2.5rem; font-weight: 900; }
.answer-display.empty::after { content: "?"; color: #b2c0cc; }
.keypad { width: min(360px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { min-height: 62px; border-radius: 18px; background: white; color: var(--navy); box-shadow: 0 5px 16px rgba(16,36,62,.09); font-size: 1.35rem; font-weight: 900; }
.key.confirm { background: var(--mint); color: #082f28; }
.help { background: transparent; color: #5b7087; font-weight: 800; padding: 14px; }
.feedback { min-height: 48px; font-size: 1.12rem; font-weight: 900; }
.feedback.good { color: #16846d; }
.feedback.try { color: #b9671d; }
.lesson { width: 100%; max-width: 620px; margin: 0 auto; }
.lesson-copy { font-size: 1.2rem; line-height: 1.5; color: #3f5369; }
.lesson-expression { padding: 24px; border-radius: 22px; background: var(--cream); text-align: center; font: 700 2.6rem "Arial Rounded MT Bold", Nunito, "Segoe UI", system-ui, sans-serif; margin: 20px 0; }
.progress-line { height: 8px; background: #dfe8ef; border-radius: 99px; overflow: hidden; margin: 14px 0 28px; }
.progress-line span { display: block; height: 100%; background: var(--mint); border-radius: inherit; transition: width .25s ease; }
.nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 760px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: rgba(244,247,251,.92); backdrop-filter: blur(14px); border-top: 1px solid rgba(16,36,62,.08); }
.nav button { padding: 10px 6px; border-radius: 14px; background: transparent; color: #687b8f; font-weight: 900; }
.nav button.active { color: var(--blue); background: #e8f1ff; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { aspect-ratio: 3 / 4; position: relative; isolation: isolate; overflow: hidden; border-radius: 20px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #173d64, #10243e); color: white; box-shadow: 0 14px 35px rgba(16,36,62,.22); }
.card::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(7,22,39,.08) 25%, rgba(7,22,39,.22) 48%, rgba(7,22,39,.96) 100%); pointer-events: none; }
.card-art { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.card.locked { background: linear-gradient(145deg, #e8eef3, #d8e1e9); color: #758598; box-shadow: none; }
.card.locked::after { display: none; }
.card .tier, .card .symbol, .card-copy { position: relative; z-index: 2; }
.card .tier { align-self: flex-start; padding: 6px 8px; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; background: rgba(10,31,52,.58); backdrop-filter: blur(8px); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
.card.locked .tier { border-color: rgba(90,110,130,.12); background: rgba(255,255,255,.5); }
.card .symbol { font: 700 3.4rem "Arial Rounded MT Bold"; text-align: center; opacity: .8; }
.card-copy { margin-top: auto; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.card-copy strong { display: block; font-size: clamp(.92rem, 3vw, 1.1rem); line-height: 1.05; }
.card-copy p { margin: 6px 0 0; font-size: clamp(.68rem, 2.25vw, .8rem); line-height: 1.28; }
.card.locked .card-copy { text-shadow: none; }
.card.foil { box-shadow: 0 14px 35px rgba(70,111,191,.3); }
.card.holo { box-shadow: 0 14px 38px rgba(84,59,176,.32); }
.card.gold { box-shadow: 0 14px 38px rgba(180,125,29,.35); }
.card-grid.reveal-grid { grid-template-columns: minmax(0, 290px); justify-content: center; }
.skill-row { padding: 18px 0; border-bottom: 1px solid #e7edf2; }
.skill-row:last-child { border: 0; }
.status { display: inline-flex; margin-top: 6px; padding: 6px 10px; border-radius: 999px; background: #e8f6f1; color: #16745f; font-weight: 900; font-size: .84rem; }
.metric { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0; }
.error-box { max-width: 560px; margin: 15vh auto; background: white; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
@media (min-width: 620px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
