:root {
  --bg: #160A2B; --bg2: #22103D; --card: #2B1650; --card2: #361C63; --line: rgba(255,255,255,.09);
  --ink: #FFF7EC; --mut: #C4B2E3; --dim: #8E7AB5;
  --pink: #FF3D8B; --orange: #FF8A3D; --sun: #FFC83D; --mint: #3DF5B0; --sky: #5CC8FF; --lav: #B08CFF;
  --r: 28px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body); color: var(--ink); background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 0% -10%, rgba(176,140,255,.28), transparent 60%),
    radial-gradient(700px 460px at 110% 5%, rgba(255,61,139,.22), transparent 60%),
    radial-gradient(800px 500px at 50% 120%, rgba(61,245,176,.10), transparent 60%);
  background-attachment: fixed;
  min-height: 100dvh; overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
#app { max-width: 540px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
.boot { margin: auto; font-size: 64px; animation: bob 1s ease-in-out infinite; }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.02em; margin: 0; }

/* ---------- generic ---------- */
.card { background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 14px; position: relative; overflow: hidden; }
.mut { color: var(--mut); }
.dim { color: var(--dim); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }

.btn-mega {
  display: block; width: 100%; font: 800 26px/1 var(--display); letter-spacing: .01em;
  padding: 26px 20px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  box-shadow: 0 8px 0 #A41E5C, 0 18px 40px rgba(255,61,139,.45);
  transition: transform .08s, box-shadow .08s;
}
.btn-mega:active { transform: translateY(6px); box-shadow: 0 2px 0 #A41E5C, 0 8px 20px rgba(255,61,139,.35); }
.btn-mega.alt { background: linear-gradient(135deg, var(--lav), var(--sky)); box-shadow: 0 8px 0 #4B3A9E, 0 18px 40px rgba(92,200,255,.35); }
.btn-mega.alt:active { box-shadow: 0 2px 0 #4B3A9E; }
.btn-mega.mint { background: linear-gradient(135deg, var(--mint), #2BC6E8); color: #0D2A22; box-shadow: 0 8px 0 #1C8C6A, 0 18px 40px rgba(61,245,176,.35); }
.btn-mega.mint:active { box-shadow: 0 2px 0 #1C8C6A; }
.btn-mega.pulse { animation: pulse 2.2s ease-in-out infinite; }

.btn { padding: 13px 18px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-weight: 700; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--pink); border-color: transparent; color: #fff; }
.btn.mint { background: var(--mint); color: #0D2A22; border-color: transparent; }
.btn.sm { padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .45; }
.pill { padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.pill:active { transform: scale(.96); }

.field { width: 100%; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
.field:focus { border-color: var(--lav); }
textarea.field { min-height: 120px; resize: vertical; }
label.lbl { display: block; font-size: 13px; color: var(--mut); margin: 10px 0 6px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); background: #fff; color: var(--bg); font-weight: 700; padding: 12px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .3s cubic-bezier(.2,1.4,.4,1); z-index: 90; max-width: 90vw; text-align: center; }
#toast.on { transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { margin: auto 0; text-align: center; }
.login h1 { font-size: 40px; line-height: 1; }
.dots { display: flex; justify-content: center; gap: 12px; margin: 22px 0; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mut); transition: .15s; }
.dots i.on { background: var(--sun); border-color: var(--sun); transform: scale(1.15); }
.dots.shake { animation: shake .4s; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pad button { height: 70px; border-radius: 22px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font: 700 26px var(--display); }
.pad button:active { background: rgba(255,255,255,.18); transform: scale(.95); }

/* ---------- home ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.hello { font: 800 28px/1.05 var(--display); }
.hello small { display: block; font: 600 14px var(--body); color: var(--mut); margin-bottom: 4px; }
.flame { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px; background: rgba(255,138,61,.16); border: 1px solid rgba(255,138,61,.35); font: 800 20px var(--display); }
.flame.cold { filter: grayscale(1); opacity: .7; }
.hero { padding: 24px 20px; background: linear-gradient(150deg, #43207A, #2B1650 60%); }
.hero::after { content: ''; position: absolute; width: 220px; height: 220px; right: -70px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(255,200,61,.35), transparent 70%); pointer-events: none; }
.hero h1 { font-size: 34px; line-height: 1.02; margin-bottom: 6px; }
.hero p { margin: 0 0 22px; color: var(--mut); }
.week { display: flex; justify-content: space-between; margin-bottom: 20px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); font-weight: 700; }
.week b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px dashed rgba(255,255,255,.18); font-size: 16px; }
.week .done b { background: linear-gradient(135deg, var(--orange), var(--pink)); border: 0; }
.week .today b { border: 2px solid var(--sun); }
.wallet .money { font: 800 46px/1 var(--display); }
.wallet .money span { font-size: 26px; vertical-align: 14px; margin-right: 2px; color: var(--mint); }
.bar { height: 14px; background: rgba(0,0,0,.3); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mint), var(--sky)); transition: width .8s cubic-bezier(.2,.9,.3,1); }
.bar.sun i { background: linear-gradient(90deg, var(--sun), var(--orange)); }
.lvl-badge { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(135deg, var(--sun), var(--orange)); box-shadow: 0 6px 0 #A8661A; flex-shrink: 0; }
.inbox { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--sun), var(--orange)); color: #2A1200; font-weight: 800; border: 0; animation: wiggle 2.5s ease-in-out infinite; width: 100%; text-align: left; }
.links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.links button { color: var(--mut); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; }
.links button:active { background: rgba(255,255,255,.08); }

/* ---------- play ---------- */
.playbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.playbar .x { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 18px; flex-shrink: 0; }
.playbar .bar { flex: 1; height: 16px; }
.playbar .bar i { background: linear-gradient(90deg, var(--pink), var(--sun)); }
.pts { font: 800 20px var(--display); min-width: 74px; text-align: right; white-space: nowrap; }
.pts.bump { animation: bump .4s; }
#stage { flex: 1; display: flex; flex-direction: column; }
.slide-in { animation: slideIn .35s cubic-bezier(.2,.9,.3,1.1); }
.tag { align-self: flex-start; padding: 7px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; background: rgba(176,140,255,.18); color: var(--lav); margin-bottom: 14px; }
.tag.new { background: rgba(255,200,61,.18); color: var(--sun); }
.tag.cam { background: rgba(255,61,139,.18); color: #FF7FB2; }
.tag.clock { background: rgba(92,200,255,.18); color: var(--sky); }
.phrase { display: flex; flex-wrap: wrap; gap: 8px 8px; margin: 6px 0 10px; }
.chip { position: relative; font: 800 clamp(30px, 9vw, 44px)/1.1 var(--display); padding: 6px 10px 14px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.chip:active { background: rgba(255,255,255,.14); }
.chip sup { position: absolute; left: 8px; bottom: 2px; font: 800 11px var(--body); color: var(--sun); letter-spacing: .03em; text-transform: lowercase; }
.meaning { color: var(--mut); margin-bottom: 8px; }
.aux { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.cam { position: relative; width: 100%; max-width: 260px; aspect-ratio: 3/4; margin: 0 auto 14px; border-radius: 26px; overflow: hidden; background: #000; border: 3px solid rgba(255,61,139,.5); }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam .rec-dot { position: absolute; top: 12px; left: 12px; background: var(--pink); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; display: none; }
.cam.live .rec-dot { display: block; animation: blink 1s infinite; }
.reczone { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.recbtn { --lvl: 0; position: relative; width: 132px; height: 132px; border-radius: 50%; font-size: 52px; color: #fff; background: radial-gradient(circle at 35% 30%, #FF7FB2, var(--pink) 55%, #C61E66); box-shadow: 0 10px 0 #8E1648, 0 0 0 calc(var(--lvl) * 26px) rgba(255,61,139,.25), 0 20px 50px rgba(255,61,139,.5); transition: box-shadow .08s, transform .08s; }
.recbtn:active { transform: translateY(6px); box-shadow: 0 4px 0 #8E1648; }
.recbtn.on { animation: none; background: radial-gradient(circle at 35% 30%, #FF9B9B, #FF4D4D 55%, #B81D1D); }
.recbtn.on::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 4px solid rgba(255,77,77,.6); animation: ring 1.2s ease-out infinite; }
.recbtn .sq { display: block; width: 40px; height: 40px; border-radius: 10px; background: #fff; margin: auto; }
.hint { font-weight: 700; color: var(--mut); min-height: 22px; }
.skip { color: var(--dim); font-size: 14px; text-decoration: underline; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.rates button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; border-radius: 22px; font-size: 38px; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.rates button b { font-size: 14px; font-family: var(--body); }
.rates button:active { transform: scale(.94); }
.rates [data-r="3"] { background: rgba(61,245,176,.14); border-color: rgba(61,245,176,.35); }
.rates [data-r="1"] { background: rgba(255,200,61,.12); border-color: rgba(255,200,61,.3); }
.floater { position: fixed; font: 800 34px var(--display); color: var(--sun); pointer-events: none; z-index: 80; animation: floatUp 1s ease-out forwards; text-shadow: 0 4px 20px rgba(0,0,0,.4); }

/* clock */
.clock { width: min(78vw, 290px); display: block; margin: 0 auto 14px; filter: drop-shadow(0 16px 30px rgba(0,0,0,.35)); }
.clock .face { fill: #FFF7EC; stroke: var(--sky); stroke-width: 3; }
.clock .tk { stroke: #3A2560; stroke-width: .6; }
.clock .tk.big { stroke-width: 1.8; }
.clock text { font: 800 8px var(--display); fill: #2B1650; text-anchor: middle; dominant-baseline: central; }
.clock .hh { stroke: var(--pink); stroke-width: 4.4; stroke-linecap: round; }
.clock .mh { stroke: #2B1650; stroke-width: 2.6; stroke-linecap: round; }
.clock .pin { fill: var(--sun); stroke: #2B1650; stroke-width: 1; }
.opts { display: grid; gap: 10px; width: 100%; }
.opts button { padding: 16px; border-radius: 20px; background: rgba(255,255,255,.07); border: 2px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--mut); text-align: left; }
.opts button b { font: 800 28px var(--display); color: var(--ink); }
.opts button.ok { background: rgba(61,245,176,.18); border-color: var(--mint); }
.opts button.bad { background: rgba(255,77,77,.15); border-color: #FF4D4D; animation: shake .4s; }
.say { background: rgba(92,200,255,.12); border: 1px solid rgba(92,200,255,.3); border-radius: 20px; padding: 14px 16px; width: 100%; }
.say b { font-family: var(--display); font-size: 20px; }

/* end */
.end { text-align: center; margin: auto 0; }
.end h1 { font-size: 44px; line-height: 1; }
.big-num { font: 800 72px/1 var(--display); background: linear-gradient(135deg, var(--sun), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chest { font-size: 96px; display: inline-block; margin: 8px 0; animation: chestBob 1.4s ease-in-out infinite; }
.chest.shake { animation: shake .12s 6; }
.chest-wrap { padding: 14px; }
.lines { text-align: left; }
.lines div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-weight: 600; }
.lines div b { color: var(--sun); font-family: var(--display); }

/* sheet / modal */
.sheet-bg { position: fixed; inset: 0; background: rgba(8,3,18,.7); backdrop-filter: blur(6px); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 540px; max-height: 88dvh; overflow: auto; background: var(--bg2); border-radius: 30px 30px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line); animation: up .3s cubic-bezier(.2,.9,.3,1.1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.2); margin: -8px auto 16px; }
.cue-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cue-big { width: 82px; height: 82px; border-radius: 24px; display: grid; place-items: center; font: 800 34px var(--display); background: linear-gradient(135deg, var(--sun), var(--orange)); color: #2A1200; flex-shrink: 0; }
.cue-box { background: rgba(255,255,255,.05); border-radius: 18px; padding: 14px; margin-top: 10px; }
.cue-box h3 { font-size: 15px; font-family: var(--body); color: var(--mut); margin-bottom: 4px; }
.cue-media { width: 100%; border-radius: 18px; margin-top: 10px; max-height: 340px; object-fit: contain; background: #000; }
.cue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cue-grid button { aspect-ratio: 1; border-radius: 22px; background: rgba(255,255,255,.06); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.cue-grid button b { font: 800 24px var(--display); }
.cue-grid button span { font-size: 12px; color: var(--mut); }
.cue-grid button i { font-style: normal; font-size: 22px; }
.cue-grid .has { border-color: rgba(61,245,176,.5); }
.fb { padding: 14px; border-radius: 20px; background: rgba(255,255,255,.05); margin-bottom: 10px; }
.stars { color: var(--sun); font-size: 20px; letter-spacing: 2px; }
audio { width: 100%; height: 40px; margin-top: 8px; }
.media-thumb { width: 100%; max-height: 300px; border-radius: 16px; background: #000; margin-top: 8px; }

/* ---------- coach ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
.tabs button { padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; background: rgba(255,255,255,.06); }
.tabs button.on { background: var(--ink); color: var(--bg); }
.tabs .n { background: var(--pink); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }
.grade-card .gstars { display: flex; gap: 6px; margin-top: 10px; }
.grade-card .gstars button { flex: 1; height: 50px; border-radius: 14px; background: rgba(255,255,255,.07); font-size: 22px; }
.grade-card .gstars button.on { background: rgba(255,200,61,.25); }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qchips button { font-size: 13px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.item-row { padding: 14px; border-radius: 20px; background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 10px; }
.item-row.off { opacity: .45; }
.item-row .meta { font-size: 13px; color: var(--dim); margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-top: 12px; }
.chart i { flex: 1; background: linear-gradient(180deg, var(--sun), var(--pink)); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.ledger div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ledger .neg { color: #FF7F7F; }
.ledger .pos { color: var(--mint); }
.mini-rec { display: inline-flex; align-items: center; gap: 6px; }
.mini-rec.on { background: #FF4D4D; color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--mut); }
.empty div { font-size: 56px; }

@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes wiggle { 0%,90%,100% { transform: rotate(0); } 93% { transform: rotate(-2deg); } 97% { transform: rotate(2deg); } }
@keyframes bump { 50% { transform: scale(1.35); color: var(--sun); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0) scale(.8); } 30% { transform: translate(-50%, -30px) scale(1.2); } to { opacity: 0; transform: translate(-50%, -120px) scale(1); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes chestBob { 50% { transform: translateY(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
