/* Winter Capybara Pet Shop: the page around the game canvas, in pixel style to match the game. */

/* the pixel font: Fusion Pixel 12px (SIL OFL 1.1, see assets/fonts), cut down by tools/build_font.py; English
   uses its Latin cut first, whose quotes, dashes and ellipsis are narrow (the Chinese build's are full width) */
@font-face {
  font-family: "Fusion Pixel";
  src: url("assets/fonts/pixel.woff2?v=4d259b8098") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel Latin";
  src: url("assets/fonts/pixel-latin.woff2?v=4d259b8098") format("woff2");
  font-display: swap;
}

:root {
  --ink: #3a2a20;
  --ink-muted: #6e5a4a;
  --paper: #fff8ec;
  --paper-2: #f4e9d8;
  --line: #d9c6ab;
  --wood: #6b4a32;
  --accent: #d9772e;
  --accent-fill: #b15e20; /* under white text: 4.7:1 */
  --accent-dark: #8f4a19;
  --hud-ink: #fff4e2;
  --focus: #3d8bd9;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --pixel: "Fusion Pixel", var(--font);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  /* one pixel of the frames round the boxes and buttons */
  --u: 2px;
  /* The font is drawn 12 pixels tall and stays sharp only when each of its pixels is a whole number of
     screen pixels: so the sizes go in steps that depend on the screen's pixel density. s: labels;
     hud: the clock and buttons over the game; m: most text; l: titles. */
  --fs-s: 12px;
  --fs-hud: 24px;
  --fs-m: 24px;
  --fs-l: 36px;
  --fs-xl: 48px; /* (the name of the game on the title screen) */
  /* pixel-art frames (tools/build_frames.py): outline with rounded pixel corners, a light and a shaded bevel.
     The frame is only the edge; each box's own background (inside the edge) is its fill colour below. */
  --fill-paper: #fff8ec;
  --fill-paper2: #f4e9d8;
  --fill-card: #ffffff;
  --fill-picked: #fff1e2;
  --fill-hud: rgba(46, 33, 26, 0.9);
  --fill-accent: #b15e20;
  --fill-accent-down: #9c521b;
  --fill-quiet: #f4e9d8;
  --fill-quiet-down: #ebdcc6;
  --fill-mint: #e8f1e4;
  --frame-paper: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%235c3f2c%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%235c3f2c%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235c3f2c%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235c3f2c%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23e9d7bd%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23e9d7bd%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23fff8ec%27/%3E%3C/svg%3E");
  --frame-paper2: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23fffdf7%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23fffdf7%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23dcc8ab%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23dcc8ab%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23f4e9d8%27/%3E%3C/svg%3E");
  --frame-card: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%23c9b394%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%23c9b394%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23c9b394%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23c9b394%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23efe4d2%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23efe4d2%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23ffffff%27/%3E%3C/svg%3E");
  --frame-picked: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%23c96a22%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%23c96a22%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23c96a22%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23c96a22%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23ffffff%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23f3d9bf%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23f3d9bf%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23fff1e2%27/%3E%3C/svg%3E");
  --frame-hud: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27rgba(18,12,9,0.92)%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27rgba(18,12,9,0.92)%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27rgba(18,12,9,0.92)%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27rgba(18,12,9,0.92)%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%236a5446%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%236a5446%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%232b201a%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%232b201a%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27rgba(46,33,26,0.9)%27/%3E%3C/svg%3E");
  --frame-accent: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%235e2f12%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%235e2f12%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235e2f12%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235e2f12%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23e3925a%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23e3925a%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%238a4517%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%238a4517%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23b15e20%27/%3E%3C/svg%3E");
  --frame-accent-down: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%235e2f12%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%235e2f12%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235e2f12%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%235e2f12%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%238a4517%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%238a4517%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23b8682c%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23b8682c%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%239c521b%27/%3E%3C/svg%3E");
  --frame-quiet: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23fffdf7%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23fffdf7%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23d9c6ab%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23d9c6ab%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23f4e9d8%27/%3E%3C/svg%3E");
  --frame-quiet-down: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%23a88b70%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%23a88b70%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23d9c6ab%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23d9c6ab%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23fffdf7%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23fffdf7%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23ebdcc6%27/%3E%3C/svg%3E");
  --frame-mint: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%277%27 height=%277%27 shape-rendering=%27crispEdges%27%3E%3Crect x=%271%27 y=%270%27 width=%275%27 height=%271%27 fill=%27%237fae8f%27/%3E%3Crect x=%271%27 y=%276%27 width=%275%27 height=%271%27 fill=%27%237fae8f%27/%3E%3Crect x=%270%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%237fae8f%27/%3E%3Crect x=%276%27 y=%271%27 width=%271%27 height=%275%27 fill=%27%237fae8f%27/%3E%3Crect x=%271%27 y=%271%27 width=%275%27 height=%271%27 fill=%27%23f6fbf4%27/%3E%3Crect x=%271%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23f6fbf4%27/%3E%3Crect x=%271%27 y=%275%27 width=%275%27 height=%271%27 fill=%27%23cfe2cf%27/%3E%3Crect x=%275%27 y=%272%27 width=%271%27 height=%273%27 fill=%27%23cfe2cf%27/%3E%3Crect x=%272%27 y=%272%27 width=%273%27 height=%273%27 fill=%27%23e8f1e4%27/%3E%3C/svg%3E");
}

