/* Piano for Stress Relief: a calm night sky with game energy (Alexis's brief: "model after Tonic").
   Colour tokens are defined once; the night theme is the default, a daylight theme follows the
   system setting. Every text pair is checked for WCAG AA in both. */
:root {
  --bg: #12102a; --bg2: #1c1840; --surface: rgba(255,255,255,.06); --surface-solid: #221e4a; --line: rgba(255,255,255,.12);
  --ink: #f6f3ff; --muted: #c4bde6; --soft: #9a92c7;
  --coral: #ff7a6b; --amber: #ffc857; --mint: #5ee6b8; --sky: #7cc7ff; --violet: #b69bff; --pink: #ff8fc7;
  --accent: #ffc857; --accent-ink: #231a00; --ok: #5ee6b8; --err: #ff9d92;
  --glow: 0 0 40px rgba(182,155,255,.35);
  --radius: 20px; --display: "Fredoka", "Nunito", system-ui, sans-serif; --body: "Nunito", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff8ef; --bg2: #ffeede; --surface: #ffffff; --surface-solid: #ffffff; --line: #f0dcc8;
    --ink: #22183f; --muted: #554a78; --soft: #6c6290;
    --coral: #c03a2c; --amber: #8a5d00; --mint: #0f7d5c; --sky: #1d6fb8; --violet: #6b4fd8; --pink: #c2347e;
    --accent: #6b4fd8; --accent-ink: #ffffff; --ok: #0f7d5c; --err: #b3261e;
    --glow: 0 10px 30px rgba(107,79,216,.15);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 17px/1.6 var(--body);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(182,155,255,.22), transparent 60%),
              radial-gradient(900px 500px at -10% 20%, rgba(255,122,107,.14), transparent 60%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
}
/* twinkling stars in the night theme only */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .55;
  background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent), radial-gradient(1px 1px at 85% 65%, #fff, transparent),
    radial-gradient(1px 1px at 10% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 50%, #fff, transparent);
  animation: twinkle 6s ease-in-out infinite alternate; }
@media (prefers-color-scheme: light) { body::before { display: none; } }
@keyframes twinkle { to { opacity: .2; } }

a { color: var(--sky); }
h1, h2, h3, .display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(32px, 6vw, 56px); margin: .15em 0 .35em; }
h2 { font-size: clamp(22px, 3.2vw, 30px); margin: 0 0 .5em; }
h3 { font-size: 20px; margin: 0 0 .3em; }
.eyebrow { font: 700 13px/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--amber); margin: 0 0 6px; }
.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 40ch; }
.muted { color: var(--muted); font-size: 15px; }
.grad { background: linear-gradient(90deg, var(--amber), var(--coral) 45%, var(--pink) 75%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px); backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 75%, transparent); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 600 19px/1 var(--display); }
.brand .mark { width: 34px; height: 34px; }
.top nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top nav a, .top nav .link { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.top nav a:hover, .top nav .link:hover { background: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink); }
.chip .ico { font-size: 16px; }

main { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px) 64px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; border-radius: 999px;
  background-color: #ffb067; background-image: linear-gradient(135deg, #ffc857, #ff9a6b); color: #231a00; font: 800 16px/1 var(--body); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,122,107,.35), inset 0 -3px 0 rgba(0,0,0,.15); transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,122,107,.45), inset 0 -3px 0 rgba(0,0,0,.15); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.big { min-height: 58px; padding: 16px 30px; font-size: 18px; }
.btn[disabled] { opacity: .7; cursor: default; transform: none; }
.link { background: none; border: 0; font: inherit; cursor: pointer; }
.inline { display: inline; margin: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 26px); margin: 18px 0; backdrop-filter: blur(6px); }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }

