:root {
  --bg: #0d0e11;
  --panel: #16181d;
  --panel-2: #1d2027;
  --line: #2a2e37;
  --text: #eceef2;
  --muted: #9097a5;
  --gold: #f2b631;
  --gold-2: #ffcf5c;
  --ok: #3ecf8e;
  --bad: #ff5d5d;
  --blue: #4c8dff;
  --radius: 18px;
  --display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 85% -120px, color-mix(in srgb, var(--gold) 13%, transparent), transparent 65%),
    radial-gradient(1100px 620px at 50% -220px, #1d202a 0%, var(--bg) 62%) fixed,
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
::selection { background: var(--gold); color: #111; }
a { color: var(--gold-2); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 1em; }
p { margin: .4em 0 .8em; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; min-width: 0; }
.big { font-size: 3rem; line-height: 1.2; }

/* layout */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(13, 14, 17, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; letter-spacing: .02em; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px;
}
.card.empty { text-align: center; padding: 28px 16px; }
.back { display: inline-block; margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.page-head { display: flex; gap: 12px; align-items: center; margin: 4px 0 16px; }
.emoji { font-size: 2rem; line-height: 1; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-align: center; transition: transform .05s, background .15s, border-color .15s;
}
.btn:hover { border-color: #3a3f4b; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn.primary:hover { background: var(--gold-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn.active { border-color: var(--gold); color: var(--gold-2); }
.btn.file { position: relative; }
.icon { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.icon:hover { background: var(--panel-2); color: var(--text); }
.say { font-size: 1.2rem; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.gold { color: var(--gold-2); border-color: rgba(242, 182, 49, .4); }
.pill.ok { color: var(--ok); border-color: rgba(62, 207, 142, .4); }

/* belt */
.belt {
  position: relative; height: 22px; margin: 12px 0;
  background: var(--belt); border-radius: 5px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(255, 255, 255, .08);
}
.belt::before { content: ''; position: absolute; inset: 7px 0; border-top: 1px dashed rgba(0, 0, 0, .15); border-bottom: 1px dashed rgba(0, 0, 0, .15); }
.belt .bar {
  position: absolute; right: 10%; top: 0; bottom: 0; width: 24%; min-width: 70px;
  background: var(--bar); display: flex; justify-content: flex-start; gap: 6px; padding: 0 8px;
}
.belt .bar i { width: 6px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.belt.big { height: 34px; margin: 6px auto 18px; max-width: 360px; }
.belt.big .bar i { width: 8px; }

/* hero / stats */
.hero { padding: 8px 0 6px; }
.hero h1 { font-size: 2rem; }
.hero h1 span { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stats.card > div { background: var(--panel-2); }
.stats b { display: block; font-size: 1.5rem; color: var(--gold-2); }
.stats span, .stats small { display: block; color: var(--muted); font-size: .8rem; }
.how li { margin: 0 0 .5em; }

/* module lists */
.mods { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.mods li > a, .mods li > div {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}
.mods li > a:hover { border-color: var(--gold); }
.mods b { display: block; }
.mods small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: .85rem;
}
.num.done { background: var(--ok); border-color: var(--ok); color: #04130c; }
.locked { opacity: .55; }

/* promotion */
.promo { margin-top: 14px; padding: 14px; border-radius: 12px; background: #1a1710; border: 1px solid rgba(242, 182, 49, .3); }
.req { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.req li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.req li.ok { color: var(--ok); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.check.big { padding: 12px; background: var(--panel-2); border-radius: 10px; margin: 12px 0; }

/* module header & tabs */
.mod-head h1 { margin-top: 4px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.steps span { font-size: .82rem; padding: 4px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.steps span.ok { color: var(--ok); border-color: rgba(62, 207, 142, .35); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; position: sticky; top: 57px; z-index: 5; background: var(--bg); padding: 6px 0; }
.tabs a { text-align: center; padding: 9px 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .88rem; }
.tabs a.active { color: #1a1405; background: var(--gold); border-color: var(--gold); }
.complete { border-color: var(--gold); text-align: center; }

/* lesson */
.lesson h2, .lesson h3 { color: var(--gold-2); margin-top: 1.1em; }
.lesson h2:first-child, .lesson h3:first-child { margin-top: 0; }
.lesson ul, .lesson ol { padding-left: 1.2em; }
.lesson li { margin: .35em 0; }
.lesson strong { color: #fff; }
blockquote { margin: .6em 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.phrases { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.phrases li { display: flex; gap: 8px; align-items: flex-start; padding: 10px; background: var(--panel-2); border-radius: 10px; }
.phrases b, .phrases span, .phrases small { display: block; }
.phrases span { color: var(--text); opacity: .85; }
.phrases small { color: var(--muted); }
.pass { background: rgba(62, 207, 142, .08); border: 1px solid rgba(62, 207, 142, .3); border-radius: 10px; padding: 10px 12px; }
.pass b { color: var(--ok); }
.pass p { margin: .2em 0 0; }

/* drill */
.bar-progress { height: 6px; background: var(--panel); border-radius: 99px; overflow: hidden; margin: 0 0 8px; }
.bar-progress i { display: block; height: 100%; background: var(--gold); transition: width .3s; }
.flash { min-height: 210px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; cursor: pointer; margin-top: 10px; }
.flash.static { cursor: default; min-height: 150px; }
.flash .front { display: flex; align-items: center; gap: 6px; justify-content: center; }
.flash .front p { font-size: 1.35rem; font-weight: 700; margin: 0; }
.flash .back { border-top: 1px dashed var(--line); padding-top: 12px; width: 100%; }
.flash .back p { font-size: 1.15rem; color: var(--gold-2); margin: 0 0 4px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.grades .btn { flex-direction: column; gap: 0; padding: 10px 4px; }
.grades small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.g0 { border-color: rgba(255, 93, 93, .5); }
.g1 { border-color: rgba(255, 170, 60, .5); }
.g2 { border-color: rgba(62, 207, 142, .5); }
.g3 { border-color: rgba(76, 141, 255, .5); }

/* test */
.options { display: grid; gap: 8px; margin: 4px 0 8px; }
.option { justify-content: flex-start; text-align: left; font-weight: 500; padding: 12px 14px; }
.option.right { border-color: var(--ok); background: rgba(62, 207, 142, .15); }
.option.wrong { border-color: var(--bad); background: rgba(255, 93, 93, .15); }
.option.dim { opacity: .5; }

/* coach */
.modes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.mode { flex: none; display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.mode b { font-weight: 600; }
.mode.active { color: var(--gold-2); border-color: var(--gold); }
.mode-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mode-list li { display: flex; gap: 12px; align-items: flex-start; }
.mode-list span { font-size: 1.4rem; }
.mode-list b, .mode-list small { display: block; }
.mode-list small { color: var(--muted); }
textarea, input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea:focus, input:focus, select:focus { outline: 2px solid rgba(242, 182, 49, .5); border-color: var(--gold); }
#prompt { font-size: .88rem; line-height: 1.5; resize: vertical; }
.chat .msgs { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.msg { padding: 10px 12px; border-radius: 12px; max-width: 92%; word-wrap: break-word; }
.msg p:first-child { margin-top: 0; }
.msg p:last-child { margin-bottom: 0; }
.msg.user { align-self: flex-end; background: #2a2414; border: 1px solid rgba(242, 182, 49, .3); }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.msg ul, .msg ol { padding-left: 1.2em; margin: .4em 0; }
details.msg summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
details.msg[open] { font-size: .85rem; }
.typing { display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.composer { display: flex; gap: 8px; align-items: stretch; border-top: 1px solid var(--line); padding-top: 10px; }
.composer textarea { flex: 1; resize: vertical; }
.icon-btn { padding: 8px 12px; }

/* forms */
.form label { display: block; margin: 0 0 10px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.form label input, .form label select, .form label textarea { margin-top: 4px; }
.form label.check { color: var(--text); font-weight: 400; font-size: 1rem; }
.form label.btn { display: inline-flex; margin: 0; color: var(--text); font-size: 1rem; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.log li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel-2); border-radius: 10px; }
.log b, .log small { display: block; }
.log small { color: var(--muted); }

/* timer */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.timer-face + .row { margin-bottom: 14px; }
.timer-face { text-align: center; padding: 26px 16px; transition: background .3s, border-color .3s; }
.timer-face .time { font-size: clamp(4rem, 22vw, 7rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.timer-face .phase { font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.timer-face[data-phase='work'] { border-color: var(--ok); background: #102018; }
.timer-face[data-phase='work'] .phase { color: var(--ok); }
.timer-face[data-phase='rest'] { border-color: var(--blue); background: #0f1626; }
.timer-face[data-phase='rest'] .phase { color: var(--blue); }
.timer-face[data-phase='done'] { border-color: var(--gold); }
.timer-face[data-phase='done'] .phase { color: var(--gold); }

/* home quick links */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 0; }
.quick .card { margin: 0; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.quick .card:hover { border-color: var(--gold); }
.quick span { font-size: 1.6rem; }
.quick small { color: var(--muted); font-size: .8rem; }
.warn-card { display: block; margin: 10px 0 0; border-color: rgba(255, 170, 60, .5); background: #1f190f; color: var(--text); }
.warn-card small { display: block; color: var(--muted); }
.gear { font-size: 1.2rem; text-decoration: none; }

/* status chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { font-size: .78rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
.chip.ok { color: var(--ok); border-color: rgba(62, 207, 142, .35); }
.chip.warn { color: #ffb347; border-color: rgba(255, 170, 60, .4); }
.status { padding: 8px 12px; border-radius: 10px; background: var(--panel-2); }
.status.ok { color: var(--ok); }
.status.warn { color: #ffb347; }
details.sub { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
details.sub summary { cursor: pointer; padding: 2px 0; }
details.sub[open] summary { margin-bottom: 8px; }
.modal-box .left { text-align: left; padding-left: 1.2em; }
.modal-box .left li { margin: .4em 0; }

/* talk */
.scenes .scene-icon { font-size: 1.6rem; width: 34px; text-align: center; flex: none; }
.talk .msgs { max-height: 52vh; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 10px; }
.talk .msg .pt { font-size: 1.05rem; }
.talk .msg .en { margin-top: 4px; font-size: .88rem; color: var(--muted); filter: blur(5px); cursor: pointer; user-select: none; transition: filter .2s; }
.talk .msg .en.show { filter: none; user-select: auto; }
.tip { align-self: flex-end; max-width: 92%; font-size: .86rem; padding: 8px 10px; border-radius: 10px; background: rgba(242, 182, 49, .1); border: 1px dashed rgba(242, 182, 49, .45); color: #ffe2a0; }
.hints { background: var(--panel-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; font-size: .92rem; }
.hints ul { margin: .2em 0; padding-left: 1.2em; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 12px; }
.mic {
  --lvl: 0;
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: #1a1405; font-size: 2rem; display: grid; place-items: center;
  box-shadow: 0 0 0 calc(4px + var(--lvl) * 26px) rgba(242, 182, 49, .25), 0 8px 24px rgba(0, 0, 0, .4);
  transition: box-shadow .08s linear, transform .1s;
}
.mic:active { transform: scale(.95); }
.mic.listening { background: var(--bad); color: #fff; box-shadow: 0 0 0 calc(6px + var(--lvl) * 30px) rgba(255, 93, 93, .28); }
.mic.thinking { background: var(--panel-2); color: var(--muted); animation: blink 1.2s infinite; }
.mic.speaking { background: var(--ok); color: #04130c; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 16px rgba(62, 207, 142, .15); } }
.mic-label { font-size: .85rem; }
.talk .composer textarea { min-height: 42px; }
.talk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.talk-tools .check { padding: 0; margin-right: auto; font-size: .9rem; }
.feedback h2, .feedback h3, .feedback h4 { color: var(--gold-2); }
.feedback ul { padding-left: 1.2em; }

/* stories */
.reader-bar { position: sticky; top: 57px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--bg); padding: 8px 0; margin-bottom: 8px; }
.story { font-size: 1.18rem; line-height: 1.85; }
.story p { margin: 0 0 1em; }
.sent { cursor: pointer; border-radius: 6px; padding: 1px 2px; transition: background .2s, color .2s; }
.sent:hover { background: rgba(255, 255, 255, .06); }
.sent.reading { background: rgba(242, 182, 49, .22); color: #fff; box-shadow: 0 0 0 2px rgba(242, 182, 49, .25); }
.tr { color: var(--muted); font-size: .9rem; }
.tr.inline { font-style: italic; }
.story p.lines { display: grid; gap: 10px; }
.line { display: flex; flex-direction: column; }
.line .tr { font-size: .9rem; line-height: 1.4; }
.qa { padding: 8px 0; border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; }
.qa p { margin: 6px 0 0 30px; color: var(--ok); }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: rgba(16, 17, 21, .95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 1.15rem; padding: 4px 0; border-radius: 10px; }
.tabbar a span { font-size: .68rem; font-weight: 600; }
.tabbar a.active { color: var(--gold-2); background: var(--panel); }
.tabbar b { position: absolute; top: 0; right: calc(50% - 22px); background: var(--bad); color: #fff; font-size: .62rem; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.tabbar b[hidden] { display: none; }

/* overlays */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2b2f38; color: var(--text); padding: 10px 16px; border-radius: 10px; z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: 90vw; animation: up .25s ease;
}
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal-box { background: var(--panel); border: 1px solid var(--gold); border-radius: 18px; padding: 24px; max-width: 420px; width: 100%; text-align: center; animation: up .3s ease; }
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }
.modal-box { animation-name: pop; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* subject identity: Portuguese is green, BJJ keeps gold */
[data-track='pt'] { --gold: #2fd18a; --gold-2: #6be3ad; }
[data-track='bjj'] { --gold: #f2b631; --gold-2: #ffcf5c; }
[data-track='pt'] .promo { background: #0f1a15; border-color: rgba(47, 209, 138, .3); }
.subject { position: relative; margin: 22px 0 0; }
.subject-label { margin: 0 0 8px; color: var(--gold-2); }
.subject .track { border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 7%, var(--panel)), var(--panel) 55%); }
.subject .quick .card:hover { border-color: var(--gold); }

/* CEFR level bar (Portuguese) */
.lvl { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.lvl b {
  flex: none; min-width: 44px; padding: 4px 8px; border-radius: 8px; text-align: center;
  background: var(--lc); color: #0b0f0d; font-weight: 800; letter-spacing: .03em;
}
.lvl .segs { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.lvl .segs i { height: 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); transition: background .3s; }
.lvl .segs i.on { background: var(--lc); border-color: var(--lc); box-shadow: 0 0 10px color-mix(in srgb, var(--lc) 45%, transparent); }
.lvl.big { max-width: 360px; margin: 6px auto 18px; }
.lvl.big b { font-size: 1.3rem; padding: 8px 12px; }
.lvl.big .segs i { height: 14px; }

/* today ring */
.today { display: flex; gap: 16px; align-items: center; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--panel-2); }
.ring .fill { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring b { font-size: 1.5rem; color: var(--gold-2); }
.ring small { color: var(--muted); font-size: .7rem; }
.today .pill[style] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* activity heatmap */
.heat { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 16px); justify-content: space-between; gap: 3px; margin: 10px 0 6px; }
.heat i, .legend i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--panel-2); }
.legend { display: inline-flex; align-items: center; gap: 3px; }
.legend i { width: 10px; }
.h-1 { visibility: hidden; }
.h1 { background: #3a3016 !important; }
.h2 { background: #7a5d15 !important; }
.h3 { background: #c4911f !important; }
.h4 { background: #ffcf5c !important; }

/* drill modes */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .88rem; padding: 8px 4px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--gold); color: #0b0f0d; }
.answer-row { display: flex; gap: 8px; margin: 10px 0 0; }
.answer-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.answer-row input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn.ghost { background: none; color: var(--muted); }
.mic-btn { padding: 16px; font-size: 1.05rem; }
.verdict { text-align: left; padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; border: 1px solid var(--line); }
.verdict.ok { background: rgba(62, 207, 142, .1); border-color: rgba(62, 207, 142, .4); }
.verdict.close { background: rgba(255, 170, 60, .1); border-color: rgba(255, 170, 60, .4); }
.verdict.bad { background: rgba(255, 93, 93, .1); border-color: rgba(255, 93, 93, .4); }
.verdict .said { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.words span { display: inline-block; padding: 1px 6px; border-radius: 6px; margin: 2px 0; font-weight: 600; }
.words .hit { color: var(--ok); background: rgba(62, 207, 142, .12); }
.words .miss { color: var(--bad); background: rgba(255, 93, 93, .12); text-decoration: underline wavy; }
.grades .suggest { box-shadow: 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--panel-2)); }
.watch { margin-top: 10px; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: translateX(40px) rotate(720deg); } }

/* ============ MASTERPIECE LAYER ============ */
h1, h2, .hero-panel b, .track-hero h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; }
main { max-width: 860px; }
.page-in { animation: pageIn .45s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .68rem; font-weight: 800; color: var(--gold-2); margin: 0 0 8px; }
.topbar { background: rgba(8, 9, 12, .72); border-bottom-color: rgba(255,255,255,.07); }
.brand { font-family: var(--display); font-size: 1.06rem; }
.brand em { color: var(--gold-2); font-style: italic; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 16px rgba(0,0,0,.45); }
.card { background: linear-gradient(165deg, rgba(255,255,255,.035), rgba(255,255,255,0) 42%), var(--panel); border-color: rgba(255,255,255,.08); box-shadow: 0 14px 34px rgba(0,0,0,.22); }
.btn { transition: transform .18s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.btn.primary { background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 22px color-mix(in srgb, var(--gold) 28%, transparent); }
.pill.glass { background: rgba(10,10,12,.55); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(8px); }

/* masthead + diptych */
.masthead { padding: 26px 2px 18px; }
.masthead h1 { font-size: clamp(2.5rem, 8vw, 4.4rem); line-height: .98; margin: 0 0 12px; }
.masthead h1 span { color: var(--gold-2); font-style: italic; }
.lede { max-width: 560px; color: var(--muted); font-size: 1.04rem; margin: 0; }
.diptych { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 14px; }
.hero-panel { position: relative; display: block; min-height: 340px; border-radius: 24px; overflow: hidden; color: #fff; border: 1px solid rgba(255,255,255,.13); box-shadow: 0 24px 50px rgba(0,0,0,.38); isolation: isolate; }
.hero-media { position: absolute; inset: 0; overflow: hidden; display: block; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); transition: transform .8s var(--ease), filter .5s; }
.hero-panel:hover .hero-media img, .feature:hover .hero-media img { filter: saturate(1.08); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,6,8,.05) 35%, rgba(5,6,8,.55) 68%, rgba(5,6,8,.92)); z-index: 1; }
.hero-panel::after, .feature::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) 0%, rgba(255,255,255,.16), transparent 55%); opacity: 0; transition: opacity .3s; }
.hero-panel:hover::after, .feature:hover::after { opacity: 1; }
.hero-copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 18px; display: flex; flex-direction: column; gap: 7px; }
.hero-copy > small { text-transform: uppercase; letter-spacing: .16em; font-size: .64rem; font-weight: 800; color: rgba(255,255,255,.78); }
.hero-copy > b { font-size: clamp(1.7rem, 4vw, 2.35rem); line-height: 1; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: rgba(255,255,255,.82); }
.hero-bar, .journey-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.hero-bar i, .journey-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 1s var(--ease); }
.journey-bar { background: var(--panel-2); margin: 10px 0; }
.hero-copy em { font-style: normal; font-weight: 700; font-size: .86rem; color: var(--gold-2); }
.tilt { transform-style: preserve-3d; will-change: transform; }

/* quest */
.quest { border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.quest h3 { font-family: var(--display); font-size: 1.45rem; margin: 0; }
.quest-score { font-family: var(--display); font-size: 2rem; color: var(--gold-2); }
.quest-list { display: grid; gap: 8px; margin-top: 12px; }
.quest-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); transition: transform .2s var(--ease), border-color .2s; }
.quest-item:hover { transform: translateX(3px); border-color: var(--gold); }
.quest-item b, .quest-item small { display: block; }
.quest-item small { color: var(--muted); font-size: .8rem; }
.quest-item em { font-style: normal; font-size: .8rem; font-weight: 800; color: var(--gold-2); white-space: nowrap; }
.quest-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--gold) 16%, var(--bg)); color: var(--gold-2); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-weight: 900; }
.quest-item.done { opacity: .68; }
.quest-item.done .quest-icon { background: var(--ok); color: #04130c; border-color: var(--ok); }

/* subject + feature cards */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.feature { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--panel); border: 1px solid rgba(255,255,255,.09); color: var(--text); box-shadow: 0 16px 34px rgba(0,0,0,.25); }
.feature-media { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.07); transition: transform .8s var(--ease); }
.feature:hover .feature-media img { transform: scale(1.13); }
.feature-body { display: flex; flex-direction: column; gap: 3px; padding: 14px; }
.feature-body small { text-transform: uppercase; letter-spacing: .16em; font-size: .63rem; font-weight: 800; color: var(--gold-2); }
.feature-body b { font-family: var(--display); font-size: 1.22rem; }
.feature-body span { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.feature-body em { font-style: normal; margin-top: 7px; font-weight: 800; font-size: .82rem; color: var(--gold-2); }
.track { padding: 0; overflow: hidden; }
.track-media { position: relative; display: block; aspect-ratio: 16/6.5; overflow: hidden; color: #fff; }
.track-media img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.07); }
.track-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(5,6,8,.86)); }
.track-media-copy { position: absolute; z-index: 1; left: 16px; bottom: 12px; display: flex; flex-direction: column; }
.track-media-copy small { text-transform: uppercase; letter-spacing: .18em; font-size: .62rem; font-weight: 800; color: rgba(255,255,255,.75); }
.track-media-copy b { font-family: var(--display); font-size: 1.35rem; }
.track-body { padding: 16px; }
.manifesto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.manifesto-grid b { color: var(--gold-2); font-size: .84rem; }
.manifesto-grid p { color: var(--muted); font-size: .84rem; margin: .25em 0 0; }

/* track hero + journey */
.track-hero { position: relative; min-height: 230px; border-radius: 24px; overflow: hidden; margin: 0 0 14px; border: 1px solid rgba(255,255,255,.12); isolation: isolate; box-shadow: 0 22px 46px rgba(0,0,0,.34); }
.track-hero.mini { min-height: 190px; }
.track-hero-copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 20px; color: #fff; display: block; }
.track-hero-copy small { text-transform: uppercase; letter-spacing: .18em; font-size: .64rem; font-weight: 800; color: rgba(255,255,255,.76); }
.track-hero-copy h1 { font-size: clamp(2rem, 7vw, 3.2rem); margin: 2px 0 4px; }
.track-hero-copy p { margin: 0; color: rgba(255,255,255,.82); font-size: .9rem; }
.journey { display: flex; align-items: flex-start; margin: 4px 0 18px; padding: 4px 2px; overflow-x: auto; scrollbar-width: none; }
.journey::-webkit-scrollbar { display: none; }
.jnode { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; text-align: center; color: var(--muted); }
.jdot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--jc); color: var(--text); font-weight: 900; font-size: .78rem; box-shadow: 0 8px 20px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.jnode:hover .jdot { transform: translateY(-3px) scale(1.05); }
.jnode.done .jdot { background: var(--jc); color: #0b0f0d; }
.jnode.current .jdot { animation: nodePulse 2s infinite; }
.jnode.locked { opacity: .42; }
@keyframes nodePulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--jc) 45%, transparent); } 50% { box-shadow: 0 0 0 9px transparent; } }
.jlabel b, .jlabel small { display: block; }
.jlabel b { font-size: .78rem; color: var(--text); }
.jlabel small { font-size: .64rem; line-height: 1.25; max-width: 86px; }
.jlink { flex: 1; min-width: 18px; height: 2px; margin-top: 24px; background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--gold) 45%, var(--line)), var(--line)); }
.current-sec { border-color: color-mix(in srgb, var(--gold) 42%, var(--line)); }
.mods li > a { transition: transform .2s var(--ease), border-color .2s, background .2s; }
.mods li > a:hover { transform: translateX(4px); }

/* drill theatre */
.drill { perspective: 1200px; }
.flash { position: relative; overflow: hidden; min-height: 250px; border-radius: 22px; background: radial-gradient(520px circle at var(--mx, 50%) -80px, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%), linear-gradient(165deg, rgba(255,255,255,.045), transparent 45%), var(--panel); transition: transform .25s var(--ease), border-color .3s; touch-action: pan-y; }
.flash::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.055) 48%, transparent 62%); transform: translateX(-70%); transition: transform .7s var(--ease); }
.flash:hover::before { transform: translateX(70%); }
.flash.swipe-r { transform: translateX(18px) rotate(1deg) !important; border-color: var(--ok); }
.flash.swipe-l { transform: translateX(-18px) rotate(-1deg) !important; border-color: var(--bad); }
.flash .front p { font-family: var(--display); font-size: clamp(1.45rem, 5vw, 2rem); }
.grades .btn { transition: transform .18s var(--ease), box-shadow .2s; }
.grades .btn:hover { transform: translateY(-3px); }

/* floating dock */
.tabbar { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: rgba(13,14,18,.82); box-shadow: 0 18px 42px rgba(0,0,0,.5); padding: 7px; }
.tabbar a { border-radius: 15px; font-size: 1.05rem; transition: background .2s, color .2s, transform .2s var(--ease); }
.tabbar a i { font-style: normal; line-height: 1; }
.tabbar a:hover { transform: translateY(-2px); }
.tabbar a.active { background: color-mix(in srgb, var(--gold) 17%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 38%, transparent); }
.modal-box { border-radius: 24px; background: linear-gradient(170deg, rgba(255,255,255,.05), transparent), var(--panel); }

@media (max-width: 640px) {
  .diptych, .features { grid-template-columns: 1fr; }
  .hero-panel { min-height: 270px; }
  .manifesto-grid { grid-template-columns: 1fr 1fr; }
  .track-media { aspect-ratio: 16/8; }
  .tabbar a span { font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ TALK: SCENE GALLERY ============ */
.talk-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.talk-status .chips { margin: 0; }
.talk-status .chip { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.09); color: var(--muted); padding: 6px 11px; border-radius: 99px; font-size: .74rem; font-weight: 600; }
.talk-status .chip.ok { color: #8ff0bd; border-color: rgba(62,207,142,.28); background: rgba(62,207,142,.07); }
.talk-status .chip.warn { color: #ffcf8a; border-color: rgba(255,170,60,.3); background: rgba(255,170,60,.07); }
.headphones { margin-left: auto; font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.scene-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 6px 2px 14px; }
.scene-head h2 { font-family: var(--display); font-size: clamp(1.55rem, 4.5vw, 2.1rem); font-weight: 600; margin: 0; }
.scene-count { flex: none; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 5px; }
.scene-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px 8px; scrollbar-width: none; }
.scene-filters::-webkit-scrollbar { display: none; }
.scene-filters button { flex: none; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.025); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 650; padding: 9px 14px; border-radius: 99px; cursor: pointer; transition: all .22s var(--ease); }
.scene-filters button:hover { color: var(--text); border-color: rgba(255,255,255,.24); transform: translateY(-1px); }
.scene-filters button.on { background: var(--text); border-color: var(--text); color: #0b0d10; box-shadow: 0 8px 22px rgba(255,255,255,.12); }
.scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scene-card { position: relative; display: flex; flex-direction: column; min-height: 178px; padding: 18px; border-radius: 22px; overflow: hidden; color: var(--text); background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.012) 48%), var(--panel); border: 1px solid rgba(255,255,255,.085); box-shadow: 0 14px 30px rgba(0,0,0,.2); transition: transform .28s var(--ease), border-color .25s, box-shadow .28s var(--ease), background .25s; }
.scene-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent); }
.scene-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 42%, rgba(255,255,255,.12)); box-shadow: 0 22px 42px rgba(0,0,0,.32); text-decoration: none; }
.scene-card:active { transform: translateY(-1px) scale(.99); }
.scene-card.featured { grid-column: span 2; min-height: 190px; background: linear-gradient(105deg, rgba(8,20,14,.92) 0%, rgba(8,20,14,.68) 52%, rgba(8,20,14,.18)), url('../assets/pt-hero.jpg') center 42% / cover; border-color: rgba(97, 231, 173, .3); }
.scene-card.featured .scene-goal { max-width: 520px; color: rgba(255,255,255,.76); }
.scene-card.featured b { color: #fff; }
.scene-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.scene-medal { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; font-size: 1.35rem; background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.035)); border: 1px solid rgba(255,255,255,.11); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 8px 18px rgba(0,0,0,.18); }
.scene-level { font-size: .68rem; font-weight: 900; letter-spacing: .1em; padding: 5px 8px; border-radius: 99px; color: var(--lc); background: color-mix(in srgb, var(--lc) 16%, rgba(7,9,11,.88)); border: 1px solid color-mix(in srgb, var(--lc) 42%, transparent); backdrop-filter: blur(8px); }
.scene-card > b { font-family: var(--display); font-size: 1.28rem; line-height: 1.12; font-weight: 650; letter-spacing: -.01em; margin-bottom: 7px; }
.scene-goal { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.scene-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; font-size: .76rem; color: var(--muted); }
.scene-foot em { display: inline-flex; align-items: center; gap: 6px; font-style: normal; font-weight: 800; color: var(--gold-2); white-space: nowrap; }
.scene-foot em i { font-style: normal; transition: transform .22s var(--ease); }
.scene-card:hover .scene-foot em i { transform: translateX(3px); }
.scene-card.started { border-color: color-mix(in srgb, var(--gold) 48%, rgba(255,255,255,.1)); }
.scene-card.started .scene-foot > span { color: var(--gold-2); font-weight: 700; }
@media (max-width: 640px) {
  .scene-grid { grid-template-columns: 1fr; }
  .scene-card, .scene-card.featured { grid-column: auto; min-height: 0; }
  .scene-head { align-items: start; flex-direction: column; gap: 4px; }
  .headphones { margin-left: 0; width: 100%; }
}

/* ============ MODERN TYPE SYSTEM ============ */
body, input, textarea, select, button { font-family: var(--sans); }
h1, h2, h3, .hero-panel b, .track-hero h1, .scene-card > b, .scene-body b, .quest h3, .feature-body b {
  font-family: var(--display);
  letter-spacing: -0.032em;
}
h1 { font-weight: 800; }
h2, h3 { font-weight: 750; }
.btn, .pill, .tabbar, .seg button, .scene-filters button { font-family: var(--display); }
.masthead h1 { letter-spacing: -0.048em; font-weight: 800; }
.masthead h1 span { font-style: normal; }
.brand { font-family: var(--display); letter-spacing: -0.02em; }
.brand em { font-style: normal; }
.kicker { font-family: var(--display); }
.flash .front p { font-family: var(--display); letter-spacing: -0.025em; }

/* ============ PHOTO SCENE CARDS ============ */
.scene-card { padding: 0; min-height: 0; }
.scene-card.featured { grid-column: span 2; min-height: 0; display: grid; grid-template-columns: 1.12fr 1fr; background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.012) 48%), var(--panel); border-color: rgba(255,255,255,.1); }
.scene-card.featured .scene-goal { color: var(--muted); }
.scene-card.featured b { color: var(--text); }
.scene-photo { position: relative; display: block; aspect-ratio: 16 / 8.6; overflow: hidden; background: var(--panel-2); }
.scene-card.featured .scene-photo { aspect-ratio: auto; min-height: 218px; height: 100%; }
.scene-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.02); transition: transform .8s var(--ease), filter .5s; }
.scene-card:hover .scene-photo img { transform: scale(1.08); filter: saturate(1.06); }
.scene-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,6,8,.12), transparent 42%, rgba(5,6,8,.18)); pointer-events: none; }
.scene-photo .scene-level { position: absolute; z-index: 1; top: 12px; right: 12px; }
.scene-progress { position: absolute; z-index: 1; left: 12px; top: 12px; font-family: var(--display); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #0b0f0d; background: var(--gold-2); padding: 6px 9px; border-radius: 99px; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.scene-body { display: flex; flex-direction: column; flex: 1; padding: 17px 18px 18px; }
.scene-body b { font-size: 1.24rem; line-height: 1.1; font-weight: 750; margin-bottom: 7px; }
.scene-card.featured .scene-body { justify-content: center; padding: 24px; }
.scene-card.featured .scene-body b { font-size: clamp(1.55rem, 3.6vw, 2.15rem); }
.scene-hero { position: relative; min-height: 196px; border-radius: 24px; overflow: hidden; margin: 0 0 14px; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 22px 46px rgba(0,0,0,.34); isolation: isolate; }
.scene-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,6,8,.08) 25%, rgba(5,6,8,.88)); }
.scene-hero-copy { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 20px; color: #fff; }
.scene-hero-copy small { font-family: var(--display); text-transform: uppercase; letter-spacing: .17em; font-size: .62rem; font-weight: 800; color: rgba(255,255,255,.76); }
.scene-hero-copy h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 3px 0 5px; }
.scene-hero-copy p { margin: 0; color: rgba(255,255,255,.84); font-size: .9rem; max-width: 560px; }
.talk .msg { border-radius: 18px; padding: 12px 14px; box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.talk .msg.user { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 28%, var(--panel-2)), var(--panel-2)); border-color: color-mix(in srgb, var(--gold) 40%, transparent); border-bottom-right-radius: 6px; }
.talk .msg.assistant { border-bottom-left-radius: 6px; }
@media (max-width: 640px) {
  .scene-card.featured { grid-column: auto; display: flex; }
  .scene-card.featured .scene-photo { aspect-ratio: 16 / 8.6; min-height: 0; height: auto; }
}

