/* ============================================================================
   PvP Quiz — News (the quiz chronicle): the content of screen-news (#newsRoot),
   rendered by server/news-render.mjs inside the app's own shell. Everything is
   scoped under .nw — the header, fonts and tokens are the app's (styles.css).
   Every class is prefixed nw- (feed, shared) or nq- (quiz page).
   ========================================================================== */

@property --nw-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* PUNCTUATION FOR GEORGIAN HEADINGS. The app's "BPG Nino Mtavruli KA" face is
   limited to Mkhedruli + digits (styles.css explains why), so the "?" of
   "ქვიზი ერთი-ერთზე?" fell through to the system font: smaller, heavier, a
   different design. BPG carries its own punctuation; this face hands over
   only that, and only to News headings in Georgian. */
@font-face {
  font-family: "NW Mtavruli Punct";
  src: url("../fonts/bpg-nino-mtavruli.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0021, U+002C-002E, U+003A-003B, U+003F;
}
:root[lang="ka"] .nw { --font-heading: "BPG Nino Mtavruli KA", "NW Mtavruli Punct", var(--font); }

.nw {
  --bg-2: #060d22;
  --ink-2: #cbd5e1;
  --muted: #8193ab;
  --line: rgba(148, 163, 184, 0.16);
  --gold-hi: #fde68a;
  --gold-lo: #b45309;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1240px;
  --r: 18px;
  position: relative; isolation: isolate; overflow-x: clip;
  min-height: 100vh; padding-bottom: 72px;
  font-family: var(--font); line-height: 1.55; color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(251, 191, 36, 0.08), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(56, 189, 248, 0.06), transparent 60%);
}
.nw[aria-busy="true"] { opacity: .4; transition: opacity .2s; }
/* the war-room map grid behind everything */
.nw::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 100% 900px at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 100% 900px at 50% 0%, #000 0%, transparent 75%);
}
/* Resets at zero specificity (:where), so every nw-/nq- class below still
   sets its own margins over them. */
:where(.nw) *, :where(.nw) *::before, :where(.nw) *::after { box-sizing: border-box; }
:where(.nw) a { color: inherit; text-decoration: none; }
:where(.nw) img { display: block; max-width: 100%; }
:where(.nw) :is(h1, h2, h3) { margin: 0; font-weight: 800; letter-spacing: -0.01em; text-transform: none; }
:where(.nw) p { margin: 0; }
:where(.nw) :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.nw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw [hidden] { display: none !important; }
.nw .nq-rest[hidden="until-found"] { display: block !important; content-visibility: hidden; height: 0; overflow: hidden; }

