/* ui-new.css - "Violet Coach" look for the opt-in new UI (site/new/*).
   Colours come from the logo: violet for actions, pink for streaks and wins.
   Right/wrong stay green/red and always carry an icon too (colour-blind safe).
   Every text pair passes 4.5:1; control edges (#857c9e) pass 3:1. */

:root {
  --bg: #faf8ff;
  --card: #ffffff;
  --ink: #1a0f24;
  --muted: #5c5a6e;
  --line: #857c9e;      /* control edges, 3.9:1 on white */
  --hair: #e4def5;      /* decorative dividers only */
  --primary: #6d2ee6;   /* white text 6.6:1 */
  --on-primary: #ffffff;
  --primary-ink: #4c1d95;
  --soft: #ede7ff;
  --win: #f66ca1;       /* always with dark text */
  --on-win: #1a0f24;
  --win-soft: #fde7f1;
  --win-ink: #7a1340;
  --ok-bg: #e8f5e9; --ok-ink: #1b5e20; --ok: #2e7d32;
  --no-bg: #ffebee; --no-ink: #b71c1c; --no: #c62828;
  --shadow: 0 2px 8px rgba(26, 15, 36, 0.07);
  --shadow-lg: 0 4px 14px rgba(26, 15, 36, 0.08);
  --radius: 16px;
  color-scheme: light;
}
/* Light only for now (Oct 2026): quiz, results and other pages have no dark version yet.
   The dark palette is kept for later; it applies only if <html data-theme="dark"> is set. */
:root[data-theme="dark"] {
    --bg: #1c1633; --card: #262044; --ink: #ece9ff; --muted: #b4aed0;
    --line: #9a91bd; --hair: #3a3360; --primary: #b794ff; --on-primary: #1c1633;
    --primary-ink: #d9ccff; --soft: #2e2758; --win: #ff8fbd; --on-win: #1c1633;
    --win-soft: #3d2340; --win-ink: #ffc2db;
    --ok-bg: #13361f; --ok-ink: #86efac; --no-bg: #3d1518; --no-ink: #fca5a5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.35); --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ui-new {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Poppins, "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: 16px; line-height: 1.5;
}
.ui-new a { color: var(--primary-ink); }
.ui-new a:hover { color: var(--ink); }
.ui-new :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.ui-new ::selection { background: var(--soft); color: var(--ink); }
.ui-new h1, .ui-new h2, .ui-new h3, .ui-new p { margin: 0; }
.ui-new button { font: inherit; color: inherit; }
.ui-new img { max-width: 100%; }
/* The hidden attribute always wins over component display rules (.n-link, .n-qrow, …). */
.ui-new [hidden] { display: none !important; }
/* Android app is 13+ only: no Little Ones Zone there (play-policy.js, docs/PLAY_STORE_COMPLIANCE.md). */
.a2q-app [data-kids] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.n-wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.n-stack { display: flex; flex-direction: column; gap: 24px; }
.n-row { display: flex; align-items: center; gap: 12px; }

/* header */
.n-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.n-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.n-brand img { width: 36px; height: 36px; object-fit: contain; }
.n-link { min-height: 48px; display: inline-flex; align-items: center; padding: 0 6px; font-weight: 600; font-size: 15px; text-decoration: none; background: none; border: 0; cursor: pointer; color: var(--primary-ink); }

