/* ============================================================
   Gita Guru v5 — "The Illuminated Manuscript"
   Warm parchment ground with a dawn glow and paper grain; deep
   saffron + peacock-teal jewel accents; sepia ink. Display set in
   Cormorant Garamond, scripture in Gentium Plus (complete IAST),
   UI in Alegreya Sans. Ornament is drawn, never decorated-on:
   hairline rules, a gold thread, blooming lotuses.
   ============================================================ */
@import url("fonts.css");

:root {
  /* ground & surfaces */
  --bg: #f6efe0;
  --card: #fffdf6;
  --well: #efe5cf;            /* recessed surfaces: inputs, hints */
  --line: #e2d5b9;            /* hairline borders */
  --line-strong: #d3c19c;     /* ornamental rules */

  /* ink — deep sepia, never gray */
  --ink: #2c1d12;
  --ink-dim: #6d5944;
  --ink-faint: #a28a69;

  /* saffron — the primary jewel */
  --accent: #b45309;
  --accent-deep: #873e05;
  --accent-bright: #e8841f;   /* gradient partner, large fills only */
  --accent-soft: #f8ecd7;
  --gold: #d3a04e;            /* ornamental gold thread */

  /* peacock — the secondary jewel (Kṛṣṇa's feather) */
  --peacock: #0e7280;
  --peacock-deep: #0a505a;
  --peacock-soft: #e2efee;

  /* feedback — emerald & earthen red, AA on their soft fills */
  --good: #11754f;
  --good-deep: #0b5238;
  --good-soft: #e2f2e9;
  --bad: #b3372c;
  --bad-deep: #7f241c;
  --bad-soft: #faeae5;

  /* ── Sacred Play layer: six jewel category colors ──
     `main` only for fills (white text on top); text on parchment
     always uses the `deep` variant; `soft` tints lean ivory. */
  --cat-remember: #4451c8;  --cat-remember-deep: #2f3a9e;  --cat-remember-soft: #eaecfa;
  --cat-build:    #1b7a44;  --cat-build-deep:    #115231;  --cat-build-soft:    #e4f1e6;
  --cat-listen:   #0e7280;  --cat-listen-deep:   #0a505a;  --cat-listen-soft:   #dfeeef;
  --cat-quiz:     #7635c8;  --cat-quiz-deep:     #54219c;  --cat-quiz-soft:     #f0e9fb;
  --cat-match:    #c13e6d;  --cat-match-deep:    #8f2c50;  --cat-match-soft:    #fae7ee;
  --cat-quick:    #ca4a08;  --cat-quick-deep:    #8f3306;  --cat-quick-soft:    #fcebdd;

  /* elevation — warm-ink shadows, never gray */
  --shadow: 0 1px 2px rgba(44, 29, 18, 0.05), 0 4px 14px rgba(44, 29, 18, 0.05);
  --e1: var(--shadow);
  --e2: 0 2px 4px rgba(44, 29, 18, 0.06), 0 10px 28px rgba(44, 29, 18, 0.10);
  --e3: 0 4px 10px rgba(44, 29, 18, 0.10), 0 18px 50px rgba(44, 29, 18, 0.16);

  /* radius & spacing scales */
  --r: 16px;
  --r-s: 10px; --r-m: 14px; --r-l: 18px; --r-xl: 24px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;

  /* motion tokens */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.18, 1.65, 0.45, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);
  --dur-1: 120ms; --dur-2: 240ms; --dur-3: 420ms; --dur-4: 800ms;

  --nav-h: 62px;
  --head-h: 58px;
  --serif: "Gentium Plus", Georgia, "Noto Serif", serif;
  --display: "Cormorant Garamond", "Gentium Plus", Georgia, serif;
  --sans: "Alegreya Sans", -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --round: "Baloo 2", "Segoe UI", Roboto, sans-serif;
  --deva: "Noto Sans Devanagari", "Nirmala UI", "Mangal", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  /* parchment with a saffron dawn at the crown and a whisper of peacock */
  background:
    radial-gradient(1100px 520px at 50% -190px, rgba(232, 132, 31, 0.13), transparent 62%),
    radial-gradient(900px 460px at 108% -60px, rgba(14, 114, 128, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.5;
  user-select: none;
}
/* paper grain over everything, beneath the pointer */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; z-index: 2; }
.screen {
  padding: calc(var(--head-h) + 16px) 18px calc(var(--nav-h) + 30px);
  animation: fadein 0.22s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-weight: 700; margin: 0 0 8px; }
