:root {
  color-scheme: dark;
  --bg: #152922;
  --panel: #1b3329;
  --line: #496250;
  --ink: #f2eee1;
  --muted: #bfccb9;
  --grass: #a7cf83;
  --rabbit: #f3e7ce;
  --fox: #f6ad7b;
  --accent: #e8cb85;
  font-family: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 10% 25%, #284031 0, transparent 65%); }
button, input, summary { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--ink); text-underline-offset: 4px; }
button { cursor: pointer; color: var(--ink); border: 1px solid var(--line); background: transparent; border-radius: 9px; min-height: 46px; padding: .55rem .85rem; }
button:hover:not(:disabled), summary:hover { color: var(--accent); border-color: var(--accent); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; z-index: 5; background: var(--bg); }
.skip-link:focus { top: 8px; }
nav { border-bottom: 1px solid #49625066; }
.nav-inner { max-width: 1176px; margin: auto; display: flex; flex-wrap: wrap; gap: 0 1.7rem; padding: .15rem 1.5rem; }
.nav-inner a { min-height: 44px; display: inline-flex; align-items: center; font-size: .75rem; text-decoration: none; color: var(--muted); }
.nav-inner a:hover { color: var(--ink); text-decoration: underline; }
.brand { max-width: 1176px; margin: auto; padding: 2rem 1.5rem 1.4rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.eyebrow { margin: 0 0 .55rem; color: var(--accent); font-size: .68rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
h1 { font-family: Georgia, serif; font-weight: normal; font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -.045em; line-height: 1.1; margin: 0; }
h1 span { color: var(--accent); }
.brand p:last-child { color: var(--muted); margin: .65rem 0 0; }
.prototype-label { color: var(--muted); font-size: .7rem; border: 1px solid var(--line); border-radius: 50%; padding: 1.6rem 1.3rem; text-align: center; transform: rotate(5deg); }
main { max-width: 1176px; margin: auto; padding: 0 1.5rem 2rem; }
.challenges { display: flex; gap: .5rem; padding: .5rem 0 1.3rem; }
.challenges button { flex: 1; text-align: left; max-width: 230px; color: var(--muted); border-color: transparent; border-bottom: 1px solid var(--line); border-radius: 0; }
.challenges button[aria-pressed='true'] { color: var(--ink); border-color: var(--accent); }
.challenges button span { color: var(--accent); font-size: .75rem; margin-right: .8rem; }
.challenge-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
h2 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.55rem); font-weight: 550; line-height: 1.35; }
.challenge-heading p:not(.eyebrow) { color: var(--muted); margin: .45rem 0 0; font-size: .85rem; }
.challenge-heading .duration { white-space: nowrap; border-left: 1px solid var(--line); padding: .6rem 0 .6rem 1rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 2rem; align-items: start; }
.meadow-panel { border: 1px solid var(--line); border-radius: 18px; background: #1b3329bf; overflow: hidden; }
.populations { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 1rem; border-bottom: 1px solid var(--line); gap: .5rem; }
.population { padding-left: .7rem; border-left: 1px solid var(--line); }
.population:first-child { border-left: none; padding-left: 0; }
.population dt { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; }
.population dd { margin: 0; font-size: 1.8rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.population .delta { font-size: .7rem; color: var(--accent); margin-left: .45rem; }
.icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.world-wrap { padding: .9rem .8rem 0; }
.world-heading { display: flex; justify-content: space-between; gap: .5rem; padding: 0 .3rem; color: var(--muted); font-size: .7rem; }
#day { font-variant-numeric: tabular-nums; white-space: nowrap; }
#meadow { display: block; width: 100%; overflow: visible; }
.grass-mark { stroke: var(--grass); fill: none; stroke-width: 2.2; stroke-linecap: round; }
.grass-mark.grown { animation: regrow .7s ease-out; }
.rabbit-shape { fill: var(--rabbit); stroke: #182b22; stroke-width: 1.2; }
.fox-shape { fill: var(--fox); stroke: #182b22; stroke-width: 1.2; }
.creature { transition: transform .55s ease-in-out; }
.fast-playback .creature { transition-duration: .22s; }
.newborn .rabbit-shape { animation: birth .65s ease-out; }
.event-ring { fill: none; stroke-width: 2; animation: event-fade .75s ease-out forwards; }
.graze-event { stroke: var(--grass); stroke-dasharray: 2 3; }
.hunt-event { stroke: var(--fox); }
.hunger-event { stroke: var(--rabbit); stroke-dasharray: 3 3; }
.relationship { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: .68rem; margin: -.25rem 0 .85rem; }
.relation-dot { margin: 0 .35rem; }
.event-caption { min-height: 3.6rem; padding: .8rem 1.1rem; border-top: 1px solid #49625066; margin: 0; font-size: .76rem; color: var(--ink); background: #15292280; }
.playback { display: flex; flex-wrap: wrap; gap: .45rem; padding: .7rem 1rem; }
.playback button { font-size: .72rem; flex: 1; padding-inline: .5rem; }
.history-panel { margin: 0; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.history-panel figcaption { color: var(--muted); font-size: .72rem; display: flex; justify-content: space-between; gap: .5rem; }
.history-panel figcaption span { font-size: .62rem; }
#history-chart { width: 100%; display: block; }
.history-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.history-label { font-family: inherit; font-size: 11px; fill: var(--muted); }
.review label { color: var(--muted); font-size: .72rem; }
.review input { width: 100%; min-height: 44px; accent-color: var(--accent); }
.observation-log { padding: .1rem 1rem .65rem; }
summary { cursor: pointer; min-height: 44px; display: list-item; padding: .7rem 0; font-size: .78rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .7rem; }
caption { text-align: left; color: var(--muted); padding: .5rem 0; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.experiment-panel { padding: .6rem 0; }
h3 { font-family: Georgia, serif; font-weight: normal; font-size: 1.55rem; line-height: 1.25; margin: 0 0 1.1rem; letter-spacing: -.02em; }
fieldset { margin: 0; padding: 0; border: none; min-width: 0; }
#interventions { display: grid; gap: .5rem; }
.intervention { position: relative; }
.intervention input, .prediction-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.intervention label { min-height: 64px; display: flex; align-items: center; gap: .85rem; cursor: pointer; padding: .6rem .9rem; background: #1b332950; border: 1px solid var(--line); border-radius: 10px; }
.intervention strong { display: block; font-size: .88rem; font-weight: 550; }
.intervention small { display: block; font-size: .7rem; color: var(--muted); }
.intervention input:checked + label { background: #e8cb8512; border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.intervention .selection-mark { margin-left: auto; color: var(--accent); opacity: 0; }
.intervention input:checked + label .selection-mark { opacity: 1; }
.intervention input:focus-visible + label, .prediction-options input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
#choices:disabled label { cursor: default; opacity: .6; }
.preview-note { color: var(--muted); min-height: 2.8rem; font-size: .72rem; margin: .8rem 0; }
#prediction { border-top: 1px solid var(--line); padding-top: .9rem; margin-bottom: 1rem; }
#prediction legend { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); padding-right: .6rem; }
#prediction legend span { color: var(--muted); text-transform: none; letter-spacing: 0; padding-left: .4rem; }
#prediction-question { font-size: .8rem; margin: .25rem 0 .7rem; }
.prediction-options { display: flex; gap: .4rem; }
.prediction-options label { position: relative; flex: 1; text-align: center; cursor: pointer; }
.prediction-options span { display: flex; min-height: 46px; align-items: center; justify-content: center; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; font-size: .75rem; }
.prediction-options input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 650; }
.small { color: var(--muted); font-size: .72rem; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 650; width: 100%; min-height: 52px; }
.primary:hover:not(:disabled) { color: var(--bg); background: #f3dfad; }
#run { display: flex; justify-content: space-between; align-items: center; }
.run-note { text-align: center; }
#watch-panel p:not(.eyebrow), #rewind-panel p:not(.eyebrow) { color: var(--muted); font-size: .85rem; }
#result-title { font-family: inherit; font-size: 1.4rem; letter-spacing: .1em; color: var(--accent); }
.goal-result { font-size: .9rem; margin-bottom: 1rem; }
.explanation { border-left: 2px solid var(--accent); padding-left: 1rem; margin: 1.4rem 0; }
.explanation p { font-size: .83rem; color: var(--muted); }
.prediction-result { font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; }
#next { width: 100%; margin-top: .55rem; }
.last-experiment { border: 1px dashed var(--line); padding: .8rem; border-radius: 9px; color: var(--muted); font-size: .74rem; }
.rules { border-top: 1px solid var(--line); margin-top: 1.3rem; }
.rules p, .rules li { font-size: .75rem; color: var(--muted); }
.rules ul { padding-left: 1.25rem; }
.rules li { margin-bottom: .7rem; }
footer { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .7rem; border-top: 1px solid #49625066; }
@keyframes regrow { from { opacity: .25; } to { opacity: 1; } }
@keyframes birth { 0% { stroke: var(--accent); stroke-width: 5; } 100% { stroke-width: 1.2; } }
@keyframes event-fade { 0%, 35% { opacity: 1; } 100% { opacity: .15; } }
@media (max-width: 800px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 1.3rem; }
  .prototype-label { border-radius: 12px; padding: .8rem; transform: none; }
  .experiment-panel { padding-top: 0; }
  #interventions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intervention label { min-height: 78px; padding: .6rem; gap: .5rem; }
  .intervention .selection-mark { display: none; }
  .preview-note { min-height: 0; }
}
@media (max-width: 480px) {
  .nav-inner { padding: .2rem 1rem; gap: 0 1rem; }
  .brand { padding: 1.3rem 1rem 1rem; }
  .brand .eyebrow { font-size: .57rem; letter-spacing: .08em; }
  .brand p:last-child { font-size: .8rem; }
  .prototype-label { display: none; }
  main { padding: 0 .85rem 1.5rem; }
  .challenges { gap: .25rem; padding-bottom: 1rem; }
  .challenges button { padding: .45rem .2rem; font-size: .78rem; text-align: center; }
  .challenges button span { margin-right: .3rem; font-size: .65rem; }
  .challenge-heading { display: block; margin-bottom: 1rem; }
  .challenge-heading .duration { display: none; }
  .populations { padding: .8rem; }
  .population dt { font-size: .66rem; gap: .25rem; }
  .population dd { font-size: 1.6rem; }
  .population .delta { display: block; margin-left: 0; font-size: .6rem; }
  .world-wrap { padding: .7rem .4rem 0; }
  .world-heading { font-size: .63rem; }
  .relationship { font-size: .58rem; gap: .25rem; }
  .event-caption { padding: .7rem .8rem; min-height: 4rem; font-size: .7rem; }
  .playback { padding: .6rem; }
  .playback button { flex-basis: 40%; }
  #interventions { grid-template-columns: minmax(0, 1fr); }
  .intervention label { min-height: 62px; padding: .6rem .85rem; gap: .85rem; }
  .intervention .selection-mark { display: inline; }
  .history-panel { padding: .7rem .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html.less-motion *, html.less-motion *::before, html.less-motion *::after { animation: none !important; transition: none !important; }