/* type */
.n-display { font-size: clamp(28px, 7vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.n-h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.n-h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
.n-lead { font-size: 16px; color: var(--muted); max-width: 60ch; }
.n-small { font-size: 13px; color: var(--muted); }

/* buttons */
.n-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 20px; border-radius: 27px; border: 0; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; transition: transform .12s ease-out, filter .12s ease-out; }
.n-btn:active { transform: scale(.98); }
.n-btn-primary { background: var(--primary); color: var(--on-primary) !important; }
.n-btn-primary:hover { filter: brightness(1.08); }
.n-btn-ghost { min-height: 50px; background: var(--card); color: var(--ink) !important; border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; }
.n-btn-onprimary { background: var(--card); color: var(--primary-ink) !important; }
.n-btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* chips */
.n-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.n-chip { min-height: 48px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 24px; background: var(--soft); color: var(--primary-ink) !important; font-weight: 600; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; }
.n-chip:hover { filter: brightness(.97); }

/* cards */
.n-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.n-hero { background: var(--primary); color: var(--on-primary); border-radius: 22px; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.n-hero p { color: var(--on-primary); } /* full strength: 88% fell to 4.45:1 under protanopia */
.n-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; white-space: nowrap; flex: none; padding: 0 12px; border-radius: 15px; background: var(--win); color: var(--on-win); font-size: 13px; font-weight: 700; }

/* list rows */
.n-list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 16px; }
.n-list > a, .n-list > div { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 0; text-decoration: none; color: var(--ink) !important; border-bottom: 1px solid var(--hair); }
.n-list > :last-child { border-bottom: 0; }
.n-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.n-ico svg { width: 20px; height: 20px; }
.n-t { display: block; font-weight: 700; font-size: 15px; }
.n-s { display: block; font-size: 13px; color: var(--muted); }
.n-grow { flex: 1; min-width: 0; }

/* tiles */
.n-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.n-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-height: 104px; padding: 14px; border-radius: var(--radius); background: var(--soft); color: var(--ink) !important; text-decoration: none; }
.n-tile svg { width: 24px; height: 24px; color: var(--primary-ink); }
.n-tile .n-s { color: var(--primary-ink); }

/* search */
.n-search { position: relative; }
.n-search input { width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 26px; padding: 0 16px 0 48px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.n-search input::placeholder { color: var(--muted); }
.n-search > svg { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; color: var(--primary-ink); pointer-events: none; }
.n-results { position: absolute; left: 0; right: 0; top: 58px; z-index: 30; background: var(--card); border-radius: 16px; box-shadow: 0 10px 30px rgba(26, 15, 36, 0.18); max-height: 60vh; overflow: auto; padding: 6px 0; }
.n-results a { display: block; padding: 10px 16px; text-decoration: none; color: var(--ink) !important; }
.n-results a[aria-selected="true"], .n-results a:hover { background: var(--soft); }
.n-results .n-empty { padding: 12px 16px; color: var(--muted); font-size: 14px; }

/* streak week */
.n-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.n-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.n-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.n-dot.done { background: #fff; color: #6d2ee6; }
.n-dot.today { border: 2px dashed currentColor; }
.n-dot.empty { background: color-mix(in srgb, currentColor 18%, transparent); }
.n-dot svg { width: 14px; height: 14px; }

/* progress */
.n-bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.n-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* inputs row */
.n-field { display: flex; gap: 8px; }
.n-field input { flex: 1; min-width: 0; height: 50px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.n-field button { min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--soft); color: var(--primary-ink); font-weight: 700; cursor: pointer; }

/* bottom nav */
.n-tabbar { position: sticky; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--hair); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 2px 2px calc(4px + env(safe-area-inset-bottom)); }  /* 67 -> ~53px (21 Oct) */
.n-tabbar button { font: inherit; background: none; border: 0; cursor: pointer; }
.n-tabbar a, .n-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; font-size: 12px; color: var(--muted) !important; text-decoration: none; }
.n-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-tabbar [aria-current="page"] svg { fill: currentColor; fill-opacity: .15; }
.n-tabbar [aria-current="page"], .n-tabbar a[aria-current="page"] { color: var(--primary) !important; font-weight: 700; }
.n-tabbar svg { width: 20px; height: 20px; }

/* footer + switch */
.n-footer { padding: 12px 16px 16px; text-align: center; display: flex; flex-direction: column; gap: 0; align-items: center; }  /* links first, switch under them (21 Oct) */
.n-footer .n-legal { order: -1; }
.n-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 24px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink) !important; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }

/* topic picker (site/new/topics.html) */
.n-seg { display: flex; gap: 4px; padding: 4px; border-radius: 26px; background: var(--soft); overflow-x: auto; scrollbar-width: none; }
.n-seg::-webkit-scrollbar { display: none; }
.n-seg button { flex: 1 0 auto; min-height: 48px; padding: 0 14px; border: 0; border-radius: 24px; background: transparent; color: var(--primary-ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.n-seg button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.n-level { display: flex; flex-direction: column; gap: 8px; }
.n-level-label { font-size: 14px; font-weight: 600; }
.n-chiprow { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.n-chiprow.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.n-chiprow.scroll::-webkit-scrollbar { display: none; }
.n-pick { flex: none; min-height: 48px; padding: 0 16px; border-radius: 24px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; scroll-snap-align: start; }
.n-pick[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--soft); color: var(--primary-ink); font-weight: 700; }
.n-hint { padding: 14px 16px; border-radius: 14px; background: var(--soft); color: var(--primary-ink); font-size: 14px; font-weight: 600; }
.n-rows { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 16px; }
.n-rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; color: var(--ink); cursor: pointer; text-decoration: none; }
.n-rows > :last-child .n-rowbtn, .n-rows > .n-rowbtn:last-child { border-bottom: 0; }
.n-rowbtn .chev { width: 18px; height: 18px; color: var(--muted); flex: none; transition: transform .15s ease-out; }
.n-rowbtn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.ui-new a.n-play, .ui-new a.n-play:hover { color: var(--on-primary); }
.n-play { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.n-mini { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: var(--win-soft); color: var(--win-ink); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.n-sub { display: flex; flex-direction: column; padding: 0 0 8px 14px; border-bottom: 1px solid var(--hair); }
.n-sub a { display: flex; align-items: center; gap: 10px; min-height: 52px; color: var(--ink) !important; text-decoration: none; border-left: 2px solid var(--soft); padding-left: 12px; }
.n-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.n-crumbs button { min-height: 36px; padding: 0 6px; border: 0; background: none; color: var(--primary-ink); font-weight: 600; font-size: 13px; cursor: pointer; }
.n-skel { height: 64px; border-bottom: 1px solid var(--hair); display: flex; align-items: center; }
.n-skel::before { content: ""; width: 60%; height: 14px; border-radius: 7px; background: var(--soft); animation: n-pulse 1.2s ease-in-out infinite; }
@keyframes n-pulse { 50% { opacity: .45; } }

/* quiz row with a separate "more ways to play" button */
.n-qrow { display: flex; align-items: center; border-bottom: 1px solid var(--hair); }
.n-rows > .n-qrow:last-child, .n-sub > .n-qrow:last-child { border-bottom: 0; }
.n-qrow > .n-rowbtn { flex: 1; min-width: 0; border-bottom: 0; }
.n-more { flex: none; width: 44px; height: 44px; margin-left: 4px; border: 0; border-radius: 22px; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.n-more:hover { background: var(--soft); color: var(--primary-ink); }
.n-more svg { width: 20px; height: 20px; }

/* mode sheet (bottom sheet on phones, dialog on desktop) */
.n-sheet-back { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 12, 36, 0.5); display: flex; align-items: flex-end; justify-content: center; animation: n-fade .15s ease-out; }
.n-sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; box-sizing: border-box; background: var(--card); color: var(--ink); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; animation: n-rise .2s ease-out; font-family: inherit; }
.n-sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hair); align-self: center; margin-bottom: 4px; }
.n-sheet h2 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.n-mode { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.n-mode:hover { background: var(--soft); }
.n-mode.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.n-mode.primary .n-s { color: color-mix(in srgb, var(--on-primary) 85%, transparent); }
.n-mode.primary .n-ico { background: rgba(255, 255, 255, 0.18); color: var(--on-primary); }
.n-sheet .n-cancel { min-height: 48px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
@keyframes n-rise { from { transform: translateY(24px); opacity: .6; } }
@keyframes n-fade { from { opacity: 0; } }
@media (min-width: 700px) {
  .n-sheet-back { align-items: center; }
  .n-sheet { border-radius: 24px; padding-bottom: 20px; }
  .n-sheet .grab { display: none; }
}

/* ---- dashboard extras ---- */
/* festival / national-day banner (only when /fun_quiz_occasion returns one) */
.n-banner { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--win-soft); color: var(--win-ink); }
.n-banner .n-h2 { color: var(--ink); }
.n-banner .emoji { font-size: 32px; line-height: 1; }
.n-banner .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.n-banner .n-btn { width: auto; flex: 1 1 auto; min-height: 48px; font-size: 15px; }
/* Fun quiz card */
.n-fun { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.n-fun .n-field input { border-radius: 24px; }
.n-fun .n-field button { border-radius: 24px; background: var(--primary); color: var(--on-primary); min-width: 64px; }
.n-fun .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.n-fun .acts .n-btn { width: auto; flex: 1 1 140px; min-height: 48px; font-size: 15px; }
.n-chips.collapsed > .extra { display: none; }
.n-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 0; border: 0; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.n-toggle .track { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.n-toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s ease-out; }
.n-toggle[aria-checked="true"] .track { background: var(--primary); }
.n-toggle[aria-checked="true"] .track::after { left: 21px; }
.n-ac { position: relative; flex: 1; min-width: 0; display: flex; }
.n-ac input { flex: 1; }
/* horizontal quiz cards (Popular) */
.n-hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; }
.n-hscroll::-webkit-scrollbar { display: none; }
.n-qcard { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 132px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.n-qcard .n-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.n-qcard .foot { display: flex; align-items: center; gap: 6px; }
.n-qcard .foot a.n-play { text-decoration: none; }
.n-sectionhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
/* demo request form */
.n-form { display: flex; flex-direction: column; gap: 6px; }
.n-form label { font-size: 14px; font-weight: 600; margin-top: 8px; }
.n-form input, .n-form select, .n-form textarea { width: 100%; box-sizing: border-box; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.n-form textarea { min-height: 88px; resize: vertical; }
.n-form .msg { min-height: 22px; font-size: 14px; }
.n-form .msg.err { color: var(--no-ink); }
.n-form .msg.ok { color: var(--ok-ink); }
.n-form .hp { position: absolute; left: -9999px; }
.n-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; font-size: 14px; }
.n-legal a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---- tap feedback (slow networks): press state, busy spinners, top progress bar ---- */
.n-btn:active, .n-chip:active, .n-pick:active, .n-tile:active, .n-rowbtn:active, .n-mode:active,
.n-list > a:active, .n-seg button:active, .n-more:active, .n-switch:active, .n-tabbar a:active, .n-link:active {
  transform: scale(.97); transition: transform .06s ease-out;
}
.n-rowbtn:active, .n-list > a:active, .n-tile:active { background: var(--soft); }
.is-busy { pointer-events: none; cursor: progress; }
.n-spin { display: inline-block; width: 1em; height: 1em; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: n-spin .7s linear infinite; vertical-align: -.15em; }
@keyframes n-spin { to { transform: rotate(360deg); } }
/* buttons: spinner replaces the label's icon, label switches to "Opening…" (set in JS) */
.n-btn.is-busy, .n-mode.is-busy, .n-switch.is-busy { opacity: .9; }
/* rows, tiles, chips: keep the content, add a spinner at the end */
.n-rowbtn.is-busy .n-play, .n-rowbtn.is-busy .chev { visibility: hidden; }
.n-rowbtn.is-busy, .n-list > a.is-busy, .n-tile.is-busy, .n-chip.is-busy, .n-pick.is-busy, .n-sub a.is-busy, .n-tabbar a.is-busy, .n-link.is-busy { position: relative; }
.n-rowbtn.is-busy::after, .n-list > a.is-busy::after, .n-sub a.is-busy::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border: 2.5px solid var(--primary); border-right-color: transparent; border-radius: 50%; animation: n-spin .7s linear infinite;
}
.n-tile.is-busy::after { content: ""; position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; border: 2.5px solid var(--primary-ink); border-right-color: transparent; border-radius: 50%; animation: n-spin .7s linear infinite; }
.n-chip.is-busy, .n-pick.is-busy, .n-tabbar a.is-busy, .n-link.is-busy { opacity: .75; }
.n-more.is-busy svg { visibility: hidden; }
.n-more.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid var(--primary); border-right-color: transparent; border-radius: 50%; animation: n-spin .7s linear infinite; }
.n-more { position: relative; }
/* in-page loading (topic lists) */
.is-loading { opacity: .55; transition: opacity .15s ease-out .1s; pointer-events: none; }
/* top progress bar */
#nProgress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 2000; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
#nProgress.on { opacity: 1; }
#nProgress::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--primary); border-radius: 2px; animation: n-bar 1.1s ease-in-out infinite; }
@keyframes n-bar { to { left: 100%; } }
/* slow-network note */
#nSlow { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2000; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; }
@media (prefers-reduced-motion: reduce) {
  .n-spin, .is-busy::after, #nProgress::before { animation-duration: 2s !important; }
  #nProgress::before { left: 0; width: 100%; animation: none !important; opacity: .7; }
}