html[lang="en"] { --pixel: "Fusion Pixel Latin", "Fusion Pixel", var(--font); }

@media (min-resolution: 1.5dppx) { :root { --fs-s: 16px; --fs-hud: 16px; --fs-m: 16px; --fs-l: 24px; --fs-xl: 40px; } }
@media (min-resolution: 2dppx) { :root { --fs-s: 12px; --fs-hud: 12px; --fs-m: 18px; --fs-l: 24px; --fs-xl: 36px; } }
@media (min-resolution: 2.5dppx) { :root { --fs-s: 12px; --fs-hud: 12px; --fs-m: 16px; --fs-l: 20px; --fs-xl: 28px; } }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1f2433;
  color: var(--ink);
  font-family: var(--pixel);
  font-size: var(--fs-m);
  font-weight: normal;
  font-synthesis: none; /* (one weight only: no smeared fake bold) */
  -webkit-font-smoothing: none;
  -webkit-text-size-adjust: 100%;
}

#app {
  position: fixed;
  inset: 0;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
  outline: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

strong,
b,
h1,
h2,
h3 {
  font-weight: normal;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  top: calc(10px + var(--safe-t));
  left: calc(10px + var(--safe-l));
  right: calc(10px + var(--safe-r));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.hud__left,
.hud__right {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}

.hud__left {
  flex-wrap: wrap;
  position: relative;
}

/* (on a narrow screen the round buttons go onto a second row rather than off the edge: a festival's
   star in the date, or the envelope of a letter, can tip a phone over) */
.hud__right {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud button,
.hud .tasks {
  pointer-events: auto;
}

/* dark pixel boxes over the game: the clock, the jobs button, the round buttons on the right */
.pill,
.icon-btn {
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-hud) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-hud) padding-box;
  color: var(--hud-ink);
  filter: drop-shadow(0 var(--u) 0 rgba(10, 8, 14, 0.35));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 10px;
  font-size: var(--fs-hud);
  line-height: 1.5;
  white-space: nowrap;
}

.clock svg {
  width: 16px;
  height: 16px;
  fill: #ffd36b;
  stroke: #ffd36b;
  stroke-width: 1.4;
  stroke-linecap: round;
  shape-rendering: crispEdges;
}

.clock__moon { display: none; }
.clock.is-night .clock__sun { display: none; }
.clock.is-night .clock__moon { display: block; fill: #dfe7ff; stroke: none; }

.tasks__rating {
  color: var(--accent-dark);
  font-size: var(--fs-s);
}

.tasks-btn .count {
  color: #ffd36b;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* the speaker: two waves with everything on, one with effects only, a cross when off */
.sound-btn .sound-btn__off,
.sound-btn[data-mode="sfx"] .sound-btn__far,
.sound-btn[data-mode="off"] .sound-btn__near,
.sound-btn[data-mode="off"] .sound-btn__far {
  display: none;
}

.sound-btn[data-mode="off"] .sound-btn__off {
  display: inline;
}

.icon-btn--text {
  width: auto;
  min-width: 40px;
  padding: 0 8px;
  font-size: var(--fs-hud);
  white-space: nowrap;
}

.icon-btn:hover,
.pill:is(button):hover {
  filter: drop-shadow(0 var(--u) 0 rgba(10, 8, 14, 0.35)) brightness(1.25);
}

.icon-btn:active,
.pill:is(button):active {
  transform: translateY(var(--u));
  filter: none;
}

.new-day {
  position: absolute;
  top: calc(60px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  border-image: var(--frame-accent) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-accent) padding-box;
  color: #fff;
  font-size: var(--fs-m);
}

.new-day:active {
  transform: translate(-50%, var(--u));
  border-image: var(--frame-accent-down) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-accent-down) padding-box;
}

/* the day's jobs, dropping down under the button */
.tasks {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  margin: 0;
  padding: 8px 12px;
  width: max-content;
  min-width: 260px;
  max-width: min(460px, calc(100vw - 20px));
  /* (a festival, the story and a request all at once: on a phone on its side it scrolls) */
  max-height: calc(100vh - 150px - var(--safe-t) - var(--safe-b));
  max-height: calc(100dvh - 150px - var(--safe-t) - var(--safe-b));
  overflow-y: auto;
  list-style: none;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(30, 20, 15, 0.3));
  font-size: var(--fs-m);
  line-height: 1.5;
}

