:root {
  color-scheme: dark;
  --bg: #101a1e;
  --surface: #18282b;
  --ink: #f0f2e9;
  --muted: #b7c6c4;
  --line: #384b4d;
  --accent: #d4e5ad;
  --accent-ink: #172620;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
body[data-world="brassbelow"] {
  --surface: #292822;
  --line: #514838;
  --accent: #f1cf8f;
  --accent-ink: #302713;
}
body[data-world="hearthcross"] {
  --surface: #29312a;
  --line: #4b5541;
  --accent: #e3d6a0;
  --accent-ink: #302d20;
}
body[data-world="starbloom"] {
  --surface: #202b3a;
  --line: #455168;
  --accent: #d3c3ec;
  --accent-ink: #282136;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
a,
input,
summary,
canvas {
  outline-offset: 5px;
}
:focus-visible {
  outline: 3px solid var(--accent);
}
button,
.button {
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: #ffffff08;
  color: var(--ink);
  border-radius: 7px;
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled),
.button:hover {
  background: #ffffff16;
  border-color: var(--accent);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
.primary,
button.primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.primary:hover,
button.primary:hover:not(:disabled) {
  background: #f0eed2;
  color: var(--accent-ink);
}
.skip {
  position: absolute;
  top: -80px;
  left: 20px;
  padding: 12px;
  background: var(--accent);
  color: var(--bg);
  z-index: 20;
}
.skip:focus {
  top: 12px;
}
.topbar,
main,
.game-footer {
  max-width: 1280px;
  padding-left: 40px;
  padding-right: 40px;
  margin: 0 auto;
}
.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-size: 14px;
  letter-spacing: 0.12em;
  font-weight: 750;
  text-decoration: none;
}
nav {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 13px;
}
nav a {
  color: var(--muted);
}
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}
summary:after {
  content: "+";
  color: var(--accent);
}
details[open] > summary:after {
  content: "−";
}
nav details {
  position: relative;
}
.options {
  position: absolute;
  top: 48px;
  right: 0;
  width: 285px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg);
  z-index: 15;
  box-shadow: 0 16px 50px #0008;
  line-height: 1.6;
}
.options label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.options p {
  font-size: 12px;
  color: var(--muted);
}
.options a {
  display: block;
  margin-top: 20px;
}
.options button {
  margin-bottom: 8px;
}
.chapter-heading {
  padding: 34px 0 28px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 750;
  margin: 0 0 12px;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(30px, 4vw, 47px);
  line-height: 1.14;
  margin: 0 0 13px;
}
h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 20px;
}
.lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 30px;
  align-items: start;
}
.stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.story-panel {
  padding: 22px 6px 20px 0;
}
.story-panel h2 {
  margin-bottom: 16px;
}
.guide {
  font-size: 14px;
  line-height: 1.65;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 0 0 23px;
}
.guide span {
  display: none;
}
.feedback {
  font-size: 16px;
  line-height: 1.75;
  min-height: 84px;
  margin: 0 0 22px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.actions .primary {
  flex-grow: 1;
}
.small-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin: 18px 0 0;
}
.ending-note {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.dialogue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
}
.dialogue img {
  flex-shrink: 0;
  object-fit: contain;
  width: 78px;
  height: 95px;
}
.dialogue p {
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}
.dialogue .speaker {
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 750;
  color: var(--accent);
  margin-bottom: 5px;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #96aaa7;
  font-size: 11px;
  line-height: 1.6;
  padding-top: 32px;
  padding-bottom: 25px;
  margin-top: 35px;
  border-top: 1px solid var(--line);
}
.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 820/480;
  background: linear-gradient(135deg, #24484c, #1c353b);
}
.map-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.route {
  stroke: #a9bc9b;
  stroke-width: 5;
  opacity: 0.5;
}
.route.broken {
  stroke-dasharray: 9 10;
  stroke: #d0b68c;
  opacity: 0.6;
}
.island ellipse {
  fill: #51634e;
}
.island .grass {
  fill: #8f9d6a;
  stroke: #c2c68c;
  stroke-width: 1.5;
}
.island.current .grass {
  fill: #b4c889;
}
.island text {
  fill: #e3ead9;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  paint-order: stroke;
  stroke: #1d363c;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.map-caption {
  fill: #bcd5c3;
  letter-spacing: 3px;
  font-size: 12px;
}
.map-stop {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  padding: 0;
  min-height: 0;
  background: #172e36c9;
  color: #eef3da;
  border: 2px solid #c8dca5;
  font-size: 25px;
}
.map-stop:active:not(:disabled) {
  transform: translate(-50%, -50%);
}
.map-stop:disabled {
  width: 28px;
  height: 28px;
  border: 1px solid #c8dca544;
  background: #172e3660;
  color: #ccc;
  opacity: 0.55;
}
.map-stop.reachable {
  box-shadow: 0 0 0 6px #d4e5ad16;
}
.map-legend {
  padding: 15px 18px;
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.stage-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 24px;
}
.stage-label h2 {
  font-size: 20px;
  margin: 0;
}
.stage-label span {
  font-size: 11px;
  color: var(--accent);
}
.tactical-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 0 24px 22px;
}
.tactical-cell {
  aspect-ratio: 1;
  position: relative;
  min-height: 0;
  border-radius: 6px;
  background: #343b36;
  padding: 0;
  border: 1px solid #56685a;
}
.tactical-cell:disabled {
  opacity: 1;
}
.tactical-cell:not(:disabled) {
  border: 2px solid #e2d3a1;
  box-shadow: 0 0 0 2px #eedda614;
}
.tactical-cell img {
  position: absolute;
  inset: -12% -10%;
  width: 120%;
  height: 120%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}