@media (min-width: 900px) {
  .n-wrap { max-width: 960px; }
  .n-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; align-items: start; }
  .n-split > * { min-width: 0; }
  /* desktop: same menu as a top bar, like the classic top tabs */
  body.ui-new:has(.n-tabbar) { padding-top: 56px; }
  .n-tabbar { position: fixed; top: 0; left: 0; right: 0; bottom: auto; display: flex; justify-content: center; gap: 4px; padding: 4px 16px; border-top: 0; border-bottom: 1px solid var(--hair); }
  .n-tabbar a, .n-tabbar button { flex-direction: row; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
  .n-tabbar a:hover, .n-tabbar button:hover { background: var(--soft); }
  .n-tabbar svg { width: 20px; height: 20px; }
  .n-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ui-new *:not(.n-spin) { transition: none !important; animation: none !important; }
}

/* Trimmed home: occasion line in the hero, start tiles, games row */
.n-occ { display: flex; flex-wrap: wrap; gap: 6px; }
.n-occ button, .n-occ a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: rgba(255, 255, 255, 0.16); color: var(--on-primary) !important; font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.n-occ button:hover, .n-occ a:hover { background: rgba(255, 255, 255, 0.26); }
.n-starttiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.n-starttiles .n-tile { background: var(--card); border: 1.5px solid var(--line); min-height: 72px; gap: 2px; justify-content: center; }
.n-starttiles .n-tile .n-s { color: var(--muted); }
.n-games .n-tile { flex: 0 0 136px; min-height: 112px; scroll-snap-align: start; }
.n-games .n-tile .n-s { font-size: 12px; }
@media (min-width: 900px) {
  .n-games { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .n-games .n-tile { flex: 1 1 130px; }
}

/* Quiz rows: one action (the pill), title max 2 lines, source 1 line */
.n-qrow .n-rowbtn { gap: 10px; min-height: 56px; }
.n-qrow .n-t { color: var(--ink); font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.n-qrow .n-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-qrow .n-play { min-height: 34px; padding: 0 12px; }

/* App bar (brand header): 44px on phones, scrolls away, back on scroll up */
.n-appbar { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--hair); transition: transform .2s ease-out; }
.n-appbar.n-away { transform: translateY(-100%); }
.n-appbar-in { max-width: 960px; margin: 0 auto; height: 44px;  /* was 52px (21 Oct) */ padding: 0 8px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.n-appbar .n-brand, .n-tb-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 16px; font-weight: 700; color: var(--ink) !important; text-decoration: none; -webkit-touch-callout: none; user-select: none; }
.n-appbar .n-brand img, .n-tb-brand img { width: 24px; height: 24px; object-fit: contain; }
.n-acct, .n-tb-acct { display: flex; align-items: center; }
.n-avatar { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.n-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.n-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #c62828; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.n-signin { min-height: 44px; }
.n-tb-brand, .n-tb-acct { display: none !important; }
/* greeting sits under the app bar now: a little smaller */
.n-appbar ~ .n-wrap .n-header { min-height: 0; padding-top: 14px !important; }
.n-appbar ~ .n-wrap .n-header .n-h1 { font-size: 22px; }
@media (min-width: 900px) {
  body.ui-new:has(.n-tabbar) .n-appbar { display: none; }  /* pages with the menu: brand lives in the top menu */
  .n-tabbar a.n-tb-brand { display: flex !important; margin-right: auto; padding: 0 8px; color: var(--ink) !important; font-size: 17px; font-weight: 700; }
  .n-tabbar a.n-tb-brand:hover { background: none; }
  .n-tabbar .n-tb-acct a { padding: 0; border-radius: 50%; }
  .n-tabbar .n-tb-acct a:hover { background: none; }
  .n-tabbar .n-tb-acct button { color: var(--primary-ink) !important; font-weight: 600; }
  .n-tabbar .n-tb-acct { display: flex !important; margin-left: auto; }
  .n-tabbar { justify-content: flex-start; }
}
