:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-2: #EDEBE4;
  --ink: #151714;
  --ink-2: #5C615A;
  --ink-3: #8C918A;
  --line: #E2DFD6;
  --accent: #1F5A43;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EEE8;
  --warm: #B8742A;
  --blue: #2563EB;
  --blue-ink: #FFFFFF;
  --blue-soft: #E3ECFE;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(20, 22, 19, .05), 0 8px 24px rgba(20, 22, 19, .06);
  --tabbar-h: 64px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F110F; --surface: #181B18; --surface-2: #222622; --ink: #F1F2EE; --ink-2: #A9AEA6; --ink-3: #7A8077;
    --line: #2A2E2A; --accent: #7CC6A3; --accent-ink: #0F110F; --accent-soft: #1C2B24; --warm: #E0A866; --blue: #5B8DEF; --blue-ink: #0F110F; --blue-soft: #1B2540;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F110F; --surface: #181B18; --surface-2: #222622; --ink: #F1F2EE; --ink-2: #A9AEA6; --ink-3: #7A8077;
  --line: #2A2E2A; --accent: #7CC6A3; --accent-ink: #0F110F; --accent-soft: #1C2B24; --warm: #E0A866; --blue: #5B8DEF; --blue-ink: #0F110F; --blue-soft: #1B2540;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner { max-width: none; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 12px clamp(16px, 3vw, 48px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; flex-shrink: 0; }
.brand img { border-radius: 8px; }
.topnav { display: flex; gap: 4px; }
.topnav a { white-space: nowrap; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.search {
  margin-left: auto; flex: 0 1 380px; min-width: 200px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 6px 0 12px; height: 44px; transition: border-color .15s, box-shadow .15s;
}
.search .ico { color: var(--ink-3); width: 18px; height: 18px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 15px var(--sans); height: 100%; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.mic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); }
.mic:hover { background: var(--surface-2); color: var(--ink); }

main { width: 100%; max-width: none; margin: 0 auto; padding: 24px clamp(16px, 3vw, 48px) 64px; outline: none; }

/* ---------- Typography ---------- */
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.h-display { font: 600 clamp(32px, 5vw, 52px)/1.04 var(--serif); letter-spacing: -.02em; margin: 6px 0 0; }
.h-section { font: 600 24px/1.2 var(--serif); letter-spacing: -.01em; margin: 0; }
.lede { color: var(--ink-2); font-size: 17px; margin: 10px 0 0; max-width: 56ch; }