h1 { font-size: 1.7rem; font-family: var(--display); letter-spacing: 0.005em; }
h2 { font-size: 1.08rem; letter-spacing: 0.01em; }
p { margin: 0 0 10px; }
a { color: var(--accent-deep); text-decoration: none; }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 0.84rem; }
.center { text-align: center; }
.spacer { height: 14px; }
.label {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 800; margin-bottom: 7px;
}
/* a label with the gold thread running out to the right */
.label.ruled { display: flex; align-items: center; gap: 10px; }
.label.ruled::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* ── fixed header ── */
.appheader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  max-width: 560px; margin: 0 auto; height: var(--head-h);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: rgba(246, 239, 224, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.appheader::after { /* the gold thread under the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 160, 78, 0.55), transparent);
}
.appheader .brand {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--ink);
  letter-spacing: 0.01em; min-width: 0; white-space: nowrap;
}
/* onboarding: the brand stands alone */
.appheader.bare .pill, .appheader.bare .avatarbtn { display: none; }
.bookmark { width: 23px; height: 23px; color: var(--accent); flex: 0 0 auto; }
.tilakmark { width: 17px; height: 22px; color: var(--accent); flex: 0 0 auto; align-self: center; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  padding: 5px 11px; font-size: 0.8rem; font-weight: 700; color: var(--ink-dim);
  box-shadow: var(--e1);
}
.pill b { color: var(--accent-deep); }
.pill.tappable { cursor: pointer; font-family: inherit; transition: border-color 0.15s, transform 0.1s; }
.pill.tappable:active { transform: scale(0.95); }
@media (hover: hover) { .pill.tappable:hover { border-color: var(--gold); } }

/* the avatar bubble — profile & settings live behind it */
.avatarbtn {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer; position: relative;
  background: linear-gradient(135deg, var(--av1, #b45309), var(--av2, #7c2d12));
  color: #fff; font-family: var(--sans); font-weight: 800; font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 246, 0.85), 0 0 0 1px var(--line-strong), var(--e1);
  transition: transform 0.1s, box-shadow 0.15s;
}
.avatarbtn:active { transform: scale(0.93); }
@media (hover: hover) { .avatarbtn:hover { box-shadow: inset 0 0 0 2px rgba(255, 253, 246, 0.85), 0 0 0 2px var(--gold), var(--e2); } }
.avatarbtn.xl { width: 76px; height: 76px; font-size: 2rem; flex-basis: 76px;
  box-shadow: inset 0 0 0 3px rgba(255, 253, 246, 0.9), 0 0 0 2px var(--gold), var(--e2); }

/* ── cards & buttons ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fdf9ef;
  font-weight: 700; font-size: 1rem;
  border: 0; border-radius: 13px; padding: 13px 20px;
  cursor: pointer; width: 100%;
  transition: transform 0.08s ease, opacity 0.15s;
  font-family: var(--sans);
}
.btn:active { transform: scale(0.98); opacity: 0.92; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost { background: transparent; color: var(--accent-deep); border: 1px dashed var(--line-strong); }
.btn.small { width: auto; padding: 8px 14px; font-size: 0.88rem; border-radius: 10px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btnrow { display: flex; gap: 10px; }
.btnrow .btn { flex: 1; }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  background: var(--well); color: var(--ink-dim); border: 1px solid var(--line);
}
.chip.new { color: var(--ink-faint); }
.chip.learning { color: var(--accent-deep); }
.chip.due { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 18%, #fff); }
.chip.known { color: var(--good); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 22%, #fff); }

/* the verse reference, large and tied to the text below it */
.verseref { text-align: center; margin: 2px 0 10px; }
.verseref .vnum { font-family: var(--display); font-size: 2.4rem; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; line-height: 1.1; }
.verseref .vch { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0; }
.verseref.sm { margin: 0 0 6px; }
.verseref.sm .vnum { font-size: 1.45rem; }
.verseref.sm .vch { font-size: 0.74rem; }

/* greeting block on Learn */
.greet { margin: 2px 0 12px; }
.greet h1 { font-size: 1.62rem; margin-bottom: 0; }
.greet .sub { color: var(--ink-faint); font-size: 0.92rem; }

/* ════════ the Learn hero dashboard ════════ */
.dash {
  position: relative; overflow: hidden;
  background:
    radial-gradient(420px 220px at 110% -40%, rgba(232, 132, 31, 0.16), transparent 60%),
    linear-gradient(160deg, #fffdf6, #fdf6e4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-l);
  box-shadow: var(--e2);
  padding: 18px 16px 16px;
  margin-bottom: 14px;
}
.dash::before { /* faint mandala in the corner */
  content: ""; position: absolute; right: -54px; top: -54px; width: 180px; height: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23b45309' stroke-width='0.7'%3E%3Ccircle cx='50' cy='50' r='48'/%3E%3Ccircle cx='50' cy='50' r='38'/%3E%3Ccircle cx='50' cy='50' r='22'/%3E%3Cpath d='M50 12c5 8 5 16 0 24-5-8-5-16 0-24z'/%3E%3Cpath d='M50 88c5-8 5-16 0-24-5 8-5 16 0 24z'/%3E%3Cpath d='M12 50c8-5 16-5 24 0-8 5-16 5-24 0z'/%3E%3Cpath d='M88 50c-8-5-16-5-24 0 8 5 16 5 24 0z'/%3E%3Cpath d='M23 23c9 2 15 8 17 17-9-2-15-8-17-17z'/%3E%3Cpath d='M77 77c-9-2-15-8-17-17 9 2 15 8 17 17z'/%3E%3Cpath d='M77 23c-2 9-8 15-17 17 2-9 8-15 17-17z'/%3E%3Cpath d='M23 77c2-9 8-15 17-17-2 9-8 15-17 17z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain; opacity: 0.16; pointer-events: none;
}
.dash .dtop { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.dash .dmeta { flex: 1; min-width: 0; }
.dash .dmeta .dn { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.15; color: var(--ink); }
.dash .dmeta .ds { color: var(--ink-dim); font-size: 0.9rem; margin-top: 2px; }
.dash .dmeta .dchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.dash .dmeta .dchip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.74rem; font-weight: 700; color: var(--ink-dim);
  background: rgba(255, 253, 246, 0.8); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px;
}
.dash .dactions { display: flex; gap: 8px; }
.dash .dactions .btn3d { flex: 1.6; }
.dash .dactions .btn3d.quiet { flex: 1; }
/* the progress ring */
.dring { position: relative; flex: 0 0 104px; width: 104px; height: 104px; }
.dring svg { display: block; transform: rotate(-90deg); }
.dring .dval {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.dring .dval b { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1; color: var(--accent-deep); }
.dring .dval span { font-size: 0.62rem; letter-spacing: 0.12em; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; margin-top: 3px; }
/* first-day variant: the invitation */
.dash.start { text-align: left; }
.dash.start .startrow { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dash.start .startrow .art { flex: 0 0 92px; }
.dash.start h2 { font-family: var(--display); font-size: 1.5rem; margin: 0 0 4px; }
.dash.start p { color: var(--ink-dim); margin: 0; font-size: 0.95rem; }

/* hero continue card (legacy quiet variant) */
.hero-cta { border-left: 3px solid var(--accent); }

/* compact chapter grid — two columns, always equal */
.chgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chcell {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 13px; cursor: pointer; box-shadow: var(--shadow);
  min-width: 0; transition: border-color 0.15s, transform 0.12s var(--ease-out), box-shadow 0.15s;
}
.chcell:active { border-color: var(--accent); transform: scale(0.98); }
@media (hover: hover) { .chcell:hover { border-color: var(--gold); box-shadow: var(--e2); transform: translateY(-1px); } }
.chcell .n { font-family: var(--display); font-weight: 700; color: var(--accent-deep); font-size: 1.2rem; }
.chcell .t { font-family: var(--serif); font-size: 0.88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chcell .xpbar { margin-top: 8px; }

/* ── the journey path: a winding trail of nodes ── */
.path { position: relative; padding: 14px 0 40px; }
.path::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  border-left: 2px dashed var(--line-strong); transform: translateX(-1px);
}
.pnode {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%; margin: 26px auto;
  background: var(--card); border: 2px solid var(--line-strong);
  color: var(--ink-faint); font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  cursor: pointer; box-shadow: var(--shadow);
}
.pnode.done { background: linear-gradient(160deg, var(--accent-bright), var(--accent)); border-color: var(--accent); color: #fff; }
.pnode.current { border-color: var(--accent); color: var(--accent-deep); animation: pulse 1.8s infinite; }
.pnode.locked { opacity: 0.55; }
.pnode.gate { border-radius: 16px; font-size: 1.15rem; }
.pnode.crown { width: 68px; height: 68px; font-size: 1.45rem; border-width: 3px; }
.pnode .sub {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap; font-family: var(--sans); font-weight: 700;
}
.pnode.crown .sub { top: 70px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.30); }
  50% { box-shadow: 0 0 0 12px rgba(180, 83, 9, 0); }
}

/* ════════ PLAY — the arcade hall ════════ */
.playhead { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 4px; }
.playhead h1 { margin: 0; }
.playhead .faint { font-size: 0.86rem; }

/* today's sādhana — the featured table */
.playhero {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: var(--r-l); border: 1px solid color-mix(in srgb, var(--cat-main, var(--accent)) 35%, var(--line));
  background:
    radial-gradient(360px 200px at 108% -30%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(150deg, var(--cat-main, var(--accent)), var(--cat-deep, var(--accent-deep)));
  color: #fff; padding: 16px;
  box-shadow: var(--e2);
  margin: 12px 0 16px;
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.12s var(--ease-out), box-shadow 0.15s;
}
.playhero:active { transform: scale(0.985); }
@media (hover: hover) { .playhero:hover { box-shadow: var(--e3); transform: translateY(-1px); } }
.playhero .phico {
  flex: 0 0 52px; height: 52px; border-radius: 15px;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.playhero .phico svg { width: 28px; height: 28px; fill: #fff; }
.playhero .phmid { flex: 1; min-width: 0; }
.playhero .phmid .phlabel { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.playhero .phmid b { display: block; font-family: var(--round); font-size: 1.18rem; line-height: 1.25; }
.playhero .phmid span { font-size: 0.82rem; opacity: 0.9; }
.playhero .phgo {
  flex: 0 0 auto; font-family: var(--round); font-weight: 800; font-size: 0.8rem;
  background: #fff; color: var(--cat-deep, var(--accent-deep));
  border-radius: 999px; padding: 8px 13px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.playhero .phx2 {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--round); font-weight: 800; font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.92); color: var(--accent-deep);
  padding: 2px 8px; border-radius: 999px;
}

/* game tiles — colorful, chunky, arcade */
.tilegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.gametile {
  position: relative; min-width: 0; cursor: pointer; text-align: left;
  background: var(--card);
  border: 1px solid var(--line); border-bottom: 3px solid color-mix(in srgb, var(--cat-main) 45%, var(--line));
  border-radius: var(--r-m); padding: 13px 12px 11px;
  box-shadow: var(--shadow);
  transition: transform 0.12s var(--ease-out), box-shadow 0.15s, border-color 0.15s;
  font-family: var(--sans);
}
.gametile:active { transform: scale(0.97); }
@media (hover: hover) { .gametile:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: color-mix(in srgb, var(--cat-main) 40%, var(--line)); } }
.gametile .gico {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 8px;
  background: linear-gradient(150deg, var(--cat-main), var(--cat-deep)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--cat-main) 35%, transparent);
}
.gametile .gico svg { width: 22px; height: 22px; fill: currentColor; }
.gametile b { display: block; font-size: 0.97rem; line-height: 1.2; color: var(--ink); }
.gametile span { display: block; font-size: 0.76rem; color: var(--ink-dim); line-height: 1.35; margin-top: 2px; }
.gametile .gbest {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--round); font-weight: 800; font-size: 0.68rem;
  color: var(--cat-deep); background: var(--cat-soft);
  border-radius: 999px; padding: 2px 8px;
}
.gametile .gnew {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--round); font-weight: 800; font-size: 0.66rem; letter-spacing: 0.06em;
  color: #fff; background: linear-gradient(150deg, var(--accent-bright), var(--accent));
  border-radius: 999px; padding: 2px 8px;
}

/* endless play — the always-there exit */
.endrow { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 20px 0 6px; }
.endrow .escore { font-size: 0.78rem; color: var(--ink-faint); font-weight: 700; letter-spacing: 0.04em; }
.endrow .endbtn {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink-dim); font-family: var(--sans); font-weight: 700; font-size: 0.86rem;
  padding: 9px 18px; cursor: pointer; box-shadow: var(--e1);
  display: inline-flex; align-items: center; gap: 7px;
}
.endrow .endbtn:active { transform: scale(0.97); }
@media (hover: hover) { .endrow .endbtn:hover { border-color: var(--accent); color: var(--accent-deep); } }

/* daily challenge banner (legacy quiet variant) */
.daily {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: var(--shadow);
}
.daily .sun { font-size: 1.5rem; }
.daily b { display: block; }
.daily span { font-size: 0.8rem; color: var(--ink-dim); }
.best { margin-left: auto; font-size: 0.72rem; color: var(--accent-deep); font-weight: 800; white-space: nowrap; }

/* the Cards deck: full-height vertical snap scroller */
.deck {
  height: calc(100vh - var(--head-h) - var(--nav-h) - 8px);
  overflow-y: auto; scroll-snap-type: y mandatory;
  margin: -6px -4px 0; padding: 4px;
}
.deckitem { scroll-snap-align: center; min-height: 72%; display: flex; flex-direction: column; justify-content: center; padding: 10px 2px; }
.deckitem .flashwrap { margin: 0 0 10px; }
.deckhint { text-align: center; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.06em; }

.scopebar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 4px; }
.scopechip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.86rem;
  background: var(--card); border: 1px solid var(--line-strong); color: var(--ink-dim);
  transition: all 0.15s;
}
.scopechip.on { background: var(--ink); color: #fdf9ef; border-color: var(--ink); }

/* ── screen-local top bar ── */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.topbar .back {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; box-shadow: var(--e1);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { font-size: 1.3rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .faint { margin: 0; }
.starbtn { font-size: 1.45rem; cursor: pointer; background: none; border: 0; color: #dcd0b6; transition: transform .12s, color .15s; padding: 4px; }
.starbtn.on { color: var(--accent); text-shadow: 0 0 12px rgba(232, 132, 31, 0.35); }
.starbtn:active { transform: scale(1.2); }

/* verse screen header: back · ‹ BG x.y › · star — the number is the title */
.vtop { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.vtop .back {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; box-shadow: var(--e1);
}
.vmid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; }
.vttl { text-align: center; min-width: 0; }
.vttl .vnum2 { font-family: var(--display); font-weight: 700; font-size: 1.9rem; line-height: 1.05; color: var(--ink); white-space: nowrap; }
.vttl .vstars { margin-top: 1px; }
.navarrow {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; flex: 0 0 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--line-strong); color: var(--accent-deep);
  font-size: 1.25rem; line-height: 1; box-shadow: var(--e1); padding: 0 0 2px;
  transition: border-color 0.15s, transform 0.1s;
}
.navarrow:active { transform: scale(0.92); }
@media (hover: hover) { .navarrow:hover:not(:disabled) { border-color: var(--accent); } }
.navarrow:disabled { opacity: 0.35; cursor: default; }

/* verse pager arrows — small circles living in the title row */
.vnav { display: flex; gap: 7px; align-items: center; flex: 0 0 auto; }
.vnav .navarrow {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 1.1rem; line-height: 1; box-shadow: var(--e1);
  transition: border-color 0.15s, transform 0.1s;
}
.vnav .navarrow:active { transform: scale(0.92); }
@media (hover: hover) { .vnav .navarrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); } }
.vnav .navarrow:disabled { opacity: 0.35; cursor: default; }

/* legacy pager (kept for safety; no longer rendered) */
.pager { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pager .btn { flex: 1; }
.pager .where { flex: 0 0 auto; font-size: 0.82rem; color: var(--ink-faint); font-weight: 700; }

/* ── stats ── */
.statrow { display: flex; gap: 10px; margin-bottom: 12px; }
.stat {
  flex: 1; text-align: center; padding: 13px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--e1);
}
.stat b { display: block; font-size: 1.45rem; color: var(--ink); font-family: var(--display); line-height: 1.15; }
.stat span { font-size: 0.66rem; color: var(--ink-faint); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.ringwrap { display: flex; align-items: center; gap: 16px; }
.ring svg { display: block; }
.ring .pct { font-size: 1rem; font-weight: 700; fill: var(--ink); font-family: var(--display); }
.ring .lbl { font-size: 0.48rem; fill: var(--ink-faint); letter-spacing: 0.1em; }
.xpbar { height: 6px; border-radius: 99px; background: var(--well); overflow: hidden; margin-top: 6px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); border-radius: 99px; }

/* ── rows ── */
.vrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.vrow:active { border-color: var(--accent); }
@media (hover: hover) { .vrow:hover { border-color: var(--gold); } }
.vrow .num {
  flex: 0 0 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--line);
  color: var(--accent-deep); font-weight: 700; font-size: 0.92rem; font-family: var(--display);
}
.vrow .mid { flex: 1; min-width: 0; }
.vrow .inc {
  font-family: var(--serif); font-size: 0.99rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stars { font-size: 0.74rem; letter-spacing: 1.5px; color: var(--gold); }
.stars .off { color: #e3d8bc; }

/* ── verse display ── */
.versecard { text-align: center; padding: 26px 16px; position: relative; }
.versecard::before, .versecard::after { /* manuscript rules above & below */
  content: ""; position: absolute; left: 18%; right: 18%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.versecard::before { top: 12px; }
.versecard::after { bottom: 12px; }
.uvaca { color: var(--ink-faint); font-style: italic; font-family: var(--serif); margin-bottom: 10px; font-size: 1rem; }
.deva-line { font-family: var(--deva); font-size: 1.2rem; color: var(--accent-deep); margin: 2px 0 10px; line-height: 1.9; }
.pada { font-family: var(--serif); font-size: 1.34rem; line-height: 1.8; margin: 3px 0; color: var(--ink); }
.pada .w { cursor: pointer; border-radius: 5px; padding: 1px 2px; transition: background 0.15s, color 0.15s; }
.pada .w:active, .pada .w.hl { background: var(--accent-soft); color: var(--accent-deep); }
/* a word under the pointer hints gently that it opens, like a link */
@media (hover: hover) {
  .pada .w:hover {
    color: var(--accent-deep);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
    text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  }
}
.transl { font-size: 0.99rem; color: var(--ink-dim); line-height: 1.65; font-family: var(--serif); }
.purport-toggle { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.purport-body p { font-size: 0.98rem; color: var(--ink-dim); line-height: 1.7; margin-bottom: 12px; user-select: text; font-family: var(--serif); }
.wbw { margin-top: 4px; }
.wbw-item {
  display: flex; gap: 10px; padding: 9px 4px; cursor: pointer;
  border-bottom: 1px solid var(--well); align-items: baseline;
}
.wbw-item .w { font-family: var(--serif); font-size: 1.02rem; color: var(--accent-deep); flex: 0 0 38%; }
.wbw-item .m { color: var(--ink-dim); font-size: 0.9rem; }
@media (hover: hover) {
  .wbw-item:hover .w { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
}

/* inline word-explanation panel (no popup): slides open under the verse */
.wordpanel {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 16px; margin: 10px 0 14px;
  animation: fadein 0.2s ease;
  text-align: left;
}
.wordpanel .word { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.wordpanel .gloss { color: var(--accent-deep); font-weight: 700; font-size: 0.92rem; margin: 1px 0 8px; }
.wordpanel p { font-size: 0.96rem; line-height: 1.65; color: var(--ink-dim); margin: 0 0 8px; font-family: var(--serif); }
.wordpanel .close { float: right; border: 0; background: none; color: var(--ink-faint); font-size: 1.1rem; cursor: pointer; }

/* ── sheet (kept for pickers & forms) ── */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(44, 29, 18, 0.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto; max-height: 80vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 18px 20px 30px;
  animation: sheetup 0.2s ease;
}
@keyframes sheetup { from { transform: translateY(36px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: -4px auto 14px; }
.rootword { font-family: var(--serif); font-size: 1.45rem; color: var(--ink); }
.rootline { margin: 10px 0; padding: 10px 12px; background: var(--card); border-radius: 10px; border: 1px solid var(--line); }
.rootline .k { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 2px; }
.rootline .v { font-size: 0.94rem; }
.rootnote { font-size: 0.92rem; color: var(--ink-dim); font-style: italic; line-height: 1.6; padding: 4px 2px; font-family: var(--serif); }

/* explainer sheets (streak / XP) */
.explain { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--well); }
.explain:last-child { border-bottom: 0; }
.explain .eico {
  flex: 0 0 32px; height: 32px; border-radius: 10px; margin-top: 1px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}
.explain .etxt { flex: 1; font-size: 0.92rem; color: var(--ink-dim); line-height: 1.45; }
.explain .etxt b { color: var(--ink); display: block; }

/* ── memorize / review ── */
.stagebar { display: flex; gap: 6px; margin-bottom: 14px; }
.stagebar i { flex: 1; height: 4px; border-radius: 99px; background: var(--well); }
.stagebar i.on { background: var(--accent); }
.hintword { letter-spacing: 0.02em; }
.bigprompt { font-size: 1.02rem; color: var(--ink-dim); text-align: center; margin: 12px 0; }
.gradegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 4px; font-weight: 700; font-size: 0.85rem; cursor: pointer; background: var(--card); font-family: var(--sans); }
.grade small { display: block; font-weight: 600; font-size: 0.64rem; color: var(--ink-faint); }
.grade.again { color: var(--bad); }
.grade.hard { color: var(--accent); }
.grade.good { color: var(--good); }
.grade.easy { color: var(--good-deep); }
.grade:active { transform: scale(0.97); background: var(--well); }

input.typebox {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--line-strong);
  color: var(--ink); font-size: 1.05rem; font-family: var(--serif);
  outline: none;
}
input.typebox:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.typetarget { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 10px 0; }
.typetarget .tw {
  padding: 7px 11px; border-radius: 9px; font-family: var(--serif); font-size: 1.04rem;
  background: var(--well); color: var(--ink-faint); border: 1px solid var(--line);
}
.typetarget .tw.hit { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 28%, #fff); }
.typetarget .tw.miss { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 24%, #fff); }

/* game cards: quiet rows (legacy, still used on verse screen) */
.gamelist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.gamerow {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow);
}
.gamerow:active { border-color: var(--accent); }
.gamerow .ico { flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--well); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.gamerow b { display: block; font-size: 0.95rem; }
.gamerow span { font-size: 0.78rem; color: var(--ink-dim); }

.gamegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gamecard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 14px 12px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
}
.gamecard:active { border-color: var(--accent); }
.gamecard .ico { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.gamecard b { display: block; font-size: 0.9rem; }
.gamecard span { font-size: 0.74rem; color: var(--ink-dim); }

.slotline { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; min-height: 44px; margin-bottom: 8px; }
.slot {
  min-width: 52px; padding: 9px 12px; border-radius: 10px; text-align: center;
  border: 1.5px dashed var(--line-strong); color: var(--ink-faint);
  font-family: var(--serif); font-size: 1.05rem;
}
.slot.filled { border-style: solid; border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.tiles { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 16px; }
.tile {
  padding: 10px 15px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-strong); border-bottom-width: 2.5px;
  font-family: var(--serif); font-size: 1.07rem; color: var(--ink);
  transition: transform 0.1s, opacity 0.2s, border-color 0.15s; box-shadow: var(--shadow);
}
.tile:active { transform: scale(0.95); }
.tile.used { opacity: 0; pointer-events: none; transform: scale(0.6); }
.tile.wrong { animation: shake 0.3s; border-color: var(--bad); }
.tile.letter { padding: 8px 12px; font-size: 1.12rem; min-width: 40px; }
@keyframes shake { 20% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 80% { transform: translateX(-3px); } }

.mcq { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.mcq .opt {
  padding: 12px 16px; border-radius: 13px; cursor: pointer; text-align: center;
  background: var(--card); border: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: 1.02rem; box-shadow: var(--shadow);
  transition: border-color 0.12s;
}
@media (hover: hover) { .mcq .opt:hover { border-color: var(--gold); } }
.mcq .opt.plain { font-family: var(--sans); font-size: 0.95rem; }
.mcq .opt.right { border-color: var(--good); background: var(--good-soft); }
.mcq .opt.wrongpick { border-color: var(--bad); background: var(--bad-soft); animation: shake 0.3s; }
.gapword { color: var(--accent-deep); border-bottom: 2px dashed var(--accent); padding: 0 6px; }

.pairgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.pair {
  padding: 11px 10px; border-radius: 12px; cursor: pointer; text-align: center;
  background: var(--card); border: 1px solid var(--line-strong); font-size: 0.9rem;
  min-height: 50px; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s, border-color 0.15s; box-shadow: var(--shadow);
}
.pair.sk { font-family: var(--serif); font-size: 1.03rem; color: var(--accent-deep); }
.pair.sel { border-color: var(--accent); background: var(--accent-soft); }
.pair.done { opacity: 0.25; pointer-events: none; border-color: var(--good); }
.pair.wrong { animation: shake 0.3s; border-color: var(--bad); }

.revealgrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rword {
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: 1.05rem; color: var(--ink-faint);
}
.rword.shown { color: var(--accent-deep); border-color: var(--accent); }

/* ── flashcards: 3D flip ── */
.flashwrap { perspective: 1200px; margin: 8px 0 14px; }
.flashcard {
  display: grid; width: 100%; min-height: 240px; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(.2,.7,.3,1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashface {
  grid-area: 1 / 1; backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.flashface.back { transform: rotateY(180deg); }
.flashface .ref { font-family: var(--display); font-size: 1.85rem; font-weight: 700; color: var(--accent-deep); }

/* ── word rain ── */
.rainfield { position: relative; height: 280px; border: 1px solid var(--line-strong); border-radius: var(--r); background: linear-gradient(180deg, var(--card), #fbf5e6); overflow: hidden; margin-top: 12px; box-shadow: var(--shadow); }
.raindrop {
  position: absolute; top: -52px; padding: 10px 16px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: 1.05rem; cursor: pointer; white-space: nowrap;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(340px); } }
.raindrop:active { transform: scale(0.94); }

/* ── memory flip grid ── */
.memgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; perspective: 1000px; }
.memcell { position: relative; aspect-ratio: 3/2.1; cursor: pointer; transform-style: preserve-3d; transition: transform 0.4s; }
.memcell.flipped { transform: rotateY(180deg); }
.memcell .f {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border-radius: 11px; border: 1px solid var(--line-strong); font-size: 0.8rem; padding: 4px;
}
.memcell .f.front { background: var(--well); color: var(--ink-faint); font-size: 1.1rem; font-family: var(--deva); }
.memcell .f.backside { background: var(--card); transform: rotateY(180deg); }
.memcell .f.backside.sk { font-family: var(--serif); font-size: 0.95rem; color: var(--accent-deep); }
.memcell.matched { opacity: 0.35; pointer-events: none; }

/* ── lightning round: countdown bar ── */
.countbar { height: 6px; border-radius: 99px; background: var(--well); overflow: hidden; margin: 8px 0 14px; }
.countbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; }
.bigword { font-family: var(--serif); font-size: 1.9rem; text-align: center; margin: 18px 0 4px; color: var(--ink); }

/* ── results ── */
.bigscore { text-align: center; padding: 24px 10px; }
.bigscore .glyph { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.bigscore b { font-size: 1.8rem; color: var(--ink); font-family: var(--display); }
.sparkle { animation: pop 0.45s ease; }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 70% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }

/* ── badges & calendar ── */
.badgegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badgecell { text-align: center; padding: 12px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; }
.badgecell .ico { font-size: 1.4rem; display: block; }
.badgecell b { font-size: 0.72rem; display: block; margin-top: 4px; }
.badgecell.locked { opacity: 0.32; filter: grayscale(1); }
.streakcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 8px; }
.daycell { aspect-ratio: 1; border-radius: 7px; background: var(--well); display: flex; align-items: center; justify-content: center; font-size: 0.6rem; color: var(--ink-faint); }
.daycell.lit { background: linear-gradient(160deg, var(--accent-bright), var(--accent)); color: #fff; font-weight: 700; }

/* ── settings ── */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--well); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--well); border: 1px solid var(--line-strong); transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
select, input[type="range"] { accent-color: var(--accent); }
select { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 10px; font-size: 0.9rem; max-width: 56%; font-family: var(--sans); }
input.txt, textarea.txt {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--line-strong);
  color: var(--ink); font-size: 1rem; font-family: var(--sans); outline: none;
}
textarea.txt { min-height: 90px; font-family: var(--serif); resize: vertical; }
input.txt:focus, textarea.txt:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── profile ── */
.profhead {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  background:
    radial-gradient(420px 200px at 110% -50%, rgba(232, 132, 31, 0.18), transparent 60%),
    linear-gradient(160deg, #fffdf6, #fcf3df);
  border: 1px solid var(--line-strong); border-radius: var(--r-l);
  box-shadow: var(--e2); padding: 18px 16px; margin-bottom: 12px;
}
.profhead .pmeta { flex: 1; min-width: 0; }
.profhead .pname { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; color: var(--ink); }
.profhead .puser { color: var(--ink-faint); font-size: 0.86rem; }
.profhead .plevel {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, #fff);
  color: var(--accent-deep); font-weight: 700; font-size: 0.78rem;
  border-radius: 999px; padding: 3px 10px;
}

/* ── leaderboard ── */
.lb { margin-top: 10px; }
.lbrow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 11px; margin-bottom: 4px;
  background: var(--card); border: 1px solid var(--line);
}
.lbrow.me { border-color: var(--accent); background: var(--accent-soft); }
.lbrow .medal { flex: 0 0 24px; text-align: center; }
.lbrow .lbname { flex: 1; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbrow .lbname i { color: var(--ink-faint); font-size: 0.76rem; font-style: normal; }
.lbrow .lbval { color: var(--accent-deep); white-space: nowrap; font-weight: 700; }

/* ── bottom nav ── */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 560px; margin: 0 auto; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(246, 239, 224, 0.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav::before { /* the gold thread above the nav */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 160, 78, 0.5), transparent);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-faint); font-size: 0.76rem; font-weight: 700; position: relative;
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item.active { color: var(--accent-deep); }
.nav-item .navwrap { position: relative; }
.nav-item .badge {
  position: absolute; top: -3px; right: -8px;
  background: var(--bad); color: #fff; font-size: 0.6rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-item .badge[hidden] { display: none; }

/* ── toast ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fdf9ef; font-weight: 700; font-size: 0.88rem;
  padding: 10px 18px; border-radius: 999px; z-index: 60;
  box-shadow: 0 6px 20px rgba(44, 29, 18, 0.3); white-space: nowrap;
  animation: toastin 0.22s ease;
}
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ── welcome / onboarding ── */
.welcome { min-height: calc(100vh - var(--head-h) - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; padding: 10px 4px; }
.welcome .om-big { font-family: var(--deva); font-size: 3rem; color: var(--accent); text-align: center; display: block; margin-bottom: 8px; }
.welcome h1 { text-align: center; font-size: 2rem; }
.welcome .tag { text-align: center; color: var(--ink-dim); font-family: var(--serif); font-style: italic; margin-bottom: 26px; }
.tour { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 20px; }
.tour .t { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow); }
.tour .t .ico { flex: 0 0 30px; text-align: center; font-size: 1.1rem; }

@media (min-width: 480px) {
  .pada { font-size: 1.44rem; }
}