.tasks li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

/* a pixel tick box (drawn, not a font glyph) */
.tasks .check {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  border: var(--u) solid #c9b394;
  background: #ffffff;
  color: transparent;
  font-size: 0;
}

.tasks li.is-done .check {
  border-color: #7fae8f;
  background: var(--fill-mint);
}

.tasks li.is-done .check::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 6px;
  width: 2px;
  height: 2px;
  background: #3e7a52;
  box-shadow: 2px 2px 0 #3e7a52, 4px 0 0 #3e7a52, 6px -2px 0 #3e7a52, 8px -4px 0 #3e7a52;
}

.tasks li.is-done span:nth-child(2) {
  color: var(--ink-muted);
  text-decoration: line-through;
}

/* on a visiting day, the guests and their wishes under the day's jobs */
.tasks .tasks__head {
  margin-top: 6px;
  padding-top: 8px;
  border-top: var(--u) dashed var(--line);
  color: var(--ink-muted);
}

.tasks li.is-waiting span:nth-child(2) {
  color: var(--ink-muted);
}

.tasks__note {
  margin-left: auto;
  padding-left: 6px;
  color: var(--ink-muted);
  font-size: var(--fs-s);
  white-space: nowrap;
}

/* ---------- the bar along the bottom ---------- */

:root {
  --bar-h: 72px; /* the bar's height, so the hint chip and the messages sit above it */
}

.bar {
  position: absolute;
  left: 50%;
  bottom: calc(8px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 4px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(20, 14, 10, 0.3));
}

.slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
}

.slot canvas {
  image-rendering: pixelated;
}

.slot[aria-pressed="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
}

.slot:active {
  transform: translateY(var(--u));
}

.slot__n {
  position: absolute;
  right: 1px;
  bottom: -2px;
  color: var(--ink);
  font-size: var(--fs-s);
  line-height: 1;
  text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
}

.slot__key {
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--ink-muted);
  font-size: var(--fs-s);
  line-height: 1;
}

.slot--bag {
  border-image: var(--frame-quiet) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet) padding-box;
}

/* a little pixel satchel */
.slot__bag {
  position: relative;
  width: 24px;
  height: 20px;
  margin-top: 4px;
  border: 3px solid #7a5230;
  border-top-width: 6px;
  background: #c8915a;
}

.slot__bag::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -13px;
  width: 12px;
  height: 7px;
  border: 3px solid #7a5230;
  border-bottom: 0;
}

.money::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  background: #ffd36b;
  box-shadow: inset -2px -2px 0 #e0a83a, 0 0 0 2px #8a5a1c;
}

/* the whole bag */
.bag {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.bag__grid {
  display: grid;
  grid-template-columns: repeat(6, 56px);
  gap: 4px;
}

.bag__grid .slot--onbar {
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper2) padding-box;
}

.bag__grid .slot[aria-pressed="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
}

.bag__detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.bag__detail strong {
  color: var(--accent-dark);
}

.bag__detail p {
  margin: 4px 0 0;
  line-height: 1.5;
}

.bag__money {
  margin-right: auto;
  align-self: center;
}

@media (max-width: 600px) {
  :root { --bar-h: 56px; }
  .slot { width: 40px; height: 40px; }
  .bar { gap: 1px; padding: 2px; }
  .slot__key { display: none; }
  .bag { grid-template-columns: 1fr; }
  .bag__grid { grid-template-columns: repeat(6, 44px); }
  .bag__grid .slot { width: 44px; height: 44px; }
}

/* ---------- hint chip, info card and toasts ---------- */

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(14px + var(--bar-h) + var(--safe-b));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 4px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-hud) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-hud) padding-box;
  color: var(--hud-ink);
  font-size: var(--fs-m);
  line-height: 1.5;
  pointer-events: none;
  white-space: nowrap;
}

.hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet) padding-box;
  color: var(--ink);
  font: var(--fs-s) / 1 var(--pixel);
}

/* a little card about the furniture she is standing by (or that was tapped) */
.info-card {
  position: absolute;
  left: 50%;
  top: calc(60px + var(--safe-t));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(calc(100vw - 32px), 360px);
  padding: 6px 10px 6px 6px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(30, 20, 15, 0.3));
  color: var(--ink);
  pointer-events: none;
  animation: card-in 0.22s steps(3, end);
}

.info-card[hidden] {
  display: none;
}

.info-card__art {
  flex: none;
  width: 60px;
  height: 60px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper2) padding-box;
  image-rendering: pixelated;
}

.info-card__name {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: var(--fs-m);
}

.info-card__text {
  margin: 0;
  font-size: var(--fs-s);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: balance; /* no single character left alone on the last line */
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-card {
    animation: none;
  }
}