.tactical-cell.wall {
  background: repeating-linear-gradient(
    0deg,
    #191d1c,
    #191d1c 12px,
    #292d28 12px,
    #292d28 14px
  );
  border-color: #171f1c;
}
.tactical-cell.danger {
  background: repeating-linear-gradient(
    135deg,
    #72562c55,
    #72562c55 8px,
    #d29d3e66 8px,
    #d29d3e66 12px
  );
  border-color: #d4a44d;
}
.tactical-cell.player {
  box-shadow: inset 0 0 0 2px #c7e4a1;
  background-color: #4c6546;
}
.hazard-mark {
  position: absolute;
  right: 5px;
  top: 1px;
  font-size: 12px;
  font-weight: 900;
  color: #f9d387;
}
.cell-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  position: absolute;
  bottom: 3px;
  left: 0;
  width: 100%;
  z-index: 3;
  text-shadow: 0 1px 4px #000;
  background: #171c17b0;
}
.counter-stage > .dialogue {
  padding: 18px 24px 20px;
  min-height: 145px;
}
.counter-stage > .dialogue img {
  width: 100px;
  height: 110px;
}
.counter {
  background: linear-gradient(#564737, #3a342b);
  border-top: 1px solid #8c775540;
  border-bottom: 1px solid #8c775540;
  padding: 22px;
  text-align: center;
}
.plate {
  border: 2px solid #b5af8a80;
  border-radius: 50%;
  background: #d3d2b01a;
  box-shadow: inset 0 0 0 7px #d3d2b00e;
  max-width: 240px;
  height: 105px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.plate img {
  width: 95px;
  height: 100px;
  object-fit: contain;
}
.empty-plate {
  font-family: Georgia, serif;
  color: #e3d9b384;
  font-size: 18px;
}
.dish-name {
  font-size: 12px;
  color: var(--accent);
  margin: 13px 0;
}
.counter .actions {
  justify-content: center;
}
.counter .primary {
  flex-grow: 0;
  min-width: 180px;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 19px 16px 0;
}
.ingredient {
  padding: 5px 2px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-color: transparent;
  font-size: 12px;
}
.ingredient img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.ingredient small {
  font-size: 9px;
  color: var(--muted);
}
.ingredient.selected {
  background: #d9db9c1c;
  border-color: var(--accent);
}
.pantry-note {
  padding: 0 20px 20px;
  margin-top: 10px;
}
.recipe-book {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.recipe-book ul {
  padding: 0;
  list-style: none;
  margin: 5px 0;
}
.recipe-book li {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid #ffffff0c;
  padding: 10px 0;
  font-size: 12px;
}
.recipe-book li span {
  color: var(--muted);
}
.packing-list {
  list-style: none;
  padding: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--accent);
}
#garden {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720/440;
  touch-action: manipulation;
  cursor: crosshair;
}
.garden-hud {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--accent);
}
.garden-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
}
.garden-controls button {
  font-size: 12px;
  padding: 9px 12px;
}
.garden-stage > .small-note {
  padding: 0 18px 18px;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .topbar,
  main,
  .game-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  .play-layout {
    gap: 22px;
    grid-template-columns: minmax(0, 1.4fr) minmax(255px, 1fr);
  }
  .tactical-grid {
    padding: 0 14px 14px;
    gap: 4px;
  }
  .shelf {
    grid-template-columns: repeat(3, 1fr);
  }
  .ingredient img {
    width: 50px;
    height: 50px;
  }
  .counter-stage > .dialogue {
    padding: 14px;
  }
  .counter-stage > .dialogue img {
    width: 75px;
  }
  .story-panel h2 {
    font-size: 25px;
  }
  .feedback {
    font-size: 15px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 70px;
  }
  .wordmark {
    font-size: 11px;
  }
  nav {
    gap: 16px;
    font-size: 12px;
  }
  .topbar,
  main,
  .game-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .chapter-heading {
    padding: 25px 0 22px;
  }
  .chapter-heading .eyebrow {
    font-size: 9px;
  }
  h1 {
    font-size: 32px;
  }
  .lede {
    font-size: 13px;
  }
  .play-layout {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .story-panel {
    padding: 20px 4px 0;
  }
  .feedback {
    min-height: 0;
  }
  .map-stop {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }
  .map-stop:disabled {
    width: 22px;
    height: 22px;
  }
  .map-legend {
    font-size: 10px;
    padding: 13px 12px;
  }
  .stage-label {
    padding: 16px;
  }
  .tactical-grid {
    gap: 5px;
    padding: 0 16px 16px;
  }
  .cell-label {
    font-size: 7px;
  }
  .shelf {
    grid-template-columns: repeat(5, 1fr);
    padding-left: 8px;
    padding-right: 8px;
  }
  .ingredient {
    font-size: 11px;
  }
  .ingredient img {
    width: 45px;
    height: 45px;
  }
  .ingredient small {
    font-size: 8px;
  }
  .counter-stage > .dialogue {
    min-height: 115px;
    padding: 10px;
  }
  .counter-stage > .dialogue img {
    height: 90px;
  }
  .dialogue p {
    font-size: 16px;
  }
  .counter {
    padding: 15px;
  }
  .plate {
    height: 83px;
  }
  .plate img {
    width: 78px;
    height: 80px;
  }
  .game-footer {
    flex-direction: column;
    gap: 4px;
    margin-top: 30px;
  }
  .garden-controls button {
    flex: 1;
    padding: 10px 7px;
    font-size: 11px;
  }
  .garden-hud {
    font-size: 11px;
  }
  .guide {
    margin-bottom: 18px;
  }
  .story-panel .eyebrow {
    margin-bottom: 10px;
  }
  .game-footer span {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.tactical-grid {
  max-width: 520px;
  margin: 0 auto;
}
.tactical-stage .map-legend {
  max-width: 520px;
  margin: 0 auto;
}

.ingredient-art {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}
.plate .ingredient-art {
  width: 74px;
  height: 74px;
}
.supper-scene {
  padding: 30px 25px 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 25%, #c1a85c2a, transparent 60%);
}
.supper-scene .pavilion {
  display: block;
  width: 280px;
  height: 235px;
  object-fit: contain;
  margin: 0 auto;
}
.supper-guests {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: -40px;
  position: relative;
}
.supper-guests img {
  display: block;
  width: 95px;
  height: 115px;
  object-fit: contain;
}
.supper-guests span {
  font-size: 11px;
  color: var(--accent);
}
.supper-scene > p:last-child {
  font-family: Georgia, serif;
  font-size: 24px;
  margin: 25px 0 0;
}
.supper-guests > div:nth-child(2) {
  padding-top: 25px;
}
@media (max-width: 700px) {
  .ingredient-art {
    width: 45px;
    height: 45px;
  }
  .supper-scene .pavilion {
    width: 240px;
    height: 200px;
  }
  .supper-guests {
    gap: 10px;
  }
  .supper-guests img {
    width: 80px;
    height: 95px;
  }
}

@media (max-width: 700px) {
  .island text {
    font-size: 25px;
  }
  .map-stop {
    width: 44px;
    height: 44px;
  }
}