/* ---------------- buttons ---------------- */
.nw-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px; border-radius: 12px; font-weight: 800; font-size: 16px; letter-spacing: .02em;
  overflow: hidden; isolation: isolate; cursor: pointer; border: 0; font-family: inherit;
  transition: transform .2s ease, box-shadow .25s ease, background .2s;
}
.nw-btn--sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.nw-btn--lg { height: 56px; padding: 0 38px; font-size: 18px; }
.nw-btn--gold {
  color: #1a1205;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #f59e0b);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, .6) inset, 0 10px 30px -10px rgba(251, 191, 36, .8);
}
.nw-btn--gold::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.nw-btn--gold:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(253, 230, 138, .8) inset, 0 16px 40px -10px rgba(251, 191, 36, .95); }
.nw-btn--gold:hover::after { transform: translateX(120%); }
.nw-btn--glass { color: #fff; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.nw-btn--glass:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }
.nw-btn--outline { color: var(--gold); background: rgba(251, 191, 36, .06); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .45); }
.nw-btn--outline:hover { background: rgba(251, 191, 36, .14); transform: translateY(-2px); }
.nw-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------------- masthead ---------------- */
.nw-mast { max-width: var(--wrap); margin: 0 auto; padding: clamp(36px, 7vw, 84px) var(--gutter) clamp(24px, 4vw, 40px); text-align: center; }
.nw-mast-eyebrow {
  display: inline-flex; align-items: center; gap: 14px; margin: 0 0 14px;
  font: 700 12px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
}
.nw-mast-eyebrow::before, .nw-mast-eyebrow::after { content: ""; width: 48px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.nw-mast-eyebrow::after { transform: scaleX(-1); }
.nw-mast-title {
  font-family: var(--font-heading); font-weight: 900;
  font-size: clamp(48px, 10vw, 128px); line-height: .95; letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff 0%, #fde68a 55%, #d97706 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 40px rgba(251, 191, 36, .25));
}
:root[lang="ka"] .nw-mast-title { letter-spacing: 0; font-size: clamp(42px, 8.5vw, 110px); }
.nw-mast-tag { margin: 16px auto 0; max-width: 560px; color: var(--ink-2); font-size: clamp(16px, 2vw, 19px); }
.nw-stats { display: flex; justify-content: center; gap: clamp(18px, 5vw, 56px); margin: 30px 0 0; padding: 0; list-style: none; }
.nw-stats li { display: flex; flex-direction: column; align-items: center; }
.nw-stats b { font: 900 clamp(24px, 3.4vw, 36px)/1 var(--font); color: #fff; font-variant-numeric: tabular-nums; }
.nw-stats li > span { margin-top: 6px; font: 600 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
/* the feed opens straight on its numbers */
.nw-mast--stats { padding-top: clamp(28px, 4.5vw, 56px); padding-bottom: clamp(22px, 3.5vw, 40px); }
.nw-mast--stats .nw-stats { margin-top: 0; gap: clamp(28px, 7vw, 96px); }
.nw-mast--stats .nw-stats b {
  font-size: clamp(34px, 5vw, 60px); letter-spacing: -.01em;
  filter: drop-shadow(0 6px 24px rgba(251, 191, 36, .25));
}
/* Gold fill per glyph: on the plain number (no JS / reduced motion), and on
   each reel digit — a text-clipped background on the parent would not reach
   text inside the moving reels. (Spans, not <i>: the app styles <i> as icons.) */
.nw-mast--stats .nw-odo:not(.is-spinning):not(.is-done),
.nw-odo-n, .nw-odo-sep {
  background: linear-gradient(180deg, #fff 0%, #fde68a 60%, #f59e0b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nw-mast--stats .nw-stats li > span { margin-top: 10px; }

/* drum digits (js/news.js drum()) */
.nw-odo { display: inline-flex; align-items: flex-start; }
.nw-odo-d { display: inline-block; height: 1em; overflow: hidden; }
.nw-odo-s { display: block; transition-property: transform; transition-timing-function: cubic-bezier(.12, .78, .22, 1.06); will-change: transform; }
.nw-odo-n { display: block; height: 1em; font: inherit; line-height: 1; text-align: center; }
.nw-odo.is-spinning .nw-odo-s { filter: blur(.5px); }
/* the curve of the drum: digits fade as they roll over the top and bottom */
.nw-odo.is-spinning .nw-odo-d {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
}
.nw-odo.is-done { animation: nw-settle .9s ease-out; }
@keyframes nw-settle {
  0% { filter: drop-shadow(0 6px 24px rgba(251, 191, 36, .25)) brightness(1); }
  30% { filter: drop-shadow(0 0 22px rgba(253, 230, 138, .9)) brightness(1.35); }
  100% { filter: drop-shadow(0 6px 24px rgba(251, 191, 36, .25)) brightness(1); }
}

.nw-mast--sub { text-align: left; padding-bottom: 12px; }
.nw-mast--sub .nw-mast-title { font-size: clamp(40px, 7vw, 84px); }
.nw-mast--sub .nw-mast-tag { margin-left: 0; }

.nw-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.nw-crumbs a:hover { color: var(--gold); }

/* ---------------- media (photo / flag mosaic / sigil) ---------------- */
.nw-media { position: relative; overflow: hidden; background: var(--tint, #0f172a); aspect-ratio: 16 / 9; }
.nw-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.nw-media--mosaic {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8%; padding: 9% 10%; place-items: center;
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--arena) 30%, transparent), transparent 70%),
    linear-gradient(160deg, #0b1430, #050a1c);
}
.nw-media--mosaic span {
  width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .12);
  transform: rotate(calc((var(--i) - 2.5) * 1.6deg)) translateY(calc(var(--i) * 1px));
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.nw-media--mosaic img { width: 100%; height: 100%; object-fit: cover; }
.nw-media--sigil {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--arena) 35%, transparent), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 14px),
    #070e24;
}
.nw-media--sigil span { font: 900 clamp(64px, 9vw, 120px)/1 var(--font-heading); color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--arena) 70%, #fff); opacity: .7; }

/* ---------------- hero (latest dispatch + quiz page head) ---------------- */
/* Ambient: the card's own picture, blurred until its compression cannot show.
   The sharp picture sits on top at no more than its native size. */
/* Tinted by the arena: the arena's colour is the light, and the blurred
   picture only lends it shape (luminosity blend keeps the picture's
   brightness and drops its hues). */
.nw-ambient {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(90% 120% at 82% 18%, color-mix(in srgb, var(--arena) 52%, #020617) 0%, transparent 70%),
    radial-gradient(70% 90% at 10% 100%, color-mix(in srgb, var(--arena) 30%, #020617) 0%, transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--arena) 22%, #020617), #020617 75%);
}
.nw-ambient img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(34px) contrast(1.15); transform: scale(1.25);
  mix-blend-mode: luminosity; opacity: .45;
  animation: nw-drift 26s ease-in-out infinite alternate;
}

.nw-hero {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: calc(var(--wrap) - 2 * var(--gutter) + 120px); margin: 0 auto; width: calc(100% - 2 * var(--gutter));
  min-height: clamp(420px, 56vh, 560px); border-radius: 28px; padding: clamp(24px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 64px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 120px -40px color-mix(in srgb, var(--arena) 55%, transparent);
}
.nw-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, .82) 0%, rgba(2, 6, 23, .4) 50%, rgba(2, 6, 23, .1) 100%);
}
.nw-hero-art {
  order: 2; position: relative; width: min(480px, 40vw); border-radius: 16px; overflow: hidden;
  transform: perspective(1400px) rotateY(-9deg) rotateZ(.6deg);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .2), 0 0 0 7px rgba(2, 6, 23, .45), 0 0 0 8px rgba(251, 191, 36, .35),
    0 50px 90px -30px #000, 0 0 90px -20px color-mix(in srgb, var(--arena) 60%, transparent);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.nw-hero:hover .nw-hero-art { transform: perspective(1400px) rotateY(-3deg) rotateZ(0deg); }
.nw-hero-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .16) 0%, transparent 32%, transparent 70%, rgba(255, 255, 255, .06) 100%);
}
.nw-hero-art .nw-media--mosaic { grid-template-columns: repeat(4, 1fr); padding: 9% 8%; gap: 7%; }
/* film grain */
.nw-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.nw-hero-in { position: relative; max-width: 640px; }
.nw-hero-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 700 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.nw-live { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); animation: nw-pulse 1.8s infinite; }
.nw-hero-title { font-family: var(--font-heading); font-size: clamp(34px, 5.6vw, 68px); line-height: 1.02; color: #fff; text-shadow: 0 4px 40px rgba(0, 0, 0, .6); }
:root[lang="ka"] .nw-hero-title { letter-spacing: 0; line-height: 1.15; }
.nw-hero-title a:hover { color: var(--gold-hi); }
.nw-hero-desc { margin: 16px 0 0; font-size: clamp(16px, 1.8vw, 19px); color: var(--ink-2); max-width: 560px; }
.nw-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.nw-hero-meta span { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }

.nw-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: color-mix(in srgb, var(--arena) 55%, #fff); }
.nw-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--arena, var(--gold)); box-shadow: 0 0 10px var(--arena, var(--gold)); }