.toasts {
  position: absolute;
  left: 50%;
  bottom: calc(40px + var(--fs-m) * 1.5 + var(--bar-h) + var(--safe-b)); /* (above the hint chip and the bar) */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(92vw, 560px);
  pointer-events: none;
}

.toast {
  padding: 4px 12px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 var(--u) 0 rgba(30, 20, 15, 0.3));
  color: var(--ink);
  font-size: var(--fs-m);
  line-height: 1.5;
  text-align: center;
  animation: toast-in 0.25s steps(3, end);
  transition: opacity 0.4s steps(4, end), transform 0.4s steps(4, end);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* the name of a place, for a moment, as she arrives */
.place-banner {
  position: absolute;
  left: 50%;
  top: calc(64px + var(--safe-t));
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 18px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(30, 20, 15, 0.3));
  color: var(--accent-dark);
  font-size: var(--fs-l);
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  animation: banner-in 0.4s steps(4, end);
  transition: opacity 0.5s steps(5, end);
}

.place-banner.is-out {
  opacity: 0;
}

@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
}

@media (prefers-reduced-motion: reduce) {
  .place-banner { animation: none; transition: none; }
}

/* ---------- panels ---------- */

.panel {
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper) padding-box;
  filter: drop-shadow(0 calc(var(--u) * 2) 0 rgba(20, 14, 10, 0.35));
}

.menu {
  position: absolute;
  z-index: 5;
  min-width: 200px;
  max-width: min(280px, 80vw);
  padding: 6px;
}

.menu__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 2px 6px 8px;
  border-bottom: var(--u) dashed var(--line);
  margin-bottom: 4px;
}

.menu__head strong {
  color: var(--accent-dark);
  font-size: var(--fs-m);
}

.menu__state {
  width: 100%;
  color: var(--ink-muted);
  font-size: var(--fs-s);
}

.chip {
  padding: 0 6px;
  border: var(--u) solid #7fae8f;
  background: var(--fill-mint);
  color: #3e6b49;
  font-size: var(--fs-s);
  line-height: 1.5;
}

.menu__item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: var(--fs-m);
  line-height: 1.5;
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--paper-2);
  box-shadow: inset var(--u) 0 0 var(--accent);
}

/* small screens: actions two to a row, so the menu fits beside or under its capybara */
@media (max-width: 600px), (max-height: 560px) {
  .menu {
    max-width: min(320px, calc(100vw - 16px));
  }

  .menu__items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 6px;
  }
}

/* a phone held upright: docked along the bottom, with the capybara shown above it */
.menu.menu--sheet {
  left: calc(8px + var(--safe-l));
  right: calc(8px + var(--safe-r));
  bottom: calc(8px + var(--safe-b));
  max-width: none;
}

/* the dialogue box: a face in a frame, a name, what they say, and buttons */
.dialog {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  width: min(680px, calc(100vw - 20px));
  padding: 10px 12px;
}

.dialog__face {
  grid-row: span 2;
  width: 72px;
  height: auto;
  image-rendering: pixelated;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper2) padding-box;
}

.dialog__name {
  color: var(--accent-dark);
  font-size: var(--fs-s);
}

.dialog__body p {
  margin: 2px 0 0;
  font-size: var(--fs-m);
  line-height: 1.5;
  text-wrap: pretty; /* (no single character alone on the last line) */
}

.dialog__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* a question's answers share the row */
.dialog__actions--choice .btn {
  flex: 1 1 auto;
}

.dialog:focus {
  outline: none;
}

/* ---------- the letter about tomorrow's guests ---------- */

.letter {
  position: relative;
  padding: 14px 16px 10px;
  border: var(--u) dashed var(--line);
  background: #fffdf6;
  line-height: 1.5;
}

.letter p {
  margin: 0 0 10px;
}

.letter > p:first-of-type {
  min-height: 42px; /* (the stamp sits beside it) */
  padding-right: 64px;
}

.letter .letter__sign {
  margin: 0;
  text-align: right;
  color: var(--ink-muted);
}

.letter__stamp {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 56px;
  height: auto;
  image-rendering: pixelated;
  border: 3px dotted #e3cfb1;
  transform: rotate(4deg);
}

.letter__guests {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.letter__guest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper2) padding-box;
}

.letter__face {
  flex: none;
  height: auto;
  image-rendering: pixelated;
}

.letter__who {
  display: grid;
  gap: 2px;
}

.letter__who strong {
  color: var(--accent-dark);
}

.letter__who span {
  font-size: var(--fs-s);
  line-height: 1.5;
}

/* ---------- buttons ---------- */

.btn {
  min-height: 40px;
  padding: 4px 14px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-accent) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-accent) padding-box;
  color: #fff;
  font-size: var(--fs-m);
  line-height: 1.5;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(var(--u));
  border-image: var(--frame-accent-down) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-accent-down) padding-box;
}

