/* DinoCura design system.
   Flat colours only (no gradients, by design). Night aquarium is the default look;
   light mode is a warm "daytime room". Contrast pairs were checked for WCAG AA. */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  /* water */
  --bg: #0e1e2b;
  --surface: #16303f;
  --surface-2: #1f3e50;
  --line: #2c5163;
  /* text */
  --text: #f5ebdd;
  --muted: #b5c3c9;
  /* betta fins */
  --coral: #f68a70;
  --orange: #f5a25d;
  --teal: #4fb8b2;
  --on-accent: #1a1410;
  --danger: #ff8a7a;
  --ok: #7fd1a8;

  --radius: 18px;
  --radius-sm: 12px;
  --space: 1rem;
  --tap: 48px;
  --shadow: 0 2px 0 rgb(0 0 0 / 0.25);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6efe4;
    --surface: #fffaf2;
    --surface-2: #efe4d3;
    --line: #dccbb2;
    --text: #13293a;
    --muted: #4c5f6b;
    --coral: #a63d26;
    --orange: #a35a14;
    --teal: #17706c;
    --on-accent: #ffffff;
    --danger: #b3261e;
    --ok: #1d6b45;
    --shadow: 0 2px 0 rgb(19 41 58 / 0.08);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6efe4;
  --surface: #fffaf2;
  --surface-2: #efe4d3;
  --line: #dccbb2;
  --text: #13293a;
  --muted: #4c5f6b;
  --coral: #a63d26;
  --orange: #a35a14;
  --teal: #17706c;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --ok: #1d6b45;
  --shadow: 0 2px 0 rgb(19 41 58 / 0.08);
}

/* Low-stimulation mode: softer accents and no motion. */
:root[data-calm="true"] {
  --coral: var(--muted);
  --orange: var(--muted);
  --teal: var(--muted);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--coral); }
img, svg, canvas { max-width: 100%; display: block; }
h1:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--orange); color: var(--on-accent); padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem max(1rem, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: var(--tap); padding: 0 .5rem; margin-right: auto;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem;
  border-radius: var(--radius-sm);
}
.brand:hover { color: var(--text); }
.brand .logo { width: 32px; height: 32px; color: var(--coral); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.footer {
  display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; justify-content: center;
  padding: 1.25rem 1rem 2rem; font-size: .9rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--muted); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: 0 1.25rem;
  border: 2px solid transparent; border-radius: 999px;
  background: var(--coral); color: var(--on-accent);
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s;
}
.btn:hover { color: var(--on-accent); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.quiet { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: transparent; color: var(--text);
  cursor: pointer; transition: background-color .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}

label { font-weight: 700; display: block; margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .9rem;
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--coral); }
.field { margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); font-weight: 700; }

/* ---------- home ---------- */
.hello { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.hello p { color: var(--muted); margin: 0; }

.tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile a {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem;
  height: 100%; min-height: 140px; padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s;
}
.tile a:hover { transform: translateY(-3px); border-color: var(--tile-color, var(--coral)); color: var(--text); }
.tile .tile-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 16px; background: var(--tile-color, var(--coral)); color: var(--on-accent);
}
.tile .tile-icon svg { width: 28px; height: 28px; }
.tile strong { font-size: 1.1rem; display: block; }
.tile small { color: var(--muted); font-size: .9rem; }

.tile.hero { grid-column: 1 / -1; }
.tile.hero a { min-height: 200px; flex-direction: row; align-items: flex-end; justify-content: flex-start; background: var(--surface-2); }
.tile.hero .tile-icon { width: 72px; height: 72px; border-radius: 22px; }
.tile.hero .tile-icon svg { width: 40px; height: 40px; }
.tile.hero strong { font-size: 1.5rem; }

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile.hero { grid-column: span 2; grid-row: span 2; }
  .tile.hero a { min-height: 296px; }
  /* 7 tiles: the last two share the bottom row evenly. */
  .tile:nth-child(n+6) { grid-column: span 2; }
  .tile:nth-child(n+6) a { min-height: 110px; flex-direction: row; align-items: center; justify-content: flex-start; }
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tiles > li { animation: rise .45s var(--ease) both; }
.tiles > li:nth-child(2) { animation-delay: .04s; }
.tiles > li:nth-child(3) { animation-delay: .08s; }
.tiles > li:nth-child(4) { animation-delay: .12s; }
.tiles > li:nth-child(5) { animation-delay: .16s; }
.tiles > li:nth-child(6) { animation-delay: .20s; }
.tiles > li:nth-child(7) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-calm="true"] *, :root[data-calm="true"] *::before, :root[data-calm="true"] *::after {
  animation: none !important; transition: none !important;
}