/* ---------- Feature hero ---------- */
.feature {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.feature-img { position: relative; background: var(--surface-2); aspect-ratio: 21 / 9; }
.feature-img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-body { padding: 24px 32px 28px; display: flex; flex-direction: column; gap: 4px; }
.feature-body p { max-width: 62ch; }
.feature-body p { color: var(--ink-2); margin: 12px 0 22px; font-size: 16px; }
.feature-body .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Segmented filters ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 44px 0 16px; }
.section-head a { color: var(--accent); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px 20px; padding: 0 24px; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.filter:hover { color: var(--ink); border-color: var(--ink-3); }
.filter[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter .n { color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.filter[aria-current="true"] .n { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.filter[data-g] { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; }
.fpics { display: inline-flex; flex-shrink: 0; }
.fpics img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid var(--surface); }
.fpics img + img { margin-left: -14px; }
.filter[aria-current="true"] .fpics img { border-color: var(--ink); }
.filter[data-g] .n { margin-left: -2px; }
.az { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px -24px 18px; padding: 2px 24px; }
.az::-webkit-scrollbar { display: none; }
.az button { flex: 0 0 auto; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font: 600 16px/1 var(--sans); color: var(--ink); transition: background .15s, transform .1s; }
.az button:hover:not(:disabled) { border-color: var(--ink-3); }
.az button:active:not(:disabled) { transform: scale(.92); }
.az button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.az button:disabled { color: var(--ink-3); opacity: .45; background: transparent; }
.az .az-all { font-size: 14px; padding: 0 14px; }
@media (max-width: 760px) { .az { margin: -4px -16px 14px; padding: 2px 16px; } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: block; }
.card-img { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s, transform .5s cubic-bezier(.2,.7,.2,1); }
.card-img img.loaded { opacity: 1; }
.card-video, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; z-index: 1; }
.card-video.on, .hero-video.on { opacity: 1; }
.card-img .tag3d, .card-img .play-mini { z-index: 2; }
.vfig { position: relative; }
.vfig .hero-video { position: absolute; }
.vplay { position: absolute; inset: 0; margin: auto; z-index: 2; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); color: #151714; display: grid; place-items: center; box-shadow: 0 4px 18px rgba(0,0,0,.25); transition: opacity .2s; }
.vplay .ico { width: 24px; height: 24px; margin-left: 3px; }
.vfig.live .vplay { opacity: 0; pointer-events: none; }
.mute { position: absolute; left: 14px; bottom: 14px; z-index: 2; height: 34px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(15,17,15,.6); color: #fff; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.mute .ico { width: 16px; height: 16px; }
.mute.on { background: rgba(255,255,255,.92); color: #151714; }
.thumbs .vthumb { position: relative; background: #000; }
.thumbs .vthumb .ico { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
@media (hover: hover) { .card:hover .card-img img { transform: scale(1.04); } }
.card-meta { padding: 10px 2px 0; display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.card-name { font-weight: 600; font-size: 16px; margin: 0; letter-spacing: -.005em; }
.card-sub { color: var(--ink-3); font-size: 13px; font-style: italic; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag3d {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(15,17,15,.55); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 8px 4px 6px; border-radius: 999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tag3d .ico { width: 13px; height: 13px; }
.card-btns { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; }
/* With a mouse, the buttons and 3D badge appear on hover (and stay while a sound plays); touch screens always show them. */
@media (hover: hover) and (pointer: fine) {
  .card-btns { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
  .card:hover .card-btns, .card:focus-within .card-btns, .card-btns:has(.playing, .speaking) { opacity: 1; transform: none; }
  .card .tag3d { opacity: 0; transform: translateY(-4px); transition: opacity .18s, transform .18s; }
  .card:hover .tag3d, .card:focus-within .tag3d { opacity: 1; transform: none; }
}
.name-mini {
  height: 34px; padding: 0 11px 0 9px; border-radius: 999px; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s, background .15s;
}
.name-mini .ico { width: 15px; height: 15px; }
.name-mini:hover { transform: scale(1.04); }
.name-mini.speaking { background: color-mix(in srgb, var(--blue) 75%, #000); }
.btn.outline.speaking { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 380px) { .card-btns span { display: none; } .name-mini, .card-btns .play-mini { padding: 0 10px; } }
.play-mini {
  position: relative; z-index: 2; height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.94); color: #151714; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: transform .15s, background .15s;
}
.play-mini .ico { width: 13px; height: 13px; }
.play-mini:hover { transform: scale(1.04); }
.play-mini.playing { background: var(--accent); color: var(--accent-ink); }
.card-img img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- Tree of life tiles ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--surface-2) center / cover no-repeat;
  display: flex; flex-direction: column; justify-content: end; padding: 16px; color: #fff;
}
.tile::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.65)); }
.tile > * { position: relative; }
.tile b { font: 600 20px/1.15 var(--serif); }
.tile span { font-size: 13px; opacity: .85; }
@media (hover: hover) { .tile { transition: transform .2s; } .tile:hover { transform: translateY(-2px); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; font-weight: 600; font-size: 15px; background: var(--ink); color: var(--bg); transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.blue { background: var(--blue); color: var(--blue-ink); }
.btn.blue.speaking { background: color-mix(in srgb, var(--blue) 80%, #000); }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.outline:hover { background: var(--surface-2); opacity: 1; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }

/* ---------- Detail ---------- */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; font-size: 15px; margin: 0 0 18px -4px; padding: 4px; }
.crumb:hover { color: var(--ink); }
.detail { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); max-width: 880px; margin: 0 auto; }
.gallery { min-width: 0; }
.hero { position: relative; z-index: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3.4; }
.slides::-webkit-scrollbar { display: none; }
.slides figure { margin: 0; flex: 0 0 100%; scroll-snap-align: center; }
.slides img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumbs button { flex: 0 0 64px; height: 64px; border-radius: 10px; overflow: hidden; opacity: .55; transition: opacity .15s; outline-offset: 0; }
.thumbs button.on { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.credit { font-size: 12px; color: var(--ink-3); margin-top: 8px; min-height: 1.4em; }
.save { z-index: 3;
  position: absolute; top: 14px; right: 14px; height: 38px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.92); color: #151714; font-size: 14px; font-weight: 600; backdrop-filter: blur(8px);
}
.save .ico { width: 17px; height: 17px; }
.save.on .ico { fill: currentColor; }

.d-tax { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.d-sci { font-style: italic; color: var(--ink-2); margin: 6px 0 0; font-size: 17px; }

.sound {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px;
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center;
}
.sound-play { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: transform .15s; }
.sound-play:hover { transform: scale(1.05); }
.sound-play .ico { width: 22px; height: 22px; margin-left: 3px; }
.sound-play.playing .ico { margin-left: 0; }
.sound-title { font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sound-title small { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.sound-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.sound-note a { text-decoration: underline; text-underline-offset: 2px; }

.d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.d-actions .btn { flex: 1 1 160px; }

.about { margin-top: 32px; }
.about p { font-size: 18px; line-height: 1.6; margin: 10px 0 0; color: var(--ink); max-width: 70ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Animal page: icons lead, words follow only where a child needs them. */
.d-head { margin-bottom: -8px; }
.d-title { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.detail > .gallery + div > .d-acts:first-child { margin-top: 0; }
.d-title .h-display { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.back-round { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); transition: background .15s, transform .15s; }
.back-round:hover { background: color-mix(in srgb, var(--ink) 12%, var(--surface-2)); }
.back-round:active { transform: scale(.92); }
.back-round .ico { width: 24px; height: 24px; stroke-width: 2.4; }
.dbar { justify-content: flex-end; }
.say-round { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--blue-ink); transition: transform .15s, background .15s; }
.say-round:hover { transform: scale(1.06); }
.say-round:active { transform: scale(.94); }
.say-round.speaking { background: color-mix(in srgb, var(--blue) 78%, #000); }
.say-round .ico { width: 22px; height: 22px; }
.d-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; margin-top: 24px; }
@media (max-width: 520px) { .act { padding: 14px 4px 12px; gap: 8px; } .act-ico { width: 52px; height: 52px; } .act-ico .ico { width: 24px; height: 24px; } .act-cap { font-size: 13px; } }
.act { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0; }
.act:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); box-shadow: 0 6px 20px -12px rgba(0,0,0,.25); }
.act:active { transform: scale(.97); }
.act-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.act-ico .ico { width: 28px; height: 28px; }
.act-cap { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-sound .act-ico { background: var(--accent); color: var(--accent-ink); }
.act-sound .act-ico .ico { margin-left: 3px; }
.act-sound.playing .act-ico { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); animation: actPulse 1.2s ease-in-out infinite; }
.act-sound.playing .act-ico .ico { margin-left: 0; }
@keyframes actPulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 8%, transparent); } }
.act-read .act-ico { background: var(--blue-soft); color: var(--blue); }
.act-read.speaking .act-ico { background: var(--blue); color: var(--blue-ink); }
.hero-acts { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: flex; gap: 10px; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; background: rgba(255,255,255,.94); color: #151714; font: 700 16px/1 var(--sans); white-space: nowrap; box-shadow: 0 6px 20px -8px rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s; }
.hero-btn:hover { transform: scale(1.05); }
.hero-btn:active { transform: scale(.95); }
.hero-btn .ico { width: 22px; height: 22px; }
.hero-sound { background: var(--accent); color: var(--accent-ink); }
.hero-sound.playing { animation: actPulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 520px) { .hero-acts { right: 12px; bottom: 12px; gap: 8px; } .hero-btn { height: 44px; padding: 0 14px 0 12px; font-size: 15px; } }
.act-story .act-ico { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--blue); }
.act-story.on { border-color: var(--blue); }
.act-story.on .act-ico { background: var(--blue); color: var(--blue-ink); }
.story[hidden] { display: none; }
.d-note { margin: 0 2px; }
.d-note:empty { display: none; }
.d-bio { font-size: 18px; line-height: 1.6; margin: 8px 0 0; color: var(--ink); }
.d-bio[lang="ta"] { font-size: 19px; line-height: 1.75; }
.facts { margin: 22px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface-2); }
.fact-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.fact dd { margin: 0; font-weight: 500; font-size: 15px; line-height: 1.4; min-width: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } }
.fact-fun { grid-column: 1 / -1; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.fact-fun .fact-ico { background: var(--accent); color: var(--accent-ink); }
.fact-fun dd { font-size: 16px; }
.story-head { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-bottom: 10px; }
.story-head h3 { margin: 0 !important; }
.story-head .say-round .ico { margin-left: 2px; }
.source { font-size: 12.5px; color: var(--ink-3); margin-top: 22px; }
.source a { text-decoration: underline; text-underline-offset: 2px; }

.langswitch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; flex-shrink: 0;
  height: 40px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px; isolation: isolate; cursor: pointer;
}
.langswitch .opt { position: relative; z-index: 1; padding: 0 14px; line-height: 32px; text-align: center; color: var(--ink-2); white-space: nowrap; transition: color .2s; }
.langswitch .opt[lang="ta"] { font-family: 'Noto Sans Tamil', var(--sans); }
/* The sliding highlight sits behind whichever language is on. */
.langswitch::before {
  content: ''; position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .25s cubic-bezier(.3,.7,.3,1);
}
.langswitch[aria-checked="true"]::before { transform: translateX(100%); }
.langswitch[aria-checked="false"] .opt[data-l="en"], .langswitch[aria-checked="true"] .opt[data-l="ta"] { color: var(--accent-ink); }
.langswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .brand { order: 0; } .langswitch { order: 1; margin-left: auto; } .search { order: 2; }
}
.name-opt { display: flex; gap: 8px; }
.name-opt .name-choice { flex: 1; min-width: 0; }
.say-opt { width: 60px; height: 60px; flex-shrink: 0; border-radius: 14px; background: var(--blue); color: #fff; display: grid; place-items: center; transition: transform .1s, background .15s; }
.say-opt .ico { width: 26px; height: 26px; stroke-width: 2; }
.say-opt:active { transform: scale(.94); }
.say-opt.speaking { background: color-mix(in srgb, var(--blue) 75%, #000); }
.name-choice[lang="ta"] { font-family: 'Noto Sans Tamil', var(--sans); font-size: 19px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; width: 10px; height: 14px; border-radius: 2px; }

/* ---------- Detail bar: big Back + Previous / Next ---------- */
.dbar { position: sticky; top: var(--top-h, 69px); z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -24px -24px 20px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.back-big { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 22px 0 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 18px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.12); flex-shrink: 0; }
.back-big .ico { width: 24px; height: 24px; stroke-width: 2.4; }
.back-big:active { transform: scale(.97); }
.pn-wrap { display: flex; gap: 8px; min-width: 0; }
.pn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); min-width: 0; max-width: 240px; }
.pn:hover { border-color: var(--ink-3); }
.pn:active { transform: scale(.97); }
.pn img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pn span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pn small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pn .ico { width: 22px; height: 22px; stroke-width: 2.2; flex-shrink: 0; }
.pn.off { visibility: hidden; width: 52px; padding: 0; }
@media (max-width: 760px) {
  .dbar { margin: -18px -16px 14px; padding: 10px 16px; }
  .pn { width: 52px; padding: 0; justify-content: center; }
  .pn img, .pn span { display: none; }
  .back-big { height: 52px; font-size: 17px; }
}
.langs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-top: 16px; }
.langs button { height: 36px; padding: 0 16px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.langs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
[lang="ta"] { font-family: 'Noto Sans Tamil', var(--sans); }
.about p[lang="ta"] { font-size: 19px; line-height: 1.75; }
.ta-note { font-size: 13px; color: var(--ink-3); margin: 8px 0 0 !important; }
.ta-note a { text-decoration: underline; }
.quiz-player p { margin: 0; color: var(--ink-2); font-weight: 500; }

/* ---------- Page heads / states ---------- */
.page-head { margin: 4px 0 28px; }
.empty { text-align: center; padding: 64px 16px; color: var(--ink-2); }
.empty b { display: block; font: 600 22px var(--serif); color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.load-more { display: flex; justify-content: center; margin: 28px 0 0; min-height: 40px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.end { color: var(--ink-3); font-size: 14px; margin: 0; }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.stats { display: flex; gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; text-align: center; min-width: 84px; }
.stat b { display: block; font: 600 22px var(--serif); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); }
.quiz-player { margin: 16px 0; display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.quiz-player .sound-play { width: 64px; height: 64px; flex-shrink: 0; }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { text-align: left; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--ink-3); }
.choice img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--surface-2); max-height: calc((100svh - var(--top-h, 69px) - 420px) / 2); min-height: 90px; }
.choice div { padding: 10px 12px; font-weight: 600; font-size: 15px; }
.choice.right { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.choice.wrong { opacity: .4; }
.feedback { min-height: 28px; margin: 14px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feedback p { margin: 0; font-weight: 600; }
.feedback .ok { color: var(--accent); }

.quiz-modes { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 14px; }
.quiz-modes a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.quiz-modes a .ico { width: 17px; height: 17px; }
.quiz-modes a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
/* The whole quiz fits on one screen: the photo takes whatever height is left. */
.name-photo { margin: 16px 0 12px; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); width: 100%;
  height: clamp(180px, calc(100svh - var(--top-h, 69px) - 390px), 460px); }
.name-photo img { width: 100%; height: 100%; object-fit: cover; }
.name-photo figcaption { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-choice { height: 60px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; font-weight: 600; transition: border-color .15s, opacity .2s; }
.name-choice:hover { border-color: var(--ink-3); }
.name-choice.right { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); color: var(--accent); }
.name-choice.wrong, .name-choice.dim { opacity: .4; }
.feedback .row { display: flex; gap: 10px; margin-left: auto; }
.more-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }

/* ---------- Tab bar (mobile) ---------- */
.tabbar { display: none; }
@media (max-width: 980px) and (min-width: 761px) { .top-inner { gap: 16px; } .brand span { display: none; } }
@media (max-width: 760px) {
  .topnav { display: none; }
  .top-inner { flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px 12px; }
  .search { flex: 1 1 100%; margin: 0; }
  main { padding: 18px 16px 32px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--ink-3); }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a[aria-current="page"] .ico { stroke-width: 2.1; }
  .filters { margin: 0 -16px 16px; padding: 0 16px; }
  .feature { grid-template-columns: 1fr; min-height: 0; }
  .feature-img { aspect-ratio: 4 / 3; }
  .feature-body { padding: 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; } .tile b { font-size: 17px; }
  .section-head { margin-top: 36px; }
  .detail { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .gallery { position: static; margin: 0 -16px; }
  .gallery .hero { border-radius: 0; }
  .gallery .thumbs, .gallery .credit { padding: 0 16px; }
}

/* ---------- Overlays ---------- */
.listening { position: fixed; inset: 0; z-index: 60; background: rgba(10,12,10,.5); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(6px); }
.listening[hidden], .viewer3d[hidden] { display: none; }
.listening-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px 24px 24px; text-align: center; width: min(360px, 100%); box-shadow: var(--shadow); }
.pulse { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; animation: ring 1.5s infinite; }
.pulse .ico { width: 30px; height: 30px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.listening-title { font: 600 22px var(--serif); margin: 0; }
.listening-hint { color: var(--ink-2); margin: 6px 0 20px; min-height: 1.5em; }

.viewer3d { position: fixed; inset: 0; z-index: 70; background: #0E100E; color: #fff; display: flex; flex-direction: column; }
.viewer3d-bar { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 12px) 20px 12px; }
.viewer3d-bar strong { font: 600 22px var(--serif); }
.viewer3d-bar .eyebrow { color: rgba(255,255,255,.55); }
.viewer3d-bar .iconbtn { background: rgba(255,255,255,.1); color: #fff; }
.viewer3d-stage { flex: 1; position: relative; }
.viewer3d-stage iframe, .viewer3d-stage model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: radial-gradient(circle at 50% 40%, #2b3a32, #0E100E 70%); }
.viewer3d-hint { text-align: center; margin: 0; padding: 12px 16px calc(env(safe-area-inset-bottom) + 14px); color: rgba(255,255,255,.55); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; z-index: 80; animation: fadeup .2s; max-width: calc(100% - 32px); text-align: center; }
@media (max-width: 760px) { .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); } }
@keyframes fadeup { from { opacity: 0; transform: translate(-50%, 8px); } }

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

/* Quiz: tighter title, and leave room for the phone tab bar. */
.quiz .h-display { font-size: clamp(28px, 4vw, 40px); }
.quiz .stat { padding: 6px 12px; } .quiz .stat b { font-size: 19px; }
@media (max-width: 760px) {
  .name-photo { height: clamp(150px, calc(100svh - var(--top-h, 118px) - 530px), 360px); }
  .name-choice, .say-opt { height: 54px; } .say-opt { width: 54px; }
  .quiz .feedback .btn { height: 42px; padding: 0 14px; }
}

/* Tamil words are longer: buttons and labels grow to fit on one line instead of wrapping. */
.btn, .filter, .play-mini, .quiz-modes a, .tabbar a, .topnav a, .back-big, .save, .mute, .stat span, .name-choice, .pill, .crumb { white-space: nowrap; }
.d-actions .btn, .feedback .btn, .feature-body .btn { flex: 0 0 auto; }
.name-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.name-opt { flex: 1 1 calc(50% - 5px); min-width: max-content; }
.name-choice { padding: 0 18px; }
.quiz-modes { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
:lang(ta) .tabbar a { font-size: 10.5px; }

/* A blue speaker beside every name says it aloud (in the chosen language). */
.name-row, .title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-row .card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.say-name { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; transition: transform .1s, background .15s; }
.say-name .ico { width: 16px; height: 16px; stroke-width: 2; }
.say-name:active { transform: scale(.92); }
.say-name.speaking { background: color-mix(in srgb, var(--blue) 75%, #000); }
.say-name.big { width: 44px; height: 44px; } .say-name.big .ico { width: 22px; height: 22px; }
.choice-wrap { position: relative; display: flex; }
.choice-wrap .choice { flex: 1; }
.choice-wrap .choice div { padding-right: 52px; }
.say-opt.in-choice { position: absolute; right: 8px; bottom: 6px; width: 38px; height: 38px; border-radius: 12px; }
.say-opt.in-choice .ico { width: 20px; height: 20px; }

/* Quiz: the Next button fills from left to right during the 2 s before the next question. */
#next.auto { position: relative; overflow: hidden; isolation: isolate; }
#next.auto::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform-origin: left; animation: fillNext 2s linear forwards; }
@keyframes fillNext { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Games screen */
.games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.game-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.game-card:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.game-card b { font: 600 22px/1.2 var(--serif); }
.game-card span:not(.game-ico) { color: var(--ink-2); font-size: 15px; }
.game-card small { position: absolute; top: 18px; right: 18px; display: inline-flex; gap: 4px; align-items: center; color: var(--accent); font-weight: 600; }
.game-card small .ico { width: 14px; height: 14px; }
.game-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.game-ico .ico { width: 24px; height: 24px; }
.group-name { margin: 0 0 14px; } .group-name b { font: 600 24px var(--serif); }
.choice.dim, .name-choice.dim { opacity: .45; }
/* Memory match */
.memory { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .memory { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mem { position: relative; aspect-ratio: 1; border-radius: 14px; perspective: 600px; }
.mem .back, .mem .front { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; backface-visibility: hidden; transition: transform .35s; display: grid; place-items: center; }
.mem .back { background: var(--accent); color: var(--accent-ink); }
.mem .back .ico { width: 32px; height: 32px; opacity: .7; }
.mem .front { transform: rotateY(180deg); background: var(--surface-2); }
.mem .front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mem .front b { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem.up .back { transform: rotateY(180deg); } .mem.up .front { transform: rotateY(360deg); }
.mem.matched .front { box-shadow: 0 0 0 3px var(--accent); }

/* Story on the animal page */
.story { margin-top: 28px; padding: 22px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line)); }
.story h3 { font: 600 24px/1.25 var(--serif); margin: 6px 0 10px; }
.story h3[lang="ta"] { font-family: 'Noto Sans Tamil', var(--sans); font-size: 21px; }
.story p { font-size: 18px; line-height: 1.7; margin: 0 0 16px; }
.story-entry { background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.story-entry .game-ico { background: var(--blue-soft); color: var(--blue); }

/* =====================================================================================
   Android app mode — Material Design 3 from the shared Kolam M3 kit (kolam-m3.css). Applied when
   html has .k-android (inside the Android app, or the Chrome-installed app on Android). The kit
   builds the top app bar, navigation bar, ripple and snackbar; this section maps Vanam's own
   tokens onto the M3 roles and gives Vanam's own components M3 shapes. The website stays as is.
   ===================================================================================== */
.appbar { display: none; }
/* App-bar buttons (Android search bar) */
.ab-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.ab-btn .ico { width: 24px; height: 24px; stroke-width: 2; }
.ab-btn[hidden] { display: none; }
.ab-title { flex: 1; min-width: 0; margin: 0 0 0 12px; font: 400 22px/28px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#abBack:not([hidden]) + .ab-title { margin-left: 4px; }
.ab-lang { font: 500 15px var(--sans); color: var(--accent); }
.ab-lang[lang="ta"] { font-family: 'Noto Sans Tamil', var(--sans); font-size: 18px; }
html.k-android.android:not(#k-m3) {
  --sans: var(--md-ref-typeface-plain); --serif: var(--md-ref-typeface-brand);
  --bg: var(--md-sys-color-surface); --surface: var(--md-sys-color-surface-container); --surface-2: var(--md-sys-color-surface-container-high);
  --ink: var(--md-sys-color-on-surface); --ink-2: var(--md-sys-color-on-surface-variant); --ink-3: var(--md-sys-color-outline);
  --line: var(--md-sys-color-outline-variant);
  --accent: var(--md-sys-color-primary); --accent-ink: var(--md-sys-color-on-primary);
  --blue: var(--md-sys-color-primary); --blue-ink: var(--md-sys-color-on-primary); --blue-soft: var(--md-sys-color-primary-container);
  --radius: var(--md-sys-shape-corner-medium); --radius-lg: var(--md-sys-shape-corner-large);
}
html.k-android body { font-size: 16px; }
html.k-android .langswitch, html.k-android .crumb { display: none; }
html.k-android #abLang .md-icon-button__text { color: var(--md-sys-color-primary); }

/* The website header becomes a full-width M3 search bar that opens from the search icon */
html.k-android .top { display: none; }
html.k-android.searching .top { display: block; position: fixed; inset: 0 0 auto 0; z-index: 40; background: var(--md-sys-color-surface); border: 0; padding-top: var(--md-inset-top); backdrop-filter: none; box-shadow: none; }
html.k-android.searching .top-inner { padding: 8px 16px; }
html.k-android.searching .brand, html.k-android.searching .topnav { display: none; }
html.k-android .search { flex: 1 1 100%; margin: 0; height: 56px; border-radius: var(--md-sys-shape-corner-full); border: 0; background: var(--md-sys-color-surface-container-high); padding: 0 4px; box-shadow: none; }
html.k-android .search > .ico { display: none; }
html.k-android .search input { font: var(--md-sys-typescale-body-large); color: var(--md-sys-color-on-surface); padding-left: 4px; }
html.k-android #searchClose { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--md-sys-color-on-surface); flex: none; }
html.k-android .mic { color: var(--md-sys-color-on-surface-variant); }

/* Content: the title lives in the app bar */
html.k-android main { padding: 8px 16px 24px; }
html.k-android .h-display { font: var(--md-sys-typescale-headline-medium); letter-spacing: 0; }
html.k-android .h-section { font: var(--md-sys-typescale-title-large); letter-spacing: 0; }
html.k-android .eyebrow { font: var(--md-sys-typescale-label-medium); letter-spacing: .5px; color: var(--md-sys-color-on-surface-variant); }
html.k-android .lede { font: var(--md-sys-typescale-body-medium); color: var(--md-sys-color-on-surface-variant); }
html.k-android .page-head { margin: 0 0 16px; }
html.k-android .page-head .h-display, html.k-android .quiz-top .h-display { display: none; }
html.k-android .section-head { margin: 24px 0 12px; }

/* Cards: M3 filled cards, 12dp corners, no hover lift */
html.k-android .card-img { border-radius: var(--md-sys-shape-corner-medium); }
html.k-android .card:hover .card-img img { transform: none; }
html.k-android .feature { border-radius: var(--md-sys-shape-corner-large); box-shadow: none; }
html.k-android .card-name { font: var(--md-sys-typescale-title-small); }
html.k-android .card-btns, html.k-android .card .tag3d { opacity: 1 !important; transform: none !important; }
html.k-android :is(.tile, .game-card, .sound, .quiz-player, .story, .stat, .fact, .act) { border-radius: var(--md-sys-shape-corner-large); border: 0; box-shadow: none; }
html.k-android :is(.game-card, .sound, .quiz-player, .fact) { background: var(--md-sys-color-surface-container); }
html.k-android .game-card:hover { transform: none; }
html.k-android .game-card b { font: var(--md-sys-typescale-title-medium); }
html.k-android :is(.choice, .name-choice, .mem) { border-radius: var(--md-sys-shape-corner-medium); }

/* Buttons: M3 common buttons — 40dp tall, fully rounded, label large */
html.k-android .btn { height: 40px; padding: 0 24px; border-radius: var(--md-sys-shape-corner-full); font: var(--md-sys-typescale-label-large); letter-spacing: .1px; }
html.k-android .btn .ico { width: 18px; height: 18px; }
html.k-android .btn.outline { border: 1px solid var(--md-sys-color-outline); background: transparent; color: var(--md-sys-color-primary); }
html.k-android .btn:hover { opacity: 1; }
html.k-android .d-actions .btn { flex: 0 0 auto; }
html.k-android :is(.hero-btn, .save, .back-round, .say-round) { border-radius: var(--md-sys-shape-corner-full); }

/* Filter chips: 32dp, 8dp corners, secondary container + check mark when selected */
html.k-android .filter { height: 32px; padding: 0 16px; border-radius: var(--md-sys-shape-corner-small); border: 0; box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); background: transparent; font: var(--md-sys-typescale-label-large); line-height: 32px; color: var(--md-sys-color-on-surface-variant); }
html.k-android .filter[aria-current="true"] { background: var(--md-sys-color-secondary-container); box-shadow: none; color: var(--md-sys-color-on-secondary-container); padding-left: 8px; }
html.k-android .filter[aria-current="true"]::before { content: ''; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.55 17.6 4.4 12.45l1.4-1.4 3.75 3.75 8.65-8.65 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.55 17.6 4.4 12.45l1.4-1.4 3.75 3.75 8.65-8.65 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat; }
html.k-android .filter[aria-current="true"] .n { color: inherit; opacity: .7; }
html.k-android .filters { margin: 0 -16px 16px; padding: 0 16px; }
/* Group chips carry animal photos: a 40dp chip with an avatar-style leading image */
html.k-android .filter[data-g] { height: 40px; padding: 0 16px 0 4px; line-height: 1; border-radius: var(--md-sys-shape-corner-full); }
html.k-android .filter[data-g] .fpics img { width: 32px; height: 32px; }
html.k-android .filter[data-g][aria-current="true"]::before { display: none; }
html.k-android .filter[aria-current="true"] .fpics img { border-color: var(--md-sys-color-secondary-container); }

/* Animal page: no Previous / Next on the page (swipe), no page back link (the phone's Back) */
html.k-android .dbar, html.k-android .back-big { display: none; }
html.k-android .gallery { position: static; margin: 0 -16px; }
html.k-android .hero { border-radius: 0; }
html.k-android .quiz-modes { background: none; padding: 0; margin-bottom: 8px; }
html.k-android .quiz-modes a { display: none; }
html.k-android .pn-bottom { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
html.k-android .pn-bottom .pn { flex: 1 1 0; max-width: none; width: auto; justify-content: flex-start; padding: 0 16px 0 12px; height: 48px; border: 0; border-radius: var(--md-sys-shape-corner-full); background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
html.k-android .pn-bottom .pn.next { justify-content: flex-end; }
html.k-android .pn-bottom .pn span { display: flex; font: var(--md-sys-typescale-label-large); } html.k-android .pn-bottom .pn img { display: block; width: 28px; height: 28px; }
html.k-android .pn-bottom .pn small { display: none; }
html.k-android .pn-bottom .pn.off { display: block; visibility: hidden; }
html.k-android .viewer3d { z-index: 50; }
html.k-android .viewer3d-bar { padding-top: calc(var(--md-inset-top) + 8px); }
/* The snackbar clears the navigation bar; Vanam's own toast is not used in the app */
html.k-android .toast { display: none; }
/* Long names shrink with an ellipsis instead of widening the card (and the page). */
.card-meta > div { min-width: 0; flex: 1; }

/* =====================================================================================
   iPhone app mode — Apple Human Interface Guidelines from the shared Kolam iOS kit (kolam-ios.css).
   Applied when html has .k-ios (inside the iPhone app, a Home Screen web app, or ?app=ios). The kit builds
   the navigation bar (large titles on the root tabs, Back + centred title), the Liquid Glass tab bar with
   the trailing Search tab, banners and haptics; here Vanam's own components get iOS shapes. Vanam is a
   dark app (<html data-theme="dark">), so the kit runs in its dark appearance. The website stays as is.
   ===================================================================================== */
html.k-ios { --sans: var(--ios-font); --serif: var(--ios-font-display); --radius: 16px; --radius-lg: 22px; }
html.k-ios :lang(ta) { --sans: "Noto Sans Tamil", var(--ios-font); }
html.k-ios body { font-size: 17px; letter-spacing: -.01em; -webkit-user-select: none; user-select: none; }
html.k-ios .tabbar, html.k-ios .top { display: none !important; }
html.k-ios.searching .top { display: block !important; position: fixed; inset: 0 0 auto 0; z-index: 46; padding-top: var(--sat); border: 0; background: color-mix(in srgb, var(--ios-grouped) 82%, transparent); -webkit-backdrop-filter: var(--ios-glass-filter); backdrop-filter: var(--ios-glass-filter); }
html.k-ios.searching .top-inner { padding: 8px 16px; }
html.k-ios.searching .brand, html.k-ios.searching .topnav, html.k-ios.searching .langswitch { display: none; }
html.k-ios .search { flex: 1 1 100%; margin: 0; height: 44px; border-radius: 999px; border: 0; background: var(--ios-fill3); padding: 0 4px 0 12px; box-shadow: none; }
html.k-ios .search > .ico { display: block; width: 18px; height: 18px; color: var(--ios-label2); }
html.k-ios .search input { font: 400 17px/22px var(--ios-font); color: var(--ios-label); }
html.k-ios .search input::placeholder { color: var(--ios-placeholder); }
html.k-ios #searchClose { order: 9; width: auto; padding: 0 12px; color: var(--ios-tint); height: 44px; display: inline-flex; align-items: center; border-radius: 0; }
html.k-ios #searchClose .ico { display: none; }
html.k-ios #searchClose::after { content: attr(data-cancel); font: 400 17px var(--ios-font); white-space: nowrap; }
html.k-ios .mic { color: var(--ios-label2); }
html.k-ios main { padding: 0 16px 24px; }
html.k-ios .page-head .h-display, html.k-ios .quiz-top .h-display { display: none; } /* the large title names the screen */
html.k-ios .h-display { font: 700 28px/34px var(--ios-font-display); letter-spacing: .01em; }
html.k-ios .h-section { font: 700 22px/28px var(--ios-font-display); letter-spacing: -.012em; }
html.k-ios .eyebrow { font: 600 13px/18px var(--ios-font); letter-spacing: -.01em; text-transform: uppercase; color: var(--ios-label2); }
html.k-ios .lede { font-size: 15px; line-height: 20px; color: var(--ios-label2); }
html.k-ios .page-head { margin: 0 0 14px; }
html.k-ios .card-img { border-radius: 14px; }
html.k-ios .card:hover .card-img img { transform: none; }
html.k-ios .card-name { font: 600 16px/21px var(--ios-font); }
html.k-ios .card-btns, html.k-ios .card .tag3d { opacity: 1 !important; transform: none !important; }
html.k-ios :is(.feature, .sound, .quiz-player, .game-card, .story) { border-radius: var(--ios-radius-card); border: 0; box-shadow: none; }
html.k-ios :is(.sound, .quiz-player, .game-card) { background: var(--ios-grouped2); }
html.k-ios .game-card:hover { transform: none; }
html.k-ios .game-card b { font: 600 19px/24px var(--ios-font); }
html.k-ios .feature-body { padding: 16px; }
html.k-ios .btn { height: 44px; padding: 0 20px; border-radius: 999px; font: 600 17px/22px var(--ios-font); }
html.k-ios .btn.outline { border: 0; background: var(--ios-fill3); color: var(--ios-tint); }
html.k-ios .btn:hover { opacity: 1; }
html.k-ios .d-actions .btn { flex: 0 0 auto; }
html.k-ios :is(.hero-btn, .save, .back-round, .say-round) { border-radius: 999px; }
html.k-ios .filter { height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--ios-fill3); font: 500 15px/32px var(--ios-font); color: var(--ios-label); }
html.k-ios .filter[aria-current="true"] { background: var(--ios-tint-fill); color: var(--ios-on-tint); }
html.k-ios .filters { margin: 0 -16px 14px; padding: 0 16px; }
html.k-ios .filter[data-g] { padding: 0 14px 0 4px; line-height: 1; }
html.k-ios .filter[data-g] .fpics img { width: 32px; height: 32px; }
html.k-ios .filter .fpics img { border-color: transparent; }
html.k-ios .fact { background: var(--ios-grouped2); border-radius: 16px; }
html.k-ios .fact-ico { background: var(--ios-fill3); }
html.k-ios .act { border: 0; border-radius: 16px; box-shadow: none; }
html.k-ios :is(.choice, .name-choice, .mem) { border-radius: 16px; }
/* Animal page */
html.k-ios .dbar, html.k-ios .back-big { display: none; }
html.k-ios .gallery { position: static; margin: 0 -16px; }
html.k-ios .hero { border-radius: 0; }
html.k-ios .detail .h-display { font-size: 34px; line-height: 41px; }
html.k-ios .pn-bottom { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
html.k-ios .pn-bottom .pn { flex: 1 1 0; max-width: none; height: 48px; border-radius: 999px; border: 0; background: var(--ios-grouped2); padding: 0 16px 0 10px; justify-content: flex-start; color: var(--ios-label); }
html.k-ios .pn-bottom .pn.next { justify-content: flex-end; padding: 0 10px 0 16px; }
html.k-ios .pn-bottom .pn span { display: flex; font: 600 15px var(--ios-font); color: var(--ios-label); } html.k-ios .pn-bottom .pn small { display: none; }
html.k-ios .pn-bottom .pn img { display: block; width: 28px; height: 28px; }
html.k-ios .pn-bottom .pn.off { display: block; visibility: hidden; }
html.k-ios .quiz-modes { background: none; padding: 0; margin: 0; } html.k-ios .quiz-modes a { display: none; }
html.k-ios .langswitch { display: none; }
html.k-ios .viewer3d { z-index: 50; }
html.k-ios .viewer3d-bar { padding-top: calc(var(--sat) + 8px); }
/* Banner (toast) above the tab bar, in the kit's glass */
html.k-ios .toast { bottom: calc(var(--ios-tabbar-space) + 8px); border-radius: 999px; background: var(--ios-glass-strong); color: var(--ios-label); -webkit-backdrop-filter: var(--ios-glass-filter); backdrop-filter: var(--ios-glass-filter); box-shadow: var(--ios-glass-shade); font: 500 15px var(--ios-font); }
/* iOS press feedback: dim instead of a ripple */
html.k-ios :is(button, .btn, .filter, .pn, .game-card, .choice, .name-choice, .tile):active { opacity: .55; transition: opacity 0s; }
html.k-ios a.card:active .card-img { opacity: .7; }
html.app .crumb { display: none; }

.hero-sound span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 761px) { .detail .slides { aspect-ratio: 16 / 10; } }

/* Previous / Next beside the photo on wide screens (arrow keys work too). */
.hero-wrap { position: relative; }
.pn-side { display: none; }
@media (min-width: 1240px) {
  .pn-side { position: absolute; top: 50%; transform: translateY(-50%); width: 132px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: var(--radius-lg); color: var(--ink); text-align: center; transition: background .15s; }
  .pn-side.prev { right: calc(100% + 20px); }
  .pn-side.next { left: calc(100% + 20px); }
  .pn-side:hover { background: var(--surface); }
  .pn-side:active { transform: translateY(-50%) scale(.96); }
  .pn-side img, .pn-side-ph { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 3px var(--surface), 0 6px 18px -8px rgba(0,0,0,.35); }
  .pn-side b { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pn-side kbd { font: 600 13px/1 var(--sans); min-width: 30px; height: 26px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); color: var(--ink-2); }
  .dbar { display: none; } /* the side ones take over */
}
@media (hover: none) { .pn-side kbd { display: none; } }

/* ================= Website look, after Unsplash: white canvas, pill search, bold sans titles,
   a masonry wall of photos with the name on the photo and the buttons on hover. The apps keep
   their own Material / iOS styling. ================= */
html:not(.app) {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F2F2F2; --ink: #111111; --ink-2: #6B6B6B; --ink-3: #8F8F8F; --line: #E6E6E6;
  --radius: 6px; --radius-lg: 10px; --serif: var(--sans);
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  html:not(.app):not([data-theme="light"]) { --bg: #111111; --surface: #1A1A1A; --surface-2: #242424; --ink: #F5F5F5; --ink-2: #A3A3A3; --ink-3: #7A7A7A; --line: #2B2B2B; }
}
html:not(.app)[data-theme="dark"] { --bg: #111111; --surface: #1A1A1A; --surface-2: #242424; --ink: #F5F5F5; --ink-2: #A3A3A3; --ink-3: #7A7A7A; --line: #2B2B2B; }

/* Header: logo, one wide pill search, quiet links */
html:not(.app) .top { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
html:not(.app) .top-inner { max-width: none; padding: 10px clamp(16px, 3vw, 48px); gap: 18px; }
html:not(.app) .search { order: 1; flex: 1 1 auto; max-width: none; height: 40px; border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; padding: 0 16px; margin-left: 0; }
html:not(.app) .search:focus-within { background: var(--surface); border-color: var(--line); box-shadow: none; }
html:not(.app) .search input { font-size: 15px; }
html:not(.app) .topnav { order: 2; }
html:not(.app) .topnav a { border-radius: 6px; font-weight: 500; color: var(--ink-2); }
html:not(.app) .topnav a[aria-current="page"], html:not(.app) .topnav a:hover { background: none; color: var(--ink); }
html:not(.app) .langswitch { order: 3; }
html:not(.app) main { max-width: none; padding: 32px clamp(16px, 3vw, 48px) 72px; }

/* Titles: big, bold, plain */
html:not(.app) .h-display { font: 700 clamp(30px, 4.4vw, 46px)/1.1 var(--sans); letter-spacing: -.025em; }
html:not(.app) .h-section { font: 700 22px/1.25 var(--sans); letter-spacing: -.015em; }
html:not(.app) .eyebrow { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ink-2); }
html:not(.app) .lede { color: var(--ink-2); }
html:not(.app) .story h3, html:not(.app) .feature-body .h-display { font-family: var(--sans); }

/* Group chips: flat, square-cornered, with their photo */
html:not(.app) .filter { border-radius: 6px; border-color: var(--line); background: var(--surface); color: var(--ink-2); }
html:not(.app) .filter:hover { border-color: var(--ink-3); color: var(--ink); }
html:not(.app) .filter[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
html:not(.app) .fpics img { border-radius: 4px; border-color: var(--surface); }
html:not(.app) .filter[aria-current="true"] .fpics img { border-color: var(--ink); }
html:not(.app) .az button { border-radius: 6px; }
html:not(.app) .az button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Masonry wall */
html:not(.app) .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: 8px; gap: 0 24px; align-items: start; }
@media (max-width: 760px) { html:not(.app) .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } }
html:not(.app) .card { position: relative; }
html:not(.app) .card-img { border-radius: 4px; aspect-ratio: 4 / 3; }
html:not(.app) .card-img::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 42%); transition: background .2s; }
@media (hover: hover) {
  html:not(.app) .card:hover .card-img::after { background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,.12) 55%, rgba(0,0,0,.25)); }
  html:not(.app) .card:hover .card-img img { transform: none; }
}
html:not(.app) .card-meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 14px; pointer-events: none; color: #fff; }
html:not(.app) .card-meta > div { min-width: 0; }
html:not(.app) .card-meta button { pointer-events: auto; }
html:not(.app) .card-name { color: #fff; font-size: 16px; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
html:not(.app) .card-sub { color: rgba(255,255,255,.8); }
html:not(.app) .card-btns { top: 12px; right: 12px; bottom: auto; }
html:not(.app) .card .tag3d { top: 12px; left: 12px; }
html:not(.app) .play-mini, html:not(.app) .name-mini { border-radius: 6px; }
@media (max-width: 760px) {
  html:not(.app) .card-meta { padding: 8px 10px; }
  html:not(.app) .card-name { font-size: 14px; }
  html:not(.app) .card-sub { display: none; }
  html:not(.app) .card-btns { top: 8px; right: 8px; }
}

/* Featured, tiles, buttons, animal page: smaller corners, flat */
html:not(.app) .feature { border-radius: 10px; box-shadow: none; border: 1px solid var(--line); }
html:not(.app) .tile, html:not(.app) .game-card, html:not(.app) .story, html:not(.app) .fact { border-radius: 8px; }
html:not(.app) .btn { border-radius: 6px; }
html:not(.app) .hero { border-radius: 6px; }
html:not(.app) .hero-btn, html:not(.app) .save, html:not(.app) .mute { border-radius: 6px; }
html:not(.app) .fact { background: var(--surface-2); }
html:not(.app) .fact-fun { background: var(--surface-2); }
html:not(.app) .back-big { border-radius: 6px; }
html:not(.app) .pn { border-radius: 6px; }
html:not(.app) .thumbs button { border-radius: 4px; }
@media (max-width: 760px) {
  html:not(.app) .search { order: 9; flex: 1 1 100%; }
  html:not(.app) .langswitch { margin-left: auto; }
  html:not(.app) .top-inner { padding: 10px 16px 12px; }
  html:not(.app) main { padding: 18px 16px 32px; }
}
/* Profile picture sits at the far right of the header */
html:not(.app) .top-inner .ka-avatar { order: 10; flex-shrink: 0; }

/* While a letter is picked, species added by scrolling stay hidden too */
#libGrid[data-az]:not([data-az=""]) > .card:not([data-letter]) { display: none; }

/* The animal's name lines up with the photo's left edge: on wide screens the round Back hangs in the
   margin; on smaller ones it sits in the bar above, left of Previous / Next. */
.d-title { position: relative; }
.d-title .back-round { display: none; }
.dbar { justify-content: space-between; }
@media (min-width: 1100px) {
  .d-title .back-round { display: grid; position: absolute; right: calc(100% + 16px); top: 50%; transform: translateY(-50%); }
  .d-title .back-round:active { transform: translateY(-50%) scale(.92); }
  .back-bar { display: none; }
  .dbar { justify-content: flex-end; }
}

/* Games: a photo on top of each card, the game's icon as a badge on it */
.game-card { padding: 0 0 18px; overflow: hidden; }
.game-card > b, .game-card > span:not(.game-cover) { padding: 0 18px; }
.game-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); margin-bottom: 8px; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) { .game-card:hover .game-cover img { transform: scale(1.04); } }
.game-cover .game-ico { position: absolute; left: 14px; bottom: -20px; margin: 0; width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 0 3px var(--surface); }
.game-card > b { margin-top: 14px; }
.game-card small { z-index: 2; top: 12px; right: 12px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.94); color: #1F5A43; }
.game-card.story-entry { background: var(--surface); }

/* Game card pictures: a tiny drawing of each game, made from real animal photos */
.game-cover { overflow: hidden; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ga { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 18px 22px; }
.ga img, .ga i { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.ga .ok { box-shadow: 0 0 0 3px var(--accent); }
.ga-story { gap: 0; }
.ga-story .ga-page { width: 42%; height: 86%; background: var(--surface); border-radius: 4px 0 0 4px; padding: 8px; box-shadow: 0 4px 14px -6px rgba(0,0,0,.25); }
.ga-story .ga-page + .ga-page { border-radius: 0 4px 4px 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px; }
.ga-story .ga-page img { border-radius: 3px; }
.ga-lines i { height: 5px; border-radius: 3px; background: var(--line); }
.ga-lines i:nth-child(2n) { width: 78%; }
.ga-sound { flex-direction: column; gap: 10px; }
.ga-speaker { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 0 0 7px color-mix(in srgb, var(--blue) 18%, transparent); }
.ga-speaker .ico { width: 22px; height: 22px; }
.ga-row { display: flex; gap: 12px; }
.ga-dot { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; border: 2px solid var(--surface); }
.ga-name .ga-photo { width: 46%; height: 88%; border-radius: 6px; overflow: hidden; }
.ga-chips { display: flex; flex-direction: column; gap: 6px; }
.ga-chips b { font: 600 12px/1 var(--sans); padding: 7px 10px; border-radius: 6px; background: var(--surface); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ga-chips b.ok { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.ga-find { flex-direction: column; gap: 8px; }
.ga-say { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: var(--blue); color: #fff; }
.ga-say .ico { width: 14px; height: 14px; }
.ga-grid { display: grid; grid-template-columns: repeat(4, 46px); gap: 8px; }
.ga-grid span { width: 46px; height: 46px; border-radius: 6px; overflow: hidden; }
.ga-odd span { width: 50px; height: 50px; border-radius: 6px; overflow: hidden; }
.ga-odd span.odd { box-shadow: 0 0 0 3px var(--warm); transform: translateY(-4px) rotate(-4deg); }
.ga-memory { display: grid; grid-template-columns: repeat(3, 44px); gap: 8px; }
.ga-memory span { width: 44px; height: 52px; border-radius: 6px; overflow: hidden; }
.ga-memory .down { display: grid; place-items: center; background: var(--accent); color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.ga-memory .down .ico { width: 18px; height: 18px; }
.ga-memory .up { box-shadow: 0 0 0 3px var(--warm); }
.game-card span.ga-speaker, .game-card span.ga-say { color: #fff; font-size: 12px; }
.game-card .ga-memory span.down { color: rgba(255,255,255,.75); }

/* Each game picture has its own colour and pattern */
.game-card .game-cover { overflow: visible; --gp: color-mix(in srgb, var(--gc) 72%, #000); background-color: color-mix(in srgb, var(--gc) 22%, var(--surface)); }
.gc-story  { --gc: #4C7DF0; background-image: radial-gradient(color-mix(in srgb, var(--gc) 30%, transparent) 1.6px, transparent 1.8px); background-size: 16px 16px; }
.gc-sound  { --gc: #F08A4C; background-image: repeating-radial-gradient(circle at 50% 38%, transparent 0 14px, color-mix(in srgb, var(--gc) 22%, transparent) 14px 16px); }
.gc-name   { --gc: #3FAE6E; background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--gc) 18%, transparent) 0 8px, transparent 8px 18px); }
.gc-find   { --gc: #8C6CE6; background-image: linear-gradient(color-mix(in srgb, var(--gc) 18%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--gc) 18%, transparent) 1px, transparent 1px); background-size: 20px 20px; }
.gc-group  { --gc: #E8B320; background-image: radial-gradient(circle, color-mix(in srgb, var(--gc) 38%, transparent) 2.5px, transparent 3px), radial-gradient(circle, color-mix(in srgb, var(--gc) 22%, transparent) 2.5px, transparent 3px); background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.gc-odd    { --gc: #E35D8F; background-image: linear-gradient(135deg, color-mix(in srgb, var(--gc) 20%, transparent) 25%, transparent 25%), linear-gradient(225deg, color-mix(in srgb, var(--gc) 20%, transparent) 25%, transparent 25%); background-size: 22px 22px; }
.gc-memory { --gc: #1E9E9A; background-image: conic-gradient(color-mix(in srgb, var(--gc) 16%, transparent) 25%, transparent 0 50%, color-mix(in srgb, var(--gc) 16%, transparent) 0 75%, transparent 0); background-size: 28px 28px; }
.game-card .game-ico { background: var(--surface); color: color-mix(in srgb, var(--gc) 80%, var(--ink)); box-shadow: 0 0 0 3px var(--surface), 0 4px 12px -6px rgba(0,0,0,.3); }
.game-card .ga .ok { box-shadow: 0 0 0 3px var(--gp); }
.game-card .ga-chips b.ok { background: var(--gp); color: #fff; }
.game-card .ga-memory span.down { background: var(--gp); }
.story-entry .game-cover { background-color: color-mix(in srgb, var(--gc) 22%, var(--surface)); }

/* ================= Animal page as a cinematic hero (after Netflix's title page): the photo or video
   fills the width, a dark shade rises from the bottom-left, and the name, details and buttons sit on it.
   ← / → keys (or swipe) go to the previous / next animal. ================= */
.detail.nf { max-width: none; gap: 28px; }
.nf .gallery { margin: 0; }
.nf .hero { border-radius: 14px; background: #000; color: #fff; }
.nf .slides { aspect-ratio: 16 / 7.4; }
@media (max-width: 1000px) { .nf .slides { aspect-ratio: 4 / 3; } }
@media (max-width: 760px) { .nf .gallery { margin: 0 -16px; } .nf .hero { border-radius: 0; } .nf .slides { aspect-ratio: 4 / 5; max-height: 72svh; } }
.nf-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 32%, rgba(0,0,0,0) 62%),
              linear-gradient(to right, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 55%); }
.nf .vfig.live ~ .nf-shade { opacity: .55; }
.nf-info { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 0 48px 40px; display: flex; flex-direction: column; gap: 18px; pointer-events: none; }
.nf-info > * { pointer-events: auto; }
.nf .d-head { margin: 0; }
.nf .d-title { margin: 0; gap: 16px; }
.nf .d-title .h-display { color: #fff; font: 800 clamp(34px, 5.6vw, 72px)/1 var(--sans); letter-spacing: -.03em; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.nf .d-title .h-display[lang="ta"], html[lang="ta"] .nf .d-title .h-display { font-family: 'Noto Sans Tamil', var(--sans); font-size: clamp(30px, 4.6vw, 58px); line-height: 1.15; }
.nf-meta { display: flex; flex-wrap: wrap; align-items: center; margin: 12px 0 0; font-size: 16px; font-weight: 600; color: rgba(255,255,255,.92); }
.nf-meta > span + span::before { content: '•'; margin: 0 10px; color: rgba(255,255,255,.5); font-weight: 400; }
.nf-meta .d-sci { margin: 0; font-size: inherit; font-weight: 500; font-style: italic; color: rgba(255,255,255,.75); }
.nf .hero-acts { position: static; display: flex; flex-wrap: wrap; gap: 12px; }
.nf .hero-btn { height: 52px; padding: 0 24px 0 20px; border-radius: 999px; font: 700 18px/1 var(--sans); box-shadow: none; transform: none; }
.nf .hero-btn .ico { width: 24px; height: 24px; }
.nf .hero-btn:active { transform: scale(.96); }
.nf .hero-sound { background: #fff; color: #111; }
.nf .hero-sound .ico { fill: currentColor; }
.nf .hero-sound.playing { background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.25); }
.nf .hero-btn:not(.hero-sound) { background: rgba(110,110,110,.6); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nf .hero-btn:not(.hero-sound):hover { background: rgba(110,110,110,.4); }
.nf .hero-acts .save { position: static; inset: auto; }
.nf .hero-acts .save.on { background: #fff; color: #111; }
.nf .say-round { width: 46px; height: 46px; }
/* Back: a round button on the photo's top-left */
.nf .nf-back { display: grid; position: absolute; z-index: 4; top: 20px; left: 20px; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transform: none; }
.nf .nf-back:hover { background: rgba(0,0,0,.65); }
.nf .back-bar { display: none; }
/* Video: Unmute moves to the top-right, like the speaker on a trailer */
.nf .vfig .mute { left: auto; right: 20px; top: 20px; bottom: auto; width: 46px; height: 46px; padding: 0; border-radius: 50%; justify-content: center; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.4); }
.nf .vfig .mute span { display: none; }
.nf .vfig .mute.on { background: #fff; color: #111; }
.nf .vplay { width: 72px; height: 72px; background: rgba(0,0,0,.35); color: #fff; border: 2px solid rgba(255,255,255,.85); box-shadow: none; backdrop-filter: blur(6px); }
/* Previous / Next: arrows on the photo's edges, with the arrow key shown */
@media (min-width: 761px) {
  .nf .pn-side { display: flex; position: absolute; z-index: 4; top: 42%; width: auto; padding: 8px; gap: 6px; border-radius: 14px; color: #fff; background: rgba(0,0,0,.28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: .85; transition: opacity .2s, background .2s; }
  .nf .hero:hover .pn-side { opacity: 1; }
  .nf .pn-side:hover { background: rgba(0,0,0,.55); }
  .nf .pn-side.prev { left: 20px; right: auto; }
  .nf .pn-side.next { right: 20px; left: auto; }
  .nf .pn-side img, .nf .pn-side .pn-side-ph { width: 56px; height: 56px; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
  .nf .pn-side b { color: #fff; font-size: 13px; max-width: 90px; }
  .nf .pn-side kbd { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }
  .nf ~ .dbar, .dbar:has(+ .detail.nf) { display: none; }
}
@media (max-width: 760px) {
  .nf-info { padding: 0 16px 20px; gap: 14px; }
  .nf .hero-btn { height: 46px; padding: 0 18px 0 14px; font-size: 16px; }
  .nf .nf-back { top: 14px; left: 14px; }
  .nf .vfig .mute { top: 14px; right: 14px; }
  .nf-meta { font-size: 14px; }
}
/* The photo strip and credit sit just under the hero */
.nf .thumbs { margin-top: 12px; }
.nf .gallery + div { max-width: 880px; }

/* Dark theme everywhere (set on <html data-theme="dark">) */
html:not(.app)[data-theme="dark"] { --bg: #0E0E0E; --surface: #181818; --surface-2: #232323; --ink: #F2F2F2; --ink-2: #A8A8A8; --ink-3: #7A7A7A; --line: #2A2A2A; --accent: #7CC6A3; --accent-ink: #0E0E0E; --blue: #4A7DF0; --blue-ink: #FFFFFF; --blue-soft: #1B2540; color-scheme: dark; }
html[data-theme="dark"] .hero-btn.hero-sound, html[data-theme="dark"] .hero-acts .save.on { color: #111; }
html[data-theme="dark"] .card-name { color: #fff; }
html[data-theme="dark"] { color-scheme: dark; --blue-ink: #FFFFFF; }
.dbar .back-bar { display: none !important; } /* the hero has its own Back */
.nf .vplay { inset: auto; top: 34%; left: 50%; margin: 0; transform: translate(-50%, -50%); }
@media (max-width: 760px) { .nf .vplay { top: 30%; } .nf .hero-acts .save span { display: none; } .nf .hero-acts .save { padding: 0 14px; } }

/* Featured today: the words sit on the photo, like a streaming-service banner */
.feature { position: relative; border: 0 !important; background: #000 !important; color: #fff; }
.feature-img { aspect-ratio: 16 / 7.4 !important; }
.feature-img::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 34%, rgba(0,0,0,0) 64%), linear-gradient(to right, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 58%); }
.feature-body { position: absolute !important; left: 0; right: 0; bottom: 0; padding: 0 48px 40px !important; pointer-events: none; }
.feature-body > * { pointer-events: auto; }
.feature-body .eyebrow { color: rgba(255,255,255,.8) !important; }
.feature-body .h-display { color: #fff; font: 800 clamp(34px, 5.6vw, 72px)/1 var(--sans) !important; letter-spacing: -.03em; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.feature-body p { color: rgba(255,255,255,.9) !important; max-width: 54ch; font-size: 17px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.feature-body .btn { height: 52px; padding: 0 24px; border-radius: 999px; font-size: 18px; font-weight: 700; border: 0; }
.feature-body .btn.accent { background: #fff; color: #111; }
.feature-body .btn.outline { background: rgba(110,110,110,.6); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.feature-body .btn.outline:hover { background: rgba(110,110,110,.4); }
@media (max-width: 1000px) { .feature-img { aspect-ratio: 4 / 3 !important; } }
@media (max-width: 760px) {
  .feature { margin: 0 -16px; border-radius: 0 !important; }
  .feature-img { aspect-ratio: 4 / 5 !important; max-height: 70svh; }
  .feature-body { padding: 0 16px 20px !important; }
  .feature-body p { font-size: 15px; }
  .feature-body .btn { height: 46px; font-size: 16px; padding: 0 18px; }
}

/* ================= Streaming-service home: full-bleed banner under a see-through header, then
   sideways-scrolling shelves of animals ================= */
html:not(.app) .top { transition: background .3s, box-shadow .3s; }
html:not(.app) .top:not(.solid) { background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0)); box-shadow: none; }
html:not(.app) .top:not(.solid) .search { background: rgba(255,255,255,.14); }
html:not(.app) .top:not(.solid) .topnav a { color: rgba(255,255,255,.8); }
html:not(.app) .top:not(.solid) .topnav a[aria-current="page"], html:not(.app) .top:not(.solid) .brand { color: #fff; }
html:not(.app) main:has(> .feature:first-child) { padding-top: 0; }
html:not(.app) main > .feature:first-child { margin: calc(-1 * var(--top-h, 69px)) calc(-1 * clamp(16px, 3vw, 48px)) 8px; width: auto; border-radius: 0 !important; }
html:not(.app) main > .feature:first-child .feature-img { aspect-ratio: auto !important; height: min(86svh, 56vw); min-height: 460px; }
html:not(.app) main > .feature:first-child .feature-body { padding: 0 clamp(16px, 3vw, 48px) 9vw !important; }
html:not(.app) main > .feature:first-child .feature-img::after { background: linear-gradient(to top, var(--bg) 0%, rgba(14,14,14,.6) 18%, rgba(0,0,0,0) 50%), linear-gradient(to right, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 60%); }
@media (max-width: 760px) {
  html:not(.app) main > .feature:first-child .feature-img { height: 78svh; min-height: 0; }
  html:not(.app) main > .feature:first-child .feature-body { padding: 0 16px 28px !important; }
}
/* the first shelf tucks up into the banner's fade */
html:not(.app) main > .feature:first-child + .shelf { margin-top: -6vw; position: relative; z-index: 2; }
@media (max-width: 760px) { html:not(.app) main > .feature:first-child + .shelf { margin-top: 0; } }

.shelf { margin: 0 0 34px; }
.shelf-title { font: 700 21px/1.2 var(--sans); letter-spacing: -.01em; margin: 0 0 12px; }
.shelf-title a { display: inline-flex; align-items: baseline; gap: 12px; }
.shelf-title a span { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.shelf-title a span .ico { width: 14px; height: 14px; }
.shelf-title a:hover span, .shelf:hover .shelf-title a span { opacity: 1; transform: none; }
@media (hover: none) { .shelf-title a span { opacity: 1; transform: none; } }
.shelf-wrap { position: relative; margin: 0 calc(-1 * clamp(16px, 3vw, 48px)); }
.shelf-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 14px clamp(16px, 3vw, 48px) 18px; scroll-padding: 0 clamp(16px, 3vw, 48px); }
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track > .card { flex: 0 0 clamp(150px, 21vw, 300px); scroll-snap-align: start; position: relative; transition: transform .25s cubic-bezier(.2,.7,.2,1), z-index 0s .25s; }
.shelf-track > .card .card-img { aspect-ratio: 16 / 9 !important; border-radius: 6px; }
@media (hover: hover) {
  .shelf-track > .card:hover { transform: scale(1.12); z-index: 5; transition: transform .25s cubic-bezier(.2,.7,.2,1) .15s, z-index 0s; }
  .shelf-track > .card:hover .card-img { box-shadow: 0 14px 34px -10px rgba(0,0,0,.8); }
  .shelf-track > .card:first-child:hover { transform-origin: left center; }
  .shelf-track > .card:last-child:hover { transform-origin: right center; }
}
.shelf-arrow { position: absolute; top: 14px; bottom: 18px; z-index: 6; width: max(44px, 3vw); max-width: 64px; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s, background .2s; }
.shelf-arrow.prev { left: 0; } .shelf-arrow.next { right: 0; }
.shelf-arrow .ico { width: 30px; height: 30px; stroke-width: 2.4; }
.shelf-wrap:hover .shelf-arrow { opacity: 1; }
.shelf-arrow:hover { background: rgba(0,0,0,.72); }
@media (hover: none) { .shelf-arrow { display: none; } }
@media (max-width: 760px) { .shelf-track { gap: 8px; padding: 8px 16px 12px; } .shelf-title { font-size: 18px; } }
.shelf .card-sub { display: none; }
/* Animal page: name on the left, the call / 3D / Save buttons on the right of the photo */
@media (min-width: 761px) {
  .nf-info { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .nf .d-head { min-width: 0; }
  .nf .hero-acts { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; }
}

/* Language switch: only in the profile panel once signed in */
html:not(.app) .top-inner:has(.ka-avatar) #langBtn { display: none; }
.zp-lang .langswitch { display: inline-flex; }

/* Quiz: a glowing "magic" button that invites a tap */
@property --magic-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes magicSpin { to { --magic-a: 360deg; } }
@keyframes magicTwinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.25) rotate(90deg); } }
.topnav a.magic { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px 7px 12px; border-radius: 999px; color: #fff !important; font-weight: 700;
  background: linear-gradient(#141414, #141414) padding-box, conic-gradient(from var(--magic-a), #ff6ec7, #ffb86b, #7cf0c5, #7aa7ff, #c48bff, #ff6ec7) border-box;
  border: 2px solid transparent; animation: magicSpin 3.5s linear infinite; box-shadow: 0 0 18px -4px rgba(196,139,255,.7); }
.topnav a.magic .ico { width: 16px; height: 16px; color: #ffd36b; animation: magicTwinkle 1.8s ease-in-out infinite; }
.topnav a.magic:hover { box-shadow: 0 0 26px -2px rgba(255,110,199,.8); background: linear-gradient(#202020, #202020) padding-box, conic-gradient(from var(--magic-a), #ff6ec7, #ffb86b, #7cf0c5, #7aa7ff, #c48bff, #ff6ec7) border-box; }
.topnav a.magic:active { transform: scale(.95); }
/* Phone tab bar: a raised glowing orb in the middle of the bar */
.tabbar a.magic { position: relative; }
.tabbar a.magic .magic-orb { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: conic-gradient(from var(--magic-a), #ff6ec7, #ffb86b, #7cf0c5, #7aa7ff, #c48bff, #ff6ec7); animation: magicSpin 3.5s linear infinite;
  box-shadow: 0 0 0 4px var(--bg), 0 0 22px -2px rgba(196,139,255,.85); }
.tabbar a.magic .magic-orb .ico { width: 22px; height: 22px; animation: magicTwinkle 1.8s ease-in-out infinite; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.tabbar a.magic:active .magic-orb { transform: scale(.92); }
@media (prefers-reduced-motion: reduce) { .topnav a.magic, .tabbar a.magic .magic-orb, .magic .ico { animation: none; } }

/* Card hover buttons (mouse only): call, 3D, Save — touch screens keep the small Hear button */
.card-acts { display: none; }
@media (hover: hover) and (pointer: fine) {
  .card-acts { display: flex; gap: 6px; position: absolute; top: 10px; right: 10px; z-index: 3; opacity: 0; transform: translateY(-4px); transition: opacity .18s, transform .18s; }
  .card:hover .card-acts, .card:focus-within .card-acts, .card-acts:has(.playing) { opacity: 1; transform: none; }
  .card .card-btns { display: none; }
  .ca-btn { height: 34px; min-width: 34px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 13px/1 var(--sans); color: #fff; background: rgba(40,40,40,.7); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .12s, background .12s; }
  .ca-btn .ico { width: 16px; height: 16px; }
  .ca-btn:hover { transform: scale(1.08); background: rgba(70,70,70,.85); }
  .ca-play { background: #fff; color: #111; border-color: #fff; padding: 0 12px 0 10px; }
  .ca-play:hover { background: #fff; }
  .ca-play .ico { fill: currentColor; width: 14px; height: 14px; }
  .ca-play span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ca-btn.on { background: #fff; color: #111; }
  .ca-play.playing { box-shadow: 0 0 0 4px rgba(255,255,255,.3); }
}
/* Previous / Next on the animal photo appear when the mouse is over it (always shown on touch screens) */
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .nf .pn-side { opacity: 0; transform: translateX(var(--pn-x, 0)); transition: opacity .2s, transform .2s, background .2s; }
  .nf .pn-side.prev { --pn-x: -8px; } .nf .pn-side.next { --pn-x: 8px; }
  .nf .hero:hover .pn-side, .nf .pn-side:focus-visible { opacity: 1; transform: none; }
}
/* Animal page: the call / 3D / Save buttons appear when the mouse is over the photo (and stay while a sound plays) */
@media (hover: hover) and (pointer: fine) {
  .nf .hero-acts { opacity: 0; transform: translateY(8px); transition: opacity .22s, transform .22s; }
  .nf .hero:hover .hero-acts, .nf .hero-acts:focus-within, .nf .hero-acts:has(.playing) { opacity: 1; transform: none; }
}
/* Shade only behind the words (bottom-left), so the rest of the photo stays bright */
.nf-shade { background: radial-gradient(ellipse 62% 58% at 0% 100%, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%) !important; }
.nf .vfig.live ~ .nf-shade { opacity: 1; }
.feature-img::after { background: radial-gradient(ellipse 62% 60% at 0% 100%, rgba(0,0,0,.8) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%) !important; }
html:not(.app) main > .feature:first-child .feature-img::after { background: radial-gradient(ellipse 60% 62% at 0% 92%, rgba(0,0,0,.8) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%), linear-gradient(to top, var(--bg) 0%, rgba(14,14,14,0) 14%) !important; }
@media (max-width: 760px) {
  .nf-shade { background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 26%, rgba(0,0,0,0) 42%) !important; }
  .feature-img::after, html:not(.app) main > .feature:first-child .feature-img::after { background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.35) 30%, rgba(0,0,0,0) 48%) !important; }
}
.page-back { display: grid; margin: 0 0 16px; }
.game-card small { top: auto !important; bottom: 16px; right: 16px !important; background: var(--surface-2) !important; color: var(--accent) !important; }
.game-groups { margin: 18px 0 4px; }
.game-groups .filter { cursor: pointer; }

/* Who's playing? */
.players { max-width: 560px; margin: 0 auto; padding: 8px 0 40px; }
.players .h-display { margin: 0 0 22px; }
.pl-count { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.pl-opt { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--ink); transition: border-color .15s, transform .12s; }
.pl-opt:active { transform: scale(.97); }
.pl-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.pl-opt b { font-size: 18px; }
.pl-faces { display: flex; }
.pl-faces i { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #ff6ec7, #7aa7ff); box-shadow: 0 0 0 3px var(--surface); }
.pl-faces i + i { margin-left: -12px; background: linear-gradient(135deg, #ffb86b, #7cf0c5); }
.pl-form { display: flex; flex-direction: column; gap: 14px; }
.pl-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.pl-form input { height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 18px var(--sans); outline: none; }
.pl-form input:focus { border-color: var(--accent); }
.pl-go { height: 54px; font-size: 18px; border-radius: 999px; margin-top: 6px; justify-content: center; }
/* Score board in each game */
.pl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.board { display: flex; gap: 10px; flex-wrap: wrap; }
.pl { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); opacity: .6; transition: opacity .2s, border-color .2s, transform .2s; }
.pl.on { opacity: 1; border-color: var(--accent); transform: scale(1.03); }
.pl.solo { opacity: 1; border-color: var(--line); transform: none; }
.pl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff6ec7, #7aa7ff); }
.pl + .pl .pl-dot { background: linear-gradient(135deg, #ffb86b, #7cf0c5); color: #111; }
.pl-name { display: flex; flex-direction: column; font-weight: 700; line-height: 1.1; }
.pl-name small { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.pl b { font-size: 20px; margin-left: 4px; min-width: 1ch; }
.pl-change { height: 38px; font-size: 14px; }
.nf .hero-ar { background: linear-gradient(135deg, #7aa7ff, #c48bff) !important; color: #fff; }
.pl-count { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .pl-count { grid-template-columns: 1fr 1fr; } }
.pl-faces i:nth-child(3) { background: linear-gradient(135deg, #7cf0c5, #7aa7ff); }
.pl-faces i:nth-child(4) { background: linear-gradient(135deg, #ffd36b, #ff6ec7); }
.pl-faces i + i { margin-left: -12px; }
.pl:nth-child(3) .pl-dot { background: linear-gradient(135deg, #7cf0c5, #7aa7ff); color: #111; }
.pl:nth-child(4) .pl-dot { background: linear-gradient(135deg, #ffd36b, #ff6ec7); color: #111; }

/* 10-question progress */
.qprog { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; flex-wrap: wrap; }
.qprog > span { font-weight: 700; font-size: 15px; }
.qprog small { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.qprog-dots { display: flex; gap: 6px; flex: 1 1 200px; max-width: 420px; }
.qprog-dots i { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); transition: background .3s; }
.qprog-dots i.done { background: var(--accent); }
.qprog-dots i.now { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); animation: qpulse 1.4s ease-in-out infinite; }
@keyframes qpulse { 50% { opacity: .55; } }
/* Wrong answer red, right answer green */
.choice.wrong, .name-choice.wrong, .pick.wrong { outline: 4px solid #E5484D !important; outline-offset: -2px; background: color-mix(in srgb, #E5484D 22%, var(--surface)) !important; opacity: 1 !important; }
.choice.right, .name-choice.right, .pick.right { outline: 4px solid #30A46C !important; outline-offset: -2px; background: color-mix(in srgb, #30A46C 22%, var(--surface)) !important; opacity: 1 !important; }
.right.reveal { animation: revealPop .5s ease-out .25s both; }
@keyframes revealPop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
#cheer .no { color: #FF8A8E; font-weight: 700; }
#next.auto { position: relative; overflow: hidden; }
/* Results */
.results { text-align: center; max-width: 620px; margin: 0 auto; }
.res-card { margin: 22px 0; padding: 28px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.res-big strong { font: 800 84px/1 var(--sans); } .res-big span { font-size: 28px; color: var(--ink-2); font-weight: 700; }
.res-stars { display: flex; gap: 6px; } .res-stars i { color: var(--surface-2); } .res-stars i.on { color: #FFD36B; } .res-stars .ico { width: 30px; height: 30px; }
.res-pl { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 360px; padding: 10px 16px; border-radius: 12px; background: var(--surface-2); }
.res-pl.top { outline: 2px solid #FFD36B; }
.res-pl b { flex: 1; text-align: left; font-size: 18px; } .res-pl strong { font-size: 26px; }
.res-line { font-size: 20px; font-weight: 700; margin: 6px 0 0; }
.res-acts { justify-content: center; gap: 12px; }

/* Question numbers 1–10 at the bottom of the game */
.qprog { display: flex !important; justify-content: center; gap: 8px; margin: 22px 0 6px !important; flex-wrap: wrap; }
.qprog i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--sans); font-style: normal; color: var(--ink-2); background: var(--surface-2); transition: background .25s, color .25s, transform .25s; }
.qprog i.ok { background: #30A46C; color: #fff; }
.qprog i.no { background: #E5484D; color: #fff; }
.qprog i.now { background: transparent; color: var(--ink); box-shadow: 0 0 0 2px var(--accent); transform: scale(1.12); }
@media (max-width: 520px) { .qprog { gap: 6px; } .qprog i { width: 28px; height: 28px; font-size: 12px; } }

/* Saved players: tap to pick (numbered in turn order), × to remove, add a new one on the spot */
.players .lede { margin: -8px 0 20px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.rp { position: relative; }
.rp-pick { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--ink); transition: border-color .15s, transform .12s; }
.rp-pick:active { transform: scale(.97); }
.rp.on .rp-pick { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.rp-pick .pl-dot { width: 54px; height: 54px; font-size: 22px; }
.rp-pick b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-pick em { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--sans); font-style: normal; background: var(--accent); color: var(--accent-ink); }
.rp-del { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.rp-del:hover { background: var(--surface-2); color: var(--ink); }
.rp-del .ico { width: 14px; height: 14px; }
.rp-add { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 14px; border: 2px dashed var(--line); }
.rp-add input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 16px var(--sans); outline: none; }
.rp-add input:focus { border-color: var(--accent); }
.rp-add .btn { height: 44px; }
.pl-dot.add { background: var(--surface-2) !important; color: var(--ink-2); }
.pl-dot.c1 { background: linear-gradient(135deg, #ffb86b, #7cf0c5); color: #111; }
.pl-dot.c2 { background: linear-gradient(135deg, #7cf0c5, #7aa7ff); color: #111; }
.pl-dot.c3 { background: linear-gradient(135deg, #ffd36b, #ff6ec7); color: #111; }
.pl-go:disabled { opacity: .45; }
.pl-go { width: 100%; }
/* The top bar is always solid; the banner starts below it (search stays readable). */
html:not(.app) .top:not(.solid) { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
html:not(.app) .top:not(.solid) .search { background: var(--surface-2); }
html:not(.app) .top:not(.solid) .topnav a { color: var(--ink-2); }
html:not(.app) .top:not(.solid) .topnav a[aria-current="page"], html:not(.app) .top:not(.solid) .brand { color: var(--ink); }
html:not(.app) main > .feature:first-child { margin-top: 0 !important; }
.top-inner .ka-avatar { border-width: 1px !important; border-color: rgba(255,255,255,.55) !important; box-shadow: none !important; }

/* Identify from a photo */
.idsheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.idsheet-card { position: relative; width: min(560px, 100%); max-height: calc(100svh - 32px); overflow: auto; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.idsheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; }
.idsheet-photo { background: #000; }
.idsheet-photo img { width: 100%; max-height: 42svh; object-fit: contain; }
.idsheet-body { padding: 18px 20px 22px; position: relative; }
.id-wait { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.id-wait .spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: idspin .8s linear infinite; }
@keyframes idspin { to { transform: rotate(360deg); } }
.id-top { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 8px 58px 0 0; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 2px solid var(--accent); color: var(--ink); }
.id-top img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.id-top span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.id-top small { font-weight: 600; color: var(--ink-2); }
.id-top b { font: 800 26px/1.1 var(--sans); }
.id-top em { font-style: normal; font-weight: 600; color: var(--accent); }
.id-say { position: absolute; right: 20px; top: 42px; }
.id-also { margin: 16px 0 8px; color: var(--ink-2); font-weight: 600; }
.id-rest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.id-rest a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.id-rest img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.id-rest b { flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-rest em { font-style: normal; color: var(--ink-2); font-size: 13px; }
.id-none { color: var(--ink-2); font-size: 16px; }
.d-more-btn { margin-top: 18px; height: 48px; border-radius: 999px; padding: 0 22px 0 18px; }
.d-more { animation: dmore .25s ease-out; }
@keyframes dmore { from { opacity: 0; transform: translateY(-6px); } }
