:root {
  --bg: #140e08;
  --bg-2: #1d150c;
  --ink: #f6ead2;
  --ink-soft: #cdbb9b;
  --ink-faint: #8f7d60;
  --gold: #e8b65a;
  --gold-soft: #f6d58a;
  --saffron: #d9822b;
  --line: rgba(232, 182, 90, 0.22);
  --card: rgba(30, 22, 12, 0.62);
  /* Latin letters use the first font; Sinhala letters fall through to the Noto Sinhala fonts */
  --serif: "Cormorant Garamond", "Noto Serif Sinhala", "Iskoola Pota", Georgia, serif;
  --sans: "Jost", "Noto Sans Sinhala", "Iskoola Pota", system-ui, sans-serif;
  --sinhala: "Noto Serif Sinhala", "Iskoola Pota", serif;
  /* clear, plain figures for all the numbers */
  --num: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── backdrop: the same land, blurred, slowly breathing ── */
.sky {
  position: fixed;
  inset: -6%;
  z-index: -2;
  background: url("assets/background.jpg") center / cover no-repeat;
  filter: blur(28px) saturate(0.8) brightness(0.32);
  animation: drift 70s ease-in-out infinite alternate;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 180, 90, 0.16), transparent 60%),
              linear-gradient(to bottom, transparent 40%, var(--bg) 100%);
}
@keyframes drift {
  from { transform: scale(1.04) translate(-1%, -0.5%); }
  to   { transform: scale(1.12) translate(1%, 1%); }
}

