/* Willowbrook's shared visual language: linen, slate, oak, and generous space. */
.world-game[data-kind="village"] {
  --city-ink: #354c4d;
  --city-paper: #f5efe3;
  --city-line: #d5cdbb;
  --city-accent: #526d65;
}
.world-game[data-kind="village"] .world-stage {
  aspect-ratio: 16/10;
  min-height: 490px;
  max-height: 76svh;
  border: 3px solid #faf5e9;
  border-radius: 20px;
  background: #c9dbe0;
}
.world-game[data-kind="village"] .world-heading {
  margin-bottom: 12px;
}
.world-game[data-kind="village"] .world-heading h1 {
  color: var(--city-ink);
}
.world-game[data-kind="village"] .world-hud {
  top: 12px;
  left: 12px;
  right: 12px;
  gap: 8px;
}
.world-game[data-kind="village"] .mission-card {
  background: #f5efe3ed;
  border: 1px solid var(--city-line);
  box-shadow: 0 3px 12px #354c4d12;
  color: var(--city-ink);
  max-width: 310px;
}
.world-game[data-kind="village"] .mission-card > span,
.world-game[data-kind="village"] .mission-card strong {
  color: var(--city-ink);
}
.world-game[data-kind="village"] .mission-track {
  background: #d6d9cd;
}
.world-game[data-kind="village"] .mission-track > span {
  background: #819a8e;
}
.world-game[data-kind="village"] .world-counter {
  display: none;
}
.world-game[data-kind="village"] .world-hud > .world-tool {
  background: var(--city-paper);
  border: 1px solid var(--city-line);
  color: var(--city-ink);
}
.world-game[data-kind="village"] .world-control-deck {
  display: block;
  margin-top: 10px;
  padding: 12px;
  background: #f5efe3;
  border: 1px solid var(--city-line);
  border-radius: 14px;
}
.world-game[data-kind="village"] .world-control-deck > p {
  max-width: none;
  text-align: left;
  color: #596b66;
  margin: 0 0 9px;
  font-size: 12px;
}
.world-game[data-kind="village"] .world-controls {
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  gap: 7px;
}
.world-game[data-kind="village"] .world-control {
  flex-shrink: 0;
  min-height: 43px;
  font: 700 12px sans-serif;
  padding: 10px 14px;
  border: 1px solid var(--city-line);
  border-radius: 9px;
  background: #fffcf4;
  color: var(--city-ink);
  box-shadow: none;
}
.world-game[data-kind="village"] .world-control.is-primary {
  background: #526d65;
  color: #fffaf0;
  border-color: #526d65;
}
.world-game[data-kind="village"] .world-controls [data-action="left"],
.world-game[data-kind="village"] .world-controls [data-action="right"],
.world-game[data-kind="village"] .world-controls [data-action="up"],
.world-game[data-kind="village"] .world-controls [data-action="down"],
.world-game[data-kind="village"] .world-controls [data-action="jump"] {
  display: none;
}
.city-v2-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: var(--city-ink);
  font-family: Nunito, sans-serif;
}
.city-v2-ui[hidden],
.city-sheet[hidden] {
  display: none !important;
}
.city-identity {
  position: absolute;
  left: 14px;
  bottom: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: #f5efe3f0;
  border: 1px solid var(--city-line);
  border-radius: 14px;
  box-shadow: 0 3px 10px #354c4d18;
}
.city-identity canvas {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  image-rendering: pixelated;
}
.city-identity span {
  font-size: 12px;
  font-weight: 800;
  white-space: pre-line;
}
.city-map-button {
  position: absolute;
  right: 14px;
  top: 78px;
  border: 4px solid #faf5e9;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  width: 132px;
  height: 132px;
  pointer-events: auto;
  box-shadow: 0 3px 12px #354c4d22;
  background: #b8c5a4;
}
.city-map-button canvas {
  width: 100%;
  height: 100%;
}
.city-destination {
  position: absolute;
  right: 14px;
  top: 220px;
  max-width: 190px;
  text-align: right;
  background: #f5efe3e8;
  border: 1px solid var(--city-line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
}
.city-context-prompt {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 44%;
  pointer-events: auto;
  background: #526d65f2;
  color: #fffcf4;
  border: 1px solid #f5efe3;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 3px 12px #354c4d33;
}
.city-context-prompt[hidden] {
  display: none;
}
.city-control-tip {
  position: absolute;
  left: 14px;
  bottom: 76px;
  font-size: 10px;
  font-weight: 700;
  color: #354c4d;
  background: #f5efe3d9;
  padding: 5px 8px;
  border-radius: 6px;
}
.city-v2-ui .city-joystick,
.city-jump {
  display: none;
}
.city-sheet {
  position: absolute;
  inset: 18px;
  z-index: 6;
  background: #f5efe3fa;
  color: #354c4d;
  border: 2px solid #fffaf0;
  border-radius: 20px;
  padding: 22px;
  overflow: auto;
  box-shadow: 0 15px 50px #243d4d44;
  font-family: Nunito, sans-serif;
}
.city-sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.city-sheet h2 {
  font-size: 26px;
  letter-spacing: -0.8px;
  margin: 0;
  color: #354c4d;
}
.city-sheet p {
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 660px;
}
.city-sheet button {
  min-height: 44px;
  padding: 10px 14px;
  margin: 4px;
  border: 1px solid #c6cdbd;
  background: #fffcf4;
  color: #354c4d;
  border-radius: 10px;
  font:
    800 12px Nunito,
    sans-serif;
  cursor: pointer;
}
.city-sheet button:hover {
  background: #e6e8db;
}
.city-sheet button:focus-visible,
.city-sheet select:focus-visible,
.city-v2-ui button:focus-visible {
  outline: 3px solid #b58d57;
  outline-offset: 2px;
}
.city-sheet-heading > button {
  background: #526d65;
  color: #fffaf0;
  flex-shrink: 0;
}
.city-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 8px 0 14px;
}
.city-card-grid > button {
  margin: 0;
  text-align: left;
  padding: 16px;
  min-height: 62px;
}
.city-shop-card {
  border: 1px solid #d5cdbb;
  border-radius: 13px;
  padding: 13px;
  background: #fffcf4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.city-shop-card span {
  font-size: 11px;
}
.city-shop-card strong {
  font-size: 14px;
}
.city-shop-card button {
  margin: 0;
  background: #e6e8db;
}
.city-dressing-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.city-preview canvas {
  width: 220px !important;
  height: 240px !important;
  max-width: 100%;
  border-radius: 16px;
}
.city-avatar-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.city-avatar-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}
.city-avatar-fields select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px;
  border: 1px solid #c6cdbd;
  border-radius: 8px;
  background: #fffdf6;
  color: #354c4d;
  font:
    700 12px Nunito,
    sans-serif;
}
.city-inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.city-sheet li {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 10px;
}
@media (pointer: coarse), (max-width: 650px) {
  .world-game[data-kind="village"] .world-stage {
    aspect-ratio: 3/4;
    min-height: 470px;
    max-height: none;
  }
  .city-v2-ui .city-joystick {
    display: block;
    position: absolute;
    left: 16px;
    bottom: 20px;
    width: 86px;
    height: 86px;
    pointer-events: auto;
    border: 2px solid #fffaf0;
    border-radius: 50%;
    background: #526d6577;
    color: white;
    touch-action: none;
    font-size: 9px;
  }
  .city-v2-ui .city-joystick:after {
    inset: 23px;
    background: #fffaf0aa;
  }
  .city-jump {
    display: block;
    position: absolute;
    right: 17px;
    bottom: 25px;
    width: 64px;
    height: 64px;
    pointer-events: auto;
    background: #526d65;
    border: 2px solid #fffaf0;
    border-radius: 50%;
    color: #fffaf0;
    font-weight: 800;
    touch-action: manipulation;
  }
  .city-map-button {
    width: 84px;
    height: 84px;
    top: 85px;
    right: 10px;
    border-width: 3px;
    border-radius: 13px;
  }
  .city-destination {
    top: 178px;
    right: 10px;
    max-width: 140px;
    font-size: 9px;
    padding: 6px;
  }
  .city-identity {
    top: 85px;
    left: 10px;
    bottom: auto;
    padding: 3px 7px 3px 3px;
    gap: 5px;
    border-radius: 10px;
  }
  .city-identity canvas {
    width: 30px;
    height: 30px;
  }
  .city-identity span {
    font-size: 9px;
  }
  .city-control-tip {
    left: 10px;
    bottom: 116px;
    max-width: 170px;
    line-height: 1.5;
    font-size: 8px;
  }
  .city-context-prompt {
    bottom: 28px;
    max-width: calc(100% - 195px);
    padding: 10px;
    font-size: 10px;
    left: 53%;
    min-height: 54px;
  }
  .city-sheet {
    inset: 7px;
    padding: 14px;
    border-radius: 15px;
  }
  .city-sheet h2 {
    font-size: 21px;
  }
  .city-sheet-heading {
    gap: 6px;
  }
  .city-sheet-heading > button {
    padding: 8px;
    font-size: 11px;
  }
  .city-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .city-card-grid > button {
    padding: 10px;
    font-size: 11px;
  }
  .city-dressing-layout {
    grid-template-columns: 100px 1fr;
    gap: 12px;
  }
  .city-preview canvas {
    width: 100px !important;
    height: 110px !important;
  }
  .city-avatar-fields {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .city-avatar-fields label {
    font-size: 10px;
  }
  .city-avatar-fields select {
    font-size: 11px;
    padding: 7px;
  }
  .world-game[data-kind="village"] .mission-card {
    max-width: 240px;
  }
  .world-game[data-kind="village"] .world-controls {
    gap: 6px;
  }
  .world-game[data-kind="village"] .world-control {
    padding: 9px 11px;
    font-size: 11px;
  }
  .city-sheet p {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .city-stage * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 651px) and (pointer: fine) {
  .world-game[data-kind="village"] .world-controls [data-action="jump"] {
    display: inline-flex;
  }
}
/* City workbenches: large choices, clear models, no timed actions. */
.city-activity-board{display:flex;flex-direction:column;gap:12px;color:var(--city-ink);min-width:0}
.city-activity-board button{min-height:48px;white-space:normal;text-align:left;line-height:1.4}
.city-activity-note{margin:0;line-height:1.6}.city-recipe{padding:15px;border:1px solid #d8c9a4;border-radius:16px;background:#fff2ce;line-height:1.8;font-weight:800}
.city-work-tray{padding:18px;background:#e8eee4;border:1px solid #c8d5c3;border-radius:18px;min-height:66px;font-weight:800}
.city-activity-filters{display:flex;gap:6px;flex-wrap:wrap}.city-activity-filters button{font-size:12px;min-height:44px}.city-activity-filters [aria-pressed=true]{background:#526d65;color:white}
.city-activity-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.city-activity-list button{background:#fffcf3;border:1px solid #d9cfbd;border-bottom:3px solid #cfc2aa;border-radius:14px;padding:13px}
.city-pattern-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-width:360px;width:100%;align-self:center}.city-pattern-grid button{min-height:72px;text-align:center}.city-pattern-model span{display:grid;place-items:center;font-size:32px;background:#fff7df;border:1px dashed #b6a47e;border-radius:13px;padding:12px}
.city-memory-grid,.city-stone-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.city-memory-grid button,.city-stone-grid button{min-height:70px;text-align:center}.city-lantern-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.city-story-page{padding:24px;background:#fffbed;border:1px solid #e3d4b7;border-radius:18px;font-size:19px;line-height:1.9}.city-book-cover{text-align:center;font-size:24px;font-weight:850}.city-keepsake-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.city-keepsake-grid p{padding:12px;border-radius:13px;background:#fff2ce}
@media(max-width:650px){.city-activity-list,.city-keepsake-grid{grid-template-columns:1fr}.city-activity-board{gap:10px}.city-story-page{padding:16px;font-size:17px}.city-activity-filters{gap:5px}.city-activity-filters button{padding:8px}.city-pattern-grid button{font-size:12px}}
.city-piece-tray{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.city-piece-tray button{font-size:26px;padding:6px 12px;margin:0;text-align:center}.city-piece-tray [aria-pressed=true]{border:2px solid #526d65;background:#e0ecdd}.city-pattern-model{max-width:230px}.city-pattern-model span{padding:4px;font-size:24px}.city-water-tray{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.city-water-tray button{margin:0}.city-activity-board .city-pattern-grid button{margin:0;min-height:60px}

/* Search stays readable and inside the city dialog on narrow screens. */
.city-directory-search { display: grid; gap: 8px; color: #354c4d; font-weight: 800; }
.city-directory-search input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #768b80; border-radius: 10px; background: #fffcf4; color: #243f3d; font: inherit; }
.city-directory-search input::placeholder { color: #526860; opacity: 1; }
.city-directory-search input:focus-visible { outline: 3px solid #b58d57; outline-offset: 2px; }

.city-directory-card { min-width: 0; display: flex; flex-direction: column; padding: 6px; border: 1px solid #c6cdbd; border-radius: 12px; background: #f3efdf; }
.city-directory-card button { overflow-wrap: anywhere; margin: 3px; }
.city-directory-card button + button { font-weight: 600; font-size: 11px; }

.city-placement-status { position: absolute; z-index: 3; left: 50%; bottom: 112px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); box-sizing: border-box; padding: 9px 12px; margin: 0; border: 1px solid #6a8478; border-radius: 10px; background: #fffcf4f2; color: #243f3d; font: 700 12px/1.45 sans-serif; text-align: center; pointer-events: none; }
.city-placement-status[hidden] { display: none; }
@media (max-width: 650px) { .city-placement-status { bottom: 142px; font-size: 11px; } }

/* Play worlds: a persistent entry point and touch-friendly in-world tools. */
.experience-launch{position:absolute;z-index:16;right:16px;top:92px;background:#222c55;color:white;border:2px solid #8ce7d0;border-radius:14px;padding:12px 18px;font-weight:800;box-shadow:0 5px 0 #111a38;cursor:pointer}
.experience-bar{position:absolute;z-index:17;bottom:18px;left:50%;transform:translateX(-50%);width:min(660px,calc(100% - 150px));background:#17223bee;color:#fff;border:1px solid #83dcca;border-radius:14px;padding:10px;display:flex;gap:8px;flex-wrap:wrap;justify-content:center;pointer-events:auto}
.experience-bar[hidden],.experience-launch[hidden]{display:none}.experience-bar strong{flex-basis:100%;text-align:center;font-size:13px}.experience-bar button{border:0;border-radius:8px;background:#c6f9e9;color:#17223b;padding:9px 12px;cursor:pointer;font-weight:700}.experience-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}.experience-grid article{background:#e7f1ee;border:2px solid #cededb;border-radius:16px;padding:16px}.experience-grid h3{margin:0 0 12px;font-size:18px}.experience-sheet button:focus-visible,.experience-bar button:focus-visible,.experience-launch:focus-visible{outline:3px solid #f4a445;outline-offset:3px}@media(max-width:600px){.experience-grid{grid-template-columns:1fr}.experience-launch{top:100px;right:8px;padding:9px;font-size:12px}.experience-bar{bottom:8px;width:calc(100% - 120px);padding:6px;gap:4px}.experience-bar button{padding:8px;font-size:11px}}

/* Every city task has a manipulative workbench, shared by mouse, touch and keys. */
.city-hands-instruction{font-weight:800;font-size:1.08rem;color:#254d43;background:#e6f2eb;padding:14px;border-radius:12px;line-height:1.5}
.city-hands-canvas{display:block;width:100%;height:auto;aspect-ratio:760/440;border:2px solid #93b9a9;border-radius:14px;touch-action:none;cursor:grab;background:#edf5f1;user-select:none}
.city-hands-canvas:active{cursor:grabbing}.city-hands-canvas:focus-visible{outline:4px solid #d38b39;outline-offset:3px}.city-hands-status{min-height:1.5em;color:#315b4a;font-weight:700}.city-hands-help{font-size:.88rem;line-height:1.5;color:#53675e}.city-activity-board .city-story-page{font-size:1.15rem;line-height:1.8}
@media(max-width:600px){.city-hands-instruction{font-size:1rem;padding:10px}.city-hands-canvas{min-width:300px}.city-activity-board{overflow-x:auto}}
.city-activity-board input[type="search"]{display:block;width:100%;box-sizing:border-box;padding:12px;margin:8px 0 16px;border:2px solid #a4c5b6;border-radius:10px;font:inherit;background:#fff;color:#26473c}.city-activity-list button[hidden]{display:none}