/* ---------- boot + error ---------- */
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--muted); }
.boot svg { width: 64px; height: 64px; color: var(--coral); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

#blazor-error-ui {
  display: none; position: fixed; inset: auto 1rem 1rem; z-index: 1000;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); border: 2px solid var(--coral);
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; background: none; border: 0; color: inherit; font: inherit; }

/* ---------- forms + account ---------- */
.auth { max-width: 28rem; margin: 1rem auto; }
.auth h1 { margin-bottom: .35rem; }
.auth > .hint { margin-bottom: 1.25rem; }
.btn.wide { width: 100%; margin-top: .5rem; }
.btn.danger { background: var(--danger); color: var(--on-accent); }
.center { text-align: center; margin-top: 1rem; }
.check { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; margin: .75rem 0 .25rem; cursor: pointer; }
.check input { flex: none; margin-top: .15rem; }
.code-input { font-size: 1.5rem; letter-spacing: .4em; font-variant-numeric: tabular-nums; text-align: center; }
.bot-check:not(:empty) { margin: .75rem 0; }
.validation-message, p.error { margin: .35rem 0 0; font-size: .95rem; }
.stack { display: grid; gap: 1rem; max-width: 40rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.key { font-size: 1.1rem; background: var(--surface-2); padding: .4rem .6rem; border-radius: 8px; overflow-wrap: anywhere; }
.banner { background: var(--surface-2); border-left: 4px solid var(--orange); padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1rem; }
.banner.top { border-radius: 0; margin: 0; text-align: center; }
.danger-zone { border-color: var(--danger); }
.icon-btn.signed-in { color: var(--teal); }

/* ---------- long-form pages (legal) ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.draft { background: var(--surface-2); border: 2px dashed var(--orange); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.placeholder { background: var(--orange); color: var(--on-accent); padding: 0 .3rem; border-radius: 4px; font-weight: 700; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-scroll { overflow-x: auto; }

/* ---------- quote of the day ---------- */
.quote-of-day {
  position: relative; display: block; overflow: hidden;
  margin: 0 0 1.25rem; padding: 1.5rem 1.5rem 1.25rem 1.75rem;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-left: 6px solid var(--orange); border-radius: var(--radius);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  animation: rise .45s var(--ease) both;
  transition: transform .2s var(--ease), border-color .2s;
}
.quote-of-day:hover { color: var(--text); transform: translateY(-2px); border-color: var(--orange); }
.quote-of-day::before {
  content: "“"; position: absolute; right: .75rem; top: -1.75rem;
  font-size: 9rem; line-height: 1; font-weight: 800; color: var(--orange); opacity: .18; pointer-events: none;
}
.quote-label { display: block; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.quote-of-day blockquote { margin: .5rem 0 .9rem; }
.quote-of-day blockquote p { margin: 0; font-size: clamp(1.2rem, 1rem + 1.2vw, 1.65rem); font-weight: 700; line-height: 1.35; text-wrap: balance; }
.quote-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.quote-of-day cite, .quote-archive cite { font-style: normal; font-weight: 700; color: var(--muted); }
.quote-of-day cite::before, .quote-archive cite::before { content: "— "; }
.quote-more { font-size: .9rem; font-weight: 700; color: var(--teal); }

.quote-archive { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .9rem; max-width: 44rem; }
.quote-archive li { border-left: 4px solid var(--line); }
.quote-archive li.today { border-left-color: var(--orange); }
.quote-archive time { font-size: .85rem; color: var(--muted); font-weight: 700; }
.quote-archive blockquote { margin: .35rem 0 .5rem; }
.quote-archive blockquote p { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.4; }

.quote-admin { max-width: 44rem; margin-bottom: 2rem; }
.quote-admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.quote-admin-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.quote-admin-list p { margin: .25rem 0 0; }

/* ---------- feed dino ---------- */
.tile.hero a { position: relative; overflow: hidden; }
.betta-art { width: min(62%, 260px); height: auto; }
.tile.hero .betta-art { position: absolute; right: 4%; top: 6%; width: min(52%, 260px); }
@media (min-width: 720px) { .tile.hero .betta-art { right: 8%; top: 16%; width: min(62%, 260px); } }
.swim { animation: swim 6s ease-in-out infinite; }
@keyframes swim { 0%, 100% { transform: translate(0, 0) rotate(-2deg); } 50% { transform: translate(-14px, -8px) rotate(2deg); } }
.tile.hero .tile-icon, .tile.hero a > span:last-child { position: relative; }

.feed { display: grid; gap: 1rem; }
.tank-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.tank { height: clamp(320px, 62vh, 620px); touch-action: manipulation; cursor: pointer; }
.tank-fallback { padding: 2rem; text-align: center; color: var(--muted); }
.hud { position: absolute; inset: .75rem .75rem auto; display: flex; justify-content: flex-end; align-items: center; gap: .5rem; pointer-events: none; }
.hud > * { pointer-events: auto; }
.chip { background: var(--bg); color: var(--text); border-radius: 999px; padding: .35rem .85rem; font-size: .95rem; border: 1px solid var(--line); }
.chip strong { color: var(--orange); }
.chip-btn { background: var(--bg); border: 1px solid var(--line); }
.feed-panel { display: grid; gap: .9rem; }
.feed-facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.feed-facts .label { display: block; color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; min-height: 32px; }
.exact { display: block; color: var(--muted); font-size: .9rem; }
.note { margin: 0; padding: .6rem .9rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.note.hungry { border-left: 4px solid var(--orange); }
.row { align-items: center; }
@media (min-width: 900px) {
  .feed { grid-template-columns: 1fr 320px; align-items: start; }
}

/* ---------- aquarium ---------- */
.tank-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 1rem; }
.tank-card { display: grid; gap: .35rem; text-decoration: none; color: var(--text); border-left: 6px solid var(--teal); min-height: 110px; align-content: center; }
.tank-card.salt { border-left-color: var(--orange); }
.tank-card:hover { color: var(--text); border-color: var(--coral); }
.new-tank h2 { margin-bottom: .75rem; }
fieldset.segmented { border: 0; padding: 0; margin: 0 0 1rem; display: flex; gap: 1rem; align-items: center; }
fieldset.segmented legend { font-weight: 700; margin-bottom: .35rem; padding: 0; }
fieldset.segmented label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin: 0; min-height: var(--tap); }
fieldset.segmented input { width: 20px; min-height: 0; accent-color: var(--coral); }

.editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.title-input { flex: 1 1 12rem; font-size: 1.4rem; font-weight: 800; background: transparent; border-color: transparent; }
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--surface-2); }
.editor-head select { width: auto; }
.save-state { min-width: 5rem; }
.aquarium-layout { display: grid; gap: 1rem; }
.tank-col { display: grid; gap: 1rem; align-content: start; }
.tank-col .tank { height: clamp(300px, 55vh, 560px); cursor: default; }
@media (min-width: 1000px) { .aquarium-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .library { position: sticky; top: 4.5rem; max-height: calc(100dvh - 6rem); overflow: auto; } }

