:root {
  --bg: #0b0a1f; --bg2: #15133a; --card: #1c1947; --card2: #252159; --line: #2f2a6b;
  --text: #f5f3ff; --muted: #a5a0d6; --purple: #7c3aed; --purple2: #a78bfa; --gold: #facc15;
  --green: #22c55e; --red: #ef4444; --orange: #fb923c;
  --r: 18px;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body { background: radial-gradient(1200px 600px at 50% -200px, #2a1f6b 0%, var(--bg) 60%) fixed; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
textarea, input, select { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: .3em 0; letter-spacing: .3px; }
h2 { font-size: 1.7rem; }
.screen { max-width: 860px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 28px); min-height: 100vh; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .95rem; margin: .3em 0 .6em; }
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.section { font-size: 1.05rem; color: var(--purple2); text-transform: uppercase; letter-spacing: 1px; margin: 22px 4px 10px; }
.section small { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* buttons */
.btn { background: var(--card2); border: 2px solid var(--line); border-radius: 14px; padding: 12px 18px; font-weight: 800; font-size: 1.05rem; transition: transform .08s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, #8b5cf6, #6d28d9); border-color: #a78bfa; box-shadow: 0 6px 0 #4c1d95; }
.btn.primary:active { box-shadow: 0 2px 0 #4c1d95; transform: translateY(4px); }
.btn.orange { background: linear-gradient(180deg, #fb923c, #ea580c); border-color: #fdba74; box-shadow: 0 6px 0 #9a3412; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 16px; font-size: 1.2rem; }
.btn.huge { padding: 20px 28px; font-size: 1.35rem; min-width: 220px; }
.btn.choice { min-width: 80px; font-size: 1.2rem; }
.btn.choice.on { background: var(--purple); border-color: var(--gold); }
.btn:disabled { opacity: .6; }
.back { color: var(--purple2); font-weight: 800; font-size: 1.05rem; padding: 6px 2px; }
.link { color: var(--purple2); text-decoration: underline; padding: 6px; }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0; }
.input { width: 100%; background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1.1rem; margin: 6px 0; }
select { background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: 8px; font-size: 1rem; }

/* aura avatar */
.aura-wrap { position: relative; width: 84px; height: 84px; flex: none; border-radius: 50%; }
.aura-wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; position: relative; z-index: 2; border: 3px solid var(--purple2); }
.aura-wrap::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; z-index: 1; animation: aura 1.4s ease-in-out infinite alternate; }
.aura-wrap.big { width: 170px; height: 170px; }
.aura-wrap.tiny { width: 44px; height: 44px; }
.aura-wrap.tiny::before { inset: -5px; }
.aura-base::before { box-shadow: 0 0 20px 6px rgba(167, 139, 250, .55); }
.aura-ss1::before, .aura-ss2::before, .aura-ss3::before { box-shadow: 0 0 26px 10px rgba(250, 204, 21, .75), 0 -10px 30px 6px rgba(253, 224, 71, .6); }
.aura-ss1 img, .aura-ss2 img, .aura-ss3 img { border-color: var(--gold); }
.aura-ss2::after, .aura-ss3::after { content: "⚡"; position: absolute; right: -6px; top: -8px; z-index: 3; font-size: 1.4em; animation: zap .5s steps(2) infinite; }
.aura-ss3::before { inset: -16px; }
.aura-god::before { box-shadow: 0 0 28px 12px rgba(244, 63, 94, .8), 0 -8px 30px 8px rgba(251, 113, 133, .6); }
.aura-god img { border-color: #f43f5e; }
.aura-ui::before { box-shadow: 0 0 30px 12px rgba(226, 232, 240, .85), 0 0 50px 18px rgba(56, 189, 248, .5); }
.aura-ui img { border-color: #e2e8f0; }
@keyframes aura { from { transform: scale(.96); opacity: .75; } to { transform: scale(1.06); opacity: 1; } }
@keyframes zap { 50% { opacity: 0; } }
.powerup::before { animation-duration: .35s; }

/* splash / celebrate */
.splash, .celebrate { min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.title { font-size: 3rem; font-weight: 900; margin: 18px 0 0; background: linear-gradient(90deg, #facc15, #f472b6, #a78bfa, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: 2px; }
.subtitle { font-weight: 900; letter-spacing: 4px; color: var(--gold); margin-bottom: 20px; }
.celebrate h1 { font-size: 2.3rem; margin: 4px 0; }
.celebrate p { font-size: 1.2rem; max-width: 560px; }
.celebrate .stat, .celebrate .panel { width: 100%; max-width: 520px; text-align: left; }
.kicker { font-weight: 900; letter-spacing: 3px; color: var(--gold); }
.trophy { font-size: 5rem; animation: bounce 1s infinite alternate; }
.goal-hit { color: var(--gold); font-weight: 900; }
@keyframes bounce { to { transform: translateY(-12px) scale(1.05); } }

/* home */
.hero { display: flex; gap: 18px; align-items: center; padding: 10px 4px 6px; }
.hero-txt { flex: 1; min-width: 0; }
.brand { font-weight: 900; letter-spacing: 2px; color: var(--gold); font-size: .9rem; }
.brand span { color: var(--muted); letter-spacing: 0; font-weight: 600; }
.rank { font-size: 1.45rem; font-weight: 900; margin: 2px 0 6px; }
.bar { height: 14px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); margin: 6px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #22c55e); border-radius: 99px; transition: width .6s; }
.bar.xp i { background: linear-gradient(90deg, #facc15, #fb923c); }
.bar.reward i { background: linear-gradient(90deg, #f472b6, #facc15); }
.stats { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-top: 12px; }
.stat-top { display: flex; justify-content: space-between; font-weight: 700; }
.stat-top b { font-size: 1.15rem; }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--bg2); border-radius: 99px; padding: 6px 12px; font-size: .95rem; }
.sow { margin-top: 8px; color: var(--gold); }
.missions { display: grid; gap: 10px; }
@media (min-width: 700px) { .missions { grid-template-columns: 1fr 1fr; } .missions .final { grid-column: 1 / -1; } }
.mission { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 16px; width: 100%; }
.mission:active { transform: scale(.98); }
.m-num { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--purple); display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; }
.m-body { flex: 1; display: flex; flex-direction: column; }
.m-body b { font-size: 1.15rem; }
.m-body small { color: var(--muted); }
.m-go { font-size: 1.8rem; color: var(--purple2); }
.mission.done { border-color: var(--green); }
.mission.done .m-num { background: var(--green); }
.mission.locked { opacity: .45; }
.mission.locked .m-num { background: var(--bg2); }
.mission.final { border-color: var(--gold); background: linear-gradient(90deg, #2a2160, #3b2a0c); }
.mission.final .m-num { background: var(--gold); color: #111; }
.mission.final.dim { opacity: .6; }
.bottom-actions { margin-top: 18px; }
.bottom-actions .row { justify-content: center; flex-wrap: wrap; }

/* ranks */
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--card); margin: 8px 0; opacity: .55; }
.rank-row.have { opacity: 1; }
.rank-row.now { border: 2px solid var(--gold); }
.rank-row div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.rank-row small { color: var(--muted); }

/* coach chat */
.coach { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.coach-face { font-size: 2.2rem; }
.bubble { background: var(--card2); border: 2px solid var(--purple); border-radius: 4px 18px 18px 18px; padding: 12px 16px; font-size: 1.2rem; line-height: 1.4; flex: 1; }
.me-say { margin: 8px 0 8px 50px; background: #14532d; border-radius: 18px 4px 18px 18px; padding: 10px 14px; font-size: 1.05rem; }
.answer { width: 100%; min-height: 90px; background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 14px; padding: 12px; font-size: 1.15rem; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.mic-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a78bfa, #6d28d9); box-shadow: 0 8px 0 #4c1d95, 0 0 0 6px rgba(167, 139, 250, .25); font-weight: 900; margin: 6px auto; }
.mic-btn.small { width: 110px; height: 110px; }
.mic-btn .mic-ico { font-size: 3rem; }
.mic-btn.small .mic-ico { font-size: 2.2rem; }
.mic-btn.rec { background: radial-gradient(circle at 35% 30%, #f87171, #dc2626); box-shadow: 0 8px 0 #7f1d1d; animation: recpulse 1s infinite; }
.mic-btn:disabled { opacity: .6; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 8px 0 #7f1d1d, 0 0 0 0 rgba(239, 68, 68, .6); } 50% { box-shadow: 0 8px 0 #7f1d1d, 0 0 0 18px rgba(239, 68, 68, 0); } }
.mic-status { color: var(--muted); min-height: 1.3em; text-align: center; }
.thinking { text-align: center; font-size: 1.2rem; padding: 20px; }
.thinking span { animation: blink 1.2s infinite; }
.thinking span:nth-child(2) { animation-delay: .2s; } .thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 0; } }
.progress-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.progress-dots i { width: 28px; height: 8px; border-radius: 99px; background: var(--line); }
.progress-dots i.on { background: var(--gold); }

/* numpad */
.num-display { font-size: 3.4rem; font-weight: 900; text-align: center; background: var(--bg2); border-radius: 16px; padding: 8px; margin: 8px auto; max-width: 320px; color: var(--gold); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 12px auto; }
.numpad button { background: var(--card2); border: 2px solid var(--line); border-radius: 16px; font-size: 1.7rem; font-weight: 800; padding: 14px 0; }
.numpad button:active { background: var(--purple); }
.numpad button.ok { background: var(--green); border-color: #86efac; }

/* ball mastery */
.big-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.skill { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.skill:active { transform: scale(.96); }
.skill .s-emoji { font-size: 2.2rem; }
.skill b { font-size: 1.05rem; text-align: center; }
.skill small { color: var(--green); font-weight: 700; }
.skill em { font-style: normal; font-size: .75rem; color: var(--gold); }
.skill.sow { border-color: var(--gold); }
.how ol { margin: 0 0 8px; padding-left: 22px; font-size: 1.15rem; line-height: 1.5; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.set-screen { min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.set-skill { font-size: 1.6rem; font-weight: 900; }
.set-goal { font-size: 1.3rem; color: var(--muted); }
.big-clock { font-size: 8rem; font-weight: 900; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(250, 204, 21, .4); }
.big-clock.small { font-size: 4rem; }
.set-msg { font-size: 1.25rem; font-weight: 700; }
#ctrl { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* combo lab */
.combo-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; justify-content: center; }
.combo-chain span { background: var(--purple); padding: 6px 12px; border-radius: 99px; font-weight: 800; }
.combo-chain i { font-style: normal; color: var(--gold); }
.combo-chain.big span { font-size: 1.3rem; padding: 10px 16px; }
.picked { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.picked .slot { min-width: 90px; text-align: center; padding: 10px; border: 2px dashed var(--line); border-radius: 12px; font-weight: 800; }
.picked i { font-style: normal; color: var(--gold); }
.move-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { background: var(--card); border: 2px solid var(--line); border-radius: 99px; padding: 10px 14px; font-weight: 700; }
.chip-btn.on { background: var(--purple); border-color: var(--gold); }
.combo-card b { font-size: 1.2rem; }

/* pitch / lessons */
.lesson-top { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 1.2rem; margin: 6px 0; gap: 8px; }
.pitch-box { position: relative; width: 100%; max-width: min(460px, calc(68vh * 100 / 146)); margin: 0 auto; aspect-ratio: 100 / 146; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); touch-action: none; }
@media (min-height: 1000px) and (min-width: 700px) { .pitch-box { max-width: min(520px, calc(68vh * 100 / 146)); } }
.pitch-svg { width: 100%; height: 100%; display: block; }
.pop { animation: pop .35s ease-out; }
@keyframes pop { from { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); } }
.pulse-ring { animation: ringp 1s ease-in-out infinite alternate; }
@keyframes ringp { to { opacity: .3; } }
.ent.draggable { cursor: grab; }
.lesson-text { font-size: 1.15rem; line-height: 1.45; }
.freeze { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .75); color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 900; letter-spacing: 2px; border: 2px solid var(--gold); animation: pop .3s; }
.countdown { position: absolute; top: 10px; right: 12px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .7); border: 3px solid var(--gold); font-size: 1.6rem; font-weight: 900; }
.q { font-size: 1.25rem; font-weight: 800; margin: 0 0 10px; }
.answers { display: grid; gap: 10px; }
.answer-btn { text-align: left; font-size: 1.1rem; }
.answer-btn.right { background: #14532d; border-color: var(--green); }
.answer-btn.wrong { background: #7f1d1d; border-color: var(--red); }
.why { margin-top: 12px; padding: 12px; border-radius: 12px; font-size: 1.1rem; line-height: 1.4; }
.why.good { background: rgba(34, 197, 94, .15); border: 1px solid var(--green); }
.why.bad { background: rgba(239, 68, 68, .12); border: 1px solid var(--red); }
.good { color: var(--green); } .bad { color: var(--red); }
.tip { font-size: 1.05rem; line-height: 1.4; }
.levels { display: flex; gap: 6px; }
.lvl { width: 38px; height: 38px; border-radius: 50%; background: var(--card2); border: 2px solid var(--line); font-weight: 900; }
.lvl.on { border-color: var(--gold); background: var(--purple); }
.lvl.won { box-shadow: inset 0 -4px 0 var(--green); }
.lvl:disabled { opacity: .5; }
.stance-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.stance-row .btn { font-size: .95rem; }
.unit-head { display: flex; gap: 12px; align-items: center; }
.unit-head .u-emoji { font-size: 2.4rem; }
.unit-head div { display: flex; flex-direction: column; }
.unit-head b { font-size: 1.25rem; }
.unit-head small { color: var(--muted); }
.unit-steps { display: grid; gap: 10px; margin: 14px 0 10px; }
@media (min-width: 700px) { .unit-steps { grid-template-columns: repeat(3, 1fr); } }
.ustep { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; background: var(--card2); border: 2px solid var(--line); border-radius: 16px; }
.ustep span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--purple); font-weight: 900; }
.ustep b { font-size: 1.1rem; }
.ustep small { color: var(--muted); }
.ustep.done { border-color: var(--green); }
.ustep.done span { background: var(--green); }
.ustep.next { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(250, 204, 21, .25); }
.clips { margin-top: 10px; }
.clip { margin: 10px 0; }
.clip-frame { position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; }
.clip-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.todo { text-align: left; display: inline-block; font-size: 1.15rem; }

/* parent */
.parent-screen { -webkit-user-select: text; user-select: text; }
.sync { font-size: .85rem; color: var(--muted); }
.sync.cloud { color: var(--green); } .sync.needcode { color: var(--orange); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.tab { white-space: nowrap; padding: 10px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.tab.on { background: var(--purple); border-color: var(--purple2); }
.tab em { font-style: normal; background: var(--red); border-radius: 99px; padding: 0 7px; margin-left: 4px; font-size: .8rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.kpi b { font-size: 1.6rem; } .kpi b.smallb { font-size: 1rem; } .kpi small { color: var(--muted); }
.bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px 0; }
.bcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bbar { width: 100%; max-width: 30px; background: var(--purple); border-radius: 6px 6px 0 0; max-height: 72%; }
.bbar.hit { background: var(--gold); }
.bval { font-size: .6rem; color: var(--muted); }
.blab { font-size: .65rem; color: var(--muted); text-align: center; padding: 4px 0; height: 34px; }
.list .li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list .li:last-child { border-bottom: 0; }
.list .li small { color: var(--muted); white-space: nowrap; }
.talk .qa { margin: 8px 0; }
.talk .qa small { color: var(--purple2); }
.talk .qa p { margin: 2px 0; }
.coach-reply { background: var(--bg2); border-radius: 12px; padding: 10px; margin-top: 8px; }
.coach-reply p { margin: 4px 0 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; }
.reward-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.reward-row.pending { border-color: var(--gold); }
.given { color: var(--green); font-weight: 800; }
.clip-review { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; }
@media (max-width: 520px) { .clip-review { grid-template-columns: 1fr; } }
.clip-review label { display: block; margin: 10px 0; }
.form label { display: block; margin: 10px 0; font-weight: 700; }
.form label.check { display: flex; gap: 8px; align-items: center; }
.form label .input, .form label select { display: block; margin-top: 4px; width: 100%; }
.pin .numpad button { font-size: 1.5rem; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--purple2); }
.pin-dots i.on { background: var(--purple2); }

/* toast + confetti */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translate(-50%, 120px); background: #111; border: 2px solid var(--gold); color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 800; transition: transform .3s; z-index: 50; }
.toast.show { transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }
@media (orientation: landscape) and (max-height: 900px) { .pitch-box { max-width: calc(56vh * 100 / 146); } .lesson-top { margin: 2px 0; } .tip { padding: 10px 14px; margin: 8px 0; } }