/* home hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(8px, 3vw, 32px) 0 24px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-art { position: relative; aspect-ratio: 1/1; }
.hero-art svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 60px rgba(124,199,255,.25)); }
.float { animation: float 5s ease-in-out infinite; transform-origin: center; }
.float.d2 { animation-delay: -1.5s; } .float.d3 { animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-12px) rotate(4deg); } }
.key-glow { animation: keyglow 3.2s ease-in-out infinite; }
.key-glow.k2 { animation-delay: .8s; } .key-glow.k3 { animation-delay: 1.6s; } .key-glow.k4 { animation-delay: 2.4s; }
@keyframes keyglow { 0%, 70%, 100% { opacity: 0; } 20% { opacity: 1; } }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { max-width: 340px; margin: 0 auto; order: -1; } }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 28px 0; }
.feature { position: relative; overflow: hidden; }
.feature .big-ico { font-size: 38px; line-height: 1; display: block; margin-bottom: 10px; }
.feature::after { content: ""; position: absolute; width: 140px; height: 140px; right: -40px; top: -40px; border-radius: 50%; background: var(--c, var(--violet)); opacity: .18; filter: blur(10px); }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* journey map */
.journey-head { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg2); }
.ring > div { position: relative; }
.ring span { position: relative; font: 600 26px/1 var(--display); }
.ring small { display: block; font: 700 12px/1 var(--body); color: var(--muted); text-align: center; margin-top: 4px; }
.challenge { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255,200,87,.16), rgba(255,122,107,.12)); border-color: rgba(255,200,87,.4); }
.challenge .count { font: 600 22px/1 var(--display); color: var(--amber); }
@media (prefers-color-scheme: light) { .challenge { background: linear-gradient(135deg, #fff1d6, #ffe3dd); border-color: #f3c98a; } }

.path { position: relative; display: grid; gap: 22px; margin-top: 28px; }
.path::before { content: ""; position: absolute; left: 39px; top: 20px; bottom: 20px; width: 4px; border-radius: 4px;
  background: repeating-linear-gradient(180deg, var(--line) 0 10px, transparent 10px 20px); }
.level { position: relative; display: grid; grid-template-columns: 82px 1fr; gap: 16px; align-items: start; }
.badge-node { width: 82px; height: 82px; border-radius: 26px; display: grid; place-items: center; font: 600 30px/1 var(--display); color: #1b1240;
  background: var(--c); box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 45%, transparent), inset 0 -5px 0 rgba(0,0,0,.18); transform: rotate(-4deg); }
.level:nth-child(even) .badge-node { transform: rotate(4deg); }
.level.done .badge-node::after { content: "✓"; position: absolute; margin: 60px 0 0 60px; width: 28px; height: 28px; border-radius: 50%; background: #5ee6b8; color: #08281e; font: 900 16px/28px var(--body); text-align: center; }
.level .card { margin: 0; }
.level-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.level-head h2 { margin: 0; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0 12px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c, var(--mint)), var(--amber)); }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lessons li.sec { font: 800 12px/1 var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--soft); margin: 12px 0 4px; }
.lessons a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--ink); text-decoration: none; background: transparent; transition: background .15s; }
.lessons a:hover { background: var(--surface); }
.dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--surface); border: 2px solid var(--line); }
.done .dot, .dot.done { background: #5ee6b8; border-color: #5ee6b8; color: #08281e; font-weight: 900; }
.tag { display: inline-block; font: 800 12px/1 var(--body); padding: 5px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.free { color: var(--mint); border-color: var(--mint); }
.tag.jam { color: var(--amber); border-color: var(--amber); }
@media (max-width: 600px) { .path::before { left: 27px; } .level { grid-template-columns: 58px 1fr; } .badge-node { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; } .journey-head { grid-template-columns: 1fr; justify-items: start; } }

/* lesson */
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.stage { position: relative; aspect-ratio: 16/9; border-radius: 24px; overflow: hidden; background: #000; box-shadow: var(--glow); border: 1px solid var(--line); margin: 16px 0; }
.stage iframe, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage.waiting { display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(182,155,255,.35), transparent 60%), linear-gradient(160deg, #2a2160, #140f33); background-color: #1c1640; color: #f6f3ff; }
.stage.waiting p { color: #d8d2f5; margin: 6px 0 16px; }
.stage.waiting .big-ico { font-size: 54px; }
.tracks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.track { border-radius: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--violet)); }
.track b { display: block; margin-bottom: 6px; }
.drive-audio { width: 100%; height: 56px; border: 0; border-radius: 10px; background: #fff; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.files li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pager a { display: block; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.pager a small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.pager a.next { text-align: right; }
.lock { text-align: center; padding: 40px 20px; }
.lock .big-ico { font-size: 56px; }

/* forms */
label { display: block; font-weight: 800; margin: 14px 0 6px; }
input[type=email] { width: 100%; min-height: 52px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface-solid); color: var(--ink); font: inherit; margin-bottom: 16px; }
input[type=email]:focus { border-color: var(--violet); outline: none; }
.error { color: var(--err); font-weight: 800; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.plan { position: relative; }
.plan.best { border: 2px solid var(--amber); box-shadow: 0 0 0 6px rgba(255,200,87,.1); }
.plan .ribbon { position: absolute; top: -13px; left: 22px; background: #ffc857; color: #231a00; font: 900 12px/1 var(--body); padding: 6px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; }
.price { font: 600 46px/1 var(--display); margin: 8px 0; } .price span { font: 700 16px var(--body); color: var(--muted); }
.perks { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; } .perks li::before { content: "✦ "; color: var(--amber); }
.seats { display: inline-block; margin: 4px 0 8px; font-weight: 800; color: var(--coral); }

/* celebration */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; padding: 14px 22px; border-radius: 999px;
  background: linear-gradient(135deg, #5ee6b8, #7cc7ff); color: #06221a; font: 800 17px/1 var(--body); box-shadow: 0 14px 40px rgba(94,230,184,.45); animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: translate(-50%, 30px) scale(.8); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 49; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.foot { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 30px 16px; color: var(--soft); font-size: 14px; border-top: 1px solid var(--line); }
.foot a { color: var(--soft); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
@media (max-width: 640px) {
  .brand span { display: none; }
  .top nav .signout { display: none; }
  .top nav a, .top nav .link { padding: 8px 9px; font-size: 14px; }
}

/* ---------- app tab bar (phones) ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .top-links { display: none; }
  body:has(.tabbar) { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; color: var(--muted); text-decoration: none; font-weight: 800; font-size: 12px; }
  .tabbar a span { font-size: 22px; line-height: 1; }
  .tabbar a.on { color: var(--ink); background: var(--surface); }
}

/* ---------- on-screen piano ---------- */
.kb-wrap { overflow-x: auto; padding: 6px 2px 10px; }
.kb { position: relative; display: block; height: clamp(150px, 28vw, 220px); min-width: calc(var(--whites) * 38px); width: 100%; user-select: none; touch-action: manipulation; }
.kb .key { position: absolute; top: 0; border: 0; cursor: pointer; padding: 0; font: 800 13px var(--body); -webkit-tap-highlight-color: transparent; }
.kb .white { left: calc(var(--x) * 100% / var(--whites)); width: calc(100% / var(--whites) - 4px); height: 100%; margin-left: 2px; border-radius: 0 0 12px 12px;
  background: linear-gradient(#ffffff, #efeaf8); color: #4a4066; box-shadow: inset 0 -6px 0 #d9d2ea, 0 4px 10px rgba(0,0,0,.25); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
.kb .black { left: calc(var(--x) * 100% / var(--whites) - (100% / var(--whites)) * .3); width: calc(100% / var(--whites) * .6); height: 60%; z-index: 2; border-radius: 0 0 8px 8px;
  background: linear-gradient(#3a3156, #15112a); box-shadow: inset 0 -4px 0 #000, 0 4px 8px rgba(0,0,0,.4); }
.kb .key.down, .kb .key:active { filter: brightness(.9); transform: translateY(2px); }
.kb .white.lit { background: linear-gradient(#fff3cf, #ffc857); }
.kb .black.lit { background: linear-gradient(#ffc857, #b8860b); }
.kb .key.ok { background: linear-gradient(#c9ffe9, #5ee6b8) !important; }
.kb .key.no { background: linear-gradient(#ffd9d4, #ff8a7a) !important; animation: shake .3s; }
.kb .key.hint { box-shadow: inset 0 0 0 4px #7cc7ff, 0 4px 10px rgba(0,0,0,.25); }
.kb .white.dim { background: linear-gradient(#f4f1fa, #ddd6ec); }
@keyframes shake { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

/* ---------- games ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.game-card { margin: 0; }
.game-ico { font-size: 40px; display: block; margin-bottom: 6px; } .game-ico.big { font-size: 64px; }
.level-pills { display: grid; gap: 8px; margin-top: 10px; }
.pill { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; }
.pill:hover { border-color: var(--amber); }
.game-top { display: flex; justify-content: center; margin: 8px 0; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.dots i.ok { background: #5ee6b8; } .dots i.meh { background: #ffc857; }
.prompt { text-align: center; font: 600 clamp(24px, 4vw, 34px)/1.2 var(--display); margin: 14px 0; min-height: 1.2em; }
.prompt b { color: var(--amber); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 10px; margin-top: 14px; }
.choice { min-height: 58px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-solid); color: var(--ink); font: 600 22px var(--display); cursor: pointer; }
.choice.ok { background: #5ee6b8; color: #06221a; border-color: #5ee6b8; } .choice.no { background: #ff8a7a; color: #2a0a05; border-color: #ff8a7a; animation: shake .3s; }
.xp { font: 600 24px var(--display); color: var(--mint); }

/* ---------- ritual ---------- */
.lengths { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; max-width: 720px; margin: 0 auto; }
.length { display: grid; gap: 4px; justify-items: center; padding: 22px 14px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; transition: transform .15s, border-color .15s; }
.length:hover, .length:focus-visible { transform: translateY(-3px); border-color: var(--amber); }
.length b { font: 600 22px var(--display); } .length small { color: var(--muted); font-weight: 700; }
.len-ico { font-size: 42px; }
.ritual-step { max-width: 760px; margin: 0 auto; }
.ritual-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.ritual-time { font: 600 34px var(--display); color: var(--amber); }
.ritual-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.ritual-dots i { width: 36px; height: 6px; border-radius: 6px; background: var(--line); } .ritual-dots i.ok { background: #5ee6b8; } .ritual-dots i.now { background: var(--amber); }
.breath { display: grid; place-items: center; height: 240px; }
.breath span { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #c4adff, #7cc7ff); box-shadow: 0 0 60px rgba(196,173,255,.6); animation: breathe 10s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.8); } 60% { transform: scale(2.1); } }
.breath-words { text-align: center; font: 600 24px var(--display); }
.moods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.mood { display: grid; justify-items: center; gap: 6px; padding: 18px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 800 16px var(--body); cursor: pointer; }
.mood span { font-size: 40px; } .mood:hover { border-color: var(--mint); }

/* ---------- me ---------- */
.me-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.avatar { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; font: 600 40px var(--display); color: #1b1240; background-color: #ffb59a; background-image: linear-gradient(135deg, #ffc857, #ff9fd0); box-shadow: 0 10px 30px rgba(255,159,208,.35); }
.xpbar { margin: 8px 0 6px; max-width: 420px; }
.badge-group { margin: 22px 0 10px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 16px 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.badge .b-ico { font-size: 34px; filter: grayscale(1); opacity: .7; }
.badge.earned .b-ico { filter: none; opacity: 1; }
.badge b { font-size: 14px; } .badge small { color: var(--muted); font-weight: 800; }
.badge.earned { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,200,87,.12); }
.badge.earned.tier-green { border-color: var(--mint); }
.remind-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.remind-row input[type=time] { min-height: 48px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface-solid); color: var(--ink); font: 800 18px var(--body); }

/* ---------- community ---------- */
.composer textarea, .reply-box textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface-solid); color: var(--ink); font: inherit; resize: vertical; }
.composer textarea:focus, .reply-box textarea:focus { border-color: var(--violet); outline: none; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.posts { display: grid; gap: 14px; margin-top: 18px; }
.post { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.post.teacher { border-color: var(--mint); }
.post.reply { margin: 12px 0 0 18px; padding: 12px 14px; }
.post header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post header time { color: var(--muted); font-size: 13px; font-weight: 700; margin-left: auto; }
.post-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #c4adff; color: #1b1240; font: 600 14px var(--display); }
.post-body p { margin: 8px 0; }
.post footer { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.clap { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 800 14px var(--body); cursor: pointer; }
.clap.on { background: #ffc857; color: #231a00; border-color: #ffc857; }
.reply-box summary { cursor: pointer; font-weight: 800; color: var(--sky); list-style: none; min-height: 36px; display: inline-flex; align-items: center; }
.reply-box summary::-webkit-details-marker { display: none; }
.reply-box[open] { flex-basis: 100%; }
.reply-box form { display: grid; gap: 8px; margin-top: 8px; justify-items: start; }
.link.danger { color: var(--err); font-weight: 800; }

/* ---------- branded checkout ---------- */
.checkout { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.co-back { font-weight: 800; text-decoration: none; }
.co-side h1 { font-size: clamp(30px, 4.5vw, 44px); }
.co-price { font: 600 52px/1 var(--display); margin: 6px 0 4px; } .co-price span { font: 700 18px var(--body); color: var(--muted); }
.co-form { background: #1c1840; border: 1px solid var(--line); border-radius: 24px; padding: 8px; min-height: 420px; box-shadow: var(--glow); }
.co-form .muted.center { color: #c4bde6; padding: 60px 0; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
