/* ============ Terfio design tokens ============ */
:root {
  --navy: #0F1E3D; --navy-2: #1D3A6E; --gold: #E0A526; --gold-2: #F3C552; --teal: #17A398; --coral: #E4572E;
  --ivory: #FAF7F0; --ink: #1B1F2A; --gray: #6B7280; --violet: #7C5CFF; --pink: #D94F8A; --blue: #1D7AE0;
  --bg: var(--ivory); --surface: #FFFFFF; --surface-2: #F3EFE6; --line: #E6E0D3; --text: var(--ink); --muted: #5E6573;
  --primary: var(--navy); --on-primary: #fff; --accent: var(--gold); --on-accent: #1B1F2A;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(15,30,61,.06), 0 8px 24px rgba(15,30,61,.08);
  --shadow-lg: 0 24px 60px rgba(15,30,61,.18);
  --font-h: 'Plus Jakarta Sans', system-ui, sans-serif; --font: 'Inter', system-ui, sans-serif; --font-read: 'Literata', Georgia, serif; --font-hand: 'Caveat', cursive;
  --nav-w: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1426; --surface: #121E36; --surface-2: #182746; --line: #24345A; --text: #E9ECF3; --muted: #9AA4B8;
  --primary: #E0A526; --on-primary: #0F1E3D; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-h); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; z-index: 999; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { font: 800 2rem var(--font-h); color: var(--navy); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ============ Buttons & inputs ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.accent { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1B1F2A; border-color: transparent; box-shadow: 0 6px 18px rgba(224,165,38,.35); }
.btn.teal { background: var(--teal); color: #fff; border-color: transparent; }
.btn.danger { background: var(--coral); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn.lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn.wand { background: linear-gradient(135deg, #7C5CFF, #D94F8A); color: #fff; border-color: transparent; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.gold { background: rgba(224,165,38,.15); color: #9A6B00; border-color: rgba(224,165,38,.4); }
.chip.teal { background: rgba(23,163,152,.12); color: #0E7A71; border-color: rgba(23,163,152,.35); }
.chip.coral { background: rgba(228,87,46,.12); color: #B23A17; border-color: rgba(228,87,46,.35); }
.chip.violet { background: rgba(124,92,255,.12); color: #5B3FD6; border-color: rgba(124,92,255,.35); }
[data-theme="dark"] .chip.gold { color: var(--gold-2); } [data-theme="dark"] .chip.teal { color: #4FD1C5; } [data-theme="dark"] .chip.coral { color: #FF8A65; } [data-theme="dark"] .chip.violet { color: #A996FF; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.click { cursor: pointer; transition: transform .15s, box-shadow .2s; text-decoration: none; display: block; }
.card.click:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lock { position: relative; }
.lock::after { content: '🔒'; position: absolute; top: 14px; right: 14px; font-size: 1.1rem; }
.badge-free { background: var(--teal); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .03em; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 99px; transition: width .4s; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Toast & modal ============ */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: tin .25s; max-width: 90vw; pointer-events: auto; }
.toast.err { background: var(--coral); } .toast.ok { background: var(--teal); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(8,14,28,.55); backdrop-filter: blur(4px); z-index: 900; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { background: var(--surface); border-radius: 20px; padding: 26px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); position: relative; }
.modal.wide { width: min(980px, 100%); }
.modal .x { position: absolute; top: 12px; right: 12px; }
@keyframes fade { from { opacity: 0; } }

/* ============ Public header / landing ============ */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 1.35rem var(--font-h); text-decoration: none; color: var(--text); }
.logo svg { width: 34px; height: 34px; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topbar nav a.lnk { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--muted); }
.topbar nav a.lnk:hover { color: var(--text); background: var(--surface-2); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 80% -10%, rgba(224,165,38,.25), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(23,163,152,.22), transparent 60%), linear-gradient(160deg, #0F1E3D, #1D3A6E); color: #fff; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font-size: 1.15rem; color: #C9D3E8; max-width: 560px; }
.hero .slogan { display: inline-flex; gap: 8px; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); padding: 6px 14px; border-radius: 999px; font-weight: 600; color: var(--gold-2); margin-bottom: 18px; }
.hero .stats { display: flex; gap: 28px; margin-top: 32px; flex-wrap: wrap; }
.hero .stats b { display: block; font: 800 1.8rem var(--font-h); color: #fff; }
.hero .stats span { color: #AEBBD6; font-size: .9rem; }
.hero-stage { border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.12); background: #0b1630; }
.sec { padding: 80px 0; }
.sec.alt { background: var(--surface-2); }
.sec-h { text-align: center; max-width: 720px; margin: 0 auto 42px; }
.eyebrow { font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; margin-bottom: 8px; display: block; }
.feature { padding: 26px; }
.feature .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; background: var(--surface-2); }
.steps-h { counter-reset: s; }
.step-h { position: relative; padding-left: 64px; }
.step-h::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 14px; background: var(--navy); color: var(--gold); display: grid; place-items: center; font: 800 1.2rem var(--font-h); }
.price { position: relative; display: flex; flex-direction: column; }
.price.hl { border: 2px solid var(--gold); transform: scale(1.03); box-shadow: var(--shadow-lg); }
.price .tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1B1F2A; font-weight: 800; font-size: .75rem; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.price .amt { font: 800 2.4rem var(--font-h); }
.price .amt small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.price .old { text-decoration: line-through; color: var(--muted); }
.price ul { list-style: none; padding: 0; margin: 16px 0 20px; flex: 1; }
.price li { padding: 6px 0 6px 26px; position: relative; font-size: .93rem; }
.price li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 4px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--gold); }
.faq details[open] summary::after { content: '−'; }
.footer { background: var(--navy); color: #AEBBD6; padding: 48px 0 28px; font-size: .9rem; }
.footer a { color: #fff; text-decoration: none; }
.footer .logo { color: #fff; }
.quote-card { font-family: var(--font-read); font-size: 1.05rem; }
.comp-pill { display: flex; gap: 12px; align-items: flex-start; }
.comp-pill .dot { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }

/* ============ App shell ============ */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C9D3E8; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .logo { color: #fff; padding: 6px 10px 18px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: #C9D3E8; font-weight: 500; }
.side a.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.nav.on { background: rgba(224,165,38,.16); color: var(--gold-2); font-weight: 700; }
.side a.nav .i { width: 24px; text-align: center; font-size: 1.1rem; }
.side .plan-box { margin-top: auto; background: rgba(255,255,255,.06); border-radius: 14px; padding: 14px; font-size: .85rem; }
.side .plan-box b { color: #fff; }
.main { min-width: 0; }
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar .title { font: 700 1.1rem var(--font-h); }
.appbar .sp { flex: 1; }
.days-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(23,163,152,.12); color: #0E7A71; font-weight: 700; font-size: .85rem; text-decoration: none; }
.days-badge.warn { background: rgba(228,87,46,.12); color: #B23A17; }
[data-theme="dark"] .days-badge { color: #4FD1C5; } [data-theme="dark"] .days-badge.warn { color: #FF8A65; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #1B1F2A; display: grid; place-items: center; font-weight: 800; cursor: pointer; border: 0; }
.page { padding: 28px; max-width: 1280px; }
.page-h { margin-bottom: 22px; }
.page-h p { color: var(--muted); max-width: 760px; }
.mnav { display: none; }
.announce { background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: #1B1F2A; text-align: center; padding: 8px 12px; font-weight: 600; font-size: .9rem; }

/* dashboard */
.dash-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
.ring { position: relative; width: 140px; height: 140px; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 2.2rem var(--font-h); }
.task { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; margin-bottom: 8px; }
.task:hover { outline: 2px solid var(--gold); }
.task .ic { font-size: 1.4rem; }
.task .go { margin-left: auto; font-weight: 700; color: var(--teal); white-space: nowrap; }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.cal i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); }
.cal i.on { background: var(--teal); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tbl tr:hover td { background: var(--surface-2); }
.score { font-weight: 800; font-family: var(--font-h); }
.score.hi { color: var(--teal); } .score.mid { color: #B7860B; } .score.lo { color: var(--coral); }

/* ============ Animation stage ============ */
.stage { position: relative; aspect-ratio: 16/9; width: 100%; background: #0b1630; overflow: hidden; border-radius: 18px; user-select: none; container-type: inline-size; }
.stage .bg, .stage .bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .actor { position: absolute; bottom: 0; width: 30%; transition: left .6s cubic-bezier(.3,1.3,.5,1), opacity .4s, transform .4s; }
.stage .actor svg { width: 100%; height: auto; display: block; overflow: visible; }
.stage .actor .nm { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); background: rgba(15,30,61,.85); color: #fff; padding: 3px 12px; border-radius: 999px; font-size: clamp(9px, 1.4cqw, 14px); font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .3s; }
.stage .actor.talking .nm { opacity: 1; }
.stage .actor.enter { animation: actorIn .7s cubic-bezier(.3,1.3,.5,1); }
@keyframes actorIn { from { transform: translateY(40%); opacity: 0; } }
.stage .board { position: absolute; right: 4%; top: 7%; width: 54%; height: 62%; background: #FDFCF7; border-radius: 1.2cqw; box-shadow: 0 1cqw 3cqw rgba(0,0,0,.25); padding: 2.4cqw 2.8cqw; color: #1B1F2A; overflow: hidden; border: .6cqw solid #C9B38A; }
.stage .board.solo { left: 50%; transform: translateX(-50%); right: auto; width: 70%; }
.stage .board h4 { font: 800 clamp(12px, 2.6cqw, 30px) var(--font-h); color: var(--navy); margin: 0 0 1.4cqw; position: relative; display: inline-block; }
.stage .board h4::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.4cqw; height: .5cqw; background: var(--gold); border-radius: 2px; transform-origin: left; animation: underline .8s .2s both; }
@keyframes underline { from { transform: scaleX(0); } }
.stage .board ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1cqw; }
.stage .board li { font: 700 clamp(11px, 2.25cqw, 26px)/1.25 var(--font-hand); color: #1D3A6E; opacity: 0; transform: translateX(-1.5cqw); transition: opacity .5s, transform .5s; clip-path: inset(0 100% 0 0); }
.stage .board li.on { opacity: 1; transform: none; clip-path: inset(0 0 0 0); transition: opacity .3s, transform .5s, clip-path 1.1s ease-out; }
.stage .board li.now { color: #B23A17; }
.stage .board.steps li { background: #F1EEE4; padding: .6cqw 1.2cqw; border-radius: .8cqw; border-left: .6cqw solid var(--teal); }
.stage .board.quad ul { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 78%; }
.stage .board.quad li { background: #F1EEE4; border-radius: 1cqw; display: grid; place-items: center; text-align: center; padding: 1cqw; }
.stage .board.quad li:nth-child(1) { background: #FCE3DA; } .stage .board.quad li:nth-child(2) { background: #DDF3F0; } .stage .board.quad li:nth-child(3) { background: #FFF1CF; } .stage .board.quad li:nth-child(4) { background: #E7E3F8; }
.stage .board.quote { display: grid; place-items: center; text-align: center; }
.stage .board.quote li { font-size: clamp(14px, 3.4cqw, 40px); }
.stage .board.compare li { padding-left: .4cqw; }
.stage .caption { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); width: min(86%, 980px); background: rgba(10,18,36,.82); color: #fff; padding: 1cqw 2cqw; border-radius: 1.2cqw; font-size: clamp(12px, 1.9cqw, 22px); line-height: 1.4; text-align: center; backdrop-filter: blur(4px); transition: opacity .3s; }
.stage .caption b { color: var(--gold-2); font-weight: 700; margin-right: .5em; }
.stage .caption:empty { opacity: 0; }
.stage.nocap .caption { display: none; }
.stage .big-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,14,28,.45); cursor: pointer; z-index: 5; border: 0; width: 100%; }
.stage .big-play span { width: 13cqw; height: 13cqw; max-width: 110px; max-height: 110px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: clamp(22px, 5cqw, 46px); color: #1B1F2A; box-shadow: 0 0 0 1.4cqw rgba(224,165,38,.25); animation: ping 1.8s infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 2.4cqw rgba(224,165,38,.08); } }
.stage .scene-title { position: absolute; top: 3%; left: 3%; background: rgba(10,18,36,.7); color: #fff; padding: .5cqw 1.4cqw; border-radius: 999px; font-size: clamp(9px, 1.3cqw, 14px); font-weight: 600; }
.stage .loading { position: absolute; top: 3%; right: 3%; }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 12px 4px; flex-wrap: wrap; }
.player-bar .progress { flex: 1; min-width: 120px; cursor: pointer; height: 10px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.dots button.on { background: var(--gold); transform: scale(1.3); }
.dots button.done { background: var(--teal); }
.transcript { max-height: 320px; overflow: auto; font-size: .92rem; }
.transcript p { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; }
.transcript p.now { background: rgba(224,165,38,.16); }

/* character idle */
.chr .body-g { animation: breathe 4s ease-in-out infinite; transform-origin: 100px 260px; }
.chr .head-g { transform-origin: 100px 150px; transition: transform .5s; animation: sway 7s ease-in-out infinite; }
.chr.talking .head-g { animation: talkbob .5s ease-in-out infinite alternate, sway 7s ease-in-out infinite; }
.chr .brow { transition: transform .35s; transform-box: fill-box; transform-origin: center; }
.chr .eye { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.chr .flush { transition: opacity .6s; }
.chr .arm { transition: transform .5s cubic-bezier(.3,1.4,.5,1), opacity .3s; transform-box: fill-box; }
@keyframes breathe { 50% { transform: translateY(1.5px) scaleY(1.008); } }
@keyframes sway { 0%,100% { transform: rotate(0); } 30% { transform: rotate(1.2deg); } 70% { transform: rotate(-1deg); } }
@keyframes talkbob { to { transform: translateY(-1.5px) rotate(.6deg); } }
@media (prefers-reduced-motion: reduce) { .chr .body-g, .chr .head-g { animation: none !important; } * { scroll-behavior: auto !important; } }

/* ============ Roleplay ============ */
.rp { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.rp .chat { height: 100%; display: flex; flex-direction: column; max-height: 76vh; }
.rp .msgs { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.5; }
.bubble.char { background: var(--surface-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.user { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
[data-theme="dark"] .bubble.user { background: var(--navy-2); }
.bubble .obs { display: block; margin-top: 6px; font-size: .78rem; color: var(--teal); font-style: italic; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.composer textarea { flex: 1; min-height: 52px; max-height: 160px; }
.mic { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: 1.4rem; cursor: pointer; flex: none; position: relative; }
.mic.rec { animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 10px rgba(228,87,46,.2); } }
.anger { position: absolute; top: 4%; right: 3%; width: 4.2%; height: 46%; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; border: 2px solid rgba(255,255,255,.35); }
.anger i { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(0deg, #17A398, #E0A526 50%, #E4572E); transition: height .8s; }
.anger-lbl { position: absolute; top: 51%; right: 1.5%; color: #fff; font-size: clamp(9px, 1.2cqw, 13px); font-weight: 700; text-shadow: 0 1px 3px #000; }
.turnc { position: absolute; top: 3%; left: 3%; background: rgba(10,18,36,.75); color: #fff; padding: .5cqw 1.4cqw; border-radius: 999px; font-size: clamp(10px, 1.4cqw, 14px); font-weight: 700; }
.wave { display: flex; gap: 3px; align-items: center; height: 28px; }
.wave i { width: 4px; background: var(--coral); border-radius: 2px; height: 20%; transition: height .08s; }
.report-comp { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }

/* ============ Reader ============ */
.reader-wrap { display: grid; grid-template-columns: 1fr 400px; gap: 0; min-height: calc(100vh - 64px); }
.reader-wrap.focus { grid-template-columns: 1fr; }
.reader { --rfs: 19px; padding: 28px 24px 120px; background: var(--rbg, var(--surface)); color: var(--rtext, var(--text)); transition: background .3s; }
.reader.sepia { --rbg: #F4ECD8; --rtext: #3B2F20; }
.reader.night { --rbg: #0E1424; --rtext: #D6DCE8; }
.reader article { max-width: 68ch; margin: 0 auto; font-family: var(--font-read); font-size: var(--rfs); line-height: 1.75; }
.reader article h2 { font-family: var(--font-h); margin-top: 2.2em; }
.reader article p { margin: 0 0 1.05em; text-align: justify; hyphens: auto; border-radius: 6px; transition: background .3s; position: relative; }
.reader article p.reading { background: rgba(224,165,38,.22); box-shadow: 0 0 0 6px rgba(224,165,38,.22); }
.reader article p .pnum { position: absolute; left: -3em; top: .2em; font: 500 .7rem var(--font); color: var(--muted); opacity: .6; user-select: none; }
.reader mark { border-radius: 3px; padding: 0 1px; color: inherit; }
mark.hl-kisi { background: rgba(124,92,255,.28); } mark.hl-rakam { background: rgba(224,165,38,.38); } mark.hl-sorun { background: rgba(228,87,46,.28); } mark.hl-celiski { background: rgba(23,163,152,.3); }
.reader-tools { position: sticky; top: 64px; z-index: 30; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.reader-tools .grp { display: flex; gap: 4px; align-items: center; padding-right: 10px; border-right: 1px solid var(--line); }
.reader-tools .grp:last-child { border-right: 0; }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--gold); z-index: 100; transition: width .2s; }
.qpanel { border-left: 1px solid var(--line); background: var(--surface-2); padding: 18px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.hl-pop { position: absolute; z-index: 200; background: var(--navy); border-radius: 12px; padding: 6px; display: flex; gap: 4px; box-shadow: var(--shadow-lg); }
.hl-pop button { border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .8rem; font-weight: 600; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; font-size: .9rem; }
.toc a:hover { background: var(--surface-2); }
.char-map { display: grid; gap: 8px; }
.char-map div { font-size: .85rem; padding: 8px 10px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); }

/* ============ Quiz ============ */
.quiz { max-width: 860px; margin: 0 auto; }
.qcard { padding: 28px; }
.qtext { font-size: 1.15rem; line-height: 1.65; margin-bottom: 20px; font-weight: 500; }
.opt { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; margin-bottom: 10px; transition: border-color .2s, background .2s, transform .1s; }
.opt:hover:not(:disabled) { border-color: var(--gold); transform: translateX(3px); }
.opt .k { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; }
.opt.sel { border-color: var(--navy-2); background: rgba(29,58,110,.06); }
.opt.right { border-color: var(--teal); background: rgba(23,163,152,.1); }
.opt.right .k { background: var(--teal); color: #fff; }
.opt.wrong { border-color: var(--coral); background: rgba(228,87,46,.08); }
.opt.wrong .k { background: var(--coral); color: #fff; }
.opt:disabled { cursor: default; }
.wand-box { border: 2px dashed #A996FF; background: linear-gradient(135deg, rgba(124,92,255,.08), rgba(217,79,138,.08)); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; animation: sparkle .6s; }
.wand-box li { margin-bottom: 6px; }
@keyframes sparkle { from { transform: scale(.96); opacity: 0; filter: blur(4px); } }
.sol-box { border-radius: 16px; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); }
.timer { font: 700 1rem var(--font-h); font-variant-numeric: tabular-nums; }

/* ============ Games ============ */
.game-area { max-width: 880px; margin: 0 auto; }
.thermo { display: grid; grid-template-columns: 90px 1fr; gap: 22px; align-items: stretch; }
.thermo .tube { position: relative; width: 44px; margin: 0 auto; height: 360px; background: var(--surface-2); border-radius: 99px; border: 3px solid var(--line); overflow: hidden; }
.thermo .tube i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #17A398, #E0A526 55%, #E4572E); transition: height .6s cubic-bezier(.3,1.4,.5,1); }
.tbar { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; margin-bottom: 14px; }
.tbar i { display: block; height: 100%; background: var(--coral); transition: width .1s linear; }
.swipe-zone { position: relative; height: 320px; display: grid; place-items: center; }
.swipe-card { position: absolute; width: min(460px, 92%); min-height: 190px; padding: 28px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); font: 600 1.25rem/1.45 var(--font-h); display: grid; place-items: center; text-align: center; touch-action: none; cursor: grab; transition: transform .35s, opacity .35s; border: 1px solid var(--line); }
.swipe-card.left { transform: translateX(-140%) rotate(-18deg); opacity: 0; }
.swipe-card.right { transform: translateX(140%) rotate(18deg); opacity: 0; }
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.mail { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; cursor: grab; font-size: .88rem; }
.mail.sel { outline: 2px solid var(--gold); }
.mail b { display: block; }
.quads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quad { min-height: 170px; border-radius: 16px; padding: 12px; border: 2px dashed var(--line); }
.quad.over { border-color: var(--gold); background: rgba(224,165,38,.08); }
.quad h4 { margin: 0 0 8px; font-size: .95rem; }
.quad .mail { cursor: pointer; }
.chain { display: flex; flex-direction: column; gap: 10px; }
.chain .lnk { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--teal); animation: sparkle .4s; }

/* ============ Coach ============ */
.coach { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.coach .msgs { height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px; }
.coach .bubble.char { max-width: 92%; }
.md p { margin: 0 0 .6em; } .md ul { margin: .2em 0 .6em; padding-left: 1.2em; }

/* ============ Admin ============ */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tabs button { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.admin-tabs button.on { background: var(--navy); color: #fff; border-color: transparent; }
.kpi b { display: block; font: 800 1.9rem var(--font-h); }
.kpi span { color: var(--muted); font-size: .85rem; }
.json-ed { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; min-height: 420px; white-space: pre; tab-size: 2; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .rp, .coach { grid-template-columns: 1fr; }
  .reader-wrap { grid-template-columns: 1fr; }
  .qpanel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .dash-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 36px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 30% 0 0; z-index: 300; height: 100vh; }
  .mnav { display: inline-flex; }
  .page { padding: 18px 14px; }
  .appbar { padding: 10px 14px; }
  .dash-top { grid-template-columns: 1fr; }
  .topbar nav a.lnk { display: none; }
  .inbox { grid-template-columns: 1fr; }
  .stage .board { width: 62%; }
  .price.hl { transform: none; }
  .report-comp { grid-template-columns: 110px 1fr 40px; }
  .reader article p .pnum { display: none; }
}
@media print {
  .side, .appbar, .no-print, .topbar, .footer { display: none !important; }
  .shell { display: block; } body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* segmented toggle (vaka kısa/uzun) */
.seg{display:inline-flex;border:1px solid var(--line,rgba(127,127,127,.3));border-radius:10px;overflow:hidden}
.seg .btn{border-radius:0;border:0;margin:0}

#story p.reading{background:color-mix(in srgb,var(--gold,#E0A526) 18%,transparent);border-radius:6px;padding:2px 4px}