/* ---------------- arena filter ---------------- */
/* One row, exactly as wide as the hero above it (same width rules as
   .nw-hero), scrolling sideways. The ends fade and show an arrow only while
   there is more that way (.can-prev / .can-next, js/news.js). */
.nw-filter-wrap {
  position: relative;
  max-width: calc(var(--wrap) - 2 * var(--gutter) + 120px); width: calc(100% - 2 * var(--gutter)); margin: 32px auto 0;
  --fl: 0px; --fr: 0px;
}
.nw-filter-wrap.can-prev { --fl: 72px; }
.nw-filter-wrap.can-next { --fr: 72px; }
.nw-filter {
  display: flex; gap: 8px; padding: 4px 0;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
}
.nw-filter::-webkit-scrollbar { display: none; }
.nw-filter .nw-chip { scroll-snap-align: start; }
.nw-fnav {
  position: absolute; top: 50%; z-index: 1; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%;
  display: grid; place-items: center; padding: 0 0 3px; cursor: pointer;
  font: 700 22px/1 var(--font); color: var(--gold);
  background: rgba(9, 15, 34, .92); border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: 0 6px 18px -6px #000;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.nw-fnav--prev { left: 0; }
.nw-fnav--next { right: 0; }
.nw-filter-wrap.can-prev .nw-fnav--prev, .nw-filter-wrap.can-next .nw-fnav--next { opacity: 1; pointer-events: auto; }
.nw-fnav:hover { transform: scale(1.08); background: rgba(251, 191, 36, .14); }
@media (pointer: coarse) { .nw-fnav { display: none; } }
.nw-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
  font: 600 14px/1 var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap;
  background: rgba(13, 21, 38, .85); border: 1px solid var(--line);
  transition: border-color .2s, color .2s, background .2s;
}
.nw-chip:hover { color: #fff; border-color: color-mix(in srgb, var(--arena, var(--gold)) 50%, transparent); }
.nw-chip[aria-pressed="true"] { color: #fff; border-color: var(--arena, var(--gold)); background: color-mix(in srgb, var(--arena, var(--gold)) 16%, rgba(13, 21, 38, .9)); }
.nw-empty { max-width: var(--wrap); margin: 40px auto; padding: 0 var(--gutter); color: var(--muted); text-align: center; }

/* ---------------- timeline ---------------- */
.nw-timeline { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 12px var(--gutter) 40px calc(var(--gutter) + 40px); }
.nw-timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 9px); width: 2px;
  background: linear-gradient(180deg, transparent, rgba(251, 191, 36, .7) 6%, rgba(251, 191, 36, .25) 70%, transparent);
}
.nw-group { position: relative; margin-top: 44px; }
.nw-node { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 22px; padding: 10px 0; }
.nw-node::after {
  content: ""; flex: 1 1 60px; align-self: center; height: 1px; min-width: 40px;
  background: linear-gradient(90deg, rgba(251, 191, 36, .35), transparent);
}
.nw-node-mark {
  position: absolute; left: -38px; top: 50%; width: 16px; height: 16px; margin-top: -8px; transform: rotate(45deg);
  background: var(--bg); border: 2px solid var(--gold); box-shadow: 0 0 0 4px rgba(251, 191, 36, .12), 0 0 18px rgba(251, 191, 36, .6);
}
.nw-node-mark::after { content: ""; position: absolute; inset: 3px; background: var(--gold); }
.nw-node h2 { font-family: var(--font-heading); font-size: clamp(24px, 3.2vw, 36px); color: #fff; }
:root[lang="ka"] .nw-node h2 { letter-spacing: 0; }
.nw-node-count { padding: 4px 10px; border-radius: 999px; font: 700 12px/1.2 var(--mono); letter-spacing: .08em; color: var(--gold); background: rgba(251, 191, 36, .1); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35); }

