/* MOF Prep — app shell, built from the design-pack tokens.
   (classic.html / courses.html keep using css/style.css.) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0b0c0c;
  --bg2:      #131315;
  --card:     #1c1f21;
  --card2:    #21252a;
  --border:   rgba(255,255,255,0.13);
  --border2:  rgba(255,255,255,0.07);
  --gold:     #c8a84b;
  --gold-brt: #e8c870;
  --gold-mid: #d4b05a;
  --gold-dim: rgba(200,168,75,0.12);
  --green:    #2ea86b;
  --green-bg: rgba(0,112,60,0.18);
  --red:      #e05545;
  --red-bg:   rgba(212,53,28,0.14);
  --cyan:     #00d4d4;
  --cyan2:    #7fd8ff;
  --purple:   #b48ce8;
  --text:     #f3f2f1;
  --text2:    #b8bcc2;
  --muted:    #8d9199;
  --dim:      #5f6470;
  --grad-gold: linear-gradient(135deg, #c8a84b 0%, #e8c870 100%);
  --glow-gold: 0 6px 20px rgba(200,168,75,.4);
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.screen { min-height: 100vh; min-height: 100dvh; padding-bottom: 90px; }
.page { max-width: 560px; margin: 0 auto; padding: 18px 20px 30px; }
.page-title { font-size: 1.45rem; font-weight: 900; margin-bottom: 16px; }
.section-label {
  font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-mid); margin: 22px 0 12px;
}
.dim { color: var(--muted); }

/* ── shared bits ── */
.bar { height: 8px; background: var(--card2); border-radius: 100px; overflow: hidden; }
.bar.thin { height: 4px; }
.bar.slim { height: 5px; margin-bottom: 12px; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 100px; transition: width .35s ease; }
.bar-fill.gold { background: var(--grad-gold); }
.bar-fill.cyan { background: linear-gradient(90deg, #0aa, var(--cyan2)); }

.btn-gold {
  display: block; width: 100%; padding: 15px; border-radius: 14px;
  background: var(--grad-gold); color: #1a1506; font-weight: 800; font-size: 1rem;
  box-shadow: var(--glow-gold); text-align: center;
}
.btn-gold:active { transform: scale(.985); }
.btn-dark {
  display: block; width: 100%; padding: 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: .95rem; text-align: center;
}
.btn-dark.cyan { color: var(--cyan2); border-color: rgba(127,216,255,.35); }
.btn-dark.green { color: #6fdba4; border-color: rgba(46,168,107,.4); }
.btn-dark.red { color: #ff9c8a; border-color: rgba(224,85,69,.4); }
.btn-red {
  display: block; width: 100%; padding: 14px; border-radius: 14px;
  background: #b3341f; color: #fff; font-weight: 800; text-align: center;
}

.circle-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.ver-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  background: var(--card2); border: 1px solid var(--border); border-radius: 100px;
  padding: 3px 9px;
}
.onb-content .ver-tag { display: inline-block; margin: -6px 0 10px; }
.flag-btn { filter: grayscale(1); opacity: .5; }
.flag-btn.on { filter: none; opacity: 1; border-color: rgba(224,85,69,.6); background: rgba(224,85,69,.14); }
.flag-row {
  background: var(--card); border: 1px solid var(--border); border-bottom: none;
  padding: 11px 14px;
}
.flag-row:first-child { border-radius: 13px 13px 0 0; }
.flag-row .fr-q { font-size: .88rem; line-height: 1.4; }
.flag-row .fr-meta { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.flag-empty { font-size: .84rem; color: var(--muted); line-height: 1.5; padding: 2px 2px; }
.tiles-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 6px; text-align: center;
}
.tile span { display: block; font-size: .66rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.tile b { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.tile.gold b { color: var(--gold-brt); }
.tile.green b { color: var(--green); }
.tile.red b { color: var(--red); }

/* ── onboarding ── */
.onb {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-end;
  background: url('../assets/hero.jpg') center 30%/cover no-repeat, var(--bg);
}
.onb-content {
  width: 100%; max-width: 560px; margin: 0 auto; padding: 40px 26px calc(44px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(11,12,12,.98) 55%, rgba(11,12,12,.75) 80%, transparent 100%);
  text-align: center;
}
.onb-crest {
  width: 180px; height: auto; margin: 0 auto 14px; display: block;
  filter: drop-shadow(0 8px 30px rgba(200,168,75,.3));
}
.onb-headline { font-size: 2rem; font-weight: 900; line-height: 1.15; margin-bottom: 12px; }
.onb-headline span {
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.onb-sub { color: var(--text2); font-size: .95rem; margin-bottom: 26px; }
.onb-cta { max-width: 340px; margin: 0 auto 14px; }
.onb-small { font-size: .74rem; color: var(--dim); }

/* ── home ── */
.home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; padding-top: env(safe-area-inset-top); }
.home-greet { font-size: 1.7rem; font-weight: 900; line-height: 1.1; }
.home-sub { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.home-top-right { display: flex; align-items: center; gap: 10px; }
.offline-badge { font-size: .68rem; color: var(--gold-mid); font-weight: 700; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-dim); border: 1px solid rgba(200,168,75,.35);
  color: var(--gold-brt); padding: 8px 14px; border-radius: 100px;
  font-size: .9rem; font-weight: 800;
}
.avatar-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--border); color: var(--gold-brt);
  font-size: 1.05rem; font-weight: 800;
}

.level-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 14px;
}
.level-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.level-label { font-size: .95rem; font-weight: 800; color: var(--gold-brt); }
.level-label b { color: var(--text); }
.level-xp { font-size: .78rem; color: var(--text2); text-align: right; }

.daily-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: linear-gradient(135deg, rgba(200,168,75,.16), rgba(200,168,75,.05));
  border: 1px solid rgba(200,168,75,.45); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 14px;
}
.daily-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; font-size: 1.4rem;
  background: var(--grad-gold); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-gold);
}
.daily-body { flex: 1; min-width: 0; }
.daily-title { display: block; font-size: 1.02rem; font-weight: 800; color: var(--gold-brt); }
.daily-sub { display: block; font-size: .78rem; color: var(--text2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.daily-start {
  background: var(--grad-gold); color: #1a1506; font-weight: 800; font-size: .95rem;
  padding: 11px 22px; border-radius: 13px; box-shadow: var(--glow-gold); flex-shrink: 0;
}
.daily-card.done { border-color: var(--border); background: var(--card); }
.daily-card.done .daily-icon { background: var(--card2); box-shadow: none; }
.daily-card.done .daily-title { color: var(--text); }
.daily-card.done .daily-start { background: var(--card2); color: var(--green); box-shadow: none; }

.resume-card {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 13px 16px; margin-bottom: 20px;
}
.resume-thumb {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: var(--card2) center/cover;
}
.resume-body { flex: 1; min-width: 0; }
.resume-label {
  display: block; font-size: .66rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.resume-title {
  display: block; font-size: .98rem; font-weight: 800; color: var(--text);
  margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resume-known { font-size: .84rem; font-weight: 800; color: var(--gold-brt); flex-shrink: 0; }

.group-card {
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 17px 18px; margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 10px;
}
.group-card .g-name { font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.group-card.g-gold .g-name { color: var(--gold-mid); }
.group-card.g-cyan .g-name { color: var(--cyan2); }
.group-card.g-purple .g-name { color: var(--purple); }
.group-card .g-sub { flex: 1; font-size: .84rem; color: var(--muted); }
.group-card .g-chev { color: var(--muted); transition: transform .2s; font-size: .9rem; }
.group-card[aria-expanded="true"] .g-chev { transform: rotate(180deg); }

.group-body { margin: 2px 0 16px; }
.course-tile {
  position: relative; display: block; width: 100%; text-align: left; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--border); aspect-ratio: 16/7;
  background: var(--card2) center/cover; margin-bottom: 10px;
}
.course-tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,6,.92) 0%, rgba(8,8,6,.35) 55%, rgba(8,8,6,.1) 100%);
}
.course-tile .ct-text { position: absolute; left: 14px; right: 14px; bottom: 11px; z-index: 1; }
.course-tile .ct-name { display: block; font-size: .95rem; font-weight: 800; color: #fff; }
.course-tile .ct-sub { display: block; font-size: .72rem; color: rgba(255,255,255,.75); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 .course-tile { aspect-ratio: 4/3.1; margin-bottom: 0; }
.grid-2 .course-tile .ct-name { font-size: .8rem; }
.grid-2 .course-tile .ct-sub { font-size: .66rem; }

/* ── course detail ── */
.detail-hero {
  position: relative; height: 190px; background: var(--card2) center/cover;
  display: flex; flex-direction: column; justify-content: space-between;
}
.detail-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,12,12,1) 0%, rgba(11,12,12,.25) 55%, rgba(11,12,12,.3) 100%);
}
.detail-back { position: relative; z-index: 1; margin: calc(14px + env(safe-area-inset-top)) 0 0 18px; background: rgba(0,0,0,.45); }
.detail-hero-text { position: relative; z-index: 1; padding: 0 20px 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.detail-hero-text h1 { font-size: 1.6rem; font-weight: 900; }
.detail-hero-text p { font-size: .85rem; color: var(--text2); }

.pace-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pace-btn {
  padding: 13px 10px; border-radius: 13px; background: var(--card); border: 1px solid var(--border);
  color: var(--text2); font-weight: 700; font-size: .9rem;
}
.pace-btn.active { background: var(--gold-dim); border-color: rgba(200,168,75,.5); color: var(--gold-brt); }

.chips-label {
  font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-mid); margin: 4px 0 10px;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  padding: 9px 16px; border-radius: 100px; font-size: .84rem; font-weight: 700;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
}
.chip.on { background: var(--gold-dim); border-color: rgba(200,168,75,.55); color: var(--gold-brt); }
.chips-hint { font-size: .78rem; color: var(--muted); margin: 4px 0 6px; }