.selected-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start; }
.name-row { display: flex; gap: .5rem; align-items: center; font-weight: 700; margin: .5rem 0 0; }
.name-row input { flex: 1; }
.hints { margin: 0; padding-left: 1.2rem; }
.hints li { margin-bottom: .35rem; }
.inhabitants { list-style: none; margin: 0 0 1rem; padding: 0; }
.inhabitants li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid var(--line); }
.icon-btn.small { width: 40px; height: 40px; border: 1px solid var(--line); font-size: 1.2rem; font-weight: 800; }
.danger-text { color: var(--danger); }

.library-tabs { display: flex; gap: .25rem; margin-bottom: .75rem; }
.library-tabs button { flex: 1; min-height: 44px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-weight: 700; border-radius: 999px; cursor: pointer; }
.library-tabs button.on { background: var(--surface-2); border-color: var(--teal); }
.filters { display: grid; gap: .5rem; margin-bottom: .5rem; }
.species-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.species-card { display: grid; grid-template-columns: 72px 1fr auto; gap: .75rem; align-items: start; padding: .6rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.species-info { display: grid; gap: .1rem; min-width: 0; }
.species-info em { color: var(--muted); font-size: .9rem; }
.note-text { font-size: .9rem; }
.thumb { width: 72px; height: 48px; object-fit: contain; display: block; }
.placeholder-thumb { background: var(--surface); border-radius: 8px; }
.add-btn { min-height: 40px; padding: 0 .9rem; }

/* ---------- quizzes ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1.25rem; }
.chip-toggle { min-height: 40px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.chip-toggle.on { background: var(--teal); border-color: var(--teal); color: var(--on-accent); font-weight: 700; }
.quiz-grid { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.quiz-card { display: grid; gap: .35rem; height: 100%; text-decoration: none; color: var(--text); padding: .75rem; }
.quiz-card:hover { color: var(--text); border-color: var(--coral); }
.quiz-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.quiz-cover.large { max-height: 260px; margin-bottom: 1rem; }
.placeholder-cover { display: grid; place-items: center; color: var(--orange); }
.placeholder-cover svg { width: 48px; height: 48px; }
.quiz-intro, .quiz-results { max-width: 44rem; margin: 0 auto; }
.review { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.review li { display: grid; gap: .15rem; padding: .75rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.ok-text { color: var(--ok); font-weight: 700; }
.review-image { max-width: 160px; max-height: 100px; border-radius: 8px; object-fit: contain; }

.quiz-play { max-width: 52rem; margin: 0 auto; display: grid; gap: 1rem; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.score strong { color: var(--orange); font-size: 1.2rem; }
.timer { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.timer-bar { height: 100%; background: var(--teal); transform-origin: left; animation-name: drain; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.timer-bar.paused { animation-play-state: paused; opacity: .5; }
:root[data-calm="true"] .timer-bar { animation: drain linear forwards !important; animation-duration: inherit; }
@media (prefers-reduced-motion: reduce) { .timer-bar { animation: drain linear forwards !important; } }
.quiz-question { font-size: clamp(1.3rem, 3.5vw, 1.9rem); text-align: center; margin: 0; }
.quiz-media { display: block; width: 100%; max-height: 42vh; object-fit: contain; border-radius: var(--radius); background: var(--surface-2); }
.quiz-media.yt { aspect-ratio: 16 / 9; max-height: none; position: relative; }
.yt-host { width: 100%; height: 100%; }
.yt-gate { position: absolute; inset: 0; display: grid; place-content: center; gap: .4rem; justify-items: center; border: 0; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; border-radius: var(--radius); padding: 1rem; text-align: center; }
.yt-gate svg { width: 40px; height: 40px; color: var(--coral); }

.answers { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .answers { grid-template-columns: 1fr 1fr; } }
.answer { display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .75rem 1rem; border: 0; border-radius: var(--radius); font: inherit; font-weight: 700; font-size: 1.05rem; text-align: left; cursor: pointer; color: #1a1410; transition: transform .12s, opacity .2s; }
.answer:hover:not([disabled]) { transform: translateY(-2px); }
.answer[disabled] { cursor: default; }
.answer-key { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: rgb(255 255 255 / .55); }
.answer.a0 { background: #f68a70; } .answer.a1 { background: #6cc4be; } .answer.a2 { background: #f5b56d; }
.answer.a3 { background: #b4acec; } .answer.a4 { background: #9fd38a; } .answer.a5 { background: #e8d58a; }
.answer.right { outline: 4px solid var(--ok); outline-offset: 2px; }
.answer.wrong { outline: 4px dashed var(--danger); outline-offset: 2px; }
.answer.dim { opacity: .45; }
.reveal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); font-size: 1.15rem; }
.reveal.good { border-color: var(--ok); }
.reveal.bad { border-color: var(--danger); }

.quiz-editor { max-width: 48rem; }
.question-editor h2 { margin: 0; }
.row.space { justify-content: space-between; }
.grow { flex: 1 1 12rem; }
.label-like { font-weight: 700; display: block; margin-bottom: .35rem; }
fieldset.answers-editor { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.answers-editor legend { font-weight: 700; margin-bottom: .35rem; padding: 0; }
.answer-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.answer-row input[type="radio"] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--ok); }
textarea { resize: vertical; }
.media-picker { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.media-preview { max-width: 220px; max-height: 140px; border-radius: var(--radius-sm); }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.save-bar { position: sticky; bottom: 0; padding: .6rem 0; background: var(--bg); border-top: 1px solid var(--line); }
.report p { margin: .4rem 0; }
.inspect { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; background: var(--surface-2); padding: .75rem; border-radius: var(--radius-sm); max-height: 320px; overflow: auto; }

/* ---------- live rooms ---------- */
.live-lobby { display: grid; gap: 1rem; max-width: 52rem; margin: 0 auto; }
@media (min-width: 800px) { .live-lobby { grid-template-columns: 1fr 1fr; align-items: start; } }
.join-card { text-align: center; }
.room-code { font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 900; letter-spacing: .18em; margin: .25rem 0 .5rem; color: var(--orange); font-variant-numeric: tabular-nums; }
.player-chips { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.player-chips li { display: inline-flex; align-items: center; gap: .25rem; padding-left: .8rem; border-radius: 999px; background: var(--surface-2); }
.player-chips .icon-btn.small { width: 36px; height: 36px; border: 0; }
.leaderboard { margin: 0 0 1rem; padding-left: 1.6rem; display: grid; gap: .35rem; }
.leaderboard li { padding: .35rem .6rem; border-radius: 8px; background: var(--surface-2); }
.leaderboard li > * { display: inline-flex; }
.leaderboard li strong { float: right; color: var(--orange); }
.leaderboard li.me { outline: 2px solid var(--teal); }
.podium { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.podium li { display: flex; justify-content: space-between; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 1.2rem; }
.podium li:first-child { background: var(--orange); color: var(--on-accent); font-size: 1.5rem; }
.live-final { max-width: 36rem; margin: 0 auto; }
.answer-count { margin-left: auto; font-size: 1.3rem; }
div.answer { cursor: default; }
.answer.chosen { outline: 4px solid var(--text); outline-offset: 2px; }

/* ---------- study room ---------- */
.study { display: grid; gap: 1rem; }
@media (min-width: 1000px) { .study { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } .study-scene { position: sticky; top: 4.5rem; } }
.study-scene .tank { height: clamp(300px, 62vh, 620px); cursor: default; }
.study-clock { position: absolute; right: 1rem; bottom: 1rem; display: grid; justify-items: center; gap: .1rem;
  padding: .75rem 1.5rem; border-radius: var(--radius); background: rgb(14 30 43 / .78); color: #f5ebdd; min-width: 12rem; }
.study-clock .digits { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.study-clock .phase { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; color: #f5a25d; }
.study-clock .hint { color: #c9d3d8; }
.study-panel { display: grid; gap: 1rem; }
.custom-times label { display: grid; gap: .25rem; font-weight: 700; flex: 1 1 5rem; }
.volume { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: .75rem; font-weight: 400; margin: .35rem 0; }
input[type="range"] { min-height: 0; padding: 0; accent-color: var(--coral); background: transparent; border: 0; }
.music-player { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); margin: .5rem 0; }
.music-player.idle { display: none; }
.music-player > div, .music-player iframe { width: 100%; height: 100%; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; height: 110px; align-items: end; margin: .5rem 0 1rem; }
.week .day { display: grid; grid-template-rows: 1fr auto; height: 100%; justify-items: center; gap: .25rem; }
.week .bar { align-self: end; width: 70%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--teal); }
.recent { margin: 0; padding-left: 1.1rem; color: var(--muted); }

/* ---------- focus tools ---------- */
.tool-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.tool-tabs a { display: inline-flex; align-items: center; text-decoration: none; }
.disclaimer { margin-top: 2rem; text-align: center; }
.page-head .btn svg { width: 20px; height: 20px; }
.visual-timer { max-width: 30rem; margin: 0 auto; display: grid; gap: 1rem; justify-items: center; }
.ring { position: relative; width: min(78vw, 300px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.ring-fill { fill: none; stroke: var(--teal); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-fill.low { stroke: var(--orange); }
.ring-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.center-row { justify-content: center; }
.custom-minutes { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; margin: 0; }
.custom-minutes input { width: 5rem; }
.task h2 { margin: 0; }
.steps { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .25rem; }
.steps li { display: flex; align-items: center; gap: .5rem; }
.step { display: flex; align-items: center; gap: .75rem; flex: 1; font-weight: 400; margin: 0; min-height: 44px; cursor: pointer; }
.step input { flex: none; }
.step.done span { text-decoration: line-through; color: var(--muted); }
.step input:checked { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.35); } }
.task.all-done { border-color: var(--ok); }
.celebrate { display: flex; align-items: center; gap: .75rem; font-weight: 800; color: var(--ok); animation: rise .5s var(--ease) both; }
.mini-dino { width: 72px; height: auto; }
.dump-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.dump-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: var(--radius-sm); background: var(--surface-2); flex-wrap: wrap; }
.small-btn { min-height: 36px; padding: 0 .75rem; font-size: .9rem; }
.done-text { text-decoration: line-through; color: var(--muted); }
.body-double { display: grid; gap: 1rem; }
.body-double .tank { height: clamp(260px, 50vh, 480px); cursor: default; }
.intent { font-size: 1.15rem; margin-bottom: .25rem; }
.pick { display: grid; justify-items: center; gap: .75rem; text-align: center; }
.picked { font-size: 1.4rem; font-weight: 800; margin: 0; animation: rise .4s var(--ease) both; }
.week-dots { display: inline-flex; gap: 4px; }
.week-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.week-dots .dot.on { background: var(--teal); border-color: var(--teal); }

/* ---------- guess the song ---------- */
.song-setup { max-width: 44rem; }
.song-setup h2 { margin-top: .5rem; }
.song-play { max-width: 44rem; margin: 0 auto; display: grid; gap: 1rem; }
.snippets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.snippets li { text-align: center; padding: .4rem 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.snippets li.used { background: var(--line); }
.snippets li.now { background: var(--teal); color: var(--on-accent); font-weight: 800; }
.play-btn { min-height: 72px; font-size: 1.25rem; justify-self: center; padding: 0 2.25rem; }
.play-btn svg { width: 28px; height: 28px; }
.song-type { display: grid; gap: .5rem; position: relative; }
.suggestions { list-style: none; margin: 0; padding: .25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: grid; }
.suggestions button { width: 100%; text-align: left; min-height: 44px; padding: .4rem .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.suggestions button:hover, .suggestions button:focus-visible { background: var(--surface-2); }
.reveal-song { display: flex; gap: 1rem; align-items: center; border-width: 2px; }
.reveal-song.good { border-color: var(--ok); }
.reveal-song img { border-radius: var(--radius-sm); flex: none; }
.reveal-song p { margin: 0; }
.song-title { font-size: 1.3rem; font-weight: 800; }

/* ---------- give ---------- */
.give { max-width: 52rem; }
.give .lead { font-size: 1.05rem; max-width: 40rem; }
.give-group { margin-top: 1.75rem; }
.give-group h2 { display: flex; align-items: center; gap: .6rem; }
.give-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--coral); }
.give-icon svg { width: 22px; height: 22px; }
.charities { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 720px) { .charities { grid-template-columns: 1fr 1fr; } }
.charity { display: flex; flex-direction: column; justify-content: space-between; gap: .75rem; }
.charity p { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.charity .btn { align-self: flex-start; }
.charity .btn svg { width: 18px; height: 18px; }