.btn--quiet {
  border-image: var(--frame-quiet) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet) padding-box;
  color: var(--ink);
}

.btn--quiet:active {
  border-image: var(--frame-quiet-down) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet-down) padding-box;
}

.backdrop {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: rgba(20, 16, 30, 0.45);
}

.modal {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(740px, calc(100vw - 20px));
  max-height: calc(100vh - 20px - var(--safe-t) - var(--safe-b));
  overflow: auto;
  padding: 12px 16px;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal__head h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--fs-l);
  line-height: 1.25;
}

.modal__close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet) padding-box;
  font-size: var(--fs-l);
  line-height: 1;
}

.modal__close:active {
  transform: translateY(var(--u));
  border-image: var(--frame-quiet-down) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet-down) padding-box;
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.hint-text {
  color: var(--ink-muted);
  font-size: var(--fs-s);
  line-height: 1.5;
}

/* the calendar */

.cal {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}

.cal th {
  padding: 2px 0;
  color: var(--ink-muted);
  font-size: var(--fs-s);
  font-weight: normal;
}

.cal__day {
  height: 64px;
  padding: 2px 4px;
  vertical-align: top;
  border: var(--u) solid var(--line);
  background: #ffffff;
  font-size: var(--fs-s);
  line-height: 1.25;
}

.cal__n {
  display: block;
  color: var(--ink);
  font-size: var(--fs-m);
}

.cal__fest {
  display: block;
  color: #a33c52;
}

.cal__guests {
  display: block;
  color: #2f6b52;
}

.cal__day.is-past {
  background: var(--paper-2);
}

.cal__day.is-past .cal__n {
  color: var(--ink-muted);
}

.cal__day.is-festival {
  border-color: #e4a0b0;
  background: #fff0f3;
}

.cal__day.is-today {
  border: calc(var(--u) * 2) solid var(--accent);
  background: #fff1e2;
}

.cal__legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: var(--fs-s);
}

.cal__key {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
}