.detail-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* ── quiz / flashcards / study shared header ── */
.run-head {
  display: flex; align-items: center; gap: 12px;
  max-width: 560px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
}
.run-title { flex: 1; text-align: center; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-mid); }
.run-title.cyan { color: var(--cyan2); }
.run-title-block { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.run-title-block .run-title { flex: none; }
.run-subtitle { font-size: .72rem; color: var(--muted); }
.run-head-spacer { width: 40px; flex-shrink: 0; }
.run-meta { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--text2); margin-bottom: 14px; }
.run-meta b { color: var(--text); }
.xp-pill {
  background: var(--gold-dim); border: 1px solid rgba(200,168,75,.35); color: var(--gold-brt);
  padding: 5px 12px; border-radius: 100px; font-size: .78rem; font-weight: 800;
}
.xp-pill b { color: var(--gold-brt); }

/* ── quiz ── */
.q-card {
  background: var(--card); border: 1px solid var(--border); border-top: 2px solid var(--gold);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.q-topic {
  display: inline-block; background: var(--gold-dim); border: 1px solid rgba(200,168,75,.4);
  color: var(--gold-mid); font-size: .66rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 100px; margin-bottom: 10px;
}
.q-text { font-size: 1.15rem; font-weight: 800; line-height: 1.4; }
.q-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 16px; font-size: .97rem; color: var(--text); transition: opacity .2s;
}
.q-opt .key {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; font-size: .78rem; font-weight: 800;
  border: 1px solid var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.q-opt.correct { background: var(--green-bg); border-color: var(--green); }
.q-opt.correct .key { background: var(--green); border-color: var(--green); color: #fff; }
.q-opt.wrong { background: var(--red-bg); border-color: var(--red); animation: shake .3s ease; }
.q-opt.wrong .key { background: var(--red); border-color: var(--red); color: #fff; }
.q-opt.faded { opacity: .45; }
@keyframes shake { 0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.q-expl {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 12px; padding: 13px 15px; font-size: .88rem; color: var(--text2);
  margin-bottom: 14px; line-height: 1.55;
}
.q-expl b { color: var(--text); }

/* ── results ── */
.results-page { display: flex; align-items: center; min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); }
.results-card {
  width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 30px 24px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.results-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.results-score { font-size: 3rem; font-weight: 900; color: var(--gold-brt); line-height: 1.1; }
.results-label { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 6px; }
.results-xp { font-size: .95rem; font-weight: 800; color: var(--gold-brt); margin-bottom: 4px; }
.results-card .tiles-3 { margin: 18px 0; }
.results-card .btn-gold { margin-bottom: 10px; }

/* ── flashcards ── */
.fc-stage { perspective: 1200px; margin-bottom: 14px; }
.flashcard {
  position: relative; width: 100%; min-height: 320px;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3,1.2,.4,1); cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px;
}
.fc-back { transform: rotateY(180deg); border-color: rgba(200,168,75,.4); }
.fc-tag { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fc-back .fc-tag { color: var(--gold-mid); }
.fc-text { font-size: 1.1rem; font-weight: 700; line-height: 1.5; }
.fc-hint { font-size: .72rem; color: var(--dim); }
.fc-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }

/* ── study reader ── */
.study-page { padding-bottom: 110px; }
.level-note {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--cyan);
  border-radius: 12px; padding: 14px 16px; font-size: .86rem; color: var(--text2);
  margin-bottom: 20px; white-space: pre-line; line-height: 1.6;
}
.lesson-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lesson-num {
  background: rgba(0,212,212,.14); border: 1px solid rgba(0,212,212,.45); color: var(--cyan);
  font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; flex-shrink: 0;
}
.lesson-num.main { background: var(--gold-dim); border-color: rgba(200,168,75,.45); color: var(--gold-brt); }
.lesson-title { font-size: 1.3rem; font-weight: 900; line-height: 1.25; }
.sb-p { font-size: .95rem; color: var(--text2); margin-bottom: 14px; }
.sb-list { margin: 0 0 14px 4px; list-style: none; }
.sb-list li { position: relative; padding-left: 18px; font-size: .95rem; color: var(--text2); margin-bottom: 8px; }
.sb-list li::before { content: '·'; position: absolute; left: 4px; color: var(--gold-mid); font-weight: 900; }
.sb-key {
  background: var(--gold-dim); border: 1px solid rgba(200,168,75,.3); border-radius: 12px;
  padding: 13px 15px; font-size: .9rem; color: var(--text); margin-bottom: 14px; line-height: 1.55;
}
.sb-key::before { content: '★ Key point'; display: block; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-mid); margin-bottom: 5px; }
.sb-how {
  background: rgba(0,212,212,.07); border: 1px solid rgba(0,212,212,.25); border-radius: 12px;
  padding: 13px 15px; font-size: .9rem; color: var(--text2); margin-bottom: 14px; line-height: 1.55;
}
.sb-how::before { content: '🛠 How'; display: block; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan2); margin-bottom: 5px; }
.sb-example { border-radius: 12px; padding: 13px 15px; font-size: .9rem; margin-bottom: 14px; line-height: 1.55; }
.sb-example.good { background: var(--green-bg); border: 1px solid rgba(46,168,107,.35); color: var(--text2); }
.sb-example.bad { background: var(--red-bg); border: 1px solid rgba(224,85,69,.35); color: var(--text2); }
.sb-example .ex-tag {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 7px;
}
.sb-example.good .ex-tag { background: rgba(46,168,107,.25); color: #6fdba4; }
.sb-example.bad .ex-tag { background: rgba(224,85,69,.25); color: #ff9c8a; }
.sb-code {
  background: #0d0f11; border: 1px solid var(--border2); border-radius: 12px;
  padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; color: #c9d1d9; margin-bottom: 14px; overflow-x: auto;
  white-space: pre; line-height: 1.6;
}
.study-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(11,12,12,.97); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  max-width: 100%; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
.study-footer .btn-dark, .study-footer .btn-gold { padding: 13px; }
@media (min-width: 600px) { .study-footer { padding-left: calc(50% - 260px); padding-right: calc(50% - 260px); } }

/* ── stats ── */
.streak-hero { text-align: center; padding: 14px 0 4px; }
.streak-flame { font-size: 3.2rem; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 16px rgba(224,85,69,.4)); }
.streak-days { font-size: 1.35rem; font-weight: 900; }
.risk-banner {
  margin: 14px auto 0; max-width: 420px; background: var(--red-bg);
  border: 1px solid rgba(224,85,69,.4); color: #ff9c8a; border-radius: 12px;
  padding: 11px 14px; font-size: .84rem; font-weight: 600;
}
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { margin: 6px 0 8px; font-size: .68rem; color: var(--muted); text-align: center; font-weight: 800; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--card); border: 1px solid var(--border2);
  font-size: .82rem; color: var(--dim);
}
.cal-day.pad { background: none; border: none; }
.cal-day.kept { background: rgba(224,85,69,.12); border-color: rgba(224,85,69,.3); }
.cal-day.today { box-shadow: 0 0 0 2px var(--gold-mid) inset; color: var(--text); font-weight: 800; }

