:root {
  color-scheme: light;
  --forest: #213e31;
  --muted: #526049;
  --paper: #f7eed7;
  --ink: #263c2d;
  --gold: #977b42;
  --lilac: #c396d2;
  --mint: #80c3a8;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 50% 0%, #fff9e9 10%, transparent 65%); }
a { color: inherit; text-underline-offset: .21em; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #795327; outline-offset: 4px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 30; padding: .8rem; background: var(--paper); top: .5rem; left: .5rem; }

.book-header {
  min-height: 65px; padding: 0 max(22px, calc((100% - 1220px) / 2)); display: flex;
  align-items: center; justify-content: space-between; gap: 1rem; color: #f5e9c6;
  background: radial-gradient(ellipse at 30% 5%, #3d5541, #233c2e 75%);
  border-bottom: 2px solid #b39a63; box-shadow: 0 3px 8px #45391c2d;
}
.brand { align-items: center; display: flex; gap: .75rem; text-decoration: none; }
.brand strong { font-size: 1.14rem; font-weight: normal; border-right: 1px solid #aa9051; padding-right: .75rem; }
.brand span { font-size: 1.43rem; line-height: 1; }
.brand small { display: block; font: 600 .39rem/1.5 system-ui; letter-spacing: .15em; margin-top: .29rem; }
.book-header nav { display: flex; gap: clamp(.65rem, 3vw, 2rem); font-size: .89rem; }
.book-header nav a { text-decoration: none; }
.book-header nav a:hover { text-decoration: underline; }
.book-header :focus-visible { outline-color: #ffedaa; }
main { max-width: 1250px; margin: 0 auto; padding: 0 22px; }
.game-intro { text-align: center; padding: clamp(19px, 3vw, 34px) 4px 19px; }
.game-intro p { margin: 0; }
.eyebrow {
  font: 650 .68rem/1.2 system-ui; text-transform: uppercase;
  letter-spacing: .24em; color: #61764b;
}
.game-intro h1 {
  margin: .27rem 0 .21rem; line-height: .98; font-size: clamp(2.45rem, 6vw, 5rem);
  font-weight: normal; color: #264531; letter-spacing: -.046em;
}
.game-intro h1 em { color: #577444; }
.game-intro p:last-child { margin-top: .55rem; color: #495f42; font-size: clamp(.81rem, 1.6vw, 1.04rem); }
.game-shell {
  border: 1px solid #a4884b; border-radius: 16px; overflow: hidden;
  background: #fbf3df; box-shadow: 0 10px 35px #463d2623, 0 1px 0 3px #f5e8cb;
}

.scoreboard {
  display: grid; grid-template-columns: 1fr minmax(140px, 2fr) 1fr;
  align-items: center; gap: clamp(.45rem, 3.3vw, 2.8rem);
  padding: .57rem clamp(.65rem, 3.6vw, 2.8rem); color: #fbebc4;
  background: linear-gradient(110deg, #344834, #21392d 50%, #354c36);
  border-bottom: 1px solid #bea86b; user-select: none;
}
.score { display: grid; align-items: center; grid-template-columns: 1fr auto; column-gap: .44rem; }
.score > span { font-size: clamp(.77rem, 1.65vw, 1.17rem); line-height: 1.12; }
.score strong { grid-column: 2; grid-row: span 2; font-size: clamp(1.4rem, 3vw, 2.3rem); font-weight: normal; color: var(--lilac); }
.score.theirs { text-align: right; grid-template-columns: auto 1fr; }
.score.theirs strong { grid-column: 1; grid-row: 1 / span 2; color: var(--mint); }
.score small { color: #e0d2a9; font: .68rem/1.4 system-ui; white-space: nowrap; }
.house-work label {
  display: flex; justify-content: space-between; margin: 0 .09rem .27rem; gap: .45rem;
  font: 650 .69rem/1.2 system-ui; letter-spacing: .05em; text-transform: uppercase;
}
.work-ready .house-work label { color: #ffefad; }
#work-label { white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter-track {
  display: flex; height: .57rem; border: 1px solid #bdab72;
  border-radius: 12px; overflow: hidden; background: #172c22;
}
.meter-track i { width: 0; background: linear-gradient(#e6bbec, var(--lilac)); transition: width .27s ease-out; }
#work-fill-1 { background: linear-gradient(#b9e2c5, var(--mint)); }

.meadow {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 1.94; min-height: 450px;
  background: #8c995d url('./meadow-stage.png') center 57% / cover;
  box-shadow: inset 0 0 46px #3845334f;
}
.meadow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(transparent 57%, #243f2824 85%, #233e2b65), radial-gradient(ellipse at 50% 50%, transparent 50%, #29372229);
}
.house {
  position: absolute; left: 50%; top: 1.5%; width: min(52%, 620px); aspect-ratio: 3/2;
  transform: translateX(-50%); z-index: 2; pointer-events: none;
  --cottage-photo: url('./daisy-cottage-v1.webp');
}
.house::before {
  content: ""; position: absolute; inset: 82% 5% 3%; border-radius: 50%;
  background: radial-gradient(ellipse, #2937259e 5%, #29372556 51%, transparent 73%);
  transform: translateY(9%); filter: blur(5px);
}
.porch-light {
  position: absolute; inset: 79% 19% -4%; opacity: 0; transform: scale(.48, .65);
  background: radial-gradient(ellipse at 50% 15%, #ffe69bcf, #ffcb6d4a 43%, transparent 71%);
  filter: blur(4px); transition: opacity .24s, transform .34s ease-out;
}
.door-open .porch-light { opacity: .92; transform: scale(1); }
.cottage-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; filter: drop-shadow(0 5px 5px #26371f67) saturate(.86);
  transition: filter .6s;
}
.house[data-stage="4"] .cottage-art { filter: drop-shadow(0 5px 5px #26371f67) saturate(1.11) brightness(1.045); }
.cottage-door-reveal {
  position: absolute; inset: 45.2% 41.6% 18.7% 40.4%; border-radius: 50% 50% 0 0 / 28% 28% 0 0;
  background: radial-gradient(ellipse at 47% 34%, #fce6ac, #e1a752 43%, #553924 92%);
  perspective: 180px; overflow: hidden; opacity: 0; transition: opacity .18s;
}
.cottage-door-reveal i {
  position: absolute; inset: 0; background: var(--cottage-photo) 49.3% 70.7% / 555.56% 277%;
  transform-origin: right; transition: transform .28s ease-in-out;
}
.door-open .cottage-door-reveal { opacity: 1; }
.door-open .cottage-door-reveal i { transform: rotateY(83deg); }
.cottage-lamplight {
  position: absolute; inset: 0; opacity: 0; transition: opacity .55s;
  background: radial-gradient(ellipse 13% 21% at 26% 57%, #ffec9d9c, transparent 79%),
    radial-gradient(ellipse 14% 20% at 75% 57%, #ffda7f9c, transparent 79%);
}
.house[data-resting="true"] .cottage-lamplight { opacity: .64; }
.house[data-stage="4"] .cottage-lamplight { opacity: 1; }
.door-anchor, .wall-anchor { position: absolute; left: 49.7%; top: 84%; }
.wall-anchor[data-wall="0"] { left: 35%; top: 93%; }
.wall-anchor[data-wall="1"] { left: 65%; top: 93%; }
.window-friends { position: absolute; top: 54%; width: 8.5%; height: 10.7%; overflow: hidden; }
.left-window { left: 21.9%; }
.right-window { left: 70.2%; }
.window-friend {
  position: absolute; left: 3%; bottom: -3%; width: 81%; aspect-ratio: 1;
  animation: settle-in .45s ease-out both, doze 3s .45s ease-in-out infinite;
}
.window-friend:nth-child(2) { left: 32%; width: 65%; bottom: -7%; }
.window-friend:nth-child(3) { left: 10%; width: 69%; bottom: -9%; }
.window-friend canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sleep-puff { position: absolute; color: #fff9d1; font: bold clamp(7px, 1vw, 14px)/1 Georgia; left: 32%; top: 0; text-shadow: 0 1px 2px #65431b; animation: snooze 3.3s ease-out infinite; }
.wall-paint { position: absolute; top: 71.2%; width: 10%; height: 8%; opacity: 0; mix-blend-mode: multiply; }
.wall-paint[data-paint="0"] { left: 17%; color: var(--lilac); }
.wall-paint[data-paint="1"] { left: 68%; color: var(--mint); }
.wall-paint.coated { opacity: .48; }
.wall-paint i {
  position: absolute; inset: 1% 13% 72% 1%; background: currentColor;
  filter: blur(1px); border-radius: 52% 26% 43% 18%; transform: rotate(-7deg);
}
.wall-paint i:nth-child(2) { inset: 32% 0 40% 5%; }
.wall-paint i:nth-child(3) { inset: 63% 20% 7% 0; }
.wall-paint.being-painted { opacity: .88; }
.wall-paint.being-painted i { animation: paint-on .34s ease-out both; }
.wall-paint.being-painted i:nth-child(2) { animation-delay: .08s; }
.wall-paint.being-painted i:nth-child(3) { animation-delay: .16s; }
.wall-paint.being-painted::after {
  content: ""; position: absolute; width: 8%; aspect-ratio: 1; border-radius: 50%;
  left: 53%; top: 32%; background: currentColor;
  box-shadow: -.68em .17em currentColor, .42em -.45em currentColor, .78em .29em currentColor;
  animation: wall-flecks .47s ease-out both;
}

.sun-motes, .actors, .scene-fx { position: absolute; inset: 0; pointer-events: none; }
.sun-motes { z-index: 3; }
.sun-motes i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff5c6;
  box-shadow: 0 0 8px #fff4b5; top: 38%; left: 15%; animation: mote-drift 6.1s ease-in-out infinite;
}
.sun-motes i:nth-child(2) { top: 52%; left: 78%; animation-delay: -1.4s; }
.sun-motes i:nth-child(3) { top: 24%; left: 37%; animation-delay: -4.6s; }
.sun-motes i:nth-child(4) { top: 69%; left: 87%; animation-delay: -.6s; }
.sun-motes i:nth-child(5) { top: 79%; left: 28%; animation-delay: -3s; }
.sun-motes i:nth-child(6) { top: 78%; left: 67%; animation-delay: -5.2s; }
.actors { z-index: 4; }
.scene-fx { z-index: 12; }
.nekomi-actor {
  --figure: clamp(100px, 11vw, 151px); --face: 1;
  --stride: .235s; --hop: -10%; --tilt: 6deg; --glance: 7deg;
  position: absolute; width: var(--figure); height: calc(var(--figure) * 1.17);
  padding: 0; border: 0; background: none; color: #283e2a;
  transform: translate(-50%, -100%); pointer-events: auto; z-index: 2;
}
.meadow[data-guide]:not([data-guide="off"]) .nekomi-actor { --figure: clamp(128px, 13vw, 175px); }
.meadow[data-guide]:not([data-guide="off"]) .paint-power { visibility: hidden; }
.meadow[data-guide="ready"] .nekomi-actor[data-player="1"] {
  --bucket-paint: var(--lilac);
}
.meadow[data-guide="ready"] .nekomi-actor[data-player="1"] .paint-pail {
  border-radius: 34%; outline: 2px solid #fff1ac; outline-offset: 4px; box-shadow: 0 0 16px 7px #ffe7a5a6;
}
.nekomi-actor[data-role="support"] { --figure: clamp(81px, 8.4vw, 107px); }
.nekomi-actor[data-player="1"] {
  --bucket-left: -4%; --can-left: 22%; --brush-left: 62%; --brush-angle: 26deg;
  --pour-tilt: -63deg; --pour-offset: -45%; --spout-left: 5%; --face: -1; --paint: var(--mint);
}
.nekomi-actor[data-player="0"] {
  --bucket-left: 79%; --can-left: 58%; --brush-left: 31%; --brush-angle: -26deg;
  --pour-tilt: 63deg; --pour-offset: 45%; --spout-left: 95%; --paint: var(--lilac);
}
.nekomi-actor:focus-visible { outline-color: #fff2ac; border-radius: 44%; }
.nekomi-actor.interactive, .nekomi-actor[data-role="leader"] { z-index: 3; }
.nekomi-actor[aria-pressed="true"] { z-index: 7; }
.nekomi-actor.walking { z-index: 8; }
.nekomi-actor.pouring, .nekomi-actor.entering { z-index: 9; }
.nekomi-actor.inside { visibility: hidden; pointer-events: none; }
.nekomi-rig {
  position: absolute; inset: 0 0 13%; transform-origin: 50% 92%;
  animation: gentle-breath var(--breath, 4.4s) var(--idle-delay, 0s) ease-in-out infinite;
}
.character-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  object-position: center bottom; filter: drop-shadow(0 4px 3px #223d2771); z-index: 2;
}
.eye-lid {
  position: absolute; width: var(--lid-size); height: calc(var(--lid-size) * .99);
  transform: translate(-50%, -50%) scaleY(0); transform-origin: center 22%;
  border-radius: 58% 61% 52% 55%; z-index: 3;
  background: linear-gradient(var(--lid-light) 15%, var(--lid-shadow));
  animation: blink 6.7s var(--idle-delay, 0s) ease-in-out infinite;
}
.eye-lid::after {
  content: ""; position: absolute; inset: 48% 14% 31%; border-radius: 0 0 50% 50%;
  border-bottom: max(1px, .07em) solid color-mix(in srgb, var(--lid-shadow) 32%, #42312b);
}
.eye-lid.rest-lid {
  animation: none; height: calc(var(--lid-size) * .88);
  transform: translate(-50%, -50%) scaleY(1);
}
.nekomi-actor.interactive:hover .nekomi-rig,
.nekomi-actor[aria-pressed="true"] .nekomi-rig { filter: drop-shadow(0 0 8px #ffe991d9); }
.ground-shadow, .leader-glow { position: absolute; border-radius: 50%; pointer-events: none; }
.ground-shadow { inset: auto 13% 12% 13%; height: 10%; background: #283c2670; filter: blur(4px); }
.leader-glow {
  inset: auto 3% 8%; height: 14%; border: 1px solid #fff0ab8c;
  box-shadow: 0 0 11px #ffe69298, inset 0 0 8px #ffe69250; opacity: 0; transition: opacity .2s;
}
[data-role="leader"] .leader-glow { opacity: .61; }
[aria-pressed="true"] .leader-glow { opacity: 1; border: 2px solid #fff4b5; }
.name-ribbon {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 5;
  max-width: 117%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 3px 8px; border: 1px solid #b3995a; border-radius: 20px;
  background: #fff3d4f5; color: #2b4430; box-shadow: 0 2px 4px #24362244;
  font: bold clamp(9px, 1vw, 11px)/1.14 Georgia, serif;
}
[data-role="leader"] .name-ribbon, [aria-pressed="true"] .name-ribbon {
  color: #fff8d9; background: #28513ceb; border-color: #d5bd75;
}
.paint-power {
  position: absolute; top: 27%; left: 6%; z-index: 5; min-width: 21px; height: 21px;
  display: grid; place-items: center; padding: 0 3px; border: 1px solid #b9984f; border-radius: 50%;
  background: #fff1c4; color: #62461c; font: 700 10px/1 system-ui;
}
.paint-pail {
  position: absolute; left: var(--bucket-left); bottom: 13%; width: 25%; height: 23%;
  z-index: 5; transform-origin: 50% 93%; pointer-events: none;
}
.pail-body {
  position: absolute; inset: 26% 4% 0; overflow: hidden;
  border: 1px solid #665136; border-radius: 7% 7% 22% 22%;
  background: linear-gradient(90deg, #8b7959, #e7d4a1 26%, #d2b87b 65%, #8d7652);
  box-shadow: 0 2px 3px #25362466;
}
.pail-liquid {
  position: absolute; inset: auto 0 0; height: 0;
  background: linear-gradient(90deg, #382a3548, #fff2d13c 45%, transparent), var(--bucket-paint, var(--paint));
  box-shadow: inset 0 2px 1px #fff6cd; transition: height .25s;
}
.pail-handle { position: absolute; inset: 0 15% 38%; border: 1px solid #685136; border-radius: 50% 50% 0 0; }
.pail-opening {
  position: absolute; inset: 21% 3% auto; height: 23%; border: 1px solid #eddbac; border-radius: 50%;
  background: linear-gradient(#594a31, #a08b62); z-index: 1;
}
.receiving .pail-opening { background: var(--bucket-paint); box-shadow: 0 0 8px var(--bucket-paint); }
.pail-count {
  position: absolute; inset: 47% -8% auto; color: #263e28; background: #fff1d2;
  padding: 1px; border: 1px solid #a3864d; border-radius: 7px; text-align: center;
  font: 750 clamp(8px, .85vw, 11px)/1.1 system-ui;
}
.brush-prop {
  position: absolute; left: var(--brush-left); top: 50%; width: 8%; height: 37%; z-index: 4;
  transform: rotate(var(--brush-angle)); transform-origin: 50% 83%; pointer-events: none;
  filter: drop-shadow(0 1px 1px #39261378);
}
.brush-handle, .brush-bristles, .brush-ferrule, .can-handle, .can-body, .can-rim, .can-spout { position: absolute; }
.brush-handle { inset: 34% 29% 0; border: 1px solid #69492f; border-radius: 25%; background: linear-gradient(90deg, #65462c, #b58348 54%, #725334); }
.brush-bristles { inset: 0 -12% 66%; border: 1px solid #876b49; border-radius: 27% 27% 7% 7%; background: var(--brush-paint, var(--paint)); }
.brush-ferrule { inset: 24% -12% 54%; border: 1px solid #74664d; border-radius: 15%; background: linear-gradient(90deg, #63665c, #e5dcc2, #817565); }
.paint-can {
  position: absolute; left: var(--can-left); top: 61%; width: 21%; height: 24%; z-index: 5;
  transform-origin: 50% 30%; transition: transform .16s ease-in-out;
  pointer-events: none; filter: drop-shadow(0 2px 1px #302b1a7d);
}
.can-body {
  inset: 23% 0 0; border: 1px solid #694b36; border-radius: 7% 7% 22% 22%;
  background: linear-gradient(90deg, #58473e55, transparent 22%, #fff4d479 46%, #4a3b3055), var(--paint);
  box-shadow: inset 0 -2px #54423655;
}
.can-handle { inset: 0 10% 46%; border: 1px solid #614f37; border-radius: 50% 50% 0 0; box-shadow: inset 0 1px #fff3b4; }
.can-rim { inset: 18% -3% 58%; border: 1px solid #edd9a3; border-radius: 50%; background: var(--paint); box-shadow: 0 1px 0 #655033; }
.can-spout { left: var(--spout-left); top: 30%; width: 1px; height: 1px; }
.walking .nekomi-rig { animation: nekomi-step var(--stride) ease-in-out infinite; }
.walking .paint-can, .walking .brush-prop { animation: tools-swing var(--stride) ease-in-out infinite alternate; }
.walking .paint-pail { animation: pail-bob var(--stride) ease-in-out infinite alternate; }
.walking .name-ribbon { opacity: .63; }
.pouring .nekomi-rig { animation: none; transform: rotate(calc(var(--face) * 8deg)); }
.pouring .paint-can { transform: translate(var(--pour-offset), -49%) rotate(var(--pour-tilt)); }
.receiving .nekomi-rig { animation: thank-you .42s ease-in-out both; }
.dipping .nekomi-rig { animation: dip-in .19s ease-out both; }
.dipping .brush-prop {
  left: calc(46% + 9% * var(--face)); top: 32%; height: 52%;
  animation: dip-brush .20s ease-in-out both;
}
.dipping .paint-pail { animation: pail-bob .18s ease-in-out alternate; }
.painting .nekomi-rig { animation: paint-sway .24s ease-in-out infinite alternate; }
.painting .brush-prop { top: 27%; height: 58%; animation: brush-stroke .24s ease-in-out infinite; }
.painting[data-painting-wall="0"] { --brush-direction: -1; }
.painting[data-painting-wall="1"] { --brush-direction: 1; }
.painting .brush-prop { left: calc(46% + 13% * var(--brush-direction)); }
.farewell { z-index: 9; }
.farewell .nekomi-rig { animation: doorstep-glance .24s ease-in-out both; }
.farewell .eye-lid { animation: doorstep-squint .24s ease-out both; }
.entering .nekomi-rig { animation: none; }
.entering .paint-pail, .entering .brush-prop, .entering .paint-can,
.entering .name-ribbon, .entering .leader-glow, .entering .paint-power { opacity: 0; }
.paint-stream { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.paint-stream path {
  fill: none; stroke: var(--stream); stroke-linecap: round; stroke-width: clamp(4px, .7vw, 9px);
  stroke-dasharray: 13 2; filter: drop-shadow(0 0 1px #fff4ce); animation: paint-flow .29s linear infinite;
}
.paint-bubble {
  position: absolute; max-width: max-content; background: #fff4d6; color: #264936;
  border: 1px solid #b99b57; border-radius: 16px; padding: .25em .58em;
  box-shadow: 0 2px 5px #2436244d; font: 700 clamp(11px, 1.55vw, 17px)/1.25 Georgia, serif;
  white-space: nowrap; transform: translate(-50%, -100%); animation: float-pop .64s ease-out both;
}
.scene-banks {
  position: absolute; inset: auto 3% 1.7%; z-index: 6; display: flex; justify-content: space-between; pointer-events: none;
}
.bank { display: flex; gap: .29rem; }
.dust {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid #f5e7be; border-radius: 50%; font: 750 10px/1 system-ui; color: #fff7de;
  background: radial-gradient(circle at 33% 22%, var(--shine), var(--shade) 53%);
  box-shadow: 0 2px 5px #122e2a5e; text-shadow: 0 1px #233729;
}
.dust.red { --shine: #f7c9b5; --shade: #823e36; }
.dust.blue { --shine: #c5eff3; --shade: #3a6375; }
.dust.yellow { --shine: #f8eab0; --shade: #79632e; }
.dust.green { --shine: #c8e6a4; --shade: #456242; }

.welcome {
  position: absolute; inset: 0; z-index: 5; display: flex; justify-content: center; align-items: end;
  padding-bottom: 5%; pointer-events: none;
}
.welcome-friend { display: grid; justify-items: center; gap: .28rem; }
.welcome-friend canvas {
  width: clamp(122px, 15vw, 188px); aspect-ratio: 1; filter: drop-shadow(0 5px 3px #263e2690);
  transform-origin: center bottom; animation: gentle-breath 4.7s ease-in-out infinite;
}
.start-button, .help-button, #play-owned {
  background: linear-gradient(#4f674a, #2c4c37); color: #fff5d5;
  border: 1px solid #a68a4d; border-radius: 7px; padding: .72rem 1.1rem;
  box-shadow: inset 0 0 0 2px #f8dda821, 0 2px 5px #322b1749; font-weight: bold;
}
.start-button { pointer-events: auto; width: 100%; min-height: 44px; }
.start-button:hover:enabled, .help-button:hover:enabled, #play-owned:hover:enabled { background: #385c41; }
.start-button:focus-visible { outline-color: #fff3ab; }
button:disabled:not(.nekomi-actor) { opacity: .58; }
.table { position: relative; }
.playline { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid #bda770; }
.turn-copy { min-width: 0; }
.turn-copy p { margin: 0; }
#turn-status { font-size: clamp(.97rem, 2.1vw, 1.32rem); font-weight: bold; }
#action-note { margin-top: 4px; font-size: .83rem; color: #495d42; line-height: 1.4; }
.help-button { min-width: 9rem; }
.options { display: flex; align-items: center; justify-content: space-between; gap: .45rem 1rem; flex-wrap: wrap; padding: 0 18px 10px; }
#last-sip { margin: 0; color: #485c42; font-size: .81rem; }
.buttons { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.secondary {
  border: 1px solid #aa965f; background: #fbf1d8; color: #314c37; border-radius: 5px;
  padding: .49rem .66rem; font-size: .79rem;
}
.secondary:hover:enabled, .secondary[aria-pressed="true"] { background: #e9e5c6; }
.game-details {
  margin: .72rem 0; padding: .1rem .9rem .3rem; border: 1px solid #cdbc96; border-radius: 7px;
  background: #fff6e1ad; font-size: .92rem;
}
.game-details summary { padding: .66rem 0; cursor: pointer; font-weight: bold; }
.game-details li, .game-details p { line-height: 1.55; }
.game-details ol { padding-left: 1.25rem; }
.quiet { color: var(--muted); font-size: .82rem; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.crew-stats, .owned-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: .4rem; }
.crew-stat, .owned-option { background: #f9efd5; padding: .43rem; font-size: .77rem; border: 1px solid #d8cbab; border-radius: 5px; }
.owned-panel { padding-bottom: .55rem; }
.owned-panel .buttons { margin-top: .55rem; }
.owned-option input { accent-color: #35533b; margin-right: .35rem; }
.owned-option label { display: flex; align-items: start; cursor: pointer; }
.history { max-height: 14rem; overflow: auto; }
.error { color: #762b28; background: #ffe5d8; border: 1px solid #ac594b; padding: .75rem; }
.game-footer { text-align: center; padding: 1.6rem 0; color: #516346; font-size: .85rem; }

@keyframes gentle-breath { 42% { transform: translateY(-2.6%) rotate(1.8deg) scale(1.015, 1.022); } 74% { transform: rotate(-1.3deg); } }
@keyframes blink { 0%, 33%, 36%, 71%, 74%, 100% { transform: translate(-50%, -50%) scaleY(0); } 34.4%, 72.4% { transform: translate(-50%, -50%) scaleY(1); } }
@keyframes nekomi-step {
  0%, 100% { transform: rotate(calc(-1 * var(--tilt))) scale(1.045, .95); }
  52% { transform: translateY(var(--hop)) rotate(var(--tilt)) scale(.98, 1.045); }
}
@keyframes tools-swing { to { rotate: 11deg; } }
@keyframes pail-bob { to { transform: translateY(-10%) rotate(-8deg); } }
@keyframes thank-you { 35% { transform: translateY(-10%) rotate(-4deg); } 74% { transform: scale(1.065, .94); } }
@keyframes dip-in { to { transform: translateY(4%) rotate(calc(11deg * var(--face))) scale(1.028, .956); } }
@keyframes dip-brush { from { transform: rotate(calc(25deg * var(--face))); } to { transform: rotate(calc(122deg * var(--face))); } }
@keyframes paint-sway {
  from { transform: translateY(2%) rotate(calc(6deg * var(--brush-direction))) scale(1.025, .965); }
  to { transform: translateY(-3%) rotate(calc(11deg * var(--brush-direction))) scale(.985, 1.025); }
}
@keyframes brush-stroke {
  from, to { transform: rotate(calc(var(--brush-direction) * 56deg)); }
  50% { transform: rotate(calc(var(--brush-direction) * 29deg)) translateY(-13%); }
}
@keyframes wall-flecks { 0%, 15% { opacity: 0; transform: scale(.4); } 55% { opacity: .86; } 100% { opacity: 0; transform: translate(-85%, -190%) scale(.65); } }
@keyframes doorstep-glance { 43% { transform: translateY(-5%) rotate(var(--glance)) scale(1.02, 1.045); } 79% { transform: rotate(calc(-.47 * var(--glance))) scale(.995, .97); } }
@keyframes doorstep-squint { 0%, 100% { transform: translate(-50%, -50%) scaleY(0); } 46%, 62% { transform: translate(-50%, -50%) scaleY(1); } }
@keyframes paint-flow { to { stroke-dashoffset: -30; } }
@keyframes paint-on { from { scale: .1 1; transform-origin: left; } to { scale: 1; } }
@keyframes float-pop { 0% { opacity: 0; translate: 0 4px; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -24px; } }
@keyframes mote-drift { 0%, 100% { opacity: .08; } 48% { opacity: .75; translate: 15px -27px; } }
@keyframes settle-in { from { transform: translateY(75%); opacity: 0; } }
@keyframes doze { 50% { transform: translateY(4%) rotate(1.5deg) scaleY(.96); } }
@keyframes snooze { 0%, 11% { opacity: 0; } 35% { opacity: 1; } 85%, 100% { opacity: 0; transform: translate(55%, -75%); } }

@media (max-width: 820px) {
  .meadow { aspect-ratio: 1.38; }
  .house { top: 3%; width: min(60%, 515px); }
}
@media (max-width: 600px) {
  main { padding: 0 9px; }
  .book-header { min-height: 55px; padding: 0 13px; }
  .brand { gap: .5rem; }
  .brand strong { font-size: .88rem; padding-right: .5rem; }
  .brand span { font-size: 1.13rem; }
  .brand small { font-size: .32rem; }
  .book-header nav { font-size: .72rem; }
  .book-header nav a:last-child { display: none; }
  .game-intro { padding: 17px 2px 15px; }
  .game-shell { border-radius: 11px; }
  .meadow { height: clamp(398px, 114vw, 530px); min-height: 0; aspect-ratio: auto; background-position: 50% 48%; }
  .meadow[data-guide]:not([data-guide="off"]) { height: clamp(340px, 101vw, 455px); }
  .house { top: 2%; width: min(83%, 392px); }
  .scoreboard { grid-template-columns: 1fr minmax(87px, 1.3fr) 1fr; }
  .score small { font-size: .53rem; }
  .house-work label { font-size: .56rem; gap: .18rem; letter-spacing: 0; text-transform: none; }
  .nekomi-actor { --figure: clamp(72px, 21vw, 108px); }
  .meadow[data-guide]:not([data-guide="off"]) .nekomi-actor { --figure: clamp(91px, 25vw, 119px); }
  .nekomi-actor[data-role="support"] { --figure: clamp(60px, 16vw, 84px); }
  .name-ribbon { padding-inline: 5px; max-width: 107%; font-size: .54rem; }
  .paint-power { min-width: 16px; height: 16px; font-size: .54rem; }
  .scene-banks { inset: auto 3% 1.2%; }
  .dust { width: 17px; height: 17px; font-size: 8px; }
  .playline { gap: .48rem; padding: 8px 10px; }
  .help-button { min-width: 0; padding: .61rem .7rem; font-size: .86rem; }
  #action-note { font-size: .72rem; }
  #last-sip { font-size: .74rem; }
  .options { padding: 0 10px 8px; }
  .options .secondary { font-size: .68rem; }
  .details-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .sun-motes { display: none; }
}

@font-face {
  font-family: Firlest;
  src: url("../assets/Firlest-Regular.otf") format("opentype");
  font-display: swap;
}
.valley-header { background: #101822; color: #f9edda; border-bottom-color: #e1b46a6b; }
.valley-header .brand { color: #f9edda; gap: .34rem; }
.valley-header .brand span { font: 400 2rem/.9 Firlest, Georgia, serif; }
.valley-header nav a { color: #fbecd0; min-height: 42px; display: inline-flex; align-items: center; }
.valley-header nav a:hover { color: #ffd694; }
.game-intro h1 { font-family: Firlest, Georgia, serif; font-weight: 400; }
.game-intro h1 em { font-style: normal; }
.crew-stat a { color: inherit; text-underline-offset: .16em; }
@media (max-width: 520px) {
  .valley-header .brand img { display: none; }
  .valley-header .brand span { font-size: 1.35rem; }
  .valley-header nav { gap: .65rem; }
}

.gathering-link { display: inline-grid; align-items: center; min-height: 44px; text-align: center; text-decoration: none; }
.gathering-link:hover { background: #385c41; }
.gathering-banner {
  margin: 0 auto 1rem; padding: .55rem .75rem; width: fit-content; text-align: center;
  border: 1px solid #a48957; border-radius: .3rem; background: #243c34; color: #fff0ca;
  font-size: .93rem;
}
.gathering-full { background: #152229; }
.gathering-full body { background: radial-gradient(ellipse at 50% 9%, #314336 0%, #152229 75%); }
.gathering-full .game-intro h1, .gathering-full .game-intro em { color: #f7eed7; }
.gathering-full .game-intro .eyebrow { color: #e8be79; }
.gathering-full .game-intro p:last-child, .gathering-full .game-footer { color: #f2dfbe; }
.gathering-full .game-shell { box-shadow: 0 0 0 3px #f5e8cb25, 0 .8rem 2rem #0b101960; }
.gathering-embed, .gathering-embed body { background: #fbf3df; }
.gathering-embed .valley-header, .gathering-embed .game-intro, .gathering-embed .game-details,
.gathering-embed .game-footer, .gathering-embed .options, .gathering-embed .skip { display: none; }
.gathering-embed main { max-width: none; margin: 0; padding: 0; }
.gathering-embed .game-shell { border: 0; border-radius: 0; box-shadow: none; }
.gathering-embed .meadow, .gathering-embed .meadow[data-guide]:not([data-guide="off"]) {
  height: clamp(20rem, 46vw, 31rem); min-height: 0; aspect-ratio: auto;
}
.gathering-embed .playline { padding-block: .85rem; }
.gathering-embed .help-button { min-height: 44px; }
.gathering-embed .gathering-link { max-width: 12.5rem; }
.gathering-embed #error { margin: .65rem; }
@media (max-width: 400px) {
  .gathering-embed .gathering-link { max-width: 10.5rem; }
}

/* Crew cards: the Nekomi's portrait on top, then name, bucket, numbers, ability and Magick costs */
.crew-stats { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .6rem; }
.crew-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 9px; background: #fbf3dc; border: 1px solid #cdb98a; box-shadow: 0 2px 6px #322b1722; }
.crew-face { position: relative; aspect-ratio: 1 / .92; background: radial-gradient(ellipse at 50% 78%, #dfe6b4 0%, #c9d8a2 42%, #a9c08c 100%); border-bottom: 1px solid #cdb98a; overflow: hidden; }
.crew-face canvas { position: absolute; left: 50%; bottom: -3%; height: 100%; width: auto; aspect-ratio: 1; transform: translateX(-50%); filter: drop-shadow(0 3px 4px #2b321d55); }
.crew-card[data-inside] .crew-face { background: radial-gradient(ellipse at 50% 60%, #ffe9b0 0%, #e9c583 55%, #b98f52 100%); }
.crew-card[data-inside] .crew-face canvas { opacity: .55; }
.crew-inside { position: absolute; left: .4rem; top: .4rem; padding: .12rem .45rem; border-radius: 999px; background: #2c4c37; color: #fff5d5; font-size: .66rem; font-weight: bold; letter-spacing: .04em; }
.crew-copy { display: grid; gap: .34rem; padding: .5rem .55rem .6rem; }
.crew-copy strong { font-size: .86rem; line-height: 1.2; }
.crew-bucket { position: relative; height: 1.05rem; border-radius: 999px; background: #e7dcbc; border: 1px solid #c9b88e; overflow: hidden; }
.crew-bucket i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#9b86c9, #7a64ad); }
.crew-bucket span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .66rem; font-weight: bold; color: #2f2a1c; }
.crew-chips { display: flex; flex-wrap: wrap; gap: .22rem; }
.crew-chips span { padding: .1rem .38rem; border-radius: 999px; background: #efe4c4; border: 1px solid #d8cbab; font-size: .68rem; white-space: nowrap; }
.crew-ability { margin: 0; font-size: .72rem; font-style: italic; color: #495d42; line-height: 1.3 !important; }
.crew-costs { display: flex; gap: .24rem; }
.crew-cost { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; font-size: .66rem; font-weight: bold; color: #fff; border: 1px solid #0000002e; }
.crew-cost.red { background: #a8524a; }
.crew-cost.blue { background: #4a7ea8; }
.crew-cost.yellow { background: #b8943c; }
.crew-cost.green { background: #5a8a55; }
@media (min-width: 1100px) { .crew-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Magick arriving: the dot that gained swells and flashes in its own colour,
   a ring spreads from it and "+n" floats up. Dots that gain together go one after another. */
.dust.gain { position: relative; z-index: 1; animation: dust-gain 1s cubic-bezier(.2, .9, .3, 1.25) var(--gain-delay, 0ms) both; }
.dust.gain::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--shine);
  opacity: 0; animation: dust-ring 1s ease-out var(--gain-delay, 0ms) both;
}
.dust.gain::after {
  content: attr(data-gain); position: absolute; left: 50%; bottom: 100%; translate: -50% 0;
  font: 800 13px/1 system-ui; color: #fff7de; text-shadow: 0 0 6px var(--shade), 0 1px 2px #1b2519;
  white-space: nowrap; opacity: 0; animation: dust-plus 1.4s ease-out var(--gain-delay, 0ms) both;
}
@keyframes dust-gain {
  0% { transform: scale(.55); filter: brightness(2.4); }
  30% { transform: scale(1.75); filter: brightness(1.6); box-shadow: 0 0 0 5px #fff7de55, 0 0 22px 9px var(--shine); }
  60% { transform: scale(.94); filter: none; }
  100% { transform: scale(1); }
}
@keyframes dust-ring {
  0% { opacity: .95; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.2); }
}
@keyframes dust-plus {
  0% { opacity: 0; transform: translateY(4px) scale(.7); }
  20% { opacity: 1; transform: translateY(-8px) scale(1.15); }
  70% { opacity: 1; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(1); }
}
