:root {
  --bg: #F6F1EA;
  --surface: #FFFFFF;
  --surface-2: #FBF8F3;
  --ink: #2C2C2A;
  --muted: #6F6C66;
  --faint: #A3A09A;
  --line: rgba(44, 44, 42, 0.12);
  --accent: #7F77DD;
  --accent-ink: #3C3489;
  --accent-soft: #EEEDFE;
  --out-bubble: #7F77DD;
  --out-ink: #FFFFFF;
  --in-bubble: #F1EFE8;
  --in-ink: #2C2C2A;
  --mark: rgba(250, 199, 117, 0.55);
  --danger: #A32D2D;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18171C;
    --surface: #232229;
    --surface-2: #2B2A32;
    --ink: #F1EFE8;
    --muted: #B4B2A9;
    --faint: #888780;
    --line: rgba(241, 239, 232, 0.12);
    --accent: #AFA9EC;
    --accent-ink: #CECBF6;
    --accent-soft: #2E2B4A;
    --out-bubble: #534AB7;
    --out-ink: #FFFFFF;
    --in-bubble: #34333B;
    --in-ink: #F1EFE8;
    --mark: rgba(239, 159, 39, 0.4);
    --danger: #F09595;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Nunito, ui-rounded, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

[hidden] { display: none !important; }

html { height: 100%; }
body { height: 100%; display: flex; flex-direction: column; }

.local-banner { flex: none; text-align: center; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 12px; }

.app { flex: 1; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.screen--center { justify-content: center; align-items: center; text-align: center; gap: 10px; padding: 24px 20px; background: transparent; }
.screen--center h1 { margin: 0; font-size: 26px; font-weight: 800; }
.lede { margin: 0 0 8px; color: var(--muted); max-width: 340px; }
.boot-text { color: var(--muted); max-width: 340px; }
.stack { display: grid; gap: 10px; width: 100%; max-width: 320px; text-align: left; }
@media (min-width: 600px) {
  .app { padding: 16px; }
  .screen:not(.screen--center) { border: 1px solid var(--line); border-radius: 28px; overflow: hidden; }
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.logo { width: 32px; height: 32px; }
.logo--big { width: 72px; height: 72px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 12px 12px 16px; border-bottom: 1px solid var(--line); }
.icon-btn { width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- chat list ---------- */

.chat-list { list-style: none; margin: 0; padding: 8px; flex: 1; overflow-y: auto; }
.chat-list > .hint { padding: 12px; }
.chat-empty { color: var(--faint); text-align: center; padding: 40px 24px; }
.chat-row { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 10px; border-radius: 14px; cursor: pointer; text-align: left; }
.chat-row:hover { background: var(--surface-2); }
.chat-row .avatar { width: 44px; height: 44px; font-size: 18px; }
.chat-row-text { display: grid; min-width: 0; }
.chat-row-text b { font-weight: 800; }
.chat-row-text span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.chats-foot .hint { margin: 0; text-align: center; }
.link-btn { border: 0; background: transparent; padding: 4px; color: var(--accent-ink); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }

/* Suggestions above the chat list: install the app, turn on notifications. */
.nudges { display: grid; gap: 8px; padding: 8px 8px 0; }
.nudges:empty { display: none; }
.nudge { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 14px; padding: 10px 6px 10px 12px; }
.nudge-text { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.nudge-text b { font-size: 14px; }
.nudge-text span { font-size: 12px; color: var(--muted); }
.nudge .icon-btn { width: 30px; height: 30px; }
.nudge .icon-btn svg { width: 16px; height: 16px; }
.share-glyph { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
.join-app-hint { max-width: 320px; }
.move-code { display: flex; gap: 6px; margin: 10px 0 4px; }
.move-code input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font: 13px ui-monospace, monospace; color: var(--ink); }
#move-in-form { margin-top: 12px; }

.join-avatars { display: flex; margin-bottom: 4px; }
.join-avatars .avatar { width: 52px; height: 52px; border: 3px solid var(--bg); }
.join-avatars .avatar + .avatar { margin-left: -14px; }

/* ---------- invite ---------- */

.invite { flex: none; display: flex; align-items: center; gap: 6px; background: var(--accent-soft); border-radius: 14px; padding: 8px 8px 8px 12px; }
.invite-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.invite-text b { font-size: 14px; }
.invite-text span { font-size: 12px; color: var(--muted); }

/* ---------- phone ---------- */

.phone { overflow: hidden; }
.phone-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; border-bottom: 1px solid var(--line); }
.head-text { flex: 1; min-width: 0; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #2C2C2A; background: var(--c); }
.who { font-weight: 800; }
.status { font-size: 13px; color: var(--muted); }

.thread { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.empty { margin: auto; text-align: center; color: var(--faint); font-size: 14px; max-width: 220px; }

.msg { display: flex; flex-direction: column; max-width: 82%; gap: 6px; }
.msg--out { align-self: flex-end; align-items: flex-end; }
.msg--in { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 8px 13px; border-radius: 18px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg--out .bubble { background: var(--out-bubble); color: var(--out-ink); border-bottom-right-radius: 6px; }
.msg--in .bubble { background: var(--in-bubble); color: var(--in-ink); border-bottom-left-radius: 6px; }
.kw { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.dbg { display: none; font-size: 12px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.show-debug .dbg { display: block; }

.ill {
  margin: 0;
  width: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
}
.ill--enter { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.ill svg { display: block; width: 100%; height: auto; }
.ill figcaption { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ill--pixel { border: 2px solid #FAC775; }
.ill--shiny { border: 2px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, linear-gradient(120deg, #F4C0D1, #FAC775, #9FE1CB, #CECBF6) border-box; }
.ill.replay { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.badge { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.badge--rare { background: #FAEEDA; color: #633806; }
.badge--shiny { background: #FBEAF0; color: #72243E; }
.badge--new { background: #E1F5EE; color: #085041; }

/* ---------- room ---------- */

.room { border-top: 1px solid var(--line); }
.room-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 0; }
.room-toggle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: transparent; padding: 5px 4px 5px 14px; cursor: pointer; text-align: left; }
.room-title { font-weight: 800; font-size: 13px; flex: none; }
.room-status { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-status--caption { color: var(--ink); }
.room-chev { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform 0.2s; }
.room--closed .room-chev { transform: rotate(180deg); }
.room-map { flex: none; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.room-map:hover { border-color: var(--accent); }
.room--closed .room-strip { display: none; }
.room-strip { height: var(--room-px, 128px); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
.room-strip > svg { display: block; }
.place-svg * { transform-box: view-box; }
.spot--found, .door, .souvenir { cursor: pointer; }
.souvenir * { animation: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Things in a place hold still until a word wakes them up. */
.spot:not(.spot--react) * { animation: none !important; }
.spot--new { animation: spot-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes spot-pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.spot--react:not(.spot--new) { animation: spot-hop 0.5s ease-in-out 3; }
@keyframes spot-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.06, 0.94); } 50% { transform: translateY(-6px) scale(0.97, 1.03); } }
.obj-spin { animation: spin 1.4s linear infinite; }
.door-glow { animation: door-glow 1.6s ease-in-out infinite; }
@keyframes door-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.resident { transition: transform 0.8s ease-in-out; }
.resident-body { animation: bob 2.8s ease-in-out infinite; }
.resident-body.resident--hop { animation: spot-hop 0.45s ease-in-out 2; }

/* The map: every place the chat has been, plus what's next. */
.map { display: flex; align-items: center; height: 100%; padding: 8px 14px; width: max-content; }
.map-node { width: 128px; flex: none; display: grid; gap: 2px; justify-items: start; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.map-node.is-here { border: 2px solid var(--accent); padding: 5px; }
.map-thumb { width: 100%; height: 44px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.map-thumb svg { width: 100%; height: 100%; display: block; }
.map-thumb svg * { animation: none !important; }
.is-locked .map-thumb { filter: grayscale(1); opacity: 0.45; }
.map-thumb--soon { display: grid; place-items: center; border: 1.5px dashed var(--faint); background: transparent; color: var(--faint); font-weight: 800; }
.map-name { font-weight: 800; font-size: 13px; line-height: 1.2; }
.map-meta { font-size: 11px; color: var(--muted); line-height: 1.25; }
.map-here { font-size: 11px; font-weight: 800; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 0 7px; }
.map-node .btn.small { padding: 1px 10px; font-size: 12px; }
.map-path { width: 26px; flex: none; border-top: 2px dashed var(--faint); }

/* Picking a souvenir to bring to the next place. */
.picker { height: 100%; display: flex; flex-direction: column; padding: 6px 0 4px; }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 0 12px 4px 14px; font-size: 12px; }
.picker-head b { flex: 1; min-width: 0; }
.picker-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 2px; flex: 1; scrollbar-width: thin; }
.pick { flex: none; width: 76px; display: grid; grid-template-rows: 1fr auto; gap: 2px; justify-items: center; align-content: stretch; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 5px 4px; cursor: pointer; font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; }
.pick:hover { border-color: var(--accent); }
.pick svg { width: 58px; height: 46px; }
.pick svg * { animation: none !important; }
.pick--skip { align-content: center; font-size: 13px; color: var(--muted); }
.pick--skip span { font-size: 10.5px; font-weight: 600; }

/* Postcards, in the chat and in the Collection tab. */
.postcard-msg { align-self: center; display: grid; gap: 6px; justify-items: center; width: 100%; }
.postcard { margin: 0; display: grid; gap: 6px; justify-items: center; }
.postcard svg { width: 100%; max-width: 300px; height: auto; display: block; border-radius: 10px; box-shadow: 0 1px 0 var(--line); }
.postcard svg * { animation: none !important; }
.postcards { display: grid; gap: 12px; }
.postcards .postcard svg { max-width: none; }

.sys { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 12px; text-align: center; }

.wx { display: none; }
.room[data-weather="day"] .wx-day, .room[data-weather="sun"] .wx-sun, .room[data-weather="rain"] .wx-rain,
.room[data-weather="snow"] .wx-snow, .room[data-weather="night"] .wx-night, .room[data-weather="rainbow"] .wx-rainbow { display: inline; }
.room .sky { transition: fill 0.6s; }
.room[data-weather="sun"] .sky { fill: #B5D4F4; }
.room[data-weather="rain"] .sky { fill: #B4B2A9; }
.room[data-weather="snow"] .sky { fill: #E6EEF6; }
.room[data-weather="night"] .sky { fill: #3C3489; }

.composer { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.msg--pending { opacity: 0.55; }
.composer input { flex: 1; min-width: 0; font-size: 16px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 10px 14px; outline: none; }
.composer input:focus { border-color: var(--accent); }
.send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.send svg { width: 18px; height: 18px; }

/* ---------- panel ---------- */

.scrim { position: fixed; inset: 0; background: rgba(20, 18, 30, 0.35); z-index: 19; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: calc(12px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom)); z-index: 20; }
.panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.panel-head .tabs { flex: 1; margin-bottom: 0; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.pane h2 { font-size: 14px; font-weight: 800; margin: 16px 0 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.slot { aspect-ratio: 8 / 7; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--faint); }
.slot svg { width: 100%; height: 100%; display: block; }
.slot svg * { animation: none !important; }
.slot--shiny { border: 2px solid #ED93B1; }

.word-form { display: grid; gap: 10px; }
.word-form label, .field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.word-form input, .word-form select, .field select, .field input, .stack textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-weight: 400; color: var(--ink); }
.field { margin-bottom: 12px; }
.error { color: var(--danger); font-size: 13px; margin: 0; min-height: 1em; }
.meter { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.word-list li { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 6px 6px 6px 12px; }
.word-list li span { flex: 1; min-width: 0; }
.word-list li em { font-style: normal; color: var(--muted); font-size: 13px; }

.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0 8px; }
.payload pre { background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.danger-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn.big { width: 100%; padding: 12px 18px; font-size: 16px; border-radius: 14px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.stack textarea { font: inherit; resize: vertical; }
.field input { font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; transform: translate(-50%, 40px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px)); text-align: center;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- illustration animation ---------- */

.ill svg * { transform-box: view-box; }

@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.blob-bob { animation: bob 2.6s ease-in-out infinite; transform-origin: 80px 126px; }
@keyframes bob { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 0.97); } }
.blink { animation: blink 4.2s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.arm-wave { animation: wave 1.2s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(22deg); } }
.arm-cheer { animation: cheer 0.9s ease-in-out infinite; }
@keyframes cheer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.fx-float { animation: float-up 2.6s ease-in infinite; }
@keyframes float-up { 0% { transform: translateY(4px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-12px); opacity: 0; } }
.fx-twinkle { animation: twinkle 1.8s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(0.5); opacity: 0.4; } 50% { transform: scale(1.1); opacity: 1; } }
.fx-steam { animation: steam 1.8s ease-in-out infinite; }
@keyframes steam { 0% { opacity: 0; transform: translateY(3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
.fx-flicker { animation: flicker 0.4s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(0.85, 1.15); } }
.fx-drip { animation: drip 1.6s ease-in infinite; }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
.fx-pulse { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.fx-slide { animation: slide 0.7s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-6px); opacity: 0.5; } }
.fx-bob { animation: tiny-bob 1.4s ease-in-out infinite; }
@keyframes tiny-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.fx-shake { animation: shake 0.5s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.fx-fall { animation: fall 2.4s linear infinite; }
@keyframes fall { 0% { transform: translateY(-6px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.fx-rain { animation: rain 0.7s linear infinite; }
@keyframes rain { from { transform: translateY(-4px); opacity: 1; } to { transform: translateY(8px); opacity: 0; } }
.fx-spin { animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fx-fly { animation: fly 3s ease-in-out infinite; }
@keyframes fly { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4px, -3px); } }
.fx-buzz { animation: buzz 0.25s linear infinite; }
@keyframes buzz { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1px); } }
.fx-burst { animation: burst 1.8s ease-out infinite; }
@keyframes burst { 0% { transform: scale(0.2); opacity: 0; } 20% { opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.fx-sway { animation: sway 2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* Pixel collectibles move in hard steps, like an old handheld. */
.px-bob { animation: px-bob 0.9s steps(1) infinite; }
@keyframes px-bob { 0% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.px-float { animation: px-float 1.6s steps(1) infinite; }
@keyframes px-float { 0% { transform: translateY(0); } 25% { transform: translateY(-3px); } 50% { transform: translateY(-6px); } 75% { transform: translateY(-3px); } }
.px-pulse { animation: px-pulse 0.8s steps(1) infinite; transform-origin: 80px 66px; }
@keyframes px-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.09); } }
.px-wiggle { animation: px-wiggle 0.8s steps(1) infinite; transform-origin: 80px 120px; }
@keyframes px-wiggle { 0% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.px-shake { animation: px-shake 0.3s steps(1) infinite; }
@keyframes px-shake { 0% { transform: translate(-1px, 0); } 50% { transform: translate(1px, -2px); } }
.px-flame { animation: px-flame 0.5s steps(1) infinite; transform-origin: 80px 120px; }
@keyframes px-flame { 0% { transform: scale(1, 1); } 50% { transform: scale(0.94, 1.08); } }
.pxfx-flicker { animation: pxfx-flicker 0.5s steps(1) infinite; }
@keyframes pxfx-flicker { 0% { opacity: 1; } 50% { opacity: 0.25; } }
.pxfx-blink { animation: pxfx-blink 3s steps(1) infinite; }
@keyframes pxfx-blink { 0% { opacity: 0; } 90% { opacity: 1; } 96% { opacity: 0; } }
.px-twinkle { animation: pxfx-flicker 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  .ill, .ill *, .place-svg, .place-svg * { animation: none !important; }
  .room .sky, .resident { transition: none; }
}