.cal__key--fest { background: #e4a0b0; }
.cal__key--guests { background: #8cc7a8; }

@media (max-width: 600px) {
  .cal { border-spacing: 2px; }
  .cal__day { height: 52px; padding: 1px 2px; }
  .cal__fest, .cal__guests { font-size: 0; height: 6px; margin-top: 2px; }
  .cal__fest { background: #e4a0b0; }
  .cal__guests { background: #8cc7a8; }
}

/* wardrobe */

.wardrobe__who {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  padding: 2px 2px 8px;
}

.who,
.item {
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  font-size: var(--fs-s);
  line-height: 1.25;
}

.who {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 2px;
}

.who canvas {
  width: 48px;
  height: auto;
  image-rendering: pixelated;
}

.who[aria-pressed="true"],
.item[aria-pressed="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
}

.who:active,
.item:active {
  transform: translateY(var(--u));
}

.wardrobe__main {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  align-items: start;
}

.wardrobe__stage {
  margin: 0;
  text-align: center;
}

.wardrobe__preview {
  width: 210px;
  height: auto;
  image-rendering: pixelated;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
}

.wardrobe__stage figcaption {
  margin-top: 6px;
  font-size: var(--fs-s);
  color: var(--ink-muted);
}

.wardrobe__row h3 {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: var(--fs-s);
}

.wardrobe__row + .wardrobe__row {
  margin-top: 10px;
}

.wardrobe__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 74px;
  min-height: 68px;
  padding: 4px 2px;
}

.item canvas {
  width: 30px;
  height: auto;
  image-rendering: pixelated;
}

.item--none span {
  color: var(--ink-muted);
}

/* rename */

.rename input,
.title__menu input {
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  color: var(--ink);
  font-size: var(--fs-l);
}

.rename input:focus,
.title__menu input:focus {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
  outline: none;
}

/* summary and help */

.stats,
.help {
  margin: 0;
  display: grid;
  gap: 2px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 4px;
  border-bottom: var(--u) dashed var(--line);
  line-height: 1.5;
}

.stat dt {
  color: var(--ink-muted);
}

.stat dd {
  margin: 0;
  text-align: right;
}

/* ---------- the townsfolk: hearts in the dialogue box, the friends tab ---------- */

.dialog__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.dialog__hearts,
.friend__hearts {
  color: #e0607e;
  font-size: var(--fs-s);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.menu-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.friends {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friend {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
}

.friend__face {
  width: 50px;
  height: auto;
  image-rendering: pixelated;
  background: var(--fill-paper2);
}

.friend--unmet .friend__face { filter: grayscale(1) brightness(0.9) opacity(0.7); }
.friend__face--capy { width: 60px; background: transparent; }
.dialog__face--capy { width: 72px; }

.menu__hearts {
  flex-basis: 100%;
  color: #e0607e;
  font-size: var(--fs-s);
  letter-spacing: 0.08em;
}

.friend__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.friend__name { line-height: 1.4; }

.friend__info {
  color: var(--ink-muted);
  font-size: var(--fs-s);
  line-height: 1.5;
}

.friend--unmet .friend__hearts { opacity: 0.4; }

.cal__bday {
  display: block;
  line-height: 0;
}

.cal__bday canvas,
.cal__legend canvas {
  image-rendering: pixelated;
  vertical-align: middle;
}

/* ---------- ice fishing ---------- */

.fishing {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(16px + var(--bar-h) + var(--safe-b));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 20px));
  display: grid;
  gap: 10px;
  padding: 12px 16px;
}

.fishing__say {
  margin: 0;
  line-height: 1.5;
}

.reel {
  position: relative;
  height: 28px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: #dbe9f6 padding-box;
}

.reel__mark {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #8fd0a6;
  box-shadow: inset 0 0 0 2px #5ea67a;
}

.reel__pos {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 6px;
  margin-left: -3px;
  background: #b15e20;
  box-shadow: 0 0 0 2px #fff8ec;
}

.fishing__pips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip {
  width: 14px;
  height: 14px;
  background: #e6dccb;
  box-shadow: inset 0 0 0 2px #c9b394;
}

.pip.is-hit { background: #8fd0a6; box-shadow: inset 0 0 0 2px #5ea67a; }
.pip--miss.is-hit { background: #e58a8a; box-shadow: inset 0 0 0 2px #c05a5a; }
.pips__gap { width: 14px; }

.fishing__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fishing__go { min-width: 120px; }

.fishing__go.is-urgent {
  animation: urgent 0.3s steps(2) infinite;
}

@keyframes urgent {
  50% { transform: translateY(calc(var(--u) * -2)); }
}

@media (prefers-reduced-motion: reduce) {
  .fishing__go.is-urgent { animation: none; }
}

body.is-title .fishing { display: none !important; }

/* ---------- the wish book ---------- */

.wishes {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: min(56vh, 460px);
  overflow: auto;
}

.wish {
  display: grid;
  gap: 4px;
  padding: 8px 12px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
}

.wish.is-done {
  border-image: var(--frame-mint) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-mint) padding-box;
}

.wish__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.wish__done { color: #3f8a5a; font-size: var(--fs-s); }
.wish__why { margin: 0; color: var(--ink-muted); font-size: var(--fs-s); line-height: 1.5; }

.wish__items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.wish__item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ink-muted);
  font-size: var(--fs-s);
}

.wish__item canvas { image-rendering: pixelated; }
.wish__item.is-have { color: var(--accent-dark); }
.wish__item.is-given { color: #3f8a5a; }

.wish__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.wish .btn:disabled { opacity: 0.5; cursor: default; }

.tasks__story { color: var(--accent-dark); }

/* ---------- the little kitchen ---------- */

.cooks {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.cook {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
}

.cook canvas { image-rendering: pixelated; }

.cook__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cook__needs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.cook__need {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #b0503f;
  font-size: var(--fs-s);
}

.cook__need.is-have { color: #3f8a5a; }

.cook .btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- the notice board, letters ---------- */

.board__note {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: #fffdf6 padding-box;
  transform: rotate(-0.6deg);
}

.board__who,
.board__want {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board__face {
  width: 44px;
  height: auto;
  image-rendering: pixelated;
}

.board__want canvas { image-rendering: pixelated; }
.board__want p,
.board__reward,
.board__empty { margin: 0; line-height: 1.5; }
.board__reward { color: var(--accent-dark); }

.mail-btn {
  position: relative;
}

.mail-btn svg path {
  stroke-linejoin: round;
}

.mail-btn__n {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  padding: 0 4px;
  background: #d64f6e;
  color: #fff;
  font-size: var(--fs-s);
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(18, 12, 9, 0.9);
}

.letters {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 600px) {
  .letters { grid-template-columns: 1fr; }
}

.letters__list {
  display: grid;
  gap: 4px;
  max-height: min(48vh, 360px);
  overflow: auto;
  padding: 2px;
}

.letters__item {
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  text-align: left;
  line-height: 1.4;
}

.letters__item[aria-pressed="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
}

.letters__item.is-new strong::before {
  content: "● ";
  color: #d64f6e;
}

.letter-paper {
  padding: 14px 18px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: #fffaf0 padding-box;
  line-height: 1.6;
}

.letter-paper p { margin: 0 0 10px; }

.letter-paper__gift {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.letter-paper__gift canvas { image-rendering: pixelated; }

/* ---------- buying and selling at a counter ---------- */

.shop {
  display: grid;
  gap: 10px;
}

.shop__tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop__tab {
  min-height: 40px;
  padding: 4px 16px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-quiet) padding-box;
  font-size: var(--fs-m);
  line-height: 1.5;
}

.shop__tab[aria-selected="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
  color: var(--accent-dark);
}

.shop__purse {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: var(--fs-m);
}

.shop__list {
  display: grid;
  gap: 4px;
  max-height: min(36vh, 300px);
  overflow: auto;
  padding: 2px;
}

.shop__line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 2px 10px 2px 4px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  text-align: left;
  font-size: var(--fs-m);
  line-height: 1.5;
}

.shop__line[aria-pressed="true"] {
  border-image: var(--frame-picked) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-picked) padding-box;
}

.shop__line canvas { image-rendering: pixelated; }

.shop__price {
  color: var(--accent-dark);
  white-space: nowrap;
}

.shop__detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: start;
  padding: 10px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-paper2) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-paper2) padding-box;
}

.shop__detail > canvas { image-rendering: pixelated; }

.shop__about p {
  margin: 2px 0 0;
  line-height: 1.5;
}

.shop__deal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
}

.shop__qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop__step {
  min-width: 40px;
  padding: 4px 8px;
}

.shop__step:disabled {
  opacity: 0.45;
  cursor: default;
}

.shop__n {
  min-width: 2.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.shop__total { color: var(--ink-muted); }

.shop__note {
  min-height: 1.5em;
  margin: 0;
  color: var(--accent-dark);
  line-height: 1.5;
}

.shop__empty { margin: 8px 4px; }

/* ---------- the title screen ---------- */

/* over the shop going on behind it: the name of the game, and a paper box with the buttons */
.title {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: calc(64px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l));
  background: radial-gradient(ellipse at 50% 42%, rgba(24, 26, 48, 0.05) 30%, rgba(24, 26, 48, 0.5));
  transition: opacity 0.7s;
}

/* (going dark before the game begins, then the dark lifts) */
.title::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #12142a;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.title.is-leaving::before { opacity: 1; }
.title.is-leaving .title__card { opacity: 0; transition: opacity 0.3s; }
.title.is-gone { opacity: 0; pointer-events: none; }

.title { outline: none; }

.title__card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(640px, 100%);
  text-align: center;
}

