@font-face {
  font-family: Nunito;
  src: url("../../public/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: Lora;
  src: url("../../public/fonts/lora.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  font-family: Nunito, system-ui, sans-serif;
  color: #fff6e7;
  background: #192c36;
  color-scheme: dark;
  --ink: #30251e;
  --cream: #fff6e7;
  --gold: #ffcb79;
  --panel: #243b44;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #ffe8a1;
  outline-offset: 4px;
}
[hidden] { display: none !important; }
svg { display: block; flex: none; }
.world-app {
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 18%, #385057 0%, #223940 43%, #14252e 100%);
}
[data-world-paused] .world-app * { animation-play-state: paused !important; }
.world-app:has(#scene[data-shared]) {
  height: calc(100svh - max(94px, env(safe-area-inset-bottom) + 84px));
  min-height: 0;
  overflow-y: auto;
  scroll-padding-block: 10px;
}
.world-header {
  max-width: 1420px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.wordmark { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.wordmark img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 3px 6px #0006); }
.wordmark span { display: block; font-size: 13px; line-height: 1.1; font-weight: 750; color: #ffe0ad; }
.wordmark h1 { margin: 1px 0 0; font: 700 clamp(20px, 2vw, 30px)/1.06 Lora, Georgia, serif; white-space: nowrap; }
.room-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid #fff3cf22;
  border-radius: 23px;
  background: #13262de0;
  box-shadow: inset 0 1px 5px #071c2680, 0 4px 12px #091a2436;
}
.room-tab, .icon-button, .dock-button, .action-button {
  border: 1px solid #ffffff25;
  box-shadow: 0 3px 0 #09182160;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.room-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: transparent;
  box-shadow: none;
  padding: 0 13px;
  min-height: 45px;
  border-radius: 17px;
  background: transparent;
  color: #fff1d9;
  font-size: 15px;
  font-weight: 850;
}
.room-tab svg { color: var(--room-color); }
.room-tab[aria-current="location"] {
  background: var(--room-color);
  color: #322720;
  box-shadow: inset 0 2px 0 #fff5, 0 3px 0 #0003;
}
.room-tab[aria-current="location"] svg { color: inherit; }
.room-tab:hover:not([aria-current]) { background: #fff1; }
.header-tools, .scene-tools { display: flex; justify-content: end; gap: 8px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 47px;
  height: 47px;
  padding: 0;
  border-radius: 16px;
  background: linear-gradient(#496267, #30464d);
}
.icon-button:hover, .dock-button:hover, .action-button:hover { filter: brightness(1.12); }
button:not(.entity):not(:disabled):active { transform: translateY(2px); }
.play-area { --chrome-height: 218px; width: min(100%, 1420px, calc((100svh - var(--chrome-height)) * 16 / 9)); min-width: min(100%, 740px); margin: 0 auto; }
.play-area:has(.play-guide:not([hidden])) { --chrome-height: 308px; }
.play-area:has(#story-tray:not([hidden])) { --chrome-height: 298px; }
.play-area:has(.shared-play-status:not([hidden])) { --chrome-height: 449px; }
.shared-play-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid #ecaac17d;
  border-radius: 15px;
  background: #493747;
  color: #fff2f6;
  font-size: 15px;
  font-weight: 800;
}
.shared-play-status [role="status"] { flex: 1 1 120px; }
.save-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 10px;
  padding: 7px 11px;
  border: 1px solid #f4bf73;
  border-radius: 14px;
  background: #4b352c;
  color: #fff3db;
  font-size: 15px;
}
.play-guide {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 11px 15px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid #ebc78775;
  border-radius: 18px;
  background: linear-gradient(110deg, #3e4c43, #2d4448 56%);
  box-shadow: inset 0 1px 0 #ffe3a626, 0 3px 0 #12262d;
}
.play-guide:has(.guide-art[hidden]) { grid-template-columns: minmax(0,1fr) auto; padding-block: 8px; }
.guide-art {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  border-radius: 14px;
  background: radial-gradient(ellipse, #d7a9695c, #d7a96900 72%);
  color: #ffe0a7;
}
.guide-art img { display: block; object-fit: contain; }
.guide-copy h2 { margin: 0; color: #fff1d6; font: 700 clamp(19px, 2.1vw, 24px)/1.12 Lora, Georgia, serif; }
.guide-copy p { margin: 4px 0 0; color: #f8e9d4; font-size: 15px; line-height: 1.3; }
.guide-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.guide-actions .guide-skip { background: #263b40; }
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  background: #977046;
  border: 2px solid #f6d79999;
  box-shadow: 0 0 0 4px #162a33, 0 14px 38px #091824b0;
  user-select: none;
  -webkit-user-select: none;
}
.room-art, .scene-layer, .room-light, .weather-layer, .arrival { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-art { object-fit: fill; pointer-events: none; }
.room-light { pointer-events: none; background: linear-gradient(145deg, #ffc97418, transparent 48%, #50261117); transition: background 460ms; }
.scene[data-time="night"] .room-light { background: linear-gradient(120deg, #2031587a, #303e6f66 55%, #221d4790); }
.scene-layer, .weather-layer, .arrival { pointer-events: none; }
.family-canvas { display: block; visibility: hidden; } /* 2.0: draws only; each figure is shown on its own surface */
.figure-surface { position: absolute; pointer-events: none; display: block; }
.scene-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  pointer-events: none;
}
.room-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 6px 13px;
  border: 1px solid #fff3d94d;
  border-radius: 17px;
  background: #263338e6;
  color: var(--cream);
  box-shadow: 0 3px 9px #35241440;
}
.room-label h2 { font: 700 19px/1.1 Lora, Georgia, serif; margin: 0; }
.room-label svg { color: #ffda99; }
.scene-button { width: 45px; height: 45px; background: #273a3ce8; pointer-events: auto; }
.entity, .station-visual, .scene-detail {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  transform: translate(-50%, -100%);
}
.station-visual, .scene-detail { object-fit: contain; pointer-events: none; }
.entity {
  touch-action: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 16px;
  pointer-events: auto;
  cursor: grab;
  isolation: isolate;
}
.entity:active { transform: translate(-50%, -100%); }
.entity[data-kind="station"] { cursor: pointer; }
.entity > img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; pointer-events: none; }
.entity > .entity-shadow {
  position: absolute;
  z-index: -1;
  left: 12%;
  right: 12%;
  height: 13%;
  bottom: -2%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #321d1796, #32211700 71%);
}
.entity[data-rendered="true"] > img { opacity: 0; }
.entity[data-selected="true"] { outline: 2px solid #fff2ae; outline-offset: 2px; }
.entity[data-target="true"] { outline: 2px dashed #fff9ce; outline-offset: 3px; }
.entity[data-over="true"] { outline: 3px solid #fff5a3; outline-offset: 4px; box-shadow: 0 0 25px 5px #ffe79c9c; }
.entity[data-grabbed="true"] { z-index: 230 !important; cursor: grabbing; }
.entity[data-grabbed="true"] > img { filter: drop-shadow(0 9px 7px #3a1c1760); }
.entity[data-grabbed="true"] > .entity-shadow { transform: translateY(9px) scale(.82); }
.entity[data-plated="true"]:not([data-selected="true"]):not([data-grabbed="true"]) { pointer-events: none; }
.entity[data-plated="true"] > img { pointer-events: auto; }
.entity[data-plated="true"]:not([data-grabbed="true"]) > .entity-shadow { display: none; }
.entity:is([data-carried-mouth="true"],[data-carried-hand="true"]):not([data-selected="true"]):not([data-grabbed="true"]),
.entity[data-table-plate="true"]:not([data-grabbed="true"]) { pointer-events: none; }
.entity:is([data-carried-mouth="true"],[data-carried-hand="true"],[data-table-plate="true"]) > img { pointer-events: auto; }
.entity-name {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-radius: 11px;
  padding: 4px 9px;
  color: #fff7e9;
  background: #29393aeb;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
  white-space: nowrap;
  pointer-events: none;
}
.entity:is(:hover, :focus-visible, [data-selected="true"], [data-over="true"]) .entity-name { display: block; }
.station-mark {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 12px;
  border: 1px solid #fff9;
  background: #2b3f3deb;
  box-shadow: 0 2px 7px #33180780;
  color: #ffe3a1;
}
.entity[data-entity="den"] .station-mark { inset: 4px auto auto 4px; }
.entity[data-entity="garden-door"] .entity-name { left: auto; right: 0; transform: none; }
.entity[data-entity="cat-bowl"] .entity-name { left: 0; transform: none; }
.entity[data-entity="pot"] .entity-name { top: calc(100% + 3px); bottom: auto; }
.entity[data-entity="reading-bench"] { top: max(calc(var(--y) * 100%), calc(46% + 45px)); }
.entity[data-entity="reading-bench"] .station-mark { right: 50%; transform: translateX(50%); }
.scene-message {
  position: absolute;
  z-index: 250;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 26px);
  width: max-content;
  background: #203437f2;
  color: #fff6df;
  border: 1px solid #ffe2a254;
  box-shadow: 0 5px 18px #1f1c2075;
  padding: 7px 16px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  pointer-events: none;
}
.scene-message[data-at-top] { top: 54px; bottom: auto; }
.arrival { opacity: 0; background: #fff3cc; }
.arrival.flash { animation: room-arrival 400ms ease-out; }
@keyframes room-arrival { from { opacity: .44; } to { opacity: 0; } }
.scene[data-weather="rain"] .weather-layer {
  opacity: .36;
  animation: rainfall 1s linear infinite;
}
.weather-layer > img { display: block; width: 100%; height: 100%; }
@keyframes rainfall { to { transform: translate(-30px, 55px); } }
.context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 5px 0 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.context-bar > p { margin: 0 4px; font-size: 15px; color: #ffe4ba; }
.recipe-ingredients { display: flex; flex: 0 0 auto; gap: 5px; margin: 0 4px; padding: 0; list-style: none; }
.recipe-ingredients li {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px dashed #d9bc8a9c; border-radius: 11px; background: #263b41;
}
.recipe-ingredients li[data-filled="true"] { border: 1px solid #c1e7be; background: #304c40; }
.recipe-ingredients img { width: 28px; height: 28px; object-fit: contain; }
.recipe-ingredients li > span {
  position: absolute; right: 1px; bottom: 1px; display: grid; place-items: center;
  width: 16px; height: 16px; border-radius: 50%; color: #183327; background: #c1e7be;
}
.action-button {
  border-radius: 14px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 11px;
  background: #324b50;
  color: var(--cream);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}
.action-button.primary { background: #f4bf73; color: #30251e; border-color: #ffe7ba; }
.action-button svg { width: 19px; height: 19px; }
.action-button.shared-play {
  background: #f2b4c8;
  color: #42273b;
  border-color: #fbe0e8;
  white-space: normal;
  line-height: 1.1;
}
.shared-play-status .action-button { background: #66465d; border-color: #f1c2d17a; }
.food-action-art { width: 27px; height: 27px; object-fit: contain; }
.world-dock {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 9px;
  border-radius: 21px;
  background: #162930;
  border: 1px solid #f2d99a37;
  padding: 6px;
  box-shadow: 0 5px 16px #101f27ad, inset 0 1px 0 #fff1;
}
.family-dock, .dock-actions { display: flex; gap: 6px; align-items: center; }
.family-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 67px;
  min-height: 48px;
  border: 1px solid #fff1;
  border-radius: 14px;
  padding: 2px 7px 2px 3px;
  background: #31474a;
  color: #fff4df;
  font-size: 14px;
  font-weight: 850;
}
.family-card img { width: 28px; height: 42px; object-fit: contain; }
.family-card[data-here="false"] { background: #27393d; }
.family-card[data-here="false"]::after {
  content: "+";
  position: absolute;
  right: -2px;
  top: -5px;
  border-radius: 50%;
  background: #ffd28a;
  color: #35251a;
  width: 17px;
  height: 17px;
  line-height: 17px;
  font-weight: 950;
}
.family-card[aria-pressed="true"] { background: #53736b; box-shadow: inset 0 0 0 2px #ffe59e; }
.dock-button {
  min-height: 47px;
  border-radius: 15px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 900;
}
.props-button { background: #d9a96f; color: #32271f; }
.stories-button { background: #f1c780; color: #32271f; }
.stories-button[data-keepsake-ready="true"] { box-shadow: inset 0 0 0 2px #fff4cd, 0 0 14px #ffd17878; }
.story-tray {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid #f9ce7b5c;
  border-radius: 16px;
  background: #304546;
}
.story-tray > .story-copy { flex: 1 1 230px; }
.story-copy strong { color: #ffd997; font-size: 15px; }
.story-copy p { margin: 2px 0 0; font-size: 16px; }
.story-images { display: flex; align-items: center; gap: 5px; }
.story-images img { width: 46px; height: 45px; object-fit: contain; }
.story-images .step-icon { display: grid; place-items: center; width: 40px; height: 43px; color: #ffe0a0; }
.world-dialog {
  color-scheme: light;
  width: min(610px, calc(100vw - 28px));
  max-height: min(78svh, 680px);
  color: var(--ink);
  background: #fff3db;
  border: 2px solid #f3c886;
  border-radius: 25px;
  box-shadow: 0 20px 70px #09141bbb;
  padding: 0;
}
.world-dialog::backdrop { background: #12252cb0; backdrop-filter: blur(4px); }
.world-dialog :is(button, a, input):focus-visible { outline-color: #6a481d; }
.dialog-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 19px;
  background: #ffe6bb;
  border-bottom: 1px solid #b9824840;
}
.dialog-head p { margin: 0 0 2px; font-size: 14px; font-weight: 850; color: #694625; }
.dialog-head h2 { margin: 0; font: 700 27px/1.12 Lora, Georgia, serif; }
.dialog-head .icon-button { color: #372a20; background: #fff2d8; border-color: #d2ad7a; }
.dialog-body { padding: 16px 19px 20px; }
.dialog-body p { font-size: 16px; }
.dialog-body p:first-child { margin-top: 0; }
.amor-closeup-art {
  position: relative;
  display: grid;
  justify-items: center;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 64%, #ffe9b8e6 14%, #f7cb86a8 46%, #724a3ca0 100%),
    var(--closeup-room) center 62% / cover;
  box-shadow: inset 0 0 0 1px #c4976170;
}
.amor-closeup-art[data-night="true"] {
  background:
    radial-gradient(ellipse at 50% 64%, #f1c99fde 14%, #8279aba6 49%, #2d294bd9 100%),
    var(--closeup-room) center 62% / cover;
}
.amor-closeup-frame {
  position: relative;
  width: min(100%, 20rem, 43svh);
  aspect-ratio: 1;
}
#amor-closeup-portrait { position: absolute; display: block; filter: drop-shadow(0 9px 11px #74472f70); }
#amor-closeup-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .3s ease-out; }
#amor-closeup-3d[data-ready="true"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #amor-closeup-3d { transition: none; } }
#amor-closeup-toy {
  position: absolute;
  width: 25%;
  transform: translate(var(--toy-grip-x), var(--toy-grip-y));
  filter: drop-shadow(0 3px 3px #55342475);
}
#amor-closeup-bowl-art, #amor-closeup-ball-art {
  position: absolute;
  bottom: 7%;
  filter: drop-shadow(0 3px 3px #55342475);
}
#amor-closeup-bowl-art { right: 7%; width: clamp(36px, 16%, 72px); }
#amor-closeup-ball-art { left: 8%; width: clamp(30px, 12%, 55px); }
.amor-closeup-art[data-reacting="true"] { box-shadow: inset 0 0 0 2px #ffe8ad, inset 0 0 22px #ffe0a06e; }
#amor-closeup-status { text-align: center; margin: 10px 0; font-weight: 750; }
.amor-closeup-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.amor-closeup-actions .action-button { white-space: normal; text-align: center; }
.amor-closeup-moods {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  max-width: 25rem;
  margin: 13px auto 9px;
}
.amor-closeup-moods .amor-closeup-mood {
  min-height: 63px;
  gap: 3px;
  padding: 4px 2px;
  border-radius: 12px;
  font-size: clamp(12px, 2.9vw, 14px);
  line-height: 1.1;
}
.amor-closeup-moods .amor-closeup-mood img { width: 36px; height: 34px; max-width: 100%; }
.amor-closeup-moods .amor-closeup-mood[aria-pressed="true"] {
  background: #f6d793;
  border-color: #926734;
  box-shadow: inset 0 0 0 1px #fff1cf, 0 2px 0 #92673480;
}
.action-button.amor-closeup-back {
  display: flex;
  margin: 0 auto;
  background: #fff0d5;
  border-color: #c9a16e;
  color: var(--ink);
}
.dialog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 9px; }
#open-prop-finder { margin-bottom: 12px; }
.prop-finder-rooms, .prop-finder-list { display: grid; gap: 7px; }
.prop-finder-rooms { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prop-finder .action-button {
  color: var(--ink);
  background: #fff7e5;
  border-color: #cfaa74;
  white-space: normal;
  text-align: center;
}
.prop-finder-rooms .action-button { min-width: 0; padding-inline: 5px; }
.prop-finder-rooms .action-button[aria-pressed="true"] { background: #c8e7c3; border-color: #668b62; }
.prop-finder .prop-finder-status { margin: 12px 0 7px; color: #695035; font-size: 14px; }
.prop-finder-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prop-finder-item {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 63px;
  padding: 5px 7px;
  border: 1px solid #c4a47885;
  border-radius: 12px;
  background: #fffaf0;
  box-shadow: 0 2px 0 #95683723;
  color: var(--ink);
  text-align: left;
}
.prop-finder-item:hover { background: #ffe9bf; }
.prop-finder-item > img { display: block; width: 43px; height: 43px; object-fit: contain; }
.prop-finder-item > span { display: grid; gap: 3px; overflow-wrap: anywhere; }
.prop-finder-item strong { font-size: 15px; line-height: 1.1; }
.prop-finder-item > span > span { color: #694f32; font-size: 13px; line-height: 1.2; }
.prop-finder-back { margin-top: 13px; }
@media (max-width: 530px) {
  .prop-finder-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 350px) {
  .prop-finder-list { grid-template-columns: 1fr; }
}
.pick-card, .story-card, .setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #362a22;
  background: #fffaf0;
  border: 1px solid #c4a47870;
  border-radius: 15px;
  box-shadow: 0 2px 0 #95683726;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 16px;
}
.pick-card { flex-direction: column; justify-content: center; min-height: 90px; text-align: center; }
.pick-card img { width: 57px; height: 51px; object-fit: contain; }
.pick-card:hover, .story-card:hover { background: #ffe9bf; }
.story-list { display: grid; gap: 8px; }
.story-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 32px;
  gap: 11px;
  min-height: 72px;
  text-align: left;
  scroll-margin-block: 80px 8px;
}
.story-card-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 54px;
  border-radius: 11px;
  background: radial-gradient(ellipse at 52% 35%, #fff8e9, #f4d8ad);
}
.story-card-art img { width: 54px; height: 49px; object-fit: contain; filter: drop-shadow(0 2px 2px #75502335); }
.story-card-copy { grid-area: 1 / 2; display: grid; gap: 3px; min-width: 0; line-height: 1.19; }
.story-card-copy small { font-size: 14px; color: #624834; }
.story-card-number {
  grid-area: 1 / 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: #f5d7a5;
  color: #694625;
  font-size: 14px;
}
.saga-view-switch { margin-bottom: 12px; }
.saga-keepsakes { margin-block: 0 16px; }
.saga-keepsake-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.saga-keepsake-head h3 { margin: 0; font: 700 20px/1.2 Lora, Georgia, serif; }
.saga-keepsake-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 10px; }
.saga-keepsake {
  display: grid;
  grid-template-columns: 57px minmax(0,1fr);
  align-items: center;
  gap: 5px 10px;
  padding: 10px;
  border: 1px solid #d7b88a;
  border-radius: 15px;
  background: #fffaf0;
}
.saga-keepsake-art { grid-row: span 2; width: 57px; height: 58px; object-fit: contain; }
.saga-keepsake-copy { align-self: end; }
.saga-keepsake-copy strong, .saga-keepsake-copy span { display: block; }
.saga-keepsake-copy span { color: #624834; font-size: 13px; }
.saga-keepsake[data-highlighted="true"] { border-color: #a4773f; box-shadow: inset 0 0 0 1px #a4773f; }
.saga-keepsake-action { justify-self: start; min-height: 44px; }
.wardrobe-choice-art { width: 57px; height: 51px; object-fit: contain; }
.wardrobe-item-art { display: block; width: 88px; height: 70px; object-fit: contain; margin: 0 auto; }
.setting-row { justify-content: space-between; margin: 0 0 7px; min-height: 47px; }
.setting-row input { accent-color: #366d5e; width: 21px; height: 21px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dialog-actions a { text-decoration: none; }
.album-entry { display: grid; justify-items: end; gap: 8px; margin: 0 0 16px; }
.album-entry:last-child { margin-bottom: 0; }
.album-photo { display: block; width: 100%; border-radius: 13px; }
.book-page { display: grid; justify-items: center; gap: 11px; text-align: center; }
.book-page img { max-width: 100%; width: 310px; border-radius: 18px; }
.book-page p { font-family: Lora, Georgia, serif; line-height: 1.6; }
.skip-link { position: fixed; left: 12px; top: -90px; z-index: 1000; background: #fff1cd; color: #24180e; padding: 10px 16px; }
.skip-link:focus { top: 8px; }
@media (min-width: 881px) {
  .play-area:has(.shared-play-status:not([hidden])) .play-guide { gap: 8px; padding: 8px; }
  .play-area:has(.shared-play-status:not([hidden])) .guide-art { padding: 0; }
  .play-area:has(.shared-play-status:not([hidden])) .guide-art img:first-child { width: 34px; height: 35px; }
  .play-area:has(.shared-play-status:not([hidden])) .guide-art img:last-child { width: 45px; height: 45px; }
  .play-area:has(.shared-play-status:not([hidden])) .guide-copy h2 { font-size: 21px; }
  .play-area:has(.shared-play-status:not([hidden])) .guide-actions .action-button { padding-inline: 8px; gap: 5px; font-size: 14px; }
}
@media (max-width: 880px) {
  .world-header { grid-template-columns: 1fr auto; gap: 8px; }
  .room-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .room-tab { flex: 1; }
  .wordmark img { height: 40px; width: 40px; }
  .play-area { min-width: 0; width: 100%; }
  .scene { border-radius: 20px; }
}
@media (max-width: 530px) {
  .world-app { padding-inline: 7px; }
  .world-header { margin-bottom: 8px; }
  .world-header:has(.shared-play:not([hidden])) .wordmark { gap: 5px; min-width: 0; }
  .world-header:has(.shared-play:not([hidden])) .wordmark h1 { white-space: normal; }
  .world-header:has(.shared-play:not([hidden])) .wordmark img { width: 34px; height: 34px; }
  .world-header:has(.shared-play:not([hidden])) .header-tools { gap: 5px; }
  .world-header:has(.shared-play:not([hidden])) .header-tools .icon-button { width: 44px; height: 44px; }
  .action-button.shared-play { max-width: 112px; gap: 4px; padding-inline: 7px; font-size: 14px; }
  .action-button.shared-play svg { width: 16px; height: 16px; }
  .shared-play-status:has(#spelrum-finish:not([hidden])) [role="status"] { flex-basis: 80px; line-height: 1.15; }
  .shared-play-status:has(#spelrum-finish:not([hidden])) .action-button {
    flex: 1 1 80px;
    white-space: normal;
    line-height: 1.1;
  }
  .room-tab { flex-direction: column; gap: 2px; padding: 4px; font-size: 13px; }
  .room-tab svg { width: 18px; height: 18px; }
  .play-guide { grid-template-columns: auto minmax(0,1fr); gap: 8px; padding: 9px; }
  .play-guide:has(.guide-art:not([hidden])) .guide-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .guide-actions .action-button { gap: 5px; padding-inline: 8px; font-size: 14px; }
  .guide-art { padding: 0; }
  .guide-art img:first-child { width: 31px; height: 35px; }
  .guide-art img:last-child { width: 47px; height: 48px; }
  .amor-closeup-actions { gap: 6px; }
  .amor-closeup-actions .action-button {
    flex: 0 1 calc(50% - 3px);
    min-width: 0;
    padding-inline: 6px;
    gap: 5px;
    font-size: 14px;
    line-height: 1.15;
  }
  .amor-closeup-moods { margin: 9px auto 8px; }
  .entity[data-entity="pot"] .station-mark { right: -10px; bottom: 0; width: 29px; height: 29px; }
  .scene-top { left: 6px; right: 6px; top: 6px; }
  .room-label { min-height: 37px; border-radius: 12px; }
  .room-label h2 { font-size: 16px; }
  .scene-button { width: 44px; height: 44px; }
  .context-bar { flex-wrap: wrap; overflow-x: visible; }
  .context-bar > .action-button { max-width: 100%; white-space: normal; }
  .world-dock { flex-wrap: wrap; justify-content: center; }
  .family-dock, .dock-actions { justify-content: center; flex: 1 0 100%; }
  .family-card { flex: 1; min-width: 0; }
  .dock-button { flex: 1; }
  .scene-message { font-size: 14px; padding: 5px 10px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
}
body.calm *, body.calm *::before, body.calm *::after {
  animation: none !important;
  transition-duration: .001ms !important;
}
.entity > img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); }
.entity:not([data-rendered="true"], [data-grabbed="true"]) > img[data-remote-drag="true"],
.worn > img[data-remote-drag="true"] { opacity: .30; }
.remote-drag {
  position: absolute;
  z-index: 232;
  inset: 0;
  pointer-events: none;
  transform: translate(var(--drag-x), var(--drag-y));
  transition: transform 80ms linear;
}
.remote-drag-art {
  position: absolute;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  opacity: .88;
  filter: drop-shadow(0 4px 6px #321e3c61);
}
.remote-drag-hand {
  position: absolute;
  z-index: 1;
  left: min(6px, calc(100% - var(--drag-x) - 32px));
  top: max(-34px, calc(4px - var(--drag-y)));
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff5e7;
  border-radius: 50%;
  background: var(--seat-color, #76578c);
  color: #24192b;
  box-shadow: 0 2px 5px #2b182bad;
}
.remote-drag.local-drag { z-index: 233; transition: none; }
.entity[data-kind="station"] > .entity-shadow { display: none; }
.entity.station-has-art .station-mark { opacity: .88; }
.entity[data-hint="true"], .scene-button[data-hint="true"] { box-shadow: 0 0 0 2px #fff7b7, 0 0 20px #fff1a2; }
.worn { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); width: var(--head-size); height: var(--head-size); display: grid; place-items: center; pointer-events: none; color: #ec816d; }
.worn img { width: 100%; height: 100%; object-fit: contain; }
.worn[data-worn-item] { pointer-events: auto; cursor: grab; }
.worn[data-worn-item]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(44px, 100%);
  height: max(44px, 100%);
  transform: translateX(-50%);
}
.lamp-glow { width: 33%; height: 63%; transform: translate(-50%,-58%); mix-blend-mode: screen; }
.lamp-glow > img, .bowl-mix > img { display: block; width: 100%; height: 100%; }
.wall-shadow { width: 8.5%; transform-origin: center bottom; }
.wall-shadow > img { display: block; width: 100%; height: auto; filter: blur(.7px); }
.pot-growth { z-index: 3; width: 5.5%; }
.pot-growth > img { display: block; width: 100%; height: auto; }
.pot-growth > .seed-dot { width: 11px; height: 9px; margin: -2px auto; }
.bowl-mix { width: 5.4%; height: 2.6%; }
.color-choice { margin: 4px 5px 4px 0; }
.recipe-card { margin: 0; padding-left: 25px; }
.recipe-card li { padding: 5px 0 8px 4px; border-bottom: 1px solid #d9b88b55; }
.recipe-card li > span { font-size: 16px; }
.arcade-memory { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f5d39c; border-radius: 12px; }

.scene[data-room="kitchen"] .bowl-mix { z-index: 3; }
.scene-top { z-index: 240; }
.effects { z-index: 245; }
.arrival { z-index: 246; }
.bowl-mix[data-empty="true"] { display: none; }
.interaction-sprite {
  position: absolute;
  z-index: 238;
  width: 7%;
  aspect-ratio: 1;
  object-fit: contain;
  pointer-events: none;
}
:is(.story-images,.pick-card,.guide-art,.prop-finder-item) img[data-type="pillow-gold"] { filter: hue-rotate(32deg) saturate(1.09) brightness(1.08); }
.step-count { color: #ffe5ac; font-weight: 800; font-size: 14px; }

/* 2.0: vännens stund vid korgen */
.friend-corner { position: relative; height: clamp(190px, 34vh, 300px); border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, #f6d9b4 0%, #f3e6d3 55%, #fbf3e8 100%); box-shadow: inset 0 0 0 1px #e8d3b6; }
.friend-corner-basket { position: absolute; left: 50%; bottom: 7%; width: min(72%, 360px); transform: translateX(-50%); filter: drop-shadow(0 10px 10px #6b42273d); }
.friend-corner-picture { position: absolute; left: 50%; bottom: 24%; height: 70%; transform: translate(-50%, 18%) scale(.6); opacity: 0; pointer-events: none; filter: drop-shadow(0 8px 10px #6b42274d); }
.friend-corner.is-awake .friend-corner-basket { width: min(62%, 310px); }
.friend-corner.is-awake .friend-corner-picture { opacity: 1; transform: translate(-50%, 0) scale(1); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; }
.friend-corner.is-patted .friend-corner-picture { animation: friend-wiggle .6s ease-out; }
@keyframes friend-wiggle { 30% { transform: translate(-50%, -6%) rotate(-4deg) scale(1.03); } 60% { transform: translate(-50%, 0) rotate(3deg); } 100% { transform: translate(-50%, 0) rotate(0); } }
.friend-corner-heart { position: absolute; left: calc(50% + (var(--i) - 2) * 34px); top: 22%; color: #f06d9e; animation: friend-heart 1.6s calc(var(--i) * .12s) ease-out both; }
.friend-corner-heart svg { fill: currentColor; }
@keyframes friend-heart { 0% { opacity: 0; transform: translateY(14px) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-60px) scale(1.15); } }
.friend-corner-status { text-align: center; margin: 10px 0; font-weight: 750; }
@media (prefers-reduced-motion: reduce) { .friend-corner * { animation: none !important; transition: none !important; } }
/* vännens hylla i klädskåpet */
.wardrobe-friend { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px;
  border-radius: 18px; background: linear-gradient(180deg, #fff6ea, #f8e6cf); box-shadow: inset 0 0 0 1px #e8d3b6; }
.wardrobe-friend-picture { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 6px 8px #6b422733); }
.wardrobe-friend-text { display: grid; gap: 3px; min-width: 0; }
.wardrobe-friend-text strong { font-family: Lora, Georgia, serif; font-size: 1.08rem; }
.wardrobe-friend-text span { font-size: .92rem; line-height: 1.35; }
@media (max-width: 560px) { .wardrobe-friend { grid-template-columns: 64px 1fr; } .wardrobe-friend-picture { width: 64px; height: 64px; } .wardrobe-friend .action-button { grid-column: 1 / -1; } }

/* 2.0: kapitel 3. Bilderbokssidan och tråden ut genom fönstret. */
.world-dialog.is-chapter { width: min(1120px, calc(100vw - 20px)); max-height: min(94svh, 900px); }
.chapter-page { margin: 0; display: grid; gap: 14px; }
.chapter-picture { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px; box-shadow: 0 10px 26px #6b42272e, inset 0 0 0 1px #e8d3b6; background: #f3e2c6; }
.chapter-side { display: grid; align-content: start; gap: 12px; }
.chapter-text { margin: 0; font-family: Lora, Georgia, serif; font-size: clamp(1.02rem, .9rem + .5vw, 1.2rem); line-height: 1.62; color: var(--ink); text-wrap: pretty; }
.chapter-next { margin: 2px 0 0; font-weight: 800; letter-spacing: .02em; color: #b4456d; }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
/* breda skärmar: ett uppslag, bilden till vänster och texten till höger */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  .chapter-page { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 28px; }
  .chapter-side { align-content: center; }
}
.chapter-thread { overflow: visible; }
.chapter-thread[hidden] { display: none; }
.chapter-thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* garn: skugga, grundfärg, tvinnade trådar, en ljus kant och ett glitter som vandrar mot fönstret */
.chapter-thread-shade { stroke: #7a3140; stroke-opacity: .22; stroke-width: 7px; transform: translate(1.4px, 2.4px); }
.chapter-thread-line { stroke: #e7848f; stroke-width: 4.6px; }
.chapter-thread-ply { stroke: #c0525f; stroke-opacity: .7; stroke-width: 4.6px; stroke-dasharray: 1.3 3.3; }
.chapter-thread-sheen { stroke: #ffd9dc; stroke-opacity: .55; stroke-width: 1.2px; transform: translate(-.8px, 0); }
.chapter-thread-shine { stroke: #fff4f2; stroke-width: 2.6px; stroke-dasharray: 12 380; animation: chapter-shine 5.2s linear infinite; }
@media (max-width: 700px) {
  .chapter-thread-shade { stroke-width: 12px; } .chapter-thread-line, .chapter-thread-ply { stroke-width: 8px; }
  .chapter-thread-ply { stroke-dasharray: 2.4 5.6; } .chapter-thread-sheen { stroke-width: 2.2px; } .chapter-thread-shine { stroke-width: 4.5px; }
}
@keyframes chapter-shine { from { stroke-dashoffset: 392; } to { stroke-dashoffset: 0; } }
.entity[data-entity="chapter-thread"] img { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .chapter-thread-shine { animation: none; stroke-opacity: 0; } }

/* 2.0: hemligheterna har ingen knappmarkering; musen nosar lite och guldtråden glimmar */
.entity[data-entity^="secret-"] .station-mark,.entity[data-entity^="secret-"] .entity-name{display:none}
.entity[data-entity="secret-mouse"] img{transform-origin:50% 90%;animation:secret-sniff 2.8s ease-in-out infinite}
.entity[data-entity="secret-gold"] img{filter:drop-shadow(0 0 6px #ffd97a) drop-shadow(0 0 14px #ffcf5a88);animation:secret-glint 2.4s ease-in-out infinite}
.entity[data-entity="secret-book"] img{transform:rotate(-14deg) skewX(-6deg);filter:brightness(.9) drop-shadow(0 3px 3px #3b221466)}
@keyframes secret-sniff{0%,70%,100%{transform:rotate(0)}76%{transform:rotate(-5deg)}82%{transform:rotate(4deg)}88%{transform:rotate(-2deg)}}
@keyframes secret-glint{0%,100%{opacity:.75}50%{opacity:1}}
/* Dagens tråd: guldtråden ligger på arkadskåpet och glimmar; den leder till Stjärnarkaden */
.entity[data-entity="daily-thread"] .station-mark,.entity[data-entity="daily-thread"] .entity-name,.entity[data-entity="daily-thread"] .entity-shadow{display:none}
.entity[data-entity="daily-thread"] img{filter:drop-shadow(0 0 7px #ffe08a) drop-shadow(0 0 16px #ffcf5acc);animation:daily-glint 2.2s ease-in-out infinite;transform-origin:50% 80%}
@keyframes daily-glint{0%,100%{transform:scale(1) rotate(-4deg);filter:drop-shadow(0 0 5px #ffe08a) drop-shadow(0 0 10px #ffcf5a88)}50%{transform:scale(1.1) rotate(4deg);filter:drop-shadow(0 0 9px #fff1b8) drop-shadow(0 0 20px #ffcf5a)}}
@media (prefers-reduced-motion:reduce){.entity[data-entity="daily-thread"] img{animation:none}}
@media (prefers-reduced-motion:reduce){.entity[data-entity^="secret-"] img{animation:none}}