/* ── profile ── */
.prof-head { display: flex; align-items: center; justify-content: space-between; }
.prof-head .page-title { margin-bottom: 0; }
.prof-identity { text-align: center; padding: 20px 0 4px; }
.prof-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--card2); border: 2px solid rgba(200,168,75,.45); color: var(--gold-brt);
  font-size: 1.9rem; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-gold);
}
.prof-name { font-size: 1.3rem; font-weight: 900; }
.prof-meta { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 8px; text-align: center;
}
.badge-tile .b-icon { font-size: 1.8rem; margin-bottom: 8px; }
.badge-tile .b-name { font-size: .74rem; font-weight: 800; margin-bottom: 3px; }
.badge-tile .b-desc { font-size: .63rem; color: var(--muted); line-height: 1.35; }
.badge-tile.locked { opacity: .45; }
.badge-tile.locked .b-icon { filter: grayscale(1); }

/* ── settings ── */
.set-group { margin-bottom: 22px; }
.set-title {
  font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; padding-left: 2px;
}
.profile-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.profile-chip {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px; border-radius: 14px; font-size: .8rem; font-weight: 800;
  background: var(--card); border: 1px solid var(--border); color: var(--text2); text-align: center;
}
.profile-chip .pc-avatar {
  width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; font-weight: 800;
  background: var(--card2); border: 1px solid var(--border); color: var(--gold-brt);
  display: flex; align-items: center; justify-content: center;
}
.profile-chip.active { border-color: rgba(200,168,75,.6); background: var(--gold-dim); color: var(--gold-brt); }
.profile-chip.active .pc-avatar { background: var(--grad-gold); border-color: transparent; color: #1a1506; box-shadow: var(--glow-gold); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 14px 16px; font-size: .92rem; font-weight: 600; text-align: left;
}
.set-group .set-row:first-of-type { border-radius: 13px 13px 0 0; }
.set-group .set-row:last-of-type { border-radius: 0 0 13px 13px; }
.set-group .set-row:only-of-type { border-radius: 13px; }
.set-row + .set-row { border-top: none; }
.set-row.danger { color: #ff8a75; }
.set-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 100px;
  background: var(--card2); border: 1px solid var(--border); position: relative; cursor: pointer;
  flex-shrink: 0; transition: background .18s;
}
.set-row input[type="checkbox"]::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text2); transition: transform .18s, background .18s;
}
.set-row input[type="checkbox"]:checked { background: var(--gold-dim); border-color: rgba(200,168,75,.5); }
.set-row input[type="checkbox"]:checked::before { transform: translateX(18px); background: var(--gold-brt); }
.reset-confirm {
  background: var(--red-bg); border: 1px solid rgba(224,85,69,.4); border-radius: 13px;
  padding: 16px; margin-top: 8px;
}
.reset-confirm.soft { background: var(--card); border-color: var(--border); }
.reset-confirm p { font-size: .86rem; color: var(--text2); margin-bottom: 14px; line-height: 1.5; }
.reset-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wipe-btn {
  width: 100%; border: 1px solid rgba(224,85,69,.4); color: #ff8a75; border-radius: 13px;
  padding: 14px; font-size: .9rem; font-weight: 800; margin-top: 4px;
}