.title__logo {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.title__capys {
  image-rendering: pixelated;
  margin-bottom: -6px;
}

/* the name, cream with a dark pixel outline one font pixel wide (the font is 12 pixels tall) */
.title__name,
.title__sub {
  --fp: calc(var(--fs-xl) / 12);
  --edge: #4a2f22;
  margin: 0;
  color: #fff6e6;
  text-wrap: balance;
  text-shadow:
    var(--fp) 0 0 var(--edge), calc(var(--fp) * -1) 0 0 var(--edge), 0 var(--fp) 0 var(--edge), 0 calc(var(--fp) * -1) 0 var(--edge),
    var(--fp) var(--fp) 0 var(--edge), calc(var(--fp) * -1) var(--fp) 0 var(--edge), var(--fp) calc(var(--fp) * -1) 0 var(--edge), calc(var(--fp) * -1) calc(var(--fp) * -1) 0 var(--edge),
    0 calc(var(--fp) * 2) 0 rgba(30, 20, 40, 0.45);
}

.title__name {
  font-size: var(--fs-xl);
  line-height: 1.25;
}

.title__sub {
  --fp: calc(var(--fs-m) / 12);
  font-size: var(--fs-m);
  line-height: 1.5;
  color: #ffe3b8;
}

.title__menu {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  padding: 14px;
  text-align: left;
}

/* a phone on its side: the name on the left, the box on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .title { padding-top: calc(16px + var(--safe-t)); }
  .title__card { grid-template-columns: 1fr minmax(0, 340px); align-items: center; width: min(900px, 100%); }
}

.title__btn {
  display: grid;
  gap: 2px;
  justify-items: center;
  width: 100%;
  padding-block: 8px;
}

.title__detail {
  font-size: var(--fs-s);
  line-height: 1.5;
  opacity: 0.92;
}

.title__ask {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--fs-m);
  line-height: 1.5;
}

.title__note {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--fs-s);
  line-height: 1.5;
  text-align: center;
}

.title__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* while it's up: only the sound and language buttons of the HUD, over it; nothing else of the game */
body.is-title .hud { z-index: 4; }
body.is-title :is(.hud__left, #photoBtn, #helpBtn, #mailBtn, .bar, .new-day, .hint, .info-card, .toasts, .place-banner) { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .title, .title::before, .title.is-leaving .title__card { transition: none; }
}

/* ---------- loading ---------- */

.loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  background: linear-gradient(#1f2433, #2d3550);
  color: #f4ecdf;
  transition: opacity 0.6s;
}

.loading h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.loading h1 span {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.loading p {
  margin: 0;
  opacity: 0.8;
}

.loading.is-done {
  opacity: 0;
  pointer-events: none;
}

/* (its words go first, so they don't show through the title screen as it fades) */
.loading.is-done > * {
  opacity: 0;
  transition: opacity 0.15s;
}

.loading__snow {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 70% 60%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 85% 20%, #fff 50%, transparent 51%);
  background-size: 180px 180px;
  opacity: 0.5;
  animation: snow 9s linear infinite;
}

@keyframes snow {
  to { background-position: 0 180px; }
}

.noscript {
  position: absolute;
  inset: auto 0 40% 0;
  text-align: center;
  color: #fff;
}

/* ---------- small screens ---------- */

@media (max-width: 600px) {
  .pill { min-height: 36px; padding: 2px 8px; }
  .icon-btn { height: 36px; }
  .icon-btn:not(.icon-btn--text) { width: 36px; }
  .tasks { min-width: min(260px, calc(100vw - 20px)); }
  .wardrobe__main { grid-template-columns: 1fr; }
  .wardrobe__preview { width: 168px; }
  .dialog { grid-template-columns: auto 1fr; padding: 8px; }
  .dialog__face { width: 56px; }
  .loading h1 { font-size: 36px; }
  .loading h1 span { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .loading__snow { animation: none; }
}

/* --- festivals: today's in the jobs list; the look back over the winter at New Year --- */
.tasks__fest { color: var(--accent-dark); }

.year {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 12px;
}

/* each a little card: the number large, what it counts under it */
.year__row {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 8px 6px 6px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  text-align: center;
}

.year dt { color: var(--ink-muted); font-size: var(--fs-s); line-height: 1.3; }
.year dd { margin: 0; font-family: var(--pixel); font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.year__head { margin: 4px 0 6px; font-size: 14px; }

.year__capys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.year__capy {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: var(--fill-card) padding-box;
  font-size: var(--fs-s);
  text-align: center;
}

.year__face { width: 52px; height: auto; image-rendering: pixelated; }
.year__hearts { color: #c4405f; font-size: 10px; letter-spacing: 0.04em; word-break: break-all; }
.year__note { margin: 0 0 4px; color: var(--ink-muted); line-height: 1.6; }

/* --- spring's festival games (games.js): goldfish scooping, the capybara race --- */
.scoop,
.race {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.scoop__tub,
.race__course {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

.race__course { cursor: pointer; }
.scoop__tub:focus-visible,
.race__course:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.scoop__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  width: 100%;
}

/* how much is left of the scoop's paper */
.scoop__paper {
  position: relative;
  width: 160px;
  height: 14px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: #e6eef4 padding-box;
}

.scoop__fill {
  display: block;
  height: 100%;
  background: #8fd0ec;
  transition: width 0.1s linear;
}

.scoop__paper.is-low .scoop__fill { background: #ec9a8f; }
.scoop__got { margin: 0; font-family: var(--pixel); font-size: var(--fs-m); }
.scoop__say,
.race__say { min-height: 1.6em; margin: 0; text-align: center; line-height: 1.5; }

/* the race's bar: cheer while the marker is in the middle */
.race__bar {
  position: relative;
  width: min(100%, 360px);
  height: 22px;
  border: calc(var(--u) * 2) solid transparent;
  border-image: var(--frame-card) 2 / calc(var(--u) * 2) / 0 stretch;
  background: #f4e9d8 padding-box;
}

.race__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #b9e3a5;
}

.race__bar.is-hot .race__zone { background: #8fd17a; }

.race__marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 6px;
  margin-left: -3px;
  background: var(--accent-fill);
  box-shadow: 0 0 0 2px #fff8ec;
}

.race__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: center;
  gap: 2px 18px;
  margin: 0;
  padding: 0;
  list-style: decimal inside;
  font-size: var(--fs-s);
  color: var(--ink-muted);
}

@media (max-width: 520px) {
  .race__legend { grid-template-columns: minmax(0, max-content); }
}

.race__cheer { min-width: 10em; }

/* a camera's flash (Lin's photo at the Blossom Picnic) */
.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #fff;
  pointer-events: none;
  animation: flash 0.6s ease-out forwards;
}

@keyframes flash {
  from { opacity: 0.85; }
  to { opacity: 0; }
}

/* --- her own clothes (the wardrobe's "You": ui.openCloset) --- */
.who__face {
  width: 40px;
  height: auto;
  image-rendering: pixelated;
}

.closet__preview { width: 228px; }

/* one she hasn't got yet: faded, with how she might come by it */
.item--locked {
  opacity: 0.62;
  cursor: default;
}

.item--locked:active { transform: none; }

.item__how {
  color: var(--ink-muted);
  font-size: var(--fs-s);
  line-height: 1.2;
  text-align: center;
}