@media (min-width: 760px) {
  .tabbar { max-width: 720px; margin: 0 auto; }
}

/* ---------- Direct videos + My Game ---------- */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.video-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.1); color: var(--text); text-decoration: none; transition: transform .25s var(--ease, ease), border-color .25s; }
.video-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.video-thumb { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.video-play::before { content: ''; position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(200,30,30,.92); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.video-play { text-shadow: 0 1px 4px rgba(0,0,0,.6); z-index: 1; }
.video-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.video-body b { font-family: var(--display); font-size: 1rem; line-height: 1.3; }
.video-body small { color: var(--gold-2); font-weight: 700; letter-spacing: .04em; }
.video-body span { color: var(--muted); font-size: .83rem; line-height: 1.45; }
.game-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 4px; padding: 18px 20px; border-radius: 20px; color: #14100a; text-decoration: none; background: linear-gradient(120deg, #f7c948, #f2a631 55%, #e8890c); box-shadow: 0 16px 34px rgba(242,166,49,.22); }
.game-banner small { display: block; text-transform: uppercase; letter-spacing: .16em; font-size: .63rem; font-weight: 800; opacity: .75; }
.game-banner b { display: block; font-family: var(--display); font-size: 1.3rem; margin: 2px 0; }
.game-banner span span { display: block; font-size: .85rem; line-height: 1.45; opacity: .85; max-width: 560px; }
.game-banner em { font-style: normal; font-weight: 800; white-space: nowrap; background: rgba(0,0,0,.78); color: #ffd97a; padding: 10px 14px; border-radius: 999px; font-size: .85rem; }
.game-hero { position: relative; overflow: hidden; border-radius: 24px; min-height: 240px; display: flex; align-items: flex-end; margin-bottom: 14px; border: 1px solid rgba(255,255,255,.1); }
.game-hero .hero-media { position: absolute; inset: 0; }
.game-hero .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.game-hero .track-hero-copy { position: relative; z-index: 2; padding: 22px; }
.quiz-q { margin: 16px 0; }
.quiz-q > b { display: block; margin-bottom: 8px; font-family: var(--display); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: var(--text); cursor: pointer; font: inherit; font-size: .86rem; font-weight: 600; transition: all .2s; }
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--gold); border-color: var(--gold); color: #14100a; }
.arch-result { margin-top: 20px; padding: 18px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 12%, transparent), transparent 60%); }
.arch-tag { color: var(--gold-2); font-weight: 700; margin-top: -6px; }
.arch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.arch-grid div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.045); }
.arch-grid small { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; color: var(--muted); font-weight: 800; margin-bottom: 4px; }
.arch-avoid { color: var(--muted); }
.arch-warn { padding: 12px 14px; border-radius: 12px; background: rgba(255,93,93,.12); border: 1px solid rgba(255,93,93,.35); }
.pos-row { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 12px; align-items: end; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.07); }
.pos-head b { display: block; font-family: var(--display); }
.pos-head small { color: var(--muted); }
.pos-row label { display: flex; flex-direction: column; gap: 5px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pos-row select { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: var(--panel-2, #1a1a22); color: var(--text); font: inherit; font-size: .9rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.flow { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 6px 0 10px; }
.flow-node { flex: 1 0 128px; padding: 13px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); }
.flow-node small { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .6rem; color: var(--gold-2); font-weight: 800; margin-bottom: 5px; }
.flow-node b { display: block; font-size: .88rem; line-height: 1.35; }
.flow-node span { display: block; margin-top: 7px; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.flow-arrow { align-self: center; color: var(--gold-2); font-weight: 800; }
.flow-def { margin-top: 8px; padding: 13px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.2); }
.flow-def small { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .6rem; color: var(--muted); font-weight: 800; margin-bottom: 5px; }
.flow-def span { display: block; color: var(--muted); font-size: .83rem; margin-top: 4px; }
.plan p { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.045); line-height: 1.55; }
@media (max-width: 640px) {
  .video-grid, .arch-grid { grid-template-columns: 1fr; }
  .pos-row { grid-template-columns: 1fr; gap: 8px; }
  .game-banner { flex-direction: column; align-items: flex-start; }
}