/* ── tab bar ── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: rgba(13,14,14,.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .64rem; font-weight: 700; color: var(--muted); padding: 3px 4px;
}
.tab-btn .tbi { font-size: 1.25rem; filter: grayscale(1) brightness(.9); }
.tab-btn.active { color: var(--gold-brt); }
.tab-btn.active .tbi { filter: none; }
.tab-daily {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; margin: 0 6px;
  background: var(--grad-gold); border: 3px solid var(--bg); color: #1a1506;
  font-size: 1.45rem; box-shadow: var(--glow-gold); position: relative; top: -18px;
  display: flex; align-items: center; justify-content: center;
}
.tab-daily-label {
  position: absolute; bottom: -17px; font-size: .62rem; font-weight: 800; color: var(--gold-brt);
}

/* ── achievement modal ── */
.achv-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.74);
  display: flex; align-items: center; justify-content: center; padding: 26px;
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.achv-card {
  background: var(--card); border: 1px solid rgba(200,168,75,.4); border-radius: 22px;
  padding: 32px 26px; max-width: 330px; width: 100%; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  animation: popIn .35s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(12px) } to { opacity: 1; transform: none } }
.achv-ring {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 18px;
  background: radial-gradient(circle, rgba(200,168,75,.3) 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center;
  animation: glow 1.6s ease-in-out infinite;
}
@keyframes glow { 0%,100% { box-shadow: 0 0 0 0 rgba(200,168,75,.35) } 50% { box-shadow: 0 0 0 15px rgba(200,168,75,0) } }
.achv-badge {
  width: 78px; height: 78px; border-radius: 50%; font-size: 2.2rem;
  background: var(--grad-gold); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-gold);
}
.achv-title { font-size: 1.2rem; font-weight: 900; margin-bottom: 6px; }
.achv-desc { font-size: .86rem; color: var(--text2); margin-bottom: 22px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── v10: gentle streak copy, profile names, footer ── */
.risk-banner.gentle {
  background: rgba(46,168,107,.10); border-color: rgba(46,168,107,.35); color: #8fdcb4;
}
.name-row { margin-top: 8px; border-radius: 13px !important; padding: 8px 8px 8px 14px; }
.name-row input[type="text"] {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--text);
  font: inherit; font-size: .92rem; outline: none; padding: 6px 0;
}
.btn-dark.small { width: auto; padding: 8px 16px; font-size: .84rem; margin: 0; }
.set-note { font-size: .74rem; color: var(--muted); margin: 7px 2px 0; line-height: 1.4; }
.onb-small a, .app-foot a { color: inherit; text-decoration: underline; }
.app-foot {
  text-align: center; font-size: .72rem; color: var(--muted);
  padding: 0 20px 110px; margin-top: -70px;
}