/* ── header ── */
.intro {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 16px 28px;
  text-align: center;
  animation: rise 1.6s ease-out both;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  line-height: 1.08;
  text-wrap: balance;
}
h1 em { color: var(--gold-soft); font-style: italic; }
.lede {
  margin: 18px auto 0;
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  text-wrap: pretty;
}
.lede strong { color: var(--ink); font-weight: 500; }
.lede p { margin: 0 0 12px; }
.lede .land-facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
  margin: 18px 0 14px; color: var(--ink-soft); font-size: 0.95rem;
}
.lede .land-facts b { display: block; margin-top: 2px; color: var(--gold-soft); font-family: var(--num); font-weight: 500; font-size: 1.25rem; }
.lede .namo { margin: 6px 0 0; font-family: var(--serif); font-size: 1.35rem; color: var(--gold); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

main { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ── the land map ── */
.stage-wrap { animation: rise 1.8s 0.2s ease-out both; }
.stage {
  position: relative;
  margin: 0;
  aspect-ratio: 1672 / 941;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--line);
  background: #0e0a05;
}
.stage svg { display: block; width: 100%; height: 100%; touch-action: manipulation; }

.mist { will-change: transform; }
.mist-a { animation: mistA 90s linear infinite alternate; }
.mist-b { animation: mistB 120s linear infinite alternate; }
@keyframes mistA { from { transform: translateX(-180px); } to { transform: translateX(260px); } }
@keyframes mistB { from { transform: translateX(240px); } to { transform: translateX(-220px); } }

.lit-glow { mix-blend-mode: screen; animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
/* offered plots: a warm gold wash that brightens the photo underneath ("screen" lightens, never darkens) */
.lit-path { mix-blend-mode: normal; }   /* solid yellow fill on offered plots */

.ripple { animation: ripple 3.2s ease-out forwards; pointer-events: none; }
@keyframes ripple {
  0%   { fill-opacity: 0; stroke-opacity: 0; }
  18%  { fill-opacity: 0.55; stroke-opacity: 1; }
  100% { fill-opacity: 0; stroke-opacity: 0; }
}

.lamp { mix-blend-mode: screen; animation: flicker var(--d, 3s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes flicker {
  0%, 100% { opacity: 0.55; }
  30% { opacity: 0.9; }
  55% { opacity: 0.65; }
  75% { opacity: 1; }
}

#hoverPath { transition: opacity 0.35s ease; }

/* rising light motes over the land */
.motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mote {
  position: absolute;
  bottom: -10px;
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: radial-gradient(circle, #fff3cf 0%, rgba(255, 196, 96, 0.6) 45%, transparent 70%);
  opacity: 0;
  animation: moteRise var(--d, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes moteRise {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: 0.85; }
  50%  { transform: translate(var(--sway, 20px), -45vh); }
  85%  { opacity: 0.5; }
  100% { transform: translate(0, -90vh); opacity: 0; }
}

/* tooltip */
.tip {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(20, 14, 8, 0.88);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.25s ease;
  backdrop-filter: blur(6px);
}
.tip.show { opacity: 1; }
.tip b { color: var(--gold-soft); font-weight: 500; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw-lit  { background: #7fcf86; box-shadow: inset 0 0 0 2px #b6f5a6; }
.sw-part { background: linear-gradient(90deg, #7fcf86 0 33%, #d8c97a 33% 100%); }
.sw-mist { background: #d8c97a; box-shadow: inset 0 0 0 2px rgba(255, 243, 160, 0.85); }

/* ── land + names row ── */
.land-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "map" "legend" "names";
}
.has-names .land-row {
  grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 300px);
  grid-template-areas: "map names" "legend .";
  column-gap: 22px;
}
.stage-wrap { grid-area: map; }
.legend { grid-area: legend; margin-bottom: 0; }

/* ── names of those who have offered ── */
.donors { grid-area: names; position: relative; min-height: 0; animation: rise 1.8s 0.3s ease-out both; }
.donors[hidden] { display: none; }
/* plot map on top, names list filling the rest of the column (same height as the land picture) */
.donors-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.plot-map {
  position: relative;
  display: block;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.75);
  background: #0e0a05;
}
.plot-map img { display: block; width: 100%; height: auto; aspect-ratio: 1573 / 1000; }
.plot-map-cap {
  position: absolute;
  left: 8px; bottom: 8px;
  padding: 2px 10px 3px;
  border-radius: 999px;
  background: rgba(16, 11, 6, 0.82);
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
a.plot-map:hover { border-color: rgba(232, 182, 90, 0.6); }
a.plot-map:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.donors-card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.donors-head { padding: 18px 18px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.donors-eyebrow { margin: 0; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.donors-title { margin: 2px 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; }
.donors-count { margin: 4px 0 0; font-size: 0.78rem; color: var(--ink-faint); }
.donors-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.donors-track { margin: 0; padding: 0; list-style: none; will-change: transform; }
.donors-track li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 12px;
  text-align: center;
}
.donors-track li::before {
  content: "✦";
  font-size: 0.55rem;
  color: rgba(232, 182, 90, 0.45);
  margin-bottom: 6px;
}
.donors-track li.dn-empty { padding-top: 40px; color: var(--ink-soft); }
.donors-track li.dn-empty::before { display: none; }
.dn-name { font-family: var(--serif); font-size: 1.22rem; font-weight: 500; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.dn-amt { margin-top: 2px; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--gold); }
.donors-track li.new .dn-name { color: var(--gold-soft); animation: newName 2.4s ease-in-out infinite; }
.donors-track li.new::before { color: var(--gold-soft); }
@keyframes newName {
  0%, 100% { text-shadow: 0 0 6px rgba(246, 213, 138, 0.25); }
  50%      { text-shadow: 0 0 18px rgba(246, 213, 138, 0.85); }
}
.donors-track.rolling { animation: namesUp var(--dur, 60s) linear infinite; }
.donors-track.rolling.down { animation-name: namesDown; }
.donors-window:hover .donors-track { animation-play-state: paused; }
@keyframes namesUp   { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes namesDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }

/* ── progress ── */
.progress {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 40px;
  margin: 48px auto 0;
  max-width: 980px;
  padding: 32px 36px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  animation: rise 1.8s 0.4s ease-out both;
}
.ring-card { position: relative; width: 210px; height: 210px; }
.ring { width: 100%; height: 100%; overflow: visible; }
#ringArc { transition: stroke-dashoffset 2.4s cubic-bezier(0.22, 1, 0.36, 1); filter: drop-shadow(0 0 6px rgba(246, 213, 138, 0.45)); }
.wheel { transform-origin: 100px 100px; animation: turn 120s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.pct { font-family: var(--num); font-size: 2.6rem; font-weight: 500; line-height: 1; color: var(--gold-soft); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
.pct-label { margin-top: 6px; font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-soft); max-width: 110px; line-height: 1.3; }

.numbers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.stat { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; border-left: 1px solid var(--line); }
.stat-num {
  display: flex;
  align-items: center;
  font-family: var(--num);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
}
/* stacked fraction beside a whole number: 71 ²⁄₃ shown as 71 with a small 2 over 3 */
.q-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-left: 0.14em;
  font-size: 0.42em;
  font-weight: 500;
  line-height: 1.05;
  color: var(--gold-soft);
}
.q-frac i { font-style: normal; padding: 0 0.12em; }
.q-frac i:first-child { border-bottom: 0.09em solid currentColor; padding-bottom: 0.06em; }
.q-frac i:last-child { padding-top: 0.06em; }
/* small inline fraction for text: ¹⁄₃ */
.fi { font-family: var(--num); font-variant-numeric: lining-nums; white-space: nowrap; }
.fi sup, .fi sub { font-size: 0.7em; line-height: 0; }
.fi sup { vertical-align: 0.45em; }
.fi sub { vertical-align: -0.1em; }
.stat-label { font-size: 0.85rem; color: var(--ink-soft); }
.status {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #8fcf8a;
  box-shadow: 0 0 0 0 rgba(143, 207, 138, 0.6);
  animation: pulse 3s ease-out infinite;
}
.status.err .live-dot { background: #d79a5a; animation: none; }
.status.demo .live-dot { background: var(--gold); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(143, 207, 138, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(143, 207, 138, 0); }
}

/* ── ways to offer ── */
.give { max-width: 980px; margin: 56px auto 0; text-align: center; animation: rise 1.8s 0.6s ease-out both; }
.give h2 { margin: 0 0 22px; font-family: var(--serif); font-weight: 500; font-size: 2rem; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 26px 18px 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(232, 182, 90, 0.5); box-shadow: 0 18px 40px -18px rgba(232, 182, 90, 0.35); }
.card.featured { border-color: rgba(232, 182, 90, 0.45); background: linear-gradient(180deg, rgba(232, 182, 90, 0.1), var(--card)); }
.plot-icon {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  width: 54px; height: 40px; margin: 0 auto 14px;
  padding: 3px; border: 1px solid var(--line); border-radius: 6px;
  transform: perspective(120px) rotateX(28deg);
}
.plot-icon i { border-radius: 2px; background: #4b4740; }
.plot-icon i.on { background: linear-gradient(180deg, #f6d58a, #d9822b); box-shadow: 0 0 8px rgba(246, 213, 138, 0.55); }
.give-intro { max-width: 640px; margin: -6px auto 26px; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; text-wrap: pretty; }
.give-intro strong { color: var(--gold-soft); font-weight: 500; }
.card-what { margin: 0 0 8px; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.card-amt { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 0; font-family: var(--num); font-size: 2.1rem; font-weight: 500; color: var(--gold-soft); line-height: 1.1; font-variant-numeric: lining-nums; }
.card-per { font-family: var(--sans); font-size: 0.9rem; font-weight: 400; color: var(--ink-soft); }
.card-total { margin: 10px auto 0; padding-top: 10px; max-width: 200px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.86rem; font-variant-numeric: lining-nums; }
.how { max-width: 620px; margin: 28px auto 0; color: var(--ink-soft); text-wrap: pretty; }
.contact { margin: 10px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.contact a { color: var(--gold-soft); text-decoration: none; border-bottom: 1px solid rgba(246, 213, 138, 0.35); }
.contact a:hover { border-bottom-color: var(--gold-soft); }

/* ── footer ── */
.foot { margin-top: 72px; padding: 32px 16px 48px; text-align: center; border-top: 1px solid rgba(232, 182, 90, 0.12); }
.pali { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--gold-soft); }
.pali-en { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-faint); letter-spacing: 0.05em; }

/* ── falling petals ── */
.petals { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -40px;
  left: var(--x, 50%);
  width: var(--w, 16px);
  opacity: 0;
  animation: fall var(--d, 24s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.petal svg { display: block; width: 100%; height: auto; animation: sway var(--sd, 5s) ease-in-out infinite alternate; }
@keyframes fall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--o, 0.7); }
  90%  { opacity: var(--o, 0.7); }
  100% { transform: translate3d(var(--dx, 80px), 110vh, 0) rotate(var(--r, 240deg)); opacity: 0; }
}
@keyframes sway { from { transform: translateX(-14px) rotate(-18deg); } to { transform: translateX(14px) rotate(22deg); } }

/* ── toast ── */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 26px;
  border-radius: 16px;
  background: rgba(24, 17, 9, 0.92);
  border: 1px solid rgba(232, 182, 90, 0.45);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 30px -6px rgba(232, 182, 90, 0.35);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 1.2s ease, transform 1.2s ease;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast #toastText { font-size: 1.05rem; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.toast #toastText b { display: block; margin: 2px 0; font-family: var(--serif); font-size: 1.45em; font-weight: 600; color: var(--gold-soft); }

/* ── inside a page of the main website (see app.js → EMBED) ── */
body.embedded { min-height: 0; }
.embedded .petals { display: none; }
.embedded .intro { padding-top: 40px; }
.embedded .toast { position: absolute; bottom: 18px; max-width: calc(100% - 32px); }

/* ── calibrate mode ── */
.calib-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  width: min(380px, calc(100vw - 32px));
  padding: 14px; border-radius: 12px;
  background: rgba(16, 11, 6, 0.95); border: 1px solid var(--gold);
  font-size: 0.85rem;
}
.calib-panel textarea { width: 100%; height: 120px; margin-top: 8px; background: #000; color: #f6d58a; border: 1px solid var(--line); border-radius: 6px; font: 12px/1.4 ui-monospace, Consolas, monospace; }
.calib-handle { cursor: grab; }
.calib-num { font: 600 15px var(--sans); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.7); stroke-width: 3px; pointer-events: none; }

/* ── small screens ── */
@media (max-width: 760px) {
  .intro { padding-top: 40px; }
  .stage { border-radius: 12px; }
  .progress { grid-template-columns: 1fr; justify-items: center; gap: 24px; padding: 26px 18px; }
  .ring-card { width: 180px; height: 180px; }
  .numbers { width: 100%; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: center; }
  .stat { padding-left: 0; border-left: 0; }
  .stat-label { font-size: 0.75rem; }
  .status { justify-content: center; }
  .cards { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .tip { font-size: 0.78rem; }
  .has-names .land-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "legend" "names"; }
  .donors { margin-top: 22px; }
  .donors-inner { position: static; }
  .donors-card { flex: none; height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petals, .motes { display: none; }
  .donors-window { overflow-y: auto; -webkit-mask-image: none; mask-image: none; }
}

/* ═════════════════════════════════════════════════════════════
   TV / event screen  (index.html?tv)
   One 16:9 screen, no scrolling, sized in vh so it reads from a distance.
   ═════════════════════════════════════════════════════════════ */
.tv-tagline, .tv-offer { display: none; }
.fs-prompt[hidden] { display: none !important; }

body.tv { height: 100vh; overflow: hidden; }
body.tv.idle, body.tv.idle * { cursor: none !important; }
.tv .sky, .tv .legend, .tv .give, .tv .foot { display: none; }
.tv main { max-width: none; padding: 0; }

/* the land fills the whole screen */
.tv .stage-wrap { animation: none; }
.tv .stage {
  position: fixed;
  left: 50%; top: 50%;
  width: max(100vw, 177.78vh);
  height: max(56.25vw, 100vh);
  transform: translate(-50%, -50%);
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
  z-index: 0;
}

/* with names: the land moves left so the names column on the right hides no plots */
.tv .land-row { display: block; }
.tv.has-names .sky { display: block; }
.tv.has-names .stage {
  left: 0;
  width: 76vw;
  height: calc(76vw * 0.5625);
  transform: translateY(-50%);
  box-shadow: 0 0 80px 10px rgba(0, 0, 0, 0.6);
}
/* TV: plot map in the top right corner, names below it, all above the progress bar */
.tv .donors {
  position: fixed;
  z-index: 3;
  top: 1.5vh;
  bottom: 2vh;
  right: 1.5vw;
  width: 21vw;
  height: auto;
  margin: 0;
  animation: none;
}
.tv .donors-inner { gap: 1.4vh; }
.tv .plot-map { border-radius: 1.4vh; pointer-events: none; }
.tv .plot-map-cap { left: 0.8vh; bottom: 0.8vh; padding: 0.2vh 1vh 0.3vh; font-size: 1.4vh; }
/* keep the title in the space left of the map column */
.tv.has-names .intro { padding-left: 2vw; padding-right: 24vw; }
.tv .donors-card { border-radius: 2vh; background: rgba(16, 11, 6, 0.82); }
.tv .donors-head { padding: 1.8vh 1vw 1.2vh; }
.tv .donors-eyebrow { font-size: 1.4vh; }
.tv .donors-title { font-size: 3.2vh; }
.tv .donors-count { font-size: 1.5vh; }
.tv .donors-track li { padding: 1.1vh 1vw 1.3vh; }
.tv .donors-track li::before { font-size: 1.1vh; margin-bottom: 0.6vh; }
.tv .dn-name { font-size: 2.9vh; }

/* title over the treeline */
.tv .intro {
  position: fixed;
  z-index: 2;
  top: 0; left: 0; right: 0;
  max-width: none;
  padding: 2.2vh 4vw 3.5vh;
  background: linear-gradient(to bottom, rgba(12, 8, 3, 0.9) 0%, rgba(12, 8, 3, 0.6) 65%, transparent);
  pointer-events: none;
}
.tv .eyebrow { margin-bottom: 0.5vh; font-size: 1.6vh; }
.tv h1 { font-size: 5.2vh; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7); }
/* the description under the title, compact so it stays above the plots */
.tv .intro .lede { display: block; max-width: 62vw; margin: 1vh auto 0; font-size: 1.85vh; line-height: 1.45; color: var(--ink); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }
.tv .lede p { margin: 0 0 0.6vh; }
.tv .lede .land-facts { display: inline-flex; gap: 2.4vw; margin: 0.4vh 1.6vw 0 0; font-size: 1.7vh; vertical-align: baseline; }
.tv .lede .land-facts span { white-space: nowrap; }
.tv .lede .land-facts b { display: inline; margin: 0 0 0 0.6vw; font-size: 2.3vh; }
.tv .lede .namo { display: block; margin: 0.4vh 0 0; font-size: 2.4vh; }
.tv.lang-si .intro .lede { font-size: 1.7vh; line-height: 1.6; }

/* soft dark glow behind the top text so it reads clearly over the photo */
.tv .intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%; top: 0;
  width: 80vw; height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 60% at 50% 40%, rgba(10, 6, 2, 0.88), rgba(10, 6, 2, 0.6) 60%, transparent 100%);
  pointer-events: none;
}
.tv.has-names .intro::before { left: calc(50% - 11vw); width: 74vw; }
.tv .intro .eyebrow, .tv .intro .lede {
  text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 0, 0, 0.75);
}
.tv .intro h1 {
  text-shadow: 0 0 6px rgba(0, 0, 0, 1), 0 0 18px rgba(0, 0, 0, 0.85), 0 0 36px rgba(255, 196, 90, 0.25);
}

/* progress bar over the road */
.tv .progress {
  position: fixed;
  z-index: 2;
  left: 2vw; right: 2vw; bottom: 2vh;
  max-width: none;
  margin: 0;
  grid-template-columns: auto auto 1fr;
  justify-items: stretch;
  gap: 2.6vw;
  padding: 1.4vh 2.4vw;
  border-radius: 2vh;
  background: rgba(16, 11, 6, 0.82);
}
/* with names: the bar stops short of the names column, which runs to the bottom */
.tv.has-names .progress { left: 1.5vw; right: 24vw; }
.tv .ring-card { width: 12vh; height: 12vh; }
.tv .pct { font-size: 3.4vh; }
.tv .pct-label { margin-top: 0.3vh; font-size: 1.15vh; max-width: 9vh; }
.tv .numbers { grid-template-columns: repeat(2, 1fr); column-gap: 2vw; row-gap: 0.2vh; text-align: left; }
.tv .stat { padding-left: 2vw; border-left: 1px solid var(--line); }
.tv .stat-num { font-size: 5.8vh; }
.tv .stat-label { font-size: 2.2vh; }
.tv .status { justify-content: flex-start; margin-top: 0.4vh; font-size: 1.35vh; }
.tv .live-dot { width: 0.8vh; height: 0.8vh; }

/* info desk box on the left end of the bar */
.tv .tv-offer { display: flex; align-items: center; gap: 1.4vw; order: -1; align-self: center; padding-right: 2.4vw; border-right: 1px solid var(--line); text-align: left; }
/* QR code: big, on white with a clear margin so phones read it easily */
.qr { display: block; background: #fff; border-radius: 10px; image-rendering: pixelated; }
.tv .tv-offer .qr { width: 19vh; height: 19vh; flex: none; padding: 0.5vh; border-radius: 1.2vh; box-shadow: 0 0 0 0.4vh rgba(232, 182, 90, 0.55), 0 0 3vh rgba(232, 182, 90, 0.35); }
.tv-offer-text { max-width: 20vw; }
.tv-offer-scan { margin: 0 0 0.8vh; font-family: var(--serif); font-size: 2.7vh; font-weight: 600; line-height: 1.25; color: var(--gold-soft); text-wrap: balance; }
.tv.lang-si .tv-offer-scan { font-size: 2.1vh; line-height: 1.5; }
.tv .tv-offer .tv-offer-desk { max-width: none; margin: 0; font-family: var(--sans); font-size: 1.7vh; font-weight: 400; color: var(--ink-soft); }
.tv.lang-si .tv-offer .tv-offer-desk { font-size: 1.6vh; }
/* web page: QR under the ways to offer */
.tv .progress { z-index: 6; }   /* above the falling petals, so nothing crosses the QR code */
.give { position: relative; z-index: 6; }   /* keeps petals from crossing the QR code */
.qr-web { display: flex; align-items: center; justify-content: center; gap: 22px; max-width: 560px; margin: 30px auto 0; padding: 18px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.qr-web .qr { width: 168px; height: 168px; flex: none; padding: 6px; }
.qr-web p { margin: 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; color: var(--gold-soft); }
.lang-si .qr-web p { font-size: 1.1rem; line-height: 1.6; }
@media (max-width: 520px) { .qr-web { flex-direction: column; text-align: center; } .qr-web .qr { width: 200px; height: 200px; } }
.tv-offer-title { margin: 0 0 0.5vh; font-size: 1.5vh; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.tv-offer ul { display: flex; gap: 1.8vw; margin: 0; padding: 0; list-style: none; }
.tv-offer li { display: flex; flex-direction: column; align-items: center; }
.tv-offer b { font-family: var(--num); font-size: 3.8vh; font-weight: 500; line-height: 1.1; color: var(--gold-soft); font-variant-numeric: lining-nums; }
.tv-offer li span { font-size: 1.6vh; color: var(--ink-soft); }
.tv-offer-desk {
  max-width: 19vw;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 3vh;
  font-weight: 500;
  line-height: 1.25;
  color: var(--gold-soft);
  text-wrap: balance;
}
.tv.lang-si .tv-offer-desk { font-size: 2.3vh; line-height: 1.45; }
.tv-contact { margin: 0.8vh 0 0; font-size: 1.8vh; color: var(--ink); letter-spacing: 0.04em; }

/* bigger, centred "Sadhu" message */
.tv .toast { bottom: 21vh; padding: 2.2vh 3.6vw; border-radius: 2vh; }
.tv .toast { max-width: 60vw; }
.tv.has-names .toast { left: 38.75vw; }   /* centred over the land, not the names column */
.tv .toast #toastText { font-size: 3vh; }
.tv .petal { width: calc(var(--w, 16px) * 1.6); }
.tv .mote { width: calc(var(--s, 4px) * 1.5); height: calc(var(--s, 4px) * 1.5); }

/* "go full screen" prompt */
.fs-prompt {
  position: fixed;
  z-index: 30;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 1.4vh;
  padding: 2.2vh 3.4vh;
  border-radius: 1.6vh;
  border: 1px solid var(--gold);
  background: rgba(16, 11, 6, 0.9);
  color: var(--ink);
  font: 400 2.4vh var(--sans);
  cursor: pointer;
  animation: glowPulse 4s ease-in-out infinite;
}
.fs-icon { font-size: 3.4vh; color: var(--gold-soft); }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 182, 90, 0.0); }
  50% { box-shadow: 0 0 40px 4px rgba(232, 182, 90, 0.35); }
}

/* ?lite — for slow TV browsers */
.lite .mist, .lite .lit-glow, .lite .lamp, .lite .wheel { animation: none !important; }
.lite .petals, .lite .motes { display: none; }

/* ── "just offered" beacon on newly taken plots ── */
.recent-fill {
  fill: #ffe9b8;
  fill-opacity: 0.35;
  stroke: #fffaf0;
  stroke-width: 3;
  stroke-linejoin: round;
  animation: recentPulse 2.4s ease-in-out infinite;
}
@keyframes recentPulse {
  0%, 100% { fill-opacity: 0.12; stroke-opacity: 0.55; }
  50%      { fill-opacity: 0.55; stroke-opacity: 1; }
}
.recent-ring {
  fill: none;
  stroke: #fff1c8;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ringOut 2.8s ease-out infinite;
}
.recent-ring.r2 { animation-delay: 1.4s; }
@keyframes ringOut {
  0%   { transform: scale(0.35); opacity: 0.95; }
  100% { transform: scale(2.8); opacity: 0; }
}
.recent-beam { mix-blend-mode: screen; transform-box: fill-box; transform-origin: bottom; animation: beam 2.4s ease-in-out infinite; }
@keyframes beam {
  0%, 100% { opacity: 0.45; transform: scaleY(0.85); }
  50%      { opacity: 1; transform: scaleY(1.05); }
}
.recent-label rect { fill: rgba(20, 14, 8, 0.9); stroke: var(--gold); stroke-width: 1.5; }
.recent-label text { fill: var(--gold-soft); font: 500 21px var(--sans); letter-spacing: 0.02em; }
.recent-label { animation: labelIn 1.2s ease-out both; }
@keyframes labelIn { from { opacity: 0; } to { opacity: 1; } }
.recent.older .recent-label, .recent.older .recent-beam { display: none; }

/* ═════════════════════════════════════════════════════════════
   Languages: English / Sinhala
   ═════════════════════════════════════════════════════════════ */
/* words fade out and back in when the language changes */
[data-i18n], [data-i18n-html], #statusText, #toastText, .donors-window, .donors-count, .recent-label text, .recent-label rect, .lang-toggle {
  transition: opacity 0.6s ease;
}
.lang-fading [data-i18n], .lang-fading [data-i18n-html], .lang-fading #statusText, .lang-fading .donors-window,
.lang-fading .donors-count, .lang-fading .recent-label text, .lang-fading .recent-label rect, .lang-fading .lang-toggle {
  opacity: 0;
}
.legend b { font-weight: inherit; }

/* language button (web page only) */
.lang-toggle {
  position: absolute;
  z-index: 6;
  top: 16px; right: 16px;
  padding: 7px 16px 8px;
  border-radius: 999px;
  border: 1px solid rgba(232, 182, 90, 0.45);
  background: rgba(20, 14, 8, 0.6);
  color: var(--gold-soft);
  font: 400 0.92rem var(--sans);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.lang-toggle:hover { border-color: var(--gold); background: rgba(232, 182, 90, 0.12); }
.lang-toggle:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.lang-toggle[hidden] { display: none; }

/* Sinhala: no italics or wide letter-spacing (they break the letter shapes), a little more line height */
.lang-si .eyebrow, .lang-si .donors-eyebrow, .lang-si .tv-offer-title { letter-spacing: 0.03em; text-transform: none; }
.lang-si .eyebrow { font-size: 0.9rem; }
.lang-si h1 { font-size: clamp(1.55rem, 3.4vw, 2.45rem); line-height: 1.4; font-weight: 500; }
.lang-si h1 em { font-style: normal; }
.lang-si .lede { font-size: 1rem; line-height: 1.85; }
.lang-si .give h2 { font-size: 1.7rem; font-weight: 600; }
.lang-si .donors-title { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.lang-si .dn-name { font-size: 1.02rem; line-height: 1.5; }
.lang-si .pct-label { max-width: 120px; letter-spacing: 0; }
.lang-si .stat-label, .lang-si .legend { font-size: 0.82rem; }
.lang-si .card-what { font-size: 1.05rem; font-weight: 600; }
.lang-si .card-per { order: -1; }   /* Sinhala reads "මසකට £27" */
.lang-si .give-intro { font-size: 0.98rem; line-height: 1.85; }
.lang-si .pali-en { letter-spacing: 0; }
.lang-si .recent-label text { font-size: 19px; letter-spacing: 0; }
.lang-si .tv h1, .tv.lang-si h1 { font-size: 4.3vh; line-height: 1.3; }
.tv.lang-si .eyebrow { font-size: 1.7vh; }
.tv.lang-si .stat-label { font-size: 1.9vh; }
.tv.lang-si .pct-label { font-size: 1vh; max-width: 10vh; }
.tv.lang-si .donors-title { font-size: 2.6vh; }
.tv.lang-si .dn-name { font-size: 2.3vh; }
.tv.lang-si .tv-offer li span { font-size: 1.45vh; }

@media (max-width: 760px) {
  .lang-toggle { top: 10px; right: 10px; padding: 5px 12px 6px; font-size: 0.85rem; }
  .intro { padding-top: 52px; }
}