/* ---------------- cards ---------------- */
.nw-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; grid-auto-flow: dense; }
.nw-card { grid-column: span 4; position: relative; isolation: isolate; border-radius: var(--r); }
/* past a period's cap: only the arena filter shows these (news-render grid()) */
.nw-card--over { display: none; }
.nw-filtering .nw-card--over:not([hidden]) { display: block; }
.nw-filtering .nw-more { display: none; }
.nw-card--lead { grid-column: span 8; }
.nw-grid > .nw-card--lead:only-child { grid-column: 1 / -1; }
/* animated arena-coloured frame, drawn on hover */
.nw-card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: calc(var(--r) + 1px); padding: 1px;
  background: conic-gradient(from var(--nw-ang), transparent 0deg, var(--arena) 60deg, var(--gold) 120deg, transparent 180deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .3s;
}
.nw-card:hover::before { opacity: 1; animation: nw-spin 3.2s linear infinite; }
.nw-card-link {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(5, 10, 28, .96));
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -30px rgba(0, 0, 0, .9);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.nw-card:hover .nw-card-link { transform: translateY(-5px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 60px -24px color-mix(in srgb, var(--arena) 55%, transparent); }
.nw-card:hover .nw-media > img { transform: scale(1.06); }
.nw-card:hover .nw-media--mosaic span { transform: rotate(0deg) translateY(-3px); }
/* THE SEAM — the arena cards' bug, fixed the arena cards' way (styles.css,
   .qc-photo). While a card lifts and its picture zooms, the picture is its own
   compositor layer and anything over it another, each rounded to device pixels
   on its own: mid-transition they disagree by a pixel and the picture's bottom
   row flashed as a line under it. So the fade into the title is the media's
   OWN alpha (a mask, not a colour laid over it), the photo stops 6px short of
   the box (clip-path, in its own space, so it zooms with it) and the tint stops
   at the same line, and the mask is fully transparent 4px before the edge:
   nothing is left there to show. */
.nw-card:not(.nw-card--lead) .nw-media {
  -webkit-mask-image: linear-gradient(#000 52%, transparent calc(100% - 4px));
  mask-image: linear-gradient(#000 52%, transparent calc(100% - 4px));
}
.nw-card:not(.nw-card--lead) .nw-media--photo { padding-bottom: 6px; background-clip: content-box; }
.nw-media--photo > img { position: absolute; inset: 0; }
.nw-card:not(.nw-card--lead) .nw-media--photo > img { clip-path: inset(0 0 6px 0); }
.nw-card-body { position: relative; display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; margin-top: -34px; }
.nw-card-title { font-size: 20px; line-height: 1.22; color: #fff; }
.nw-card-desc { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: auto 0 0; padding-top: 16px; font: 600 12.5px/1 var(--mono); color: var(--muted); }
.nw-qcount { color: var(--ink-2); }
.nw-qcount::before { content: "◆"; margin-right: 6px; color: var(--arena); font-size: 10px; }
.nw-new {
  position: absolute; top: 14px; left: 14px; z-index: 2; padding: 5px 10px; border-radius: 8px;
  font: 800 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #1a1205;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 6px 20px -4px rgba(251, 191, 36, .8);
}
/* the lead story: sharp picture framed on its own blurred light */
.nw-card--lead .nw-card-link { position: relative; isolation: isolate; flex-direction: row; align-items: center; }
.nw-card--lead .nw-ambient { z-index: -1; }
.nw-card--lead .nw-ambient::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 30%, rgba(3, 7, 22, .6)); }
.nw-card--lead .nw-media {
  flex: 0 0 min(48%, 400px); margin: 22px 0 22px 22px; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 24px 50px -18px #000, 0 0 50px -16px color-mix(in srgb, var(--arena) 70%, transparent);
}
.nw-card--lead .nw-card-body { flex: 1 1 0; min-width: 0; align-self: stretch; justify-content: center; margin: 0; padding: 26px 28px; }
/* body face, not the display one: Mtavruli capitals are too wide for the
   text column beside the picture and split long Georgian words */
.nw-card--lead .nw-card-title { font-family: var(--font); font-size: clamp(21px, 2vw, 26px); }
.nw-card--lead .nw-card-meta { margin-top: 0; }
.nw-card--lead .nw-card-desc { color: var(--ink-2); }
.nw-card--lead .nw-new { top: 32px; left: 32px; }
.nw-card--lead .nw-card-title { font-family: var(--font-heading); font-size: clamp(26px, 3vw, 38px); line-height: 1.08; }
:root[lang="ka"] .nw-card--lead .nw-card-title { line-height: 1.2; letter-spacing: 0; }
.nw-card--lead .nw-card-desc { font-size: 16px; -webkit-line-clamp: 3; }
.nw-card--lead .nw-media--mosaic { grid-template-columns: repeat(4, 1fr); gap: 6%; padding: 8%; }
/* Georgian has no capitals to space out: tracked mono labels read as gaps */
:root[lang="ka"] .nw-mast-eyebrow, :root[lang="ka"] .nw-hero-eyebrow, :root[lang="ka"] .nw-stats li > span,
:root[lang="ka"] .nq-stats dt, :root[lang="ka"] .nw-new,
:root[lang="ka"] .nw-node-count { font-family: var(--font); letter-spacing: .04em; }

.nw-more {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 18px 22px;
  border-radius: var(--r); font-weight: 700; color: var(--gold);
  background: linear-gradient(90deg, rgba(251, 191, 36, .1), rgba(251, 191, 36, .02));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .28);
  transition: background .2s, transform .2s;
}
.nw-more:hover { background: linear-gradient(90deg, rgba(251, 191, 36, .18), rgba(251, 191, 36, .04)); transform: translateX(4px); }
.nw-more span:last-child { font-size: 22px; }

/* ---------------- quiz page ---------------- */
.nq-hero { margin-top: 24px; min-height: clamp(420px, 60vh, 600px); }
.nq-hero .nw-crumbs { color: var(--ink-2); }
.nq-hero { padding-bottom: calc(clamp(24px, 5vw, 64px) + 40px); }
.nq-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; overflow: hidden;
  max-width: calc(var(--wrap) - 2 * var(--gutter)); width: calc(100% - 2 * var(--gutter)); margin: -36px auto 0; position: relative; z-index: 2;
  border-radius: var(--r); background: var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.nq-stats > div { padding: 18px 22px; background: rgba(9, 15, 34, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nq-stats dt { font: 700 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.nq-stats dd { margin: 10px 0 0; font-weight: 700; color: #fff; min-height: 28px; display: flex; align-items: center; }
.nq-stats dd b { font-size: 28px; line-height: 1; color: var(--gold); }
.nq-mix { display: flex; width: 100%; height: 8px; gap: 3px; border-radius: 4px; overflow: hidden; }
.nq-mix i { display: block; min-width: 6px; border-radius: 2px; }
[data-d="1"], [data-d="2"] { --d: #34d399; }
[data-d="3"] { --d: #fbbf24; }
[data-d="4"] { --d: #f97316; }
[data-d="5"] { --d: #ef4444; }
.nq-mix i { background: var(--d); }

.nq-dossier { max-width: 920px; margin: 0 auto; padding: clamp(48px, 7vw, 80px) var(--gutter) 24px; }
.nq-dossier-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.nq-dossier-head h2 { font-family: var(--font-heading); font-size: clamp(30px, 4vw, 44px); color: #fff; }
:root[lang="ka"] .nq-dossier-head h2 { letter-spacing: 0; }
.nq-lock { margin: 0; font-size: 14px; color: var(--muted); }
.nq-shared { margin: 22px 0 0; font-size: 18px; font-weight: 700; color: var(--ink-2); }
.nq-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.nq-q {
  position: relative; display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 18px;
  padding: 22px 4px; border-bottom: 1px solid var(--line);
}
.nq-q::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 0; height: 1px;
  background: linear-gradient(90deg, var(--arena), var(--gold)); transition: width .5s ease;
}
.nq-q:hover::after { width: 100%; }
.nq-num { font: 900 40px/1 var(--font); color: transparent; -webkit-text-stroke: 1.2px color-mix(in srgb, var(--arena) 60%, var(--gold)); font-variant-numeric: tabular-nums; }
.nq-text { margin: 0; font-size: clamp(17px, 2vw, 20px); font-weight: 600; line-height: 1.45; color: var(--ink); }
.nq-diff { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.nq-diff i { display: block; width: 5px; border-radius: 2px; background: rgba(148, 163, 184, .22); }
.nq-diff i:nth-child(1) { height: 7px; } .nq-diff i:nth-child(2) { height: 10px; } .nq-diff i:nth-child(3) { height: 14px; } .nq-diff i:nth-child(4) { height: 18px; }
.nq-diff[data-d="2"] i:nth-child(-n+1), .nq-diff[data-d="3"] i:nth-child(-n+2),
.nq-diff[data-d="4"] i:nth-child(-n+3), .nq-diff[data-d="5"] i:nth-child(-n+4) { background: var(--d); box-shadow: 0 0 8px var(--d); }
/* flags are 160x120 and badges 256x256: tiles stay at or under that */
/* six to a row (three on phones): PREVIEW_PICS = 12 fills both exactly */
.nq-list--pics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 16px; padding-top: 24px; }
.nq-q--pic { display: block; padding: 0; border: 0; }
.nq-q--pic::after { display: none; }
.nq-q--pic .nq-num { position: absolute; top: -10px; left: -6px; z-index: 1; font-size: 28px; -webkit-text-stroke: 1px var(--gold); text-shadow: 0 2px 12px #000; }
.nq-pic { display: block; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: #0b1430; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 12px 30px -12px #000; transition: transform .3s; }
.nq-pic img { width: 100%; height: 100%; object-fit: cover; }
.nq-q--pic:hover .nq-pic { transform: translateY(-3px) scale(1.02); }
.nq-list--pics + .nq-rest .nq-list--pics { padding-top: 16px; }

.nq-more { position: relative; display: flex; justify-content: center; padding-top: 34px; }
.nq-more::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120px; pointer-events: none;
  background: linear-gradient(0deg, var(--bg-2), transparent);
}
.nq-more.is-open::before { display: none; }
.nq-list--pics + .nq-rest + .nq-more::before { height: 48px; }
.nq-rest.is-open { animation: nw-reveal .5s ease both; }

.nq-cta {
  position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; text-align: center;
  max-width: calc(var(--wrap) - 2 * var(--gutter)); width: calc(100% - 2 * var(--gutter)); margin: 64px auto 0;
  min-height: 420px; padding: 56px 24px; border-radius: 28px;
  background:
    radial-gradient(600px 300px at 50% 110%, rgba(251, 191, 36, .28), transparent 70%),
    radial-gradient(500px 400px at 0% 50%, color-mix(in srgb, var(--arena) 25%, transparent), transparent 70%),
    radial-gradient(500px 400px at 100% 50%, rgba(239, 68, 68, .2), transparent 70%),
    linear-gradient(180deg, #0a1230, #050a1c);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .25), 0 40px 100px -40px rgba(251, 191, 36, .4);
}
/* The sprites are 512x1024 with the figure inside (crown to boots ~88% of
   the height), so a sprite no taller than the panel is never cut. */
.nq-cta-l, .nq-cta-r { position: absolute; bottom: 0; height: 100%; width: auto; max-width: none; z-index: -1; opacity: .9; filter: drop-shadow(0 0 30px rgba(0, 0, 0, .8)); }
.nq-cta-l { left: 2%; }
.nq-cta-r { right: 2%; transform: scaleX(-1); }
.nq-cta-in { max-width: 520px; }
.nq-cta-vs { margin: 0 0 6px; font: 900 64px/1 var(--font); color: transparent; -webkit-text-stroke: 1.5px var(--gold); opacity: .8; letter-spacing: .06em; }
.nq-cta h2 { font-family: var(--font-heading); font-size: clamp(30px, 4.4vw, 48px); line-height: 1.1; color: #fff; }
:root[lang="ka"] .nq-cta h2 { letter-spacing: 0; line-height: 1.25; }
.nq-cta p { color: var(--ink-2); margin: 14px 0 28px; }

.nq-related { max-width: var(--wrap); margin: 0 auto; padding: 72px var(--gutter) 20px; }
.nq-related-h { font-family: var(--font-heading); font-size: clamp(24px, 3vw, 32px); margin-bottom: 22px; color: #fff; }
:root[lang="ka"] .nq-related-h { letter-spacing: 0; }
.nw-grid--row .nw-card { grid-column: span 4; }

/* ---------------- archive (foot of every page) ---------------- */
.nw-archive { max-width: var(--wrap); margin: 72px auto 0; padding: 28px var(--gutter) 0; border-top: 1px solid var(--line); }
.nw-archive h2 { font: 700 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
:root[lang="ka"] .nw-archive h2 { font-family: var(--font); letter-spacing: .04em; }
.nw-archive div { display: flex; flex-wrap: wrap; gap: 10px; }
.nw-archive a { padding: 8px 14px; border-radius: 10px; font-size: 14px; color: var(--ink-2); background: rgba(13, 21, 38, .7); box-shadow: inset 0 0 0 1px var(--line); }
.nw-archive a:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .45); }
.nw-archive a span { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-left: 4px; }

/* ---------------- motion ---------------- */
@keyframes nw-drift { from { transform: scale(1.3) translate3d(-3%, 0, 0); } to { transform: scale(1.2) translate3d(3%, -2%, 0); } }
@keyframes nw-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes nw-spin { to { --nw-ang: 360deg; } }
@keyframes nw-reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nw-card.is-in { animation: nw-reveal .6s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- club badges: medallions ----------------
   A badge is square (256x256), often with a transparent edge, so the flag
   treatment (4:3 tile, cover) cut them. Each sits WHOLE (contain) on a dark
   disc instead; 70% of the diameter keeps a square badge's corners inside the
   circle. Placed after the hero / lead mosaic rules it has to win over. */
.nw-media--mosaic.nw-media--badges { grid-template-columns: repeat(4, 1fr); align-content: center; padding: 5% 8%; gap: 4% 5%; }
.nw-media--badges span, .nq-q--badge .nq-pic {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #24315a 0%, #0b1330 55%, #050a1c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 -8px 16px rgba(0, 0, 0, .55),
    0 0 0 2px color-mix(in srgb, var(--arena) 35%, transparent), 0 10px 24px -8px rgba(0, 0, 0, .85);
}
.nw-media--badges img, .nq-q--badge .nq-pic img { width: 70%; height: 70%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.nq-q--badge .nq-pic { overflow: visible; }

/* ---------------- Day theme ----------------
   The panels (cards, hero, CTA, stat bar) are dark art in both themes, so
   they pin the night tokens for everything inside them — otherwise the day
   values below (and the app's day --ink / --gold) would put dark text on
   them. What sits on the page itself turns dark on the light page. */
.nw-card, .nw-hero, .nq-cta, .nq-stats {
  --ink: #e2e8f0; --ink-2: #cbd5e1; --muted: #8193ab; --line: rgba(148, 163, 184, .16); --gold: #fbbf24;
}
:root[data-theme="day"] .nw {
  --bg-2: #eef2f7; --ink-2: #334155; --muted: #64748b; --line: rgba(15, 23, 42, .12);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(217, 119, 6, .08), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(14, 116, 144, .06), transparent 60%);
}
:root[data-theme="day"] .nw::before {
  background-image: linear-gradient(rgba(15, 23, 42, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .05) 1px, transparent 1px);
}
:root[data-theme="day"] .nw :is(.nw-node h2, .nq-dossier-head h2, .nq-related-h) { color: #0f172a; }
:root[data-theme="day"] .nw .nq-shared { color: #334155; }
:root[data-theme="day"] .nw .nq-text { color: #1b2333; }
:root[data-theme="day"] .nw .nw-mast-title {
  background: linear-gradient(180deg, #1e293b 0%, #92400e 70%, #d97706 100%);
  -webkit-background-clip: text; background-clip: text; filter: none;
}
:root[data-theme="day"] .nw-mast--stats .nw-stats b { filter: drop-shadow(0 4px 14px rgba(180, 83, 9, .18)); }
:root[data-theme="day"] .nw-mast--stats .nw-odo:not(.is-spinning):not(.is-done),
:root[data-theme="day"] .nw .nw-odo-n, :root[data-theme="day"] .nw .nw-odo-sep {
  background-image: linear-gradient(180deg, #78350f 0%, #b45309 55%, #d97706 100%);
}
:root[data-theme="day"] .nw .nw-node-mark { background: #fff; }
:root[data-theme="day"] .nw .nw-chip, :root[data-theme="day"] .nw .nw-archive a {
  background: #fff; color: #334155; border-color: rgba(15, 23, 42, .12); box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
:root[data-theme="day"] .nw .nw-chip:hover { color: #0f172a; }
:root[data-theme="day"] .nw .nw-chip[aria-pressed="true"] {
  color: #0f172a; border-color: var(--arena, #b45309);
  background: color-mix(in srgb, var(--arena, #b45309) 14%, #fff);
}
:root[data-theme="day"] .nw .nw-archive a:hover { color: #0f172a; box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .45); }
:root[data-theme="day"] .nw .nw-fnav { background: #fff; color: #b45309; border-color: rgba(180, 83, 9, .45); box-shadow: 0 4px 12px -4px rgba(15, 23, 42, .3); }
:root[data-theme="day"] .nw .nq-q--pic .nq-num { text-shadow: 0 1px 6px #fff; }

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .nw-card { grid-column: span 6; }
  .nw-card--lead { grid-column: 1 / -1; }
  .nw-grid--row .nw-card { grid-column: span 6; }
  .nw-grid--row .nw-card:nth-child(3) { display: none; }
}
@media (max-width: 720px) {
  .nw-filter-wrap { margin-top: 24px; }
  .nw-grid { grid-template-columns: 1fr; gap: 14px; }
  .nw-card, .nw-grid--row .nw-card { grid-column: 1 / -1; }
  .nw-card--lead .nw-card-link { flex-direction: column; align-items: stretch; }
  .nw-card--lead .nw-media { flex: none; margin: 14px 14px 0; }
  .nw-card--lead .nw-new { top: 24px; left: 24px; }
  .nw-card--lead .nw-ambient::after { background: linear-gradient(180deg, transparent 30%, rgba(3, 7, 22, .8)); }
  .nw-grid--row .nw-card:nth-child(3) { display: block; }
  /* compact row card: picture left, text right */
  .nw-card:not(.nw-card--lead) .nw-card-link { flex-direction: row; }
  .nw-card:not(.nw-card--lead) .nw-media { flex: 0 0 38%; aspect-ratio: auto; min-height: 112px; }
  /* the seam fix turned sideways: the picture sits left of the text here */
  .nw-card:not(.nw-card--lead) .nw-media {
    -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent calc(100% - 4px));
    mask-image: linear-gradient(90deg, #000 55%, transparent calc(100% - 4px));
  }
  .nw-card:not(.nw-card--lead) .nw-media--photo { padding: 0 6px 0 0; }
  .nw-card:not(.nw-card--lead) .nw-media--photo > img { clip-path: inset(0 6px 0 0); }
  .nw-card:not(.nw-card--lead) .nw-card-body { margin: 0; padding: 14px 14px 14px 12px; }
  .nw-card:not(.nw-card--lead) .nw-card-title { font-size: 16.5px; }
  .nw-card:not(.nw-card--lead) .nw-card-desc { font-size: 13.5px; -webkit-line-clamp: 2; }
  .nw-card:not(.nw-card--lead) .nw-card-meta { padding-top: 10px; font-size: 11.5px; }
  .nw-card:not(.nw-card--lead) .nw-new { top: 8px; left: 8px; padding: 4px 7px; font-size: 10px; }
  /* px, not %: a percentage padding resolves against the CARD's width here
     (~330px), which left 20px tiles in a 126px picture */
  .nw-card:not(.nw-card--lead) .nw-media--mosaic { grid-template-columns: repeat(2, 1fr); align-content: center; padding: 12px 10px; gap: 8px; }
  .nw-card:not(.nw-card--lead) .nw-media--mosaic span:nth-child(n+5) { display: none; }
  .nw-card--lead .nw-card-body { padding: 18px 18px 20px; }
  .nw-timeline { padding-left: calc(var(--gutter) + 26px); }
  .nw-timeline::before { left: calc(var(--gutter) + 4px); }
  .nw-node-mark { left: -29px; width: 13px; height: 13px; margin-top: -6.5px; }
  .nw-hero { border-radius: 20px; min-height: 0; grid-template-columns: 1fr; padding: 16px 16px 24px; gap: 22px; }
  .nq-hero { padding-bottom: 64px; }
  .nw-hero::before { background: linear-gradient(0deg, rgba(2, 6, 23, .92) 0%, rgba(2, 6, 23, .55) 60%, rgba(2, 6, 23, .3) 100%); }
  .nw-hero-art { order: 0; width: 100%; transform: none; }
  .nw-hero:hover .nw-hero-art { transform: none; }
  .nw-actions .nw-btn { flex: 1 1 auto; }
  .nq-q { grid-template-columns: 52px 1fr; gap: 12px; }
  .nq-num { font-size: 30px; }
  .nq-diff { grid-column: 2; }
  .nq-list--pics { grid-template-columns: repeat(3, 1fr); gap: 16px 10px; }
  .nq-cta-l, .nq-cta-r { opacity: .28; }
}
