:root {
  --night: #0B0F2E; --ink: #0D1233; --lime: #C8F31D; --mint: #3CF0C8; --sky: #5FC8FF; --blue: #2440F0;
  --bg: #F4F6FB; --card: #fff; --line: #E2E6F0; --muted: #5B6180;
  --grad: linear-gradient(90deg, #C8F31D, #3CF0C8, #5FC8FF, #2440F0);
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5 }
h1, h2, h3, .btn, .kicker, .brand span { font-family: Lexend, "Be Vietnam Pro", sans-serif }
a { color: var(--blue) }
.boot { min-height: 100vh; display: grid; place-items: center }
.boot-msg { color: var(--muted); font-weight: 600; padding: 24px; text-align: center }
.bar { height: 6px; background: var(--grad) }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px;
  font-weight: 700; font-size: 16px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; min-height: 48px }
.btn:hover { filter: brightness(1.15) }
.btn:disabled { opacity: .5; cursor: wait }
.btn.big { font-size: 18px; padding: 14px 22px; min-height: 56px }
.btn.sm { font-size: 14px; padding: 8px 12px; min-height: 40px; border-radius: 10px }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink) }
.btn.tw { background: var(--blue); margin-top: 6px }
.btn.on { background: #1E9E6A }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--night) }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 24px; padding: 28px 24px 22px; display: flex; flex-direction: column; gap: 8px; position: relative }
.login-logo { height: 28px; align-self: flex-start }
.login-octi { position: absolute; right: 8px; top: -64px; width: 120px }
.login-card h1 { margin: 2px 0 10px; font-size: 26px }
.login-card label { font-weight: 600; font-size: 14px }
.login-card input { font: inherit; font-size: 18px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px }
.login-card input:focus { border-color: var(--blue); outline: none }
.login-card .btn { margin-top: 10px }
.msg { color: #C0392B; min-height: 1.4em; margin: 4px 0 0; font-size: 14px }
.hint { color: var(--muted); font-size: 13px; margin: 0 }

/* top */
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); gap: 12px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink) }
.brand img { height: 24px }
.brand span { font-weight: 600; color: var(--muted) }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600 }
.main { max-width: 1040px; margin: 0 auto; padding: 18px 16px 60px }
h2 { font-size: 21px; margin: 0 0 12px }
.empty { padding: 40px 16px; text-align: center; color: var(--muted) }

/* home */
.hello { display: flex; gap: 18px; align-items: center; background: var(--night); color: #fff; border-radius: 22px; padding: 18px 22px; margin-bottom: 18px }
.hello h1 { margin: 0 0 4px; font-size: 28px }
.hello p { margin: 0; color: #C9D0F0 }
.hello .count { margin-top: 8px; color: #fff }
.hello .count b { color: var(--lime); font-size: 22px; font-family: Lexend }
.hello-octi { width: 110px; flex: none }
.passport { background: #fff; border-radius: 22px; padding: 18px; margin-bottom: 22px; border: 1px solid var(--line) }
.chang h3 { font-size: 15px; margin: 12px 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.chang small { font-family: "Be Vietnam Pro"; font-weight: 500; color: var(--muted) }
.stamps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #C3C9DA; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px; color: #9AA1B8 }
.stamp .num { font: 700 18px Lexend }
.stamp .bn { font-size: 10px; line-height: 1.15; font-weight: 600 }
.stamp.on { border: 0; background: var(--c); color: var(--ink); box-shadow: inset 0 0 0 3px rgba(13, 18, 51, .15) }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px }
.lesson { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; text-decoration: none; color: var(--ink) }
a.lesson:hover { border-color: var(--blue) }
.lesson .ln { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font: 700 18px Lexend }
.lesson .lt { font-weight: 600 }
.lesson .ls { font-size: 13px; color: var(--muted); font-weight: 600; text-align: right }
.lesson .ls.ok { color: #1E9E6A }
.lesson.locked { opacity: .55 }
.lesson.locked .ln { background: #C3C9DA; color: #fff }

/* lesson */
.back { display: inline-block; margin-bottom: 10px; font-weight: 600; text-decoration: none }
.lhead { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: #fff; border-radius: 22px; padding: 20px 22px; border: 1px solid var(--line); margin-bottom: 16px }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--blue) }
.lhead h1 { font-size: 32px; margin: 4px 0 6px; line-height: 1.15 }
.story { margin: 0 0 10px; max-width: 560px }
.lesson-octi { width: 150px; flex: none }
.panel { background: #fff; border-radius: 22px; padding: 18px 20px; border: 1px solid var(--line); margin-bottom: 16px }
.panel .sub { color: var(--muted); margin: -6px 0 12px }
.prog { height: 10px; border-radius: 6px; background: #E8ECF5; overflow: hidden; margin-bottom: 14px }
.prog i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .3s }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--bg) }
.steps li.done { background: #E3F8EE }
.steps input { width: 26px; height: 26px; margin: 2px 0 0; accent-color: #1E9E6A; flex: none }
.steps label { display: flex; gap: 10px; cursor: pointer }
.steps .no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; font: 700 13px Lexend }
.steps li.done .no { background: #1E9E6A; color: #fff }
.code { margin: 0; background: var(--bg); border-radius: 16px; padding: 12px; text-align: center; max-width: 360px }
.code svg { max-width: 100%; height: auto }
.code figcaption { font-size: 13px; color: var(--muted); margin-top: 6px }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px }
.card { border: 2px dashed var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center }
.card svg { max-width: 100%; height: auto }
.card p { margin: 0 }
.doctor { background: #FFF6E0; border-color: #F4D58A }
.doctor p { margin: 0 0 12px }
.chall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px }
.ch { border: 3px solid var(--mint); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 6px }
.ch.lv1 { border-color: var(--sky) } .ch.lv2 { border-color: var(--blue) }
.ch b { font-family: Lexend; display: flex; justify-content: space-between }
.ch p { margin: 0; flex: 1 }
.stars { color: #F5B301; letter-spacing: 2px }
.stars.big { font-size: 22px }
.howto { margin: 0 0 12px; padding-left: 20px }
.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0 }
.upload input[type=text] { flex: 1 1 260px; font: inherit; padding: 12px; border: 2px solid var(--line); border-radius: 12px; min-height: 48px }
.fname { color: var(--muted); font-size: 14px }
.subs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px }
.subs li { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start }
.when { font-size: 13px; color: var(--muted); font-weight: 600 }
.knote { font-size: 14px }
.review p { margin: 4px 0 0 }
.pill { display: inline-block; background: var(--lime); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; margin-left: 8px }
.wait { font-size: 14px; color: var(--muted) }
.home-task { background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 18px }
.home-task b { color: var(--lime); font-family: Lexend }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 9; max-width: calc(100% - 32px) }

@media (max-width: 760px) {
  .stamps { grid-template-columns: repeat(4, 1fr) }
  .mission, .chall { grid-template-columns: 1fr }
  .lesson-octi, .hello-octi { width: 80px }
  .lhead h1 { font-size: 26px }
}
