/* ==========================================================================
   Avatar Palace - Claude redesign ("Daylight")
   A light, daytime take on the Palace: the red AVP logo sets the one strong
   colour, the soft tints come from the room art, and doorways and speech
   balloons are the recurring shapes.
   Plain CSS, no build step. Edit this file directly.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;

  --page: #fbfaff;            /* page background: daylight white with a hint of lilac */
  --surface: #ffffff;         /* cards and panels */
  --surface-soft: #f6f4fc;    /* quiet side panels */
  --ink: #221b3d;             /* text and outlines: deep plum, never pure black */
  --ink-soft: #55506e;        /* secondary text */
  --line: rgba(34, 27, 61, .14);
  --shade: rgba(34, 27, 61, .16);  /* the "thickness" under raised panels */

  --red: #c4161f;             /* from the AVP logo; white text on it passes contrast */
  --red-bright: #d21c26;
  --red-deep: #8f0d15;
  --focus: #2747d8;

  /* Soft tints taken from the room art */
  --sky: #e1e8fc;    --sky-deep: #c5d2f7;     /* Mall Arch */
  --lilac: #f3e3fa;  --lilac-deep: #e3c8f1;   /* Unique Pagent */
  --aqua: #d6f3f4;   --aqua-deep: #b3e6ea;    /* Adoption Center */
  --sun: #fff1cc;    --sun-deep: #ffd97a;
  --peach: #ffe6dc;
  --plate: #fdf1e2;           /* matches the background baked into history-computer.png */

  --font-display: "Trebuchet MS", "Lucida Grande", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ui: Verdana, Tahoma, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  /* The hero takes its tint from whichever room is showing */
  --tint: var(--sky);
  --tint-deep: var(--sky-deep);
}

#avatar-palace-page[data-room="jail"] { --tint: #e4e6ee; --tint-deep: #cdd1dc; }   /* Badboy Jail: you only get here by swearing at RatBot */
#avatar-palace-page[data-room="pagent"] { --tint: var(--lilac); --tint-deep: var(--lilac-deep); }
#avatar-palace-page[data-room="adoption"] { --tint: var(--aqua); --tint-deep: var(--aqua-deep); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#avatar-palace-page { min-height: 100vh; isolation: isolate; overflow-x: clip; background: var(--page); color: var(--ink); }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

img { max-width: 100%; vertical-align: middle; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
}

a { color: inherit; text-underline-offset: 4px; }
button, input, summary { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#main:focus, [tabindex="-1"]:focus { outline: none; }

.container { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  transform: translateY(-200%);
  padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 700;
}
.skip-link:focus { transform: none; }

/* Small label above headings. The red diamond is one facet of the logo. */
.eyebrow {
  font: 700 12px/1.4 var(--font-ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  background: var(--red);
  transform: translateY(-1px) rotate(45deg);
}

.helper { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.helper a { color: var(--ink); }

/* Text link with a red underline and an arrow */
.arrow-link {
  display: inline-block;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.arrow-link::after { content: " \2192"; white-space: nowrap; }
@media (max-width: 640px) { .arrow-link { padding-block: 3px; } }   /* a little taller, so it is easier to tap on a phone */
/* On a phone the address row takes the card's full width, so the whole address can be read */
@media (max-width: 640px) { .steps .step > .copy-row { grid-column: 1 / -1; justify-self: stretch; max-width: none; margin-top: 6px; } .steps .step-number { grid-row: 1 / span 2; } }
.arrow-link:hover { color: var(--red-deep); }

/* ---------- 3. Buttons: raised tiles that press down ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  padding: 12px 28px;
  border: 2px solid var(--red-deep);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 700 16px/1.2 var(--font-body);
  text-align: center; text-decoration: none;
  box-shadow: 0 4px 0 var(--red-deep);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.button:hover { background: var(--red-bright); transform: translateY(-1px); box-shadow: 0 5px 0 var(--red-deep); }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }

.button-quiet { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.button-quiet:hover { background: var(--surface-soft); box-shadow: 0 5px 0 var(--ink); }
.button-quiet:active { box-shadow: 0 1px 0 var(--ink); }

.button-light { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.button-light:hover { background: var(--sun); box-shadow: 0 5px 0 var(--ink); }
.button-light:active { box-shadow: 0 1px 0 var(--ink); }

.button-small { min-height: 42px; padding: 8px 18px; font-size: 14px; box-shadow: 0 3px 0 var(--red-deep); }
.button-small:hover { box-shadow: 0 4px 0 var(--red-deep); }
.button-quiet.button-small { box-shadow: 0 3px 0 var(--ink); }
.button-quiet.button-small:hover { box-shadow: 0 4px 0 var(--ink); }

.text-button {
  min-height: 42px; padding: 8px 2px;
  border: 0; background: none;
  font-size: 14px; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.text-button:hover { color: var(--red-deep); }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 66px; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; }
/* Shown at its real size. The filter only hides the cream background baked into the file. */
.brand-logo { width: 106px; height: 47px; flex: none; filter: url(#avp-key); }
.brand-name { font: 700 23px/1.1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.brand-name small { display: block; margin-top: 5px; font: 400 12px/1.3 var(--font-ui); letter-spacing: 0; color: var(--ink-soft); }

.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; white-space: nowrap; }
.site-nav a { padding: 9px 13px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; }
.site-nav a:hover { background: rgba(34, 27, 61, .07); }

.mobile-menu { display: none; position: relative; margin-left: auto; }
.mobile-menu summary {
  list-style: none;
  padding: 9px 18px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--surface); font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 0 var(--ink);
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { transform: translateY(3px); box-shadow: none; background: var(--sun); }
.mobile-menu nav {
  position: absolute; right: 0; top: 54px; z-index: 60;
  width: 230px; padding: 8px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 18px;
  box-shadow: 0 6px 0 var(--shade);
}
.mobile-menu nav a { display: block; padding: 12px 14px; border-radius: 12px; font-weight: 600; text-decoration: none; }
.mobile-menu nav a:hover { background: var(--surface-soft); }
.mobile-menu nav .menu-enter { margin-top: 6px; background: var(--red); color: #fff; text-align: center; font-weight: 700; }
.mobile-menu nav .menu-enter:hover { background: var(--red-bright); }

/* ---------- 5. Hero: the doorway and the room ---------- */
.hero { padding-top: 16px; }

/* A wide archway, tinted by the room you are looking at */
.gate {
  position: relative;
  padding: 48px 32px 34px;
  text-align: center;
  background-color: var(--tint);
  border-radius: 50% 50% 36px 36px / 180px 180px 36px 36px;
  transition: background-color .5s ease;
}
.gate::before {
  content: "";
  position: absolute; inset: 12px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: inherit;
  pointer-events: none;
}
.gate-copy { position: relative; }

.gate h1 { margin: 10px auto 0; font-size: clamp(34px, 4.3vw, 52px); line-height: 1.06; }
.h1-accent { display: block; color: var(--red); }
.lede { max-width: 44em; margin: 12px auto 0; font-size: 18px; line-height: 1.5; color: var(--ink-soft); text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 20px; }

.stage { position: relative; margin-top: 28px; }

/* The Palace window */
.window {
  width: fit-content; max-width: 100%;
  margin-inline: auto;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 8px 0 var(--shade);
  overflow: hidden;
}

.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-bottom: 2px solid var(--ink);
  font: 700 12px/1.3 var(--font-ui);
}
.window-icon { width: 22px; height: 22px; flex: none; border-radius: 50%; object-fit: cover; }
.window-room { font-weight: 400; }
.window-room::before { content: "\203A"; margin-right: 8px; color: var(--ink-soft); }
.window-tag {
  margin-left: auto; padding: 3px 10px; border-radius: 999px;
  background-color: var(--tint);
  font-weight: 400; font-size: 11px; white-space: nowrap;
  transition: background-color .5s ease;
}

.window-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 512px) 218px;
  grid-template-areas: "rooms room bag";
}

/* Room list */
.rooms-rail { grid-area: rooms; padding: 9px 9px 6px; background: var(--surface-soft); border-right: 2px solid var(--ink); }
.rail-label { font: 700 11px/1.3 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.rooms-rail .rail-label { padding-left: 5px; }
.room-choices { display: grid; gap: 4px; margin-top: 6px; }
.room-choice {
  display: grid; gap: 3px;
  padding: 4px 4px 3px;
  border: 2px solid transparent; border-radius: 12px;
  background: transparent;
  text-align: left; font: 600 12px/1.35 var(--font-body);
  transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease;
}
.room-choice img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 7px; border: 1px solid var(--line); }
.room-choice span { padding-left: 2px; }
.room-choice:hover { background: var(--surface); border-color: var(--line); }
.room-choice[aria-pressed="true"] { background: var(--surface); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.room-choice:focus-visible { outline-offset: 1px; }

/* The room itself. Never wider than the art's real 512 pixels. */
.room-wrap { grid-area: room; display: flex; align-items: flex-start; justify-content: center; background: var(--surface-soft); }
.room { position: relative; isolation: isolate; overflow: hidden; flex: none; width: 100%; max-width: 512px; aspect-ratio: 4 / 3; background: var(--surface-soft); }
.backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.layer { position: absolute; display: block; pointer-events: none; }
.sprite, .face, .prop-on, .rat-entry img, .story-actor img, .bag-who img, .prop-art img { image-rendering: pixelated; }

.room button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; border-radius: 6px; }

.room-btn { position: absolute; border: 0; background: none; padding: 0; line-height: 0; }
.room-btn img { display: block; width: 100%; height: auto; }

.gift { left: 41.1%; top: 82.7%; width: 10.5%; aspect-ratio: 113 / 110; }
.gift::after { content: ""; position: absolute; inset: -7px; }
.gift .base, .gift .lid { position: absolute; left: 0; width: 100%; height: auto; }
.gift .base { top: 49.09%; }
.gift .lid { top: 0; transform-origin: 20% 90%; transition: transform .28s ease-out; }
.gift:not(.opened) .lid { animation: lid-hop 5s ease-in-out 2s infinite; }
.gift:hover .lid { animation: none; transform: rotate(-6deg) translateY(-4%); }
.gift.opened .lid { animation: none; transform: translate(-23%, -37%) rotate(-24deg); }

.bubble { left: 56.4%; top: 71.8%; width: 24%; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4)); transition: transform .15s ease; }
.bubble:hover { transform: translateY(-2px) rotate(-2deg); }

.player, .rat-entry { position: absolute; width: 8.59375%; aspect-ratio: 1; }
.player { left: 50.391%; top: 83.854%; pointer-events: none; }
.face { display: block; width: 100%; height: auto; }
.prop-on { position: absolute; height: auto; }
.beanie-on { width: 81.818%; left: 0; top: -29.545%; }
.specs-on { width: 72.727%; left: 9.091%; top: 20.455%; }
.rat-entry .dunce-on { width: calc(100% * 29 / 44); left: calc(100% * 12 / 44); top: calc(100% * -15 / 44); }   /* the cap at its real size (29 of RatBot's 44 pixels), resting on the top of his head: 12 pixels in, 15 up */
.rat-entry { left: 63.965%; top: 63.672%; border: 0; background: none; padding: 0; }
.rat-entry::after { content: ""; position: absolute; inset: -10px; }
.rat-entry img { width: 100%; height: auto; }
.rat-entry:hover { filter: brightness(1.12); }
.spark { animation: wear .28s ease-out; }

/* Pinned in Badboy Jail. The chains are a simple stand-in drawing until the real pin prop is added. */
.pin-chains {
  position: absolute; inset: -9%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cdefs%3E%3Cg id='k'%3E%3Cellipse cx='-18' rx='5.2' ry='3'/%3E%3Cellipse cx='-9' rx='5.2' ry='3'/%3E%3Cellipse rx='5.2' ry='3'/%3E%3Cellipse cx='9' rx='5.2' ry='3'/%3E%3Cellipse cx='18' rx='5.2' ry='3'/%3E%3C/g%3E%3C/defs%3E%3Cg fill='none'%3E%3Cg stroke='%2326262b' stroke-width='3.2'%3E%3Cuse href='%23k' transform='translate(26 26) rotate(45)'/%3E%3Cuse href='%23k' transform='translate(26 26) rotate(-45)'/%3E%3C/g%3E%3Cg stroke='%23c9ccd4' stroke-width='1.3'%3E%3Cuse href='%23k' transform='translate(26 26) rotate(45)'/%3E%3Cuse href='%23k' transform='translate(26 26) rotate(-45)'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
.room.is-jail > .sprite, .room.is-jail .gift, .room.is-jail .bubble { visibility: hidden; }
.room.is-jail .player { left: 32.7%; top: 54.3%; }    /* inside the cell, behind the bars */
[data-pinned] .prop:disabled, [data-pinned] .room-choice:disabled, [data-pinned] .postcard:disabled { opacity: .5; }

/* RatBot's expressions. He has one picture, so each mood is a set of marks drawn over and beside it:
   cross = slanted brows and a red anger mark, pleased = sparkles, flustered = worried brows and sweat drops.
   His picture stays 44 by 44. The marks are drawn in a slightly bigger box (56 by 60, reaching 16 above his head
   and 12 to his right), so they can be large enough to see without changing his size.
   These are stand-ins until there is real expression art. */
#avatar-palace-page {
  --face-mad: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -16 56 60' fill='none'%3E%3Cpath d='M15 9l11 6M36 9l-9 6' stroke='%23111' stroke-width='3.2' shape-rendering='crispEdges'/%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M39-13v4q0 2.5-2.5 2.5h-4M44-13v4q0 2.5 2.5 2.5h4M39 5v-4q0-2.5-2.5-2.5h-4M44 5v-4q0-2.5 2.5-2.5h4' stroke='%23221b3d' stroke-width='5.8'/%3E%3Cpath d='M39-13v4q0 2.5-2.5 2.5h-4M44-13v4q0 2.5 2.5 2.5h4M39 5v-4q0-2.5-2.5-2.5h-4M44 5v-4q0-2.5 2.5-2.5h4' stroke='%23e3212c' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
  --face-pleased: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -16 56 60' fill='%23ffd23f' stroke='%23221b3d' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M42-14l2.9 7.1 7.1 2.9-7.1 2.9-2.9 7.1-2.9-7.1-7.1-2.9 7.1-2.9z'/%3E%3Cpath d='M27-14l1.5 3.5 3.5 1.5-3.5 1.5-1.5 3.5-1.5-3.5-3.5-1.5 3.5-1.5z'/%3E%3Cpath d='M50 8.5l1 2.5 2.5 1-2.5 1-1 2.5-1-2.5-2.5-1 2.5-1z'/%3E%3C/svg%3E");
  --face-flustered: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -16 56 60'%3E%3Cpath d='M17 14l8-3M35 14l-7-3' stroke='%23111' stroke-width='2.8' fill='none' shape-rendering='crispEdges'/%3E%3Cg fill='%235aa9f2' stroke='%23221b3d' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44-14c3.9 6 6 9.4 6 12.4a6 6 0 0 1-12 0c0-3 2.1-6.4 6-12.4z'/%3E%3Cpath d='M30-13c1.9 3 3 4.7 3 6.2a3 3 0 0 1-6 0c0-1.5 1.1-3.2 3-6.2z'/%3E%3C/g%3E%3Cpath d='M40.9-1.2a3.2 3.2 0 0 0 2 2.9' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rat-entry::before, .ratchat-portrait::after, .msg-face::after, .rat-launcher-face::after {
  content: "";
  position: absolute; z-index: 1;
  background: center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  transform-origin: 75% 20%;
}
.rat-entry::before { left: 0; top: -36.36%; width: 127.27%; height: 136.36%; }   /* the same box, as a share of his size in the room */
#avatar-palace-page[data-rat="mad"] .rat-entry::before,
#avatar-palace-page[data-rat="mad"] .ratchat-portrait::after,
#avatar-palace-page[data-rat="mad"] .rat-launcher-face::after,
.msg.is-mad .msg-face::after { background-image: var(--face-mad); opacity: 1; }
#avatar-palace-page[data-rat="pleased"] .rat-entry::before,
#avatar-palace-page[data-rat="pleased"] .ratchat-portrait::after,
#avatar-palace-page[data-rat="pleased"] .rat-launcher-face::after,
.msg.is-pleased .msg-face::after { background-image: var(--face-pleased); opacity: 1; }
#avatar-palace-page[data-rat="flustered"] .rat-entry::before,
#avatar-palace-page[data-rat="flustered"] .ratchat-portrait::after,
#avatar-palace-page[data-rat="flustered"] .rat-launcher-face::after,
.msg.is-flustered .msg-face::after { background-image: var(--face-flustered); opacity: 1; }
#avatar-palace-page[data-rat="mad"] .rat-entry, .msg.is-mad .msg-face { animation: rat-shake .35s ease-in-out 3; }
.msg.is-pleased .msg-face { animation: wear .35s ease-out; }
/* The marks pop in, so a change of mood catches the eye. Each mood has its own copy of the same little
   animation, so that going straight from one mood to another plays it again. */
#avatar-palace-page[data-rat="mad"] .rat-entry::before,
#avatar-palace-page[data-rat="mad"] .ratchat-portrait::after,
.msg.is-mad .msg-face::after { animation: mood-pop-mad .32s ease-out; }
#avatar-palace-page[data-rat="pleased"] .rat-entry::before,
#avatar-palace-page[data-rat="pleased"] .ratchat-portrait::after,
.msg.is-pleased .msg-face::after { animation: mood-pop-pleased .32s ease-out; }
#avatar-palace-page[data-rat="flustered"] .rat-entry::before,
#avatar-palace-page[data-rat="flustered"] .ratchat-portrait::after,
.msg.is-flustered .msg-face::after { animation: mood-pop-flustered .32s ease-out; }
/* The sky behind his portrait changes with his mood as well */
#avatar-palace-page[data-rat="mad"] .ratchat-portrait { background: linear-gradient(180deg, #f0766c 0%, #fde3de 100%); }
#avatar-palace-page[data-rat="pleased"] .ratchat-portrait { background: linear-gradient(180deg, #6fd3a8 0%, #e8f9f0 100%); }
#avatar-palace-page[data-rat="flustered"] .ratchat-portrait { background: linear-gradient(180deg, #b9a6f0 0%, #f1ecff 100%); }

/* Prop bag and guide */
.bag { grid-area: bag; display: flex; flex-direction: column; border-left: 2px solid var(--ink); background: var(--surface); }
.bag-props { flex: 1; padding: 9px 14px 7px; }
.bag-guide { padding: 9px 14px 12px; border-top: 2px dashed var(--line); background: var(--surface-soft); }
.bag-who { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.bag-who img { width: 44px; height: 44px; flex: none; }   /* both smileys are always 44 by 44 */

.props { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.prop {
  display: grid; justify-items: center; gap: 1px;
  padding: 7px 4px 6px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 3px 0 var(--ink);
  font: 700 13px/1.25 var(--font-body);
  transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease;
}
.prop-art { display: grid; place-items: center; height: 42px; }
.prop[data-prop="specs"] .prop-art img { width: 64px; height: 30px; }    /* exactly 2x */
.prop[data-prop="beanie"] .prop-art img { width: 72px; height: 38px; }   /* exactly 2x */
.prop:hover { background: var(--surface-soft); }
.prop[aria-pressed="true"] { background: var(--sun); transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.wear-state { font: 400 11px/1.3 var(--font-body); color: var(--ink-soft); }
.prop[aria-pressed="true"] .wear-state { color: var(--red-deep); font-weight: 700; }

.bag-foot { margin-top: 6px; }
.reset { min-height: 30px; padding: 4px 0; border: 0; background: none; font-size: 12px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.reset:disabled { color: var(--ink-soft); text-decoration: none; font-weight: 400; }
.bag-note { font-size: 11px; line-height: 1.4; color: var(--ink-soft); }
.bag-guide .button { width: 100%; margin-top: 9px; }
.bag.is-open .bag-props { animation: bag-glow 1.1s ease-out; }

.window-status { display: flex; align-items: center; min-height: 42px; padding: 9px 14px; border-top: 2px solid var(--ink); font-size: 14px; line-height: 1.4; }
.status-message::before { content: "\2726"; margin-right: 8px; color: var(--red); }

.stage-caption { position: relative; max-width: 60em; margin: 22px auto 0; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.stage-caption a { color: var(--ink); font-weight: 600; white-space: nowrap; }
.no-js { max-width: 40em; margin: 12px auto 0; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); font-size: 14px; }

/* ---------- 6. Sections ---------- */
.section { padding-top: 96px; }
.section h2 { margin-top: 12px; font-size: clamp(30px, 3.5vw, 44px); }
.section-head { max-width: 760px; }
.section-lede { max-width: 34em; margin-top: 14px; font-size: 18px; line-height: 1.55; color: var(--ink-soft); }
.section-more { margin-top: 28px; }
.section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 26px; }

/* A raised card: ink outline with a soft slab underneath */
.trio-card, .step, .member-rooms {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--shade);
}

/* This is Palace */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.trio-card { padding: 14px 14px 24px; }
.trio-card h3 { margin: 20px 8px 0; font-size: 24px; }
.trio-card p { margin: 8px 8px 0; color: var(--ink-soft); }
.trio-art { display: flex; align-items: flex-end; justify-content: center; height: 180px; border-radius: 12px; overflow: hidden; }
.trio-art-room { background: var(--aqua); align-items: center; }
.trio-art-room img { width: auto; height: 100%; }
.trio-art-faces { gap: 12px; padding: 0 12px 14px; background: var(--lilac); }
.trio-art-faces img { flex: 0 1 auto; min-width: 0; height: auto; }
.trio-art-talk { justify-content: center; gap: 26px; padding: 0 16px 22px; background: var(--sun); }
.talker { display: grid; justify-items: start; gap: 12px; }
.talker img { width: 44px; height: 44px; }
.talker-right { justify-items: end; margin-bottom: 34px; }

/* Speech balloon, as in a Palace room */
.speech {
  position: relative;
  padding: 6px 13px 7px;
  border: 2px solid var(--ink); border-radius: 16px;
  background: #fff;
  font: 700 14px/1.2 var(--font-display);
  white-space: nowrap;
}
.speech::after {
  content: "";
  position: absolute; left: 14px; bottom: -7px;
  width: 10px; height: 10px;
  background: #fff;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.talker-right .speech::after { left: auto; right: 14px; }

/* How to join */
.join-panel { padding: 52px 48px 54px; border-radius: 36px; background: var(--sun); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 34px; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 22px 24px; box-shadow: 0 6px 0 var(--sun-deep); }
.step-number {
  display: grid; place-items: center;
  width: 42px; height: 42px; margin-bottom: 6px;
  border-radius: 50%;
  background: var(--red); color: #fff;
  font: 700 19px/1 var(--font-display);
}
.step h3 { font-size: 22px; }
.step p { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.step > .arrow-link, .step > .button { margin-top: auto; }
.step > .button + .arrow-link { margin-top: 8px; font-size: 14px; }
.step > p + .arrow-link, .step > p + .button { padding-top: 0; }
.step .helper { font-size: 13px; }

/* The address must always be readable in full. Where the card is too narrow for the address and the button
   side by side, the button drops underneath. */
.copy-row { display: flex; flex-wrap: wrap; width: 100%; margin-top: 4px; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; }
.copy-row input { flex: 100 1 212px; width: 0; min-width: 0; padding: 10px 4px 10px 10px; border: 0; background: #fff; color: var(--ink); font: 13px/1.4 var(--font-mono); letter-spacing: -.01em; }
.copy-button { flex: 1 0 auto; min-height: 44px; padding: 0 13px; border: 0; border-left: 2px solid var(--ink); background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.copy-button:hover { background: #3b3263; }
.copy-row :focus-visible { outline-offset: -3px; }
.copy-row .copy-button:focus-visible { outline-color: #fff; }

/* Three Doors: three real door shapes */
.doors .section-head { max-width: none; }
.doors-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 40px; }
.door {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  min-height: 450px;
  padding: 40px 42px 34px;
  text-align: center;
  background: var(--door, var(--sky));
  border: 2px solid var(--ink);
  border-radius: 50% 50% 22px 22px / 170px 170px 22px 22px;
  box-shadow: 0 8px 0 var(--shade);
  transition: transform .18s ease, box-shadow .18s ease;
}
.door::before {
  content: "";
  position: absolute; inset: 10px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: inherit;
  pointer-events: none;
}
.door::after {   /* door knob */
  content: "";
  position: absolute; right: 22px; top: 58%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .8);
  pointer-events: none;
}
.door-original { --door: var(--peach); }
.door-retro { --door: var(--lilac); }
.door-new { --door: var(--aqua); }
.door:hover { transform: translateY(-6px); box-shadow: 0 14px 0 var(--shade); }
.door:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }

.door-number {
  position: relative;
  display: grid; place-items: center;
  width: 54px; height: 54px; margin-top: 14px;
  border: 2px solid var(--ink); border-radius: 50%;
  background: #fff;
  font: 700 15px/1 var(--font-ui); letter-spacing: .04em;
}
.door h3 { position: relative; margin-top: 22px; font-size: 36px; }
.door-strap { position: relative; margin-top: 10px; font-weight: 700; font-size: 17px; line-height: 1.35; }
.door p:not(.door-strap) { position: relative; margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.door-link {
  margin-top: auto;
  padding: 9px 18px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.3; text-decoration: none;
}
.door-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* whole door is clickable */
.door-link:focus-visible { outline: none; }
.door:hover .door-link { background: var(--ink); color: #fff; }
.door p + .door-link { margin-top: auto; }
.door p:last-of-type { margin-bottom: 22px; }

/* Community and member rooms */
.community-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.member-rooms { padding: 24px 26px 22px; border-radius: 24px; box-shadow: 0 8px 0 var(--shade); }
.member-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.member-head h3 { font-size: 24px; }
.member-head .arrow-link { font-size: 14px; }
.postcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 20px; }
.postcard {
  display: block; width: 100%; padding: 6px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  line-height: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.postcard img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 7px; }
.postcard-wrap:nth-child(odd) .postcard { transform: rotate(-1.5deg); }
.postcard-wrap:nth-child(even) .postcard { transform: rotate(1.5deg); }
.postcard-wrap .postcard:hover { transform: translateY(-3px) rotate(0deg); box-shadow: 0 7px 0 var(--ink); }
.postcard-wrap .postcard:active { transform: translateY(3px) rotate(0deg); box-shadow: 0 1px 0 var(--ink); }
.postcards figcaption { margin-top: 14px; text-align: center; font: 700 15px/1.3 var(--font-display); }
.member-rooms > .helper { margin-top: 14px; text-align: center; }

/* Seasonal rooms: early evening, not night */
.seasonal-panel {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: center;
  padding: 52px 48px;
  border-radius: 36px;
  background: linear-gradient(115deg, #e9e4fb 0%, #f5e2f3 55%, #ffe8d4 100%);
}
.seasonal-copy, .seasonal-action { position: relative; }
.seasonal-action .helper { margin-top: 14px; }

/* The song player. It plays only when the visitor presses play.
   The only song is the holiday track, which is Christmas-only, so the holder is hidden until section 17 shows it. */
.palace-tracks { grid-column: 1 / -1; display: none; gap: 18px; }
.palace-track { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding: 18px 20px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.palace-track-mark { display: flex; align-items: flex-end; gap: 3px; width: 36px; height: 32px; }
.palace-track-mark i { flex: 1; height: 35%; border-radius: 2px; background: var(--red); transform-origin: bottom; }
.palace-track-mark i:nth-child(2) { height: 75%; }
.palace-track-mark i:nth-child(3) { height: 50%; }
.palace-track-mark i:nth-child(4) { height: 100%; }
.palace-track-mark i:nth-child(5) { height: 60%; }
.palace-track.is-playing .palace-track-mark i { animation: track-bar .7s ease-in-out infinite alternate; }
.palace-track.is-playing .palace-track-mark i:nth-child(2) { animation-delay: -.25s; }
.palace-track.is-playing .palace-track-mark i:nth-child(3) { animation-delay: -.5s; }
.palace-track.is-playing .palace-track-mark i:nth-child(4) { animation-delay: -.1s; }
.palace-track.is-playing .palace-track-mark i:nth-child(5) { animation-delay: -.4s; }
.palace-track-copy { display: grid; gap: 1px; min-width: 0; }
.palace-track-copy small { font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.palace-track-copy strong { font: 700 22px/1.2 var(--font-display); letter-spacing: -.01em; }
.palace-track-copy em { font-style: normal; font-size: 14px; color: var(--ink-soft); }
.palace-track-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 9px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 var(--ink); font: 700 15px/1.2 var(--font-body); transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.palace-track-toggle:hover { background: var(--sun-deep); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.palace-track-toggle:active, .palace-track-toggle[aria-pressed="true"] { background: var(--sun-deep); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.palace-track-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.palace-track-progress input { flex: 1; min-width: 0; height: 28px; margin: 0; accent-color: var(--red); }
.palace-track-progress time { flex: none; font: 600 13px/1 var(--font-mono); color: var(--ink-soft); }
.palace-track-note { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
@keyframes track-bar { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
@media (max-width: 640px) {
  .palace-track { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .palace-track-toggle { grid-column: 1 / -1; }
}
.twinkle { position: absolute; color: #f0ad2e; line-height: 1; animation: twinkle 3.6s ease-in-out infinite; pointer-events: none; }
.twinkle-a { right: 7%; top: 16%; font-size: 30px; }
.twinkle-b { right: 31%; top: 12%; font-size: 20px; animation-delay: -1.2s; }
.twinkle-c { right: 15%; bottom: 14%; font-size: 16px; animation-delay: -2.4s; }

/* Museum and history */
.history-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 64px; align-items: center; }
.history-plate {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--plate);
  border: 2px solid var(--ink); border-radius: 24px;
  box-shadow: 0 8px 0 var(--shade);
  transform: rotate(-2deg);
}
/* Real size. The art is cropped top and bottom in the file, so those edges fade into the plate. */
.history-plate img {
  width: 203px; height: 104px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.link-list { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 22px; }
.history-copy > .helper { margin-top: 14px; }

/* Neighbours */
.neighbours-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.neighbours h2 { font-size: clamp(28px, 3vw, 38px); }

/* Drop zone: a dashed tray, like a Palace drop room, holding neighbours' banners instead of props */
.drop-zone { padding: 18px 20px 18px; border: 2px dashed var(--ink); border-radius: 22px; background: var(--surface-soft); }
.drop-zone-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.drop-zone-sign { padding: 5px 13px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); font-size: 13px; font-weight: 700; line-height: 1.3; }
.drop-zone-list { display: grid; gap: 10px; margin-top: 14px; }
.banner-prop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.banner-prop:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.banner-prop:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.banner-frame { flex: none; line-height: 0; }
.banner-frame img { display: block; width: 150px; height: 40px; image-rendering: pixelated; }   /* the banner's real size */
.banner-text { display: grid; gap: 2px; }
.banner-text strong { font: 700 20px/1.2 var(--font-display); letter-spacing: -.01em; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.banner-text span { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.banner-text span::after { content: " \2197"; }
.drop-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 18px; }
.drop-slot-box { flex: none; display: grid; place-items: center; width: 150px; height: 40px; border: 2px dashed rgba(34, 27, 61, .45); border-radius: 6px; font: 700 11px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.drop-slot p { flex: 1 1 180px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.drop-slot a { color: var(--ink); font-weight: 600; }
.drop-zone-note { margin-top: 12px; }

/* One last door, in the logo's red */
.closing-door {
  position: relative;
  max-width: 760px; margin-inline: auto;
  padding: 100px 32px 68px;
  text-align: center;
  background: var(--red); color: #fff;
  border: 2px solid var(--ink); border-bottom: 0;
  border-radius: 50% 50% 0 0 / 230px 230px 0 0;
}
.closing-door::before {
  content: "";
  position: absolute; inset: 12px 12px 0;
  border: 2px solid rgba(255, 255, 255, .45); border-bottom: 0;
  border-radius: inherit;
  pointer-events: none;
}
.closing-door .eyebrow { position: relative; color: #fff; }
.closing-door .eyebrow::before { background: #fff; }
.closing-door h2 { position: relative; font-size: clamp(34px, 4.4vw, 54px); }
.closing-door .button { position: relative; margin-top: 30px; }
.closing-door :focus-visible { outline-color: #fff; }

/* ---------- 7. Footer ---------- */
.footer { position: relative; padding: 30px 0 118px; background: var(--surface); border-top: 2px solid var(--ink); }   /* bottom space keeps the last line clear of RatBot's button */
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; }
.footer nav a { padding: 8px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; }
.footer nav a:hover { background: rgba(34, 27, 61, .07); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.footer-bottom small { font-size: 12px; line-height: 1.5; }
.motion-toggle { flex: none; min-height: 42px; padding: 8px 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.motion-toggle:disabled { color: var(--ink-soft); text-decoration: none; }

/* ---------- 8. RatBot story window ---------- */
.story:not([open]) { display: none; }   /* an older browser that does not know <dialog> would otherwise show it in the page */
.story {
  width: min(516px, calc(100vw - 24px));   /* room art stays at 512 or smaller */
  max-height: calc(100vh - 24px);          /* for browsers without dvh; the next line replaces it where dvh is known */
  max-height: calc(100dvh - 24px);
  padding: 0; overflow: auto;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 0 8px 0 var(--shade);
}
.story::backdrop { background: rgba(246, 244, 252, .86); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.story-title { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; background: var(--surface); border-bottom: 2px solid var(--ink); font: 700 12px/1.3 var(--font-ui); }
.story-title button { margin-left: auto; min-height: 34px; padding: 5px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font: 700 12px/1.2 var(--font-body); }
.story-title button:hover { background: var(--sun); }
.story-scene { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-soft); border-bottom: 2px solid var(--ink); }
.story-back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* The unmasking, staged like the original Palace box: sky, clouds, a suit, and a smiley being lifted off.
   The drawing is 170 by 128 units, so at full size one unit is 3 pixels and the sprites sit at exactly 3x. */
.box-stage { position: absolute; inset: 0; background: linear-gradient(180deg, #86b4f2 0%, #bcd6f9 58%, #e8f1fe 100%); }
.box-art { display: block; width: 100%; height: 100%; }
.box-art image { image-rendering: pixelated; }
.box-art .cloud { fill: #fff; }
.box-art .suit { fill: #232845; }
.box-art .lapel { fill: #3b4274; }
.box-art .shirt { fill: #f6f7fb; }
.box-art .sleeve { fill: none; stroke: #232845; stroke-width: 10; stroke-linecap: round; }
.box-art .cuff { fill: none; stroke: #f6f7fb; stroke-width: 10; }
.box-art .paw { fill: #9c9c9c; stroke: #111; stroke-width: 1; }
.box-art .paw-lines { fill: none; stroke: #111; stroke-width: .8; }
.box-arm { transform: rotate(-56deg); }                       /* resting state: smiley already off */
.box-stage.is-lifting .box-arm { animation: lift .9s cubic-bezier(.34, 1.4, .55, 1) .8s backwards; }
.box-stage.is-lifting .box-rat { animation: rat-pop .35s ease-out 1.45s backwards; }

.jail-stage { position: absolute; inset: 0; }
.story-actor { position: absolute; top: 60%; left: 37%; width: 8.59375%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.story-actor img { position: absolute; height: auto; }
.rat-body { inset: 0; width: 100%; }
.rat-hat { width: calc(100% * 29 / 44); left: calc(100% * 12 / 44); top: calc(100% * -15 / 44); }   /* the same placing as in the room: real size, on the top of his head */
.jail-door, .front-bars { position: absolute; left: 23.535%; top: 7.552%; width: 26.758%; height: auto; pointer-events: none; }
.door-shutting { animation: shut .4s ease-out both; transform-origin: left center; }
.story-body { padding: 22px 24px 24px; }
.story-body h2 { margin: 10px 0 10px; font-size: 30px; }
.story-body h2:focus { outline: none; }
.story-body > p:not(.eyebrow) { color: var(--ink-soft); }
.story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 20px; }

/* ---------- 8b. RatBot the site guide ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.chip { min-height: 36px; padding: 5px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; line-height: 1.2; }
.chip:hover { background: var(--sun); }
.chip:disabled { opacity: .5; background: var(--surface); }
.chip-sorry { background: var(--sun); }
.chip-sorry:hover { background: var(--sun-deep); }
.chip-swear { color: var(--red-deep); letter-spacing: .06em; }   /* the visitor "swearing" at RatBot, with no real words */

/* RatBot's disguise is a grey smiley: the green sprite shown without its colour, until the real grey file is found.
   The rule only matches while the picture is still a smiley, so RatBot himself keeps his blue eyes. */
#room-rat-face[src*="smiley"], #bag-guide-face[src*="smiley"], #rat-launcher-face[src*="smiley"] { filter: grayscale(1); }

/* Floating button, bottom right. A grey smiley until he is unmasked. */
.rat-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; align-items: center; gap: 13px; padding: 0; border: 0; background: none; }
.rat-launcher:disabled { display: none; }
/* The button is a little doorway, like the Three Doors, with someone standing in it */
.rat-launcher-face {
  position: relative;
  display: grid; justify-items: center; align-items: end;
  width: 72px; height: 88px; padding-bottom: 9px;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 36px 36px 14px 14px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.rat-launcher-face::before { content: ""; position: absolute; inset: 6px; border: 2px solid rgba(255, 255, 255, .95); border-radius: 28px 28px 7px 7px; pointer-events: none; }
.rat-launcher-face img { position: relative; width: 44px; height: 44px; image-rendering: pixelated; transition: transform .15s ease; animation: door-peek 8s ease-in-out 4s infinite; }
.rat-launcher:hover .rat-launcher-face { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); background: var(--sun-deep); }
.rat-launcher:hover .rat-launcher-face img { animation: none; transform: translateY(-5px); }
/* His mood shows in the doorway too. The marks sit over his picture and move with it. */
.rat-launcher-face::after { left: 12px; bottom: 9px; width: 56px; height: 60px; transition: transform .15s ease; }
#avatar-palace-page[data-rat] .rat-launcher-face img { animation: none; }
.rat-launcher:hover .rat-launcher-face::after { transform: translateY(-5px); }
.rat-launcher:active .rat-launcher-face { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.rat-launcher:focus-visible { outline: none; }
.rat-launcher:focus-visible .rat-launcher-face { outline: 3px solid var(--focus); outline-offset: 3px; }
.rat-launcher-bubble { padding: 7px 14px 8px; font-size: 15px; box-shadow: 0 3px 0 var(--shade); }
.rat-launcher-bubble::after { left: auto; right: -7px; bottom: 12px; border-bottom: 0; border-top: 2px solid var(--ink); }

/* Chat panel, docked bottom right so the page stays visible while he helps */
.ratchat {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  display: flex; flex-direction: column;
  width: min(390px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 32px));    /* for browsers without dvh */
  max-height: min(640px, calc(100dvh - 32px));
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 0 8px 0 var(--shade), 0 22px 44px -20px rgba(34, 27, 61, .5);
  overflow: hidden;
}
.ratchat-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; background: var(--sun); border-bottom: 2px solid var(--ink); }
/* His portrait: the same doorway shape, with the sky from the unmasking scene behind him */
.ratchat-portrait::after { left: 5px; bottom: 5px; width: 56px; height: 60px; }   /* the marks may poke out of the doorway */
.ratchat-portrait { position: relative; flex: none; display: grid; justify-items: center; align-items: end; width: 58px; height: 62px; padding-bottom: 5px; border: 2px solid var(--ink); border-radius: 29px 29px 10px 10px; background: linear-gradient(180deg, #86b4f2 0%, #e8f1fe 100%); }
.ratchat-head img { width: 44px; height: 44px; image-rendering: pixelated; }
.ratchat-head h2 { font-size: 20px; }
.ratchat-head h2:focus { outline: none; }
.ratchat-head p { margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ink-soft); }
.ratchat-head button { flex: none; margin-left: auto; min-height: 34px; padding: 5px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font: 700 12px/1.2 var(--font-body); }
.ratchat-head button:hover { background: var(--surface-soft); }

/* The conversation looks like a Palace room: two faces and their speech balloons, on the current room's colour */
.ratchat-log { flex: 1 1 auto; min-height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 12px; background-color: var(--tint); transition: background-color .5s ease; }
.ratchat-log:focus-visible { outline-offset: -3px; }
.msg { display: flex; align-items: flex-end; gap: 11px; animation: msg-in .18s ease-out; }
.msg-you { flex-direction: row-reverse; }
.msg-face { position: relative; flex: none; width: 44px; height: 44px; }   /* both faces stay 44 by 44 */
.msg-face img { display: block; width: 44px; height: 44px; image-rendering: pixelated; }
.msg-face::after { left: 0; top: -16px; width: 56px; height: 60px; }
.msg-bubble { position: relative; min-width: 0; max-width: calc(100% - 62px); overflow-wrap: anywhere; padding: 9px 13px 10px; border: 2px solid var(--ink); border-radius: 16px; background: var(--surface); font-size: 15px; line-height: 1.45; }
.msg-you .msg-bubble { background: var(--surface); }
.msg-bubble::after {   /* the balloon's tail, pointing at whoever is speaking */
  content: "";
  position: absolute; bottom: 13px;
  width: 13px; height: 13px;
  background: inherit;
  transform: rotate(45deg);
}
.msg-bot .msg-bubble::after { left: -8.5px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.msg-you .msg-bubble::after { right: -8.5px; border-right: 2px solid var(--ink); border-top: 2px solid var(--ink); }
/* When the same speaker goes on, the face and tail are shown once */
.msg-bot + .msg-bot .msg-face, .msg-you + .msg-you .msg-face { visibility: hidden; height: 0; }
.msg-bot + .msg-bot .msg-bubble::after, .msg-you + .msg-you .msg-bubble::after { display: none; }
/* ...unless RatBot's mood has changed since his last line. Then his face is shown again, with the new expression. */
.msg-bot:not(.is-mad) + .msg-bot.is-mad .msg-face,
.msg-bot:not(.is-pleased) + .msg-bot.is-pleased .msg-face,
.msg-bot:not(.is-flustered) + .msg-bot.is-flustered .msg-face { visibility: visible; height: 44px; }
.msg-bot:not(.is-mad) + .msg-bot.is-mad .msg-bubble::after,
.msg-bot:not(.is-pleased) + .msg-bot.is-pleased .msg-bubble::after,
.msg-bot:not(.is-flustered) + .msg-bot.is-flustered .msg-bubble::after { display: block; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.msg-do, .msg-link {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 5px 12px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--surface);
  font-size: 13px; font-weight: 700; line-height: 1.2; text-decoration: none;
}
.msg-do { background: var(--sun); }
.msg-do:hover { background: var(--sun-deep); }
.msg-link:hover { background: var(--surface-soft); }
.msg-link::after { content: "\00a0\2197"; }           /* leaves this site */
.msg-link.msg-here::after { content: "\00a0\2192"; }   /* another page of this site */

/* Buttons only. There is no message box. */
.ratchat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 4px; border-top: 2px solid var(--ink); }
.ratchat-note { margin: 6px 14px 12px; font-size: 12px; line-height: 1.4; color: var(--ink-soft); }
/* Only the conversation shrinks when space is tight, so the buttons are never cut off */
.ratchat-head, .ratchat-chips, .ratchat-note { flex: none; }

/* ---------- 9. Motion ---------- */
@keyframes wear { 40% { transform: translateY(-4%) scale(1.05); } }
@keyframes lid-hop { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-9%) rotate(-5deg); } 95% { transform: translateY(-2%) rotate(2deg); } }
@keyframes bag-glow { 0% { background-color: var(--sun); } 100% { background-color: transparent; } }
@keyframes twinkle { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes lift { from { transform: rotate(0deg); } to { transform: rotate(-56deg); } }
@keyframes rat-pop { 50% { transform: translateY(-2px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mood-pop-mad { from { opacity: 0; transform: scale(.3); } 60% { transform: scale(1.18); } }
@keyframes mood-pop-pleased { from { opacity: 0; transform: scale(.3); } 60% { transform: scale(1.18); } }
@keyframes mood-pop-flustered { from { opacity: 0; transform: scale(.3); } 60% { transform: scale(1.18); } }
@keyframes rat-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-2px) rotate(-4deg); } 75% { transform: translateX(2px) rotate(4deg); } }
@keyframes door-peek { 0%, 90%, 100% { transform: none; } 94% { transform: translateY(-6px); } 97% { transform: translateY(-1px); } }
@keyframes shut { from { transform: scaleX(.05); } to { transform: scaleX(1); } }

/* "Pause small animations" in the footer, and the system reduced-motion setting.
   With motion off, the smiley is simply shown already lifted. */
html[data-motion="paused"] { scroll-behavior: auto; }
html[data-motion="paused"] *, html[data-motion="paused"] *::before, html[data-motion="paused"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 10. Smaller screens ---------- */
@media (max-width: 1100px) {
  .site-nav a { padding-inline: 9px; font-size: 14px; }
  .header-inner { gap: 16px; }
  .community-layout { gap: 44px; }
  .history-layout { gap: 48px; grid-template-columns: 280px minmax(0, 1fr); }
}

/* Tablet: the room list becomes a strip of tabs above the room */
@media (max-width: 1023px) {
  .site-nav, .header-enter { display: none; }
  .mobile-menu { display: block; }

  .window-body { grid-template-columns: minmax(0, 512px) minmax(190px, 218px); grid-template-areas: "rooms rooms" "room bag"; }
  .rooms-rail { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .rooms-rail .rail-label { padding: 0; }
  .room-choices { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .room-choice { grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px; }
  .room-choice span { padding: 0; }

  .trio { grid-template-columns: 1fr; gap: 20px; }
  .trio-card { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: 14px; align-content: center; padding: 14px; }
  .trio-art { grid-row: 1 / span 2; }
  .trio-card h3 { align-self: end; margin-top: 0; }
  .trio-card p { align-self: start; }

  .join-panel { padding: 44px 32px 46px; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .step { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 18px; row-gap: 6px; align-items: start; padding: 20px 22px 22px; }
  .step-number { grid-row: 1 / span 6; margin: 0; }
  .step > :not(.step-number) { grid-column: 2; justify-self: start; }
  .step > .arrow-link, .step > .button { margin-top: 6px; }
  .copy-row { max-width: 340px; }

  .doors-grid { gap: 20px; }
  .door { padding-inline: 30px; }

  .community-layout { grid-template-columns: 1fr; gap: 40px; }
  .seasonal-panel { grid-template-columns: 1fr; gap: 26px; padding: 44px 36px; }
  .neighbours-layout { gap: 32px; }
}

/* Small tablet and phone: everything in one column */
@media (max-width: 820px) {
  .gate { padding: 48px 20px 26px; border-radius: 50% 50% 30px 30px / 110px 110px 30px 30px; }
  .gate::before { inset: 8px; }
  .window-body { grid-template-columns: minmax(0, 512px); grid-template-areas: "rooms" "room" "bag"; }
  .bag { flex-direction: row; border-left: 0; border-top: 2px solid var(--ink); }
  .bag-props { flex: 1 1 54%; }
  .bag-guide { flex: 1 1 46%; border-top: 0; border-left: 2px dashed var(--line); }

  .section { padding-top: 76px; }

  .doors-grid { grid-template-columns: 1fr; gap: 28px; max-width: 400px; margin-inline: auto; }
  .door { min-height: 410px; }

  .history-layout { grid-template-columns: 1fr; gap: 36px; }
  .history-plate { width: min(300px, 100%); }
  .neighbours-layout { grid-template-columns: 1fr; gap: 22px; }

  .footer-main { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer nav { justify-content: flex-start; margin-left: -10px; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 28px); }
  .header-inner { min-height: 64px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 20px; }

  .hero { padding-top: 12px; }
  .gate { padding: 40px 10px 18px; border-radius: 50% 50% 26px 26px / 64px 64px 26px 26px; }
  .gate-copy { padding-inline: 8px; }
  .lede { font-size: 17px; }
  .hero-actions { gap: 12px; }
  .stage { margin-top: 28px; }
  .window { border-radius: 16px; }
  .window-bar { padding-inline: 10px; }
  .window-title, .window-room::before { display: none; }   /* keep room name and the "not live" label */
  .window-room { font-weight: 700; }
  .window-tag { padding: 2px 8px; font-size: 11px; }
  .rooms-rail { display: block; padding: 8px; }
  .rooms-rail .rail-label { display: none; }
  .room-choice { grid-template-columns: 1fr; gap: 3px; text-align: center; font-size: 11px; }
  .stage-caption { padding-inline: 8px; }

  .section { padding-top: 64px; }
  .section-lede { font-size: 17px; }
  .trio-card { display: block; padding: 12px 12px 22px; }
  .trio-card h3 { margin-top: 18px; }
  .trio-art { height: 168px; }
  .join-panel { padding: 34px 16px 30px; border-radius: 28px; }
  .join-panel .section-head { padding-inline: 6px; }
  .member-rooms { padding: 20px 16px 18px; }
  .postcards { gap: 14px; }
  .seasonal-panel { padding: 36px 22px; border-radius: 28px; }
  .closing-door { padding: 76px 20px 56px; border-radius: 50% 50% 0 0 / 120px 120px 0 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 4px; }

  .rat-launcher { right: 12px; bottom: 12px; gap: 11px; }
  .rat-launcher-face { width: 64px; height: 78px; padding-bottom: 7px; border-radius: 32px 32px 12px 12px; }
  .rat-launcher-face::before { inset: 5px; border-radius: 25px 25px 6px 6px; }
  .rat-launcher-face::after { left: 8px; bottom: 7px; }
  .rat-launcher-bubble { font-size: 13px; padding: 5px 10px 6px; }
  .ratchat { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: min(600px, calc(100vh - 80px)); max-height: min(600px, calc(100dvh - 80px)); }
  .msg-bubble { font-size: 14px; }
  /* One row of suggestions that slides sideways, so the conversation keeps its space */
  .ratchat-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .ratchat-chips .chip { flex: none; white-space: nowrap; }
}

@media (max-width: 460px) {
  .eyebrow { font-size: 11px; letter-spacing: .1em; }
  .brand-logo { width: 84px; height: auto; }
  .brand-name { font-size: 18px; }
  .mobile-menu summary { padding: 8px 14px; }
  .bag { flex-direction: column; }
  .bag-guide { border-left: 0; border-top: 2px dashed var(--line); }
  .window-status { font-size: 13px; }
  .button { padding-inline: 22px; }
  .story-body { padding: 18px 16px 20px; }
  .story-body h2 { font-size: 26px; }
}

/* ==========================================================================
   11. Door pages (doors/original.html, doors/retro.html, doors/new.html)
   Same look as the homepage. Each page wears its own door's colour.
   ========================================================================== */
#avatar-palace-page[data-door="original"] { --tint: var(--peach); --tint-deep: #ffcbb6; }
#avatar-palace-page[data-door="retro"] { --tint: var(--lilac); --tint-deep: var(--lilac-deep); }
#avatar-palace-page[data-door="new"] { --tint: var(--aqua); --tint-deep: var(--aqua-deep); }

.site-nav a[aria-current="true"] { background: rgba(34, 27, 61, .08); }

/* Top of the page: the door's name on the left, the door itself on the right */
.door-hero { padding-top: 16px; }
.door-hero-panel {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center;
  padding: 46px 60px 54px;
  background-color: var(--tint);
  border-radius: 36px;
}
.door-hero-panel::before {
  content: "";
  position: absolute; inset: 12px;
  border: 2px solid rgba(255, 255, 255, .8); border-radius: 26px;
  pointer-events: none;
}
.door-hero-copy { position: relative; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font: 700 12px/1.4 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.breadcrumb a { display: inline-block; padding: 5px 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }   /* the padding makes it easier to tap */
.breadcrumb a:hover { color: var(--red-deep); }

.door-hero h1 { margin-top: 10px; font-size: clamp(46px, 6.2vw, 78px); line-height: 1; }
.door-hero-strap { margin-top: 12px; font: 700 clamp(20px, 2.3vw, 27px)/1.25 var(--font-display); letter-spacing: -.01em; color: var(--red); }
.door-hero .lede { max-width: 31em; margin: 16px 0 0; text-wrap: pretty; }
.door-hero-note { margin-top: 12px; font-weight: 700; }
.door-hero .hero-actions { justify-content: flex-start; align-items: center; gap: 14px 22px; margin-top: 26px; }

/* The door: an arch you look through. Room art inside is never shown larger than its real size. */
.door-frame {
  position: relative; justify-self: center;
  width: min(100%, 392px); margin: 0;
  padding: 22px 20px;
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 50% 50% 22px 22px / 150px 150px 22px 22px;
  box-shadow: 0 8px 0 var(--shade);
}
.door-frame .door-number { margin: 8px auto 0; background: var(--tint); }
.door-frame-art { position: relative; overflow: hidden; margin-top: 18px; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface-soft); }
.door-frame-art .backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* A picture that is not a 4 by 3 room (the client screenshot) keeps its own shape */
.door-frame-art-wide { aspect-ratio: auto; }
.door-frame-art-wide img { display: block; width: 100%; height: auto; }
.door-frame figcaption { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.door-frame figcaption a { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* A door that is still shut: used where the work is not public yet */
.door-frame-closed { display: flex; flex-direction: column; align-items: center; min-height: 400px; background: var(--tint-deep); }
.door-frame-closed::before { content: ""; position: absolute; inset: 10px; border: 2px solid rgba(255, 255, 255, .85); border-radius: inherit; pointer-events: none; }
.door-frame-closed::after { content: ""; position: absolute; right: 24px; top: 58%; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, .8); }
.door-frame-closed .door-number { background: #fff; }
.door-sign { position: relative; margin: auto 0; padding: 10px 18px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; font: 700 17px/1.25 var(--font-display); transform: rotate(-3deg); box-shadow: 0 4px 0 var(--shade); }

/* Door 01 / 02 / 03 switcher. The door you are on stays pressed in. */
.door-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.door-tab {
  display: grid; gap: 2px; justify-items: center;
  padding: 11px 10px 13px;
  border: 2px solid var(--ink); border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--ink);
  text-align: center; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.door-tab small { font: 700 11px/1.4 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.door-tab strong { font: 700 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.door-tab:hover { background: var(--surface-soft); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.door-tab[aria-current="page"] { background-color: var(--tint); transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }

/* What the door means: heading on the left, plain words on the right */
.door-statement { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; align-items: start; }
.prose { padding-top: 32px; }
.prose p { font-size: 18px; line-height: 1.6; color: var(--ink-soft); }
.prose p + p { margin-top: 16px; }
.section-note { margin-top: 12px; color: var(--ink-soft); }

.door-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.door-cards-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.door-card { padding: 22px 20px 24px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.door-card-tag { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 999px; background-color: var(--tint); font: 700 13px/1 var(--font-ui); letter-spacing: .06em; }
.door-card h3 { margin-top: 16px; font-size: 21px; line-height: 1.2; }
.door-card p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }

/* Where things stand today */
.door-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 48px; border-radius: 36px; background: var(--sun); }
.door-status-single { grid-template-columns: 1fr; }
.status-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 28px 26px 26px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--sun-deep); }
.status-card h2 { margin-top: 0; font-size: clamp(24px, 2.4vw, 30px); }
.status-card > p:not(.eyebrow) { max-width: 46em; color: var(--ink-soft); }
.status-card > .arrow-link { margin-top: auto; padding-top: 8px; }
.status-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: auto; padding-top: 8px; }
.status-card-plain { box-shadow: 0 6px 0 var(--shade); }   /* the same card when it sits on the page, not on a yellow panel */

.guardrails { padding: 48px; border-radius: 36px; background: var(--sun); }
.guardrail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-top: 28px; }
.guardrail-list li { padding: 16px 18px; background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; line-height: 1.5; color: var(--ink-soft); }
.guardrail-list strong { color: var(--ink); }

.door-next { padding-bottom: 96px; text-align: center; }
.door-next h2 { max-width: 20em; margin-inline: auto; }
.door-next-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 24px; margin-top: 28px; }

/* ==========================================================================
   12. The Listening Room (feedback.html)
   A composer that never sends anything. The visitor copies the text or opens their own email app.
   ========================================================================== */
#avatar-palace-page[data-page="listening"] { --tint: var(--sky); --tint-deep: var(--sky-deep); }
.door-hero .listening-title { font-size: clamp(36px, 4.8vw, 60px); line-height: 1.04; }

.listening-art { position: relative; justify-self: center; display: grid; justify-items: center; gap: 18px; padding: 8px 0; }
.listening-art img { width: 44px; height: 44px; }
.listening-balloon { position: relative; display: grid; gap: 12px; width: 230px; padding: 28px 28px 30px; background: var(--surface); border: 2px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--shade); }
.listening-balloon span { display: block; height: 10px; border-radius: 999px; background-color: var(--tint-deep); }
.listening-balloon span:nth-child(2) { width: 82%; }
.listening-balloon span:nth-child(3) { width: 55%; }
.listening-balloon::after { content: ""; position: absolute; left: calc(50% - 9px); bottom: -11px; width: 18px; height: 18px; background: var(--surface); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }

.card { background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.prose a, .guidance a, .contact-note a { color: var(--ink); font-weight: 600; }

.composer-panel { padding: 48px; border-radius: 36px; background: var(--sun); }
.composer-panel .card { box-shadow: 0 6px 0 var(--sun-deep); }
.composer-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 30px; }
.composer { padding: 26px 26px 24px; }
.composer-boundary { padding: 12px 14px; border-radius: 12px; background: var(--surface-soft); font-size: 14px; line-height: 1.5; }

.field { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.field label, .field legend { display: block; padding: 0; font-size: 16px; font-weight: 700; }
.req, .opt { margin-left: 6px; font: 700 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.req { color: var(--red-deep); }
.opt { color: var(--ink-soft); }
.hint { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  display: block; width: 100%; margin-top: 8px; padding: 11px 12px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: #fff; color: var(--ink);
  font: 16px/1.4 var(--font-body);
}
.field textarea { min-height: 160px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--red); background: #fff6f5; }
.count { margin-top: 4px; font-size: 12px; text-align: right; color: var(--ink-soft); }
.field .check { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; font-weight: 400; line-height: 1.5; }
.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--red); }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 26px; }
.composer-actions .button:disabled { opacity: .45; box-shadow: none; transform: none; }
.composer-status { min-height: 22px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.form-errors { margin-top: 18px; padding: 14px 16px; border: 2px solid var(--red); border-radius: 14px; background: #fff6f5; }
.form-errors h3 { font-size: 18px; }
.form-errors ul { display: grid; gap: 4px; margin-top: 8px; }
.form-errors a { color: var(--red-deep); font-weight: 600; }

.composer-side { display: grid; gap: 22px; }
.guidance, .review { padding: 22px; }
.guidance h3, .review h3 { margin-top: 8px; font-size: 22px; }
.guidance p:not(.eyebrow) { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.review dl { display: grid; gap: 2px; margin: 10px 0 0; }
.review dt { margin-top: 10px; font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.review dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.contact-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px; }
.contact-card h2, .contact-note h2 { margin-top: 0; font-size: clamp(24px, 2.6vw, 32px); }
.contact-card > p:not(.eyebrow):not(.helper):not(.contact-address) { color: var(--ink-soft); }
.contact-address a { font: 700 20px/1.3 var(--font-display); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.contact-note { padding-top: 10px; }
.contact-note h3 { font-size: 22px; }
.contact-note p:not(.eyebrow) { margin-top: 12px; color: var(--ink-soft); }
.plain-list { display: grid; gap: 6px; margin-top: 10px; padding-left: 20px; list-style: disc; color: var(--ink-soft); }
.listening-close { margin-inline: auto; }

@media (max-width: 1023px) {
  .composer-panel { padding: 40px 32px; }
  .composer-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .composer-panel { padding: 30px 14px; border-radius: 28px; }
  .composer-panel .section-head { padding-inline: 6px; }
  .composer { padding: 20px 16px; }
  .listening-balloon { width: 190px; }
  .contact-card { padding: 22px 18px; }
}

@media (max-width: 1023px) {
  .door-hero-panel { grid-template-columns: 1fr; gap: 36px; padding: 40px 40px 46px; }
  .door-statement { grid-template-columns: 1fr; gap: 18px; }
  .prose { padding-top: 0; }
  .door-cards, .door-cards-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-status, .guardrails { padding: 40px 32px; }
}
@media (max-width: 640px) {
  .door-hero-panel { gap: 28px; padding: 30px 20px 34px; border-radius: 28px; }
  .door-hero-panel::before { inset: 8px; border-radius: 21px; }
  .door-frame-closed { min-height: 340px; }
  .door-switcher { gap: 8px; }
  .door-tab { padding: 9px 4px 10px; border-radius: 13px; }
  .door-tab small { font-size: 11px; letter-spacing: .06em; }
  .door-tab strong { font-size: 17px; }
  .door-cards, .door-cards-three { grid-template-columns: 1fr; }
  .door-status, .guardrails { grid-template-columns: 1fr; padding: 30px 16px; border-radius: 28px; }
  .guardrail-list { grid-template-columns: 1fr; }
  .door-next { padding-bottom: 72px; }
}

/* ==========================================================================
   13. Pages carried over from the live site
   (enter, about, community, museum, restoration, building, ethics, privacy)
   Their wording and their markup come from the live pages unchanged, so the class names in this part are
   the live site's own. Only the look is new. Each top-level section is its own centred column.
   ========================================================================== */
#avatar-palace-page[data-page="enter"] { --tint: var(--sun); --tint-deep: var(--sun-deep); }
#avatar-palace-page[data-page="community"], #avatar-palace-page[data-page="ethics"] { --tint: var(--lilac); --tint-deep: var(--lilac-deep); }
#avatar-palace-page[data-page="museum"], #avatar-palace-page[data-page="restoration"] { --tint: var(--peach); --tint-deep: #ffcbb6; }
#avatar-palace-page[data-page="building"] { --tint: var(--aqua); --tint-deep: var(--aqua-deep); }

/* ---- Frame and plain text ---- */
.page-main { padding: 16px 0 96px; }
.page-main > section, .page-main > p { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.page-main > section { padding-top: 84px; }
.page-main h4, .page-main dl, .page-main dd, .page-main blockquote { margin: 0; }
.page-main h1 { margin-top: 10px; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; }
.page-main h1 em { font-style: normal; color: var(--red); }
.page-main h2 { margin-top: 12px; font-size: clamp(30px, 3.5vw, 44px); }
.page-main h3 { font-size: 22px; line-height: 1.2; }
.page-main h4 { font: 700 18px/1.25 var(--font-display); letter-spacing: -.01em; }
.page-main p { text-wrap: pretty; }
.page-main section p:not(.eyebrow), .page-main section li, .page-main section dd { color: var(--ink-soft); }
.page-main section strong { color: var(--ink); }
.page-main h3 + p, .page-main h4 + p, .page-main p + p { margin-top: 12px; }
.page-main h2 + p { margin-top: 18px; }
.page-main > section > p, .page-main > section > div > p { max-width: 46em; }
/* ordinary paragraphs that sit straight under a section heading read a little larger */
.page-main > section > p:not([class]), .page-main > section > div > p:not([class]) { font-size: 17px; line-height: 1.6; }
.page-main a:not(.button) { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; overflow-wrap: anywhere; }
.page-main a:not(.button):hover { color: var(--red-deep); }
/* a link that sits on its own under a paragraph gets its own line (and never leaves its arrow alone on a line) */
.page-main :is(section, article, aside, figure, div) > a:not(.button) { display: inline-block; margin-top: 12px; text-wrap: balance; }
.page-main code, .archive-filename { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); font: 600 .92em var(--font-mono); color: var(--ink); overflow-wrap: anywhere; }
.page-main img { height: auto; }
.page-main img[width="512"] { width: 100%; max-width: 512px; }   /* room art is never shown larger than its real size */

.page-main .button { min-height: 48px; padding: 10px 24px; }
.page-main .button--secondary, .page-main .button--outline { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.page-main .button--secondary:hover, .page-main .button--outline:hover { background: var(--surface-soft); box-shadow: 0 5px 0 var(--ink); }
.page-main .button--secondary:active, .page-main .button--outline:active { box-shadow: 0 1px 0 var(--ink); }

/* small quiet notes */
.client-credit, .client-note, .entry-device-note, .avp-games-note, .avp-history-note, .timeline-reading-note, .avp-small-note, .avp-game-context, .timeline-current-note { font-size: 14px; line-height: 1.5; }
.page-main figcaption { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.page-main figcaption p + p { margin-top: 6px; }
.museum-object figcaption > *, .timeline-visual figcaption > *, .museum-room-guide figcaption > strong { display: block; }
.page-main :is(.museum-object, .timeline-visual) figcaption > a { margin-top: 2px; padding-block: 4px; }   /* easier to tap */
.page-main .eyebrow + h3 { margin-top: 10px; }

/* rows of buttons and links */
.page-actions, .closing-threshold__actions, .museum-welcome-actions, .timeline-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 24px; }
.page-main :is(.page-actions, .closing-threshold__actions, .museum-welcome-actions, .timeline-links, .museum-jump, .museum-note-links, .ecosystem-room__links, .avp-year-nav) > a:not(.button) { margin-top: 0; }
.timeline-links { margin-top: 14px; }
/* rows of pill links */
.museum-jump, .museum-note-links, .ecosystem-room__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.page-main :is(.museum-jump, .museum-note-links, .ecosystem-room__links) > a { padding: 8px 15px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-size: 14px; line-height: 1.3; text-decoration: none; }
.page-main :is(.museum-jump, .museum-note-links, .ecosystem-room__links) > a:hover { background: var(--surface-soft); }
.ecosystem-room__links > a > span { margin-left: 5px; }   /* the little "opens elsewhere" arrow was touching the words */

/* fold-out parts */
.page-main details > summary { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); box-shadow: 0 4px 0 var(--ink); font-weight: 700; color: var(--ink); list-style: none; transition: transform .12s ease, box-shadow .12s ease; }
.page-main details > summary::-webkit-details-marker { display: none; }
.page-main details > summary::after { content: "+"; font: 700 18px/1 var(--font-ui); }
.page-main details[open] > summary { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); background: var(--sun); }
.page-main details[open] > summary::after { content: "\2013"; }
.page-main details > summary + * { margin-top: 20px; }
.page-main details { margin-top: 18px; }

/* ---- Top of each page: a tinted panel, like the door pages ---- */
.page-main > .page-hero, .page-main > .entry-welcome, .page-main > .museum-intro { position: relative; padding: 46px 60px 54px; background-color: var(--tint); border-radius: 36px; }
.page-main > .page-hero::before, .page-main > .entry-welcome::before, .page-main > .museum-intro::before { content: ""; position: absolute; inset: 12px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 26px; pointer-events: none; }
.page-main > .page-hero > *, .page-main > .entry-welcome > *, .page-main > .museum-intro > * { position: relative; }
.page-hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
.page-main .page-hero__lead, .museum-intro-copy > p:not(.eyebrow) { max-width: 31em; margin-top: 16px; font-size: 18px; line-height: 1.55; }
.page-main .museum-welcome-lead { font: 700 clamp(20px, 2.3vw, 27px)/1.25 var(--font-display); letter-spacing: -.01em; color: var(--red); }
.status-label { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font: 700 12px/1.3 var(--font-ui); letter-spacing: .04em; color: var(--ink) !important; }
.status-light { width: 10px; height: 10px; border-radius: 50%; background: #2fa36b; box-shadow: 0 0 0 3px rgba(47, 163, 107, .25); }

/* pictures and drawings that sit beside the heading */
.support-picture, .visual-demonstration, .museum-room-guide, .museum-object, .timeline-visual { margin: 0; padding: 14px 14px 16px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 8px 0 var(--shade); }
.page-main :is(.support-picture, .museum-room-guide, .museum-object, .timeline-visual, .client-peek) img { display: block; border: 2px solid var(--ink); border-radius: 10px; }
.page-main :is(.support-picture, .timeline-visual, .client-peek) img { width: 100%; }
.page-main :is(.support-picture, .museum-room-guide, .museum-object, .timeline-visual, .client-peek) > a { display: block; margin-top: 0; }
.museum-room-guide, .museum-object { justify-self: center; width: min(100%, 544px); }

/* Building page drawing: a doorway joined to four points. A new, simple drawing in place of the live site's own. */
.visual-demonstration__scene { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface-soft); }
.visual-demonstration__scene > span { position: absolute; }
.building-map-demo__path { left: 50%; top: 50%; width: 76.5%; margin-left: -38.25%; border-top: 2px dashed var(--ink); }
.building-map-demo__path--one { transform: rotate(27.2deg); }
.building-map-demo__path--two { transform: rotate(-27.2deg); }
.building-map-demo__threshold, .building-map-demo__node { z-index: 1; }   /* the dots and the doorway sit on top of the lines */
.building-map-demo__threshold { left: 50%; top: 50%; width: 22%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 2px solid var(--ink); border-radius: 999px 999px 8px 8px; background: var(--tint-deep); box-shadow: 0 0 0 6px var(--surface-soft); }
.building-map-demo__node { width: 9%; aspect-ratio: 1; margin: -4.5% 0 0 -4.5%; border: 2px solid var(--ink); border-radius: 50%; }
.building-map-demo__node--client { left: 16%; top: 22%; background: var(--red); }
.building-map-demo__node--community { left: 84%; top: 22%; background: var(--sun-deep); }
.building-map-demo__node--server { left: 16%; top: 78%; background: var(--lilac-deep); }
.building-map-demo__node--history { left: 84%; top: 78%; background: #ffcbb6; }
/* Privacy page drawing: this website on one side, outside services on the other, and one choice crossing the line */
.privacy-boundary-demo__website, .privacy-boundary-demo__external { top: 20%; width: 32%; height: 60%; border: 2px solid var(--ink); border-radius: 10px; background: linear-gradient(var(--tint-deep) 0 22%, var(--surface) 22%); }
.privacy-boundary-demo__website { left: 8%; }
.privacy-boundary-demo__external { right: 8%; border-style: dashed; background: linear-gradient(var(--line) 0 22%, var(--surface) 22%); }
.privacy-boundary-demo__boundary { left: 50%; top: 8%; bottom: 8%; border-left: 3px dashed var(--red); }
.privacy-boundary-demo__pointer { left: 40%; top: 55%; width: 20%; border-top: 2px solid var(--ink); }
.privacy-boundary-demo__pointer::after { content: ""; position: absolute; right: 0; top: -6px; width: 9px; height: 9px; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: rotate(45deg); }
.privacy-boundary-demo__choice { left: 50%; top: 55%; width: 8%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid var(--ink); border-radius: 50%; background: var(--sun-deep); z-index: 1; }
/* Ethics and Preservation: a doorway */
.page-hero__emblem { position: relative; justify-self: center; width: min(100%, 250px); aspect-ratio: 3 / 4; border: 2px solid var(--ink); border-radius: 999px 999px 22px 22px; background: var(--surface); box-shadow: 0 8px 0 var(--shade); }
.page-hero__emblem span { position: absolute; inset: 16px; border: 2px solid var(--ink); border-radius: 999px 999px 10px 10px; background: var(--tint-deep); }
.page-hero__emblem span::after { content: ""; position: absolute; right: 16px; top: 58%; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, .8); }

/* ---- Sections ---- */
.section-heading, .living-heading, .avp-history-heading, .avp-games-heading, .timeline-heading { max-width: 800px; }
.section-heading--split { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; align-items: end; max-width: none; }
.section-heading--split > p { font-size: 18px; line-height: 1.6; }
.section-heading--center { margin-inline: auto; text-align: center; }
/* what was a dark band on the live site is a sunny panel here */
.page-main > .section--dark { margin-top: 84px; padding: 48px; border-radius: 36px; background: var(--sun); }
.page-main > .section--dark p:not(.eyebrow) { color: var(--ink); }
/* A heading with plain paragraphs is set out the way the door pages do it: heading on the left, words on the right.
   The live pages wrap the two halves in two plain boxes, which is what makes this possible. */
.support-note, .ethics-operating-principle, #palace32-faces, .project-stream,
.about-feed-difference, .about-lineage, .community-development, .community-expectations, .privacy-feedback, .privacy-external, .privacy-safety, .privacy-contact, .building-conversation, .phase-note { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
:is(.support-note, .ethics-operating-principle, .project-stream, .about-feed-difference, .about-lineage, .community-development, .community-expectations, .privacy-feedback, .privacy-external, .privacy-safety, .privacy-contact, .building-conversation, .phase-note) > div + div { padding-top: 30px; }
.page-main :is(.support-note, .ethics-operating-principle, .project-stream, .about-feed-difference, .about-lineage, .community-development, .community-expectations, .privacy-feedback, .privacy-external, .privacy-safety, .privacy-contact, .building-conversation, .phase-note) > div + div p:not(.eyebrow) { font-size: 17px; line-height: 1.6; }
.page-main .ethics-operating-principle__trust { font: 700 20px/1.3 var(--font-display); color: var(--ink); }
.closing-threshold, .page-next { text-align: center; }
.closing-threshold__actions, .page-next .page-actions { justify-content: center; }
.page-main > .entry-followup { margin-top: 48px; text-align: center; }

/* ---- Cards ---- */
.community-route-grid, .principle-grid, .entry-step-grid, .client-grid, .avp-continuity-grid, .avp-games-grid, .journey-steps, .roadmap-list, .restoration-status-list, .palace-definition-grid, .truth-list, .privacy-summary__list, .accountability__list, .timeline-present { display: grid; gap: 20px; margin-top: 34px; }
.community-route-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.principle-grid, .entry-step-grid, .avp-continuity-grid, .avp-games-grid, .journey-steps, .roadmap-list, .palace-definition-grid, .truth-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.client-grid, .restoration-status-list, .privacy-summary__list, .accountability__list, .timeline-present { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-main :is(.community-route-grid, .principle-grid, .entry-step-grid, .client-grid, .avp-continuity-grid, .avp-games-grid, .restoration-status-list) > article,
.page-main :is(.journey-steps, .roadmap-list, .truth-list, .privacy-summary__list) > li,
.palace-definition-grid > div, .accountability__list > p, .timeline-present > div, .public-story-note, .avp-games-credits, .avp-room-directory, .connection-card {
  padding: 22px 20px 24px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade);
}
.page-main :is(.community-route-grid, .principle-grid, .entry-step-grid, .client-grid, .avp-continuity-grid, .avp-games-grid) > article { display: flex; flex-direction: column; align-items: flex-start; }
.page-main :is(.community-route-grid, .entry-step-grid, .client-grid) > article > :is(a, .button):last-child { margin-top: auto; }
.page-main :is(.community-route-grid, .entry-step-grid, .client-grid) > article > p:last-of-type { margin-bottom: 14px; }
.page-main :is(article, li, .palace-definition-grid > div) h3, .page-main :is(article, li) h4 { margin-top: 14px; }
.page-main article > .eyebrow + h3 { margin-top: 10px; }
.page-main :is(article, li) p:not(.eyebrow) { margin-top: 8px; font-size: 15px; line-height: 1.55; }
.page-main .section--dark :is(.accountability__list > p) { margin-top: 0; font-size: 16px; color: var(--ink-soft); box-shadow: 0 6px 0 var(--sun-deep); }
.page-main :is(.truth-list, .privacy-summary__list) > li { font-size: 15px; line-height: 1.55; }
.restoration-status-list > article, .journey-steps > li, .roadmap-list > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.page-main :is(.restoration-status-list > article, .journey-steps > li, .roadmap-list > li) h3 { margin-top: 8px; }
.palace-definition-grid dt { font: 700 21px/1.2 var(--font-display); letter-spacing: -.01em; }
.palace-definition-grid dd { margin-top: 8px; font-size: 15px; line-height: 1.55; }
/* number tags: 01, 02, "01 / CONNECT" */
.page-main :is(.principle-grid > article, .journey-steps > li, .roadmap-list > li) > span:first-child, .status-index, .avp-theme-number, .page-main .entry-step-grid .door-number, .avp-game-label > span:first-child {
  display: inline-grid; place-items: center; width: auto; min-width: 44px; height: 44px; margin: 0; padding: 0 13px; border: 2px solid var(--ink); border-radius: 999px; background: var(--tint); font: 700 13px/1 var(--font-ui); letter-spacing: .06em; color: var(--ink);
}
.avp-game-label { display: flex; align-items: center; gap: 10px; margin-top: 14px; font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.avp-game-label > span:first-child { min-width: 36px; height: 36px; padding: 0 10px; }
.status-chip { display: inline-flex; margin-top: 16px; padding: 7px 13px; border: 2px solid var(--ink); border-radius: 999px; font: 700 11px/1.2 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }
.status-chip--available { background: var(--aqua-deep); }
.status-chip--progress { background: var(--sun-deep); }
.status-chip--ongoing { background: var(--lilac-deep); }
.page-main > .project-stream { margin-top: 48px; padding-top: 44px; border-top: 2px solid var(--line); }
.page-main > .page-hero + .project-stream { border-top: 0; margin-top: 0; padding-top: 72px; }

/* the server address */
.connection-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-top: 30px; padding: 24px 26px; }
.page-main .connection-card__label { font: 700 12px/1.4 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.page-main :is(.connection-card, .welcome-address) code { display: inline-block; padding: 0; border: 0; background: none; font: 700 clamp(18px, 2.2vw, 26px)/1.3 var(--font-mono); }
.welcome-address { align-self: stretch; margin-top: 14px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--sun); }
.welcome-address > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 6px; }
.page-main .welcome-address code { font-size: 17px; }
.page-main .welcome-address .button { min-height: 40px; padding: 7px 18px; font-size: 14px; }
.welcome-address + .client-note { margin-bottom: 0; }

/* ---- Enter ---- */
.entry-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; }
.page-main .entry-device-note { margin-top: 18px; font-size: 17px; color: var(--ink); }
.page-main .entry-welcome > .button { margin-top: 26px; }
.page-main .entry-welcome > .entry-shortcut { margin-top: 16px; }
.client-platforms { font: 700 11px/1.4 var(--font-ui) !important; letter-spacing: .1em; text-transform: uppercase; }
.client-card > details { align-self: stretch; margin: 14px 0 4px; }
.page-main .client-credit { margin-top: 26px; }
.client-peek figure { margin: 0; }

/* ---- Museum ---- */
.museum-intro-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 544px); gap: 48px; align-items: center; }
.avp-year-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.page-main .avp-year-nav > a { display: grid; gap: 2px; justify-items: center; padding: 11px 8px 13px; border: 2px solid var(--ink); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 0 var(--ink); font: 700 22px/1.2 var(--font-display); text-align: center; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.page-main .avp-year-nav > a:hover { color: var(--ink); background: var(--surface-soft); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.avp-year-nav span { font: 700 11px/1.4 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.avp-history-note { margin-top: 18px !important; }
.avp-timeline, .software-timeline { display: grid; gap: 22px; margin-top: 38px; }
.avp-timeline > li, .software-timeline > li { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; }
.avp-date, .timeline-date { padding-top: 24px; font: 700 24px/1.1 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.avp-date time { display: block; font-size: 38px; }
.avp-date span, .timeline-date span { display: block; margin-top: 6px; font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.avp-chapter, .software-timeline > li > article { padding: 26px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.avp-chapter, .timeline-chapter { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 26px; align-items: start; }
.page-main :is(.avp-chapter, .software-timeline > li > article) h3 { margin-top: 0; font-size: 26px; }
.page-main :is(.avp-chapter, .software-timeline > li > article) p:not(.eyebrow) { font-size: 16px; }
.page-main .avp-mood, .page-main .timeline-moment { font: 700 18px/1.35 var(--font-display); color: var(--red-deep); }
.avp-tools, .timeline-source-invitation { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.page-main :is(.avp-tools, .timeline-source-invitation) h4 { margin-top: 0; }
.page-main :is(.avp-tools, .timeline-source-invitation) p { font-size: 14px; }
.page-main .timeline-source-invitation figure + h4 { margin-top: 16px; }
/* The "two readmes" diagram has small lettering, so its entry is stacked and the diagram gets its full 400px. */
#palace32-era .timeline-chapter { grid-template-columns: 1fr; }
#palace32-era .timeline-source-invitation { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); column-gap: 26px; align-items: start; }
#palace32-era .timeline-source-invitation > figure { grid-row: 1 / span 4; }
#palace32-era .timeline-source-invitation > :not(figure) { grid-column: 2; }
.page-main #palace32-era .timeline-source-invitation > h4 { margin-top: 0; }
#palace32-era .timeline-source-invitation > a { justify-self: start; }
.timeline-visual { box-shadow: none; }
/* A video exhibit in the timeline (Jim Bumgardner's 1996 talk). Nothing is fetched until the visitor presses play. */
#jim-earth-to-avatars-1996 .timeline-chapter { grid-template-columns: 1fr; }
.timeline-video { max-width: 672px; }   /* the recording is 640 wide, and it is never shown larger */
.timeline-video video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--ink); border: 2px solid var(--ink); border-radius: 10px; }
.video-frame { position: relative; }
.video-begin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 9px 22px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 rgba(0, 0, 0, .55); font: 700 15px/1.2 var(--font-body); white-space: nowrap; }
.video-begin:hover { background: var(--sun-deep); }
.video-begin:focus-visible { outline-color: #fff; }
.video-needs-script { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }   /* shown only when scripts are off */
html[data-watching] .snowfall { display: none; }   /* no snow across a video while it plays */
.page-main .timeline-present > div { box-shadow: none; background: var(--surface-soft); }
.page-main .timeline-present h4 { margin-top: 8px; }
.avp-gate-display { display: grid; grid-template-columns: minmax(0, 544px) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 30px; }
.avp-gate-display > details { margin-top: 0; }
.avp-room-directory__bar { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--line); font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.avp-room-directory ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.page-main .avp-room-directory li { padding: 8px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--tint); font: 700 14px/1.3 var(--font-display); color: var(--ink); }
.museum-game-diagram, .museum-naming-diagram { margin: 0; align-self: stretch; }
.page-main :is(.museum-game-diagram, .museum-naming-diagram) svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.avp-games-story { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 32px; align-items: start; margin-top: 40px; }
/* Josef's words, in a speech balloon */
.page-main blockquote { position: relative; margin: 18px 0 26px; padding: 18px 22px; border: 2px solid var(--ink); border-radius: 20px; background: var(--surface); box-shadow: 0 5px 0 var(--shade); }
.page-main blockquote::after { content: ""; position: absolute; left: 34px; bottom: -11px; width: 18px; height: 18px; background: var(--surface); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.page-main blockquote p { font: 700 22px/1.3 var(--font-display); color: var(--ink); }
.page-main blockquote footer { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.avp-games-credits dt { margin-top: 14px; font: 700 18px/1.2 var(--font-display); }
.avp-games-credits dd { margin-top: 2px; font-size: 15px; }
.avp-games-invitation, .avp-memory-invitation { margin-top: 34px; padding: 34px; border-radius: 28px; background: var(--sun); text-align: center; }
.page-main :is(.avp-games-invitation, .avp-memory-invitation) p { max-width: 44em; margin-inline: auto; color: var(--ink); }
.avp-memory-invitation .timeline-links { justify-content: center; }
.page-main .avp-continuity-lead { margin-top: 14px; font-size: 18px; }
.public-story-note { margin-top: 30px; }
.public-story-note h3 { margin-top: 0; }
.museum-source-fold .software-sources ol { display: grid; gap: 12px; margin-top: 14px; padding-left: 24px; list-style: decimal; }
.page-main .software-sources li { font-size: 15px; line-height: 1.6; }
.page-main .software-sources p { max-width: 60em; font-size: 15px; }

@media (max-width: 1023px) {
  .page-main > .page-hero, .page-main > .entry-welcome, .page-main > .museum-intro { padding: 40px 40px 46px; }
  .page-main > .section--dark { padding: 40px 32px; }
  .page-hero, .museum-intro-layout, .section-heading--split, .support-note, .ethics-operating-principle, #palace32-faces, .project-stream, .avp-games-story, .avp-gate-display, .avp-chapter, .timeline-chapter,
  .about-feed-difference, .about-lineage, .community-development, .community-expectations, .privacy-feedback, .privacy-external, .privacy-safety, .privacy-contact, .building-conversation, .phase-note { grid-template-columns: 1fr; gap: 26px; }
  :is(.support-note, .ethics-operating-principle, .project-stream, .about-feed-difference, .about-lineage, .community-development, .community-expectations, .privacy-feedback, .privacy-external, .privacy-safety, .privacy-contact, .building-conversation, .phase-note) > div + div { padding-top: 0; }
  .section-heading--split { align-items: start; }
  .community-route-grid, .principle-grid, .roadmap-list, .palace-definition-grid, .avp-games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-step-grid, .journey-steps, .truth-list, .avp-continuity-grid { grid-template-columns: 1fr; }
  .avp-timeline > li, .software-timeline > li { grid-template-columns: 1fr; gap: 12px; }
  #palace32-era .timeline-source-invitation { display: block; }
  .page-main #palace32-era .timeline-source-invitation > h4 { margin-top: 16px; }
  .avp-date, .timeline-date { padding-top: 8px; }
  .avp-date time { display: inline; margin-right: 10px; }
  .avp-date span { display: inline; }
}
@media (max-width: 640px) {
  .page-main > section, .page-main > p { width: calc(100% - 28px); }
  .page-main > section { padding-top: 60px; }
  .page-main > .page-hero, .page-main > .entry-welcome, .page-main > .museum-intro { padding: 30px 20px 34px; border-radius: 28px; }
  .page-main > .page-hero::before, .page-main > .entry-welcome::before, .page-main > .museum-intro::before { inset: 8px; border-radius: 21px; }
  .page-main > .section--dark { margin-top: 60px; padding: 30px 16px; border-radius: 28px; }
  .community-route-grid, .principle-grid, .roadmap-list, .palace-definition-grid, .avp-games-grid, .client-grid, .restoration-status-list, .privacy-summary__list, .accountability__list, .timeline-present { grid-template-columns: 1fr; }
  .avp-year-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avp-chapter, .software-timeline > li > article { padding: 20px 16px; }
  .avp-games-invitation, .avp-memory-invitation { padding: 26px 16px; }
  .page-main > .project-stream { margin-top: 36px; padding-top: 32px; }
}

/* ==========================================================================
   14. The analytics choice (analytics.js)
   A card under the header on a first visit, and an "Analytics choices" link in the footer.
   Both answers look the same on purpose, so neither one is pushed.
   ========================================================================== */
.avp-analytics-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; width: min(1160px, calc(100% - 48px)); margin: 16px auto 0; padding: 18px 22px; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.avp-analytics-panel:not(.avp-analytics-panel--top) { margin: 28px auto; }   /* reopened from the footer: it sits just above the footer */
.avp-analytics-panel > div:first-child { flex: 1 1 420px; min-width: 0; }
.avp-analytics-panel h2 { font-size: 20px; }
.avp-analytics-panel p { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.avp-analytics-panel a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.avp-analytics-panel .avp-analytics-draft { font-size: 12px; font-weight: 700; color: var(--ink); }
.avp-analytics-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.avp-analytics-actions button { min-height: 44px; padding: 8px 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--ink); font: 700 14px/1.2 var(--font-body); transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.avp-analytics-actions button:hover { background: var(--surface-soft); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.avp-analytics-actions button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.avp-analytics-settings { flex: none; min-height: 42px; padding: 8px 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { flex-wrap: wrap; row-gap: 0; }
.footer-bottom small { margin-right: auto; }
@media (max-width: 640px) { .avp-analytics-panel { width: calc(100% - 28px); padding: 16px; } }

/* ==========================================================================
   15. My Collection (my-collection.html)
   Wording and markup come from the live page. The visitor's choices stay in their own browser.
   The cabinet on the right has three display styles the visitor can pick: Palace, Midnight and Paper.
   ========================================================================== */
#avatar-palace-page[data-page="collection"] { --tint: var(--peach); --tint-deep: #ffcbb6; }
.page-main > .collection-heading, .page-main > .collection-workspace { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.page-main > .collection-heading { position: relative; padding: 46px 60px 50px; background-color: var(--tint); border-radius: 36px; }
.page-main > .collection-heading::before { content: ""; position: absolute; inset: 12px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 26px; pointer-events: none; }
.collection-heading > * { position: relative; }
.page-main .collection-heading > p:not(.eyebrow) { max-width: 31em; margin-top: 16px; font-size: 18px; line-height: 1.55; color: var(--ink-soft); }
.collection-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.page-main .collection-jump > a { padding: 8px 15px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-size: 14px; line-height: 1.3; text-decoration: none; }
.page-main .collection-jump > a:hover { background: var(--surface-soft); }

.collection-workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: start; margin-top: 44px; }
.collection-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.page-main .collection-section-heading h2 { margin-top: 0; font-size: clamp(26px, 2.8vw, 34px); }
.collection-section-heading span { font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }

.collection-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.collection-item { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--shade); }
.collection-image { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-soft); border-bottom: 2px solid var(--ink); }
.page-main .collection-image img, .page-main .collection-saved-image img { display: block; width: 100%; height: 100%; object-fit: scale-down; }   /* scale-down never shows a picture larger than its real size */
.public-bookmark-label { padding: 6px 12px; border: 2px dashed var(--ink); border-radius: 999px; background: var(--surface); font: 700 11px/1.3 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.collection-item-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 16px 16px 18px; }
.page-main .collection-item .collection-item-copy h3 { margin-top: 0; font-size: 19px; }
.page-main .collection-item-copy > a { margin-bottom: 14px; }
.page-main .collection-item-copy > button { margin-top: auto; }

/* the small buttons on this page */
.page-main :is(.collection-item-copy, .collection-item-actions, .collection-backup, .collection-restore) button, .collection-file {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 7px 16px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink);
  box-shadow: 0 4px 0 var(--cab-button-shade, var(--ink));
  font: 700 14px/1.2 var(--font-body); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.page-main :is(.collection-item-copy, .collection-item-actions, .collection-backup, .collection-restore) button:hover:not(:disabled), .collection-file:hover { background: var(--surface-soft); transform: translateY(-1px); }
.page-main :is(.collection-item-copy, .collection-item-actions, .collection-backup, .collection-restore) button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--cab-button-shade, var(--ink)); }
.page-main :is(.collection-item-copy, .collection-item-actions, .collection-backup, .collection-restore) button:disabled, .collection-file:has(input:disabled) { opacity: .45; box-shadow: none; cursor: default; }
.page-main .collection-item-copy button[aria-pressed="true"] { background-color: var(--tint); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.collection-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.collection-file:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

.collection-cabinet { --cab-bg: var(--sun); --cab-ink: var(--ink); --cab-soft: var(--ink-soft); --cab-card: var(--surface); padding: 26px 24px 28px; border: 2px solid var(--ink); border-radius: 28px; background: var(--cab-bg); }
.collection-cabinet[data-style="midnight"] { --cab-bg: #221b3d; --cab-ink: #ffffff; --cab-soft: #d4cfe9; --cab-card: #342b59; --cab-button-shade: #0e0a1f; --focus: #a9bcff; }
.collection-cabinet[data-style="paper"] { --cab-bg: var(--surface); }
.page-main .collection-cabinet :is(h2, h3, legend) { color: var(--cab-ink); }
.page-main .collection-cabinet p:not(.eyebrow), .page-main .collection-cabinet .collection-section-heading span { color: var(--cab-soft); }
.page-main .collection-cabinet a:not(.button) { color: var(--cab-ink); }
.collection-style { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.collection-style legend { padding: 0; font: 700 11px/1.4 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }
.collection-style label { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; margin: 8px 8px 0 0; padding: 6px 14px 6px 10px; border: 2px solid var(--cab-ink); border-radius: 999px; color: var(--cab-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.collection-style label:has(input:checked) { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.collection-style input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.page-main .collection-storage, .page-main .collection-status, .page-main .collection-backup-note { margin-top: 12px; font-size: 13px; line-height: 1.5; }
.page-main .collection-cabinet .collection-status { font-weight: 700; color: var(--cab-ink); }
.page-main .collection-cabinet .collection-status[data-error="true"] { color: var(--red-deep); }
.page-main .collection-cabinet[data-style="midnight"] .collection-status[data-error="true"] { color: #ffb9b3; }
.collection-empty { display: grid; justify-items: center; gap: 8px; margin-top: 18px; padding: 26px 18px; border: 2px dashed var(--cab-ink); border-radius: 18px; text-align: center; }
.page-main .collection-empty h3 { margin-top: 4px; }
.page-main .collection-empty p { margin-top: 0; font-size: 15px; }
.collection-saved-list { display: grid; gap: 12px; margin-top: 18px; }
.collection-saved-list:empty { display: none; }
.collection-saved-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px 14px; align-items: start; padding: 12px; background: var(--cab-card); border: 2px solid var(--ink); border-radius: 16px; }
.collection-saved-image { display: grid; place-items: center; width: 72px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-soft); border: 2px solid var(--ink); border-radius: 8px; }
/* in the small thumbnail the "Story bookmark" words would not fit, so a red diamond stands for them */
.collection-saved-image .public-bookmark-label { padding: 0; border: 0; background: none; font-size: 0; }
.collection-saved-image .public-bookmark-label::before { content: ""; display: block; width: 14px; height: 14px; background: var(--red); transform: rotate(45deg); }
.page-main .collection-saved-list .collection-saved-item h3 { margin-top: 0; font-size: 17px; }
.page-main .collection-saved-list .collection-saved-item p { margin-top: 4px; font-size: 13px; }
.collection-item-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.page-main .collection-item-actions button { min-height: 36px; padding: 5px 12px; font-size: 13px; }
.collection-backup { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--cab-soft); }
.collection-restore { margin-top: 16px; padding: 16px; border: 2px solid var(--ink); border-radius: 16px; background: var(--cab-card); }
.page-main .collection-restore h3 { margin-top: 0; }
.page-main .collection-restore button { margin: 12px 8px 0 0; }

@media (max-width: 1023px) {
  .page-main > .collection-heading { padding: 40px 40px 44px; }
  .collection-workspace { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .page-main > .collection-heading, .page-main > .collection-workspace { width: calc(100% - 28px); }
  .page-main > .collection-heading { padding: 30px 20px 32px; border-radius: 28px; }
  .page-main > .collection-heading::before { inset: 8px; border-radius: 21px; }
  .collection-library-grid { grid-template-columns: 1fr; }
  .collection-cabinet { padding: 22px 16px 24px; border-radius: 24px; }
}

/* ==========================================================================
   16. Member Rooms (backgrounds/index.html)
   The room library itself is kept by a program on the Avatar Palace server, so in the draft this page
   can only show its frame. The names inside #content are the ones the library's script creates.
   ========================================================================== */
#avatar-palace-page[data-page="member-rooms"] { --tint: var(--lilac); --tint-deep: var(--lilac-deep); }
.library-main { padding: 16px 0 96px; }
.library-head { position: relative; padding: 40px 60px 44px; background-color: var(--tint); border-radius: 36px; }
.library-head::before { content: ""; position: absolute; inset: 12px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 26px; pointer-events: none; }
.library-head > * { position: relative; }
.library-head h1 { margin-top: 6px; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; }
.library-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.library-nav a { padding: 8px 15px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.library-nav a:hover { background: var(--surface-soft); }
.library-search { display: grid; gap: 6px; max-width: 420px; margin-top: 22px; font-weight: 700; }
.library-search input, .library-controls select { min-height: 46px; padding: 9px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: 16px/1.4 var(--font-body); }
.library-search input:disabled { opacity: .5; }
.library-controls { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 26px; }
.library-controls label { display: grid; gap: 6px; font-weight: 700; }
.library-status { margin-top: 26px; padding: 10px 16px; border-radius: 12px; background: var(--surface-soft); font: 700 12px/1.5 var(--font-ui); letter-spacing: .04em; color: var(--ink); }
.library-draft-note { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 46em; margin-top: 22px; padding: 22px 24px; }
.library-content .library-draft-note h2 { margin-top: 0; font-size: 24px; }
.library-draft-note p { color: var(--ink-soft); }
.library-content h2 { margin-top: 30px; font-size: clamp(26px, 3vw, 36px); }
.library-content > p { margin-top: 16px; color: var(--ink-soft); }
/* albums: each one is a little doorway */
.library-content .category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 24px; }
.library-content .category { display: grid; place-items: center; min-height: 128px; padding: 34px 12px 16px; border: 2px solid var(--ink); border-radius: 75px 75px 16px 16px; background: var(--surface); box-shadow: 0 5px 0 var(--shade); text-align: center; text-decoration: none; font: 700 15px/1.25 var(--font-display); overflow-wrap: anywhere; transition: transform .12s ease, background-color .12s ease; }
.library-content .category:hover { background-color: var(--tint); transform: translateY(-2px); }
.library-content > a { display: inline-block; margin-top: 26px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
/* one album: a grid of room cards */
.library-content .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr)); gap: 16px; margin-top: 18px; }
.library-content .grid > .card { overflow: hidden; padding-bottom: 14px; overflow-wrap: anywhere; }
.library-content .grid > .card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: scale-down; background: var(--surface-soft); border-bottom: 2px solid var(--ink); }
.library-content .grid > .card :is(strong, small, a), .library-content .missing { display: block; margin: 8px 14px 0; }
.library-content .grid > .card small { color: var(--ink-soft); }
.library-content .grid > .card a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.library-content .missing { font-size: 13px; color: var(--red-deep); }
.library-pages { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.library-pages:empty { display: none; }
.library-pages button { min-height: 44px; padding: 8px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--ink); font: 700 14px/1.2 var(--font-body); }
.library-pages button:hover:not(:disabled) { background: var(--surface-soft); }
.library-pages button:disabled { opacity: .45; box-shadow: none; }
@media (max-width: 1023px) { .library-head { padding: 36px 40px 40px; } }
@media (max-width: 640px) {
  .library-head { padding: 28px 20px 30px; border-radius: 28px; }
  .library-head::before { inset: 8px; border-radius: 21px; }
  .library-content .category-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
}

/* ==========================================================================
   17. Winter look (Christmas)
   Switched on and off by one line in season.js, which puts data-season="winter"
   on the page. Without it, nothing in this section applies.
   The snow, the lights, the holly, the wreaths and the snow bank are simple
   shapes drawn in this file. They are not Palace artwork, and no picture in
   assets/ is changed.
   ========================================================================== */
html[data-season="winter"] {
  --page: #f5f8ff;            /* a colder white */
  --snow-edge: #7088dc;      /* the blue shading that lets a pale flake show on a white page */
}
html[data-season="winter"] .site-header { background: rgba(245, 248, 255, .92); }

/* Falling snow. season.js makes the flakes. "Stop the snow" in the footer takes them away again. */
.snowfall { position: fixed; inset: 0; z-index: 45; overflow: hidden; pointer-events: none; contain: strict; }
.flake { position: absolute; left: var(--x); top: -30px; opacity: var(--o); animation: snow-fall var(--fall) linear var(--delay) infinite; will-change: transform; }
.flake i { display: block; width: var(--size); height: var(--size); border-radius: 50%; background: radial-gradient(circle at 36% 32%, #fff 0 16%, #b9c8f8 58%, var(--snow-edge) 100%); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95); animation: snow-sway var(--swaytime) ease-in-out infinite alternate; }
.flake-star i { border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round'%3E%3Cpath d='M12 2.5v19M3.8 7.25l16.4 9.5M3.8 16.75l16.4-9.5M12 6l-2.2-2.2M12 6l2.2-2.2M12 18l-2.2 2.2M12 18l2.2 2.2M6.8 9l-3 .8M6.8 9L6 6M17.2 15l3-.8M17.2 15l.8 3M6.8 15l-3-.8M6.8 15L6 18M17.2 9l3 .8M17.2 9l.8-3' stroke='%23fff' stroke-width='4.2'/%3E%3Cpath d='M12 2.5v19M3.8 7.25l16.4 9.5M3.8 16.75l16.4-9.5M12 6l-2.2-2.2M12 6l2.2-2.2M12 18l-2.2 2.2M12 18l2.2 2.2M6.8 9l-3 .8M6.8 9L6 6M17.2 15l3-.8M17.2 15l.8 3M6.8 15l-3-.8M6.8 15L6 18M17.2 9l3 .8M17.2 9l.8-3' stroke='%237f97dd' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat; box-shadow: none; animation-name: snow-sway-turn; }
@keyframes snow-fall { to { transform: translate3d(0, calc(100vh + 60px), 0); } }
@keyframes snow-sway { from { transform: translateX(calc(var(--sway) * -1)); } to { transform: translateX(var(--sway)); } }
@keyframes snow-sway-turn { from { transform: translateX(calc(var(--sway) * -1)) rotate(-50deg); } to { transform: translateX(var(--sway)) rotate(50deg); } }
html[data-motion="paused"] .snowfall, html[data-snow="off"] .snowfall { display: none; }
html[data-motion="paused"] .snow-toggle { display: none; }   /* "Pause small animations" has already stopped the snow */
.snow-toggle { flex: none; min-height: 42px; padding: 8px 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* A string of lights hanging under the header */
html[data-season="winter"] .site-header::before,
html[data-season="winter"] .site-header::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 34px; pointer-events: none; background-repeat: repeat-x; background-position: center top; }
/* the glow of every other bulb: this is the part that twinkles */
html[data-season="winter"] .site-header::before {
  background-image: radial-gradient(circle 15px at 21px 17px, rgba(210, 28, 38, .4), transparent), radial-gradient(circle 15px at 105px 17px, rgba(31, 138, 98, .4), transparent);
  background-size: 168px 34px;
  animation: lights-glow 2.6s ease-in-out infinite alternate;
}
/* the wire and the bulbs, with a steady glow on the other two */
html[data-season="winter"] .site-header::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='28' viewBox='0 0 168 28'%3E%3Cpath d='M0 2Q21 12 42 2Q63 12 84 2Q105 12 126 2Q147 12 168 2' fill='none' stroke='%23221b3d' stroke-width='1.6'/%3E%3Cg stroke='%23221b3d' stroke-width='1.5'%3E%3Cpath d='M18.5 6h5v4.5h-5zM60.5 6h5v4.5h-5zM102.5 6h5v4.5h-5zM144.5 6h5v4.5h-5z' fill='%23221b3d'/%3E%3Cellipse cx='21' cy='17.5' rx='5' ry='7' fill='%23d21c26'/%3E%3Cellipse cx='63' cy='17.5' rx='5' ry='7' fill='%23ffc93c'/%3E%3Cellipse cx='105' cy='17.5' rx='5' ry='7' fill='%231f8a62'/%3E%3Cellipse cx='147' cy='17.5' rx='5' ry='7' fill='%234a78e6'/%3E%3C/g%3E%3Cg fill='%23fff' fill-opacity='.8'%3E%3Cellipse cx='19.2' cy='15' rx='1.2' ry='2.2'/%3E%3Cellipse cx='61.2' cy='15' rx='1.2' ry='2.2'/%3E%3Cellipse cx='103.2' cy='15' rx='1.2' ry='2.2'/%3E%3Cellipse cx='145.2' cy='15' rx='1.2' ry='2.2'/%3E%3C/g%3E%3C/svg%3E"), radial-gradient(circle 15px at 63px 17px, rgba(255, 201, 60, .5), transparent), radial-gradient(circle 15px at 147px 17px, rgba(74, 120, 230, .4), transparent);
  background-size: 168px 28px, 168px 34px, 168px 34px;
}
@keyframes lights-glow { from { opacity: .15; } to { opacity: 1; } }
html[data-snow="off"] .site-header::before { animation: none; }
/* a little more room under the header, so the bulbs hang clear of what is below */
html[data-season="winter"] main { margin-top: 20px; }
html[data-season="winter"] .avp-analytics-panel--top { margin-top: 36px; }

/* A sprig of holly beside the name. The logo picture itself is untouched. */
html[data-season="winter"] .site-header .brand-name { position: relative; }
html[data-season="winter"] .site-header .brand-name::after { content: ""; position: absolute; left: 100%; top: 50%; width: 30px; height: 24px; margin: -14px 0 0 5px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='24' viewBox='0 0 30 24'%3E%3Cg stroke='%23221b3d' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M14 13L12.2 10L12.6 6.4L9.4 7.2L8.6 3.4L5.6 5L2 2L3.4 5.8L1.2 8.6L4.6 9L3.8 12.6L7.4 11.8L7.8 15.6L11 13.8Z' fill='%231f8a62'/%3E%3Cpath d='M16 13L17.8 10L17.4 6.4L20.6 7.2L21.4 3.4L24.4 5L28 2L26.6 5.8L28.8 8.6L25.4 9L26.2 12.6L22.6 11.8L22.2 15.6L19 13.8Z' fill='%231e6b50'/%3E%3Ccircle cx='12.2' cy='19' r='3' fill='%23d21c26'/%3E%3Ccircle cx='17.8' cy='19' r='3' fill='%23d21c26'/%3E%3Ccircle cx='15' cy='14.5' r='3' fill='%23c4161f'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
@media (max-width: 520px) { html[data-season="winter"] .site-header .brand-name::after { display: none; } }

/* A wreath round each door number */
html[data-season="winter"] :is(.doors-grid .door, .door-frame) .door-number::before { content: ""; position: absolute; left: 50%; top: 50%; width: 92px; height: 100px; margin: -47px 0 0 -46px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='100' viewBox='0 0 92 100'%3E%3Ccircle cx='46' cy='46' r='34' fill='none' stroke='%23221b3d' stroke-width='15'/%3E%3Ccircle cx='46' cy='46' r='34' fill='none' stroke='%231e6b50' stroke-width='11'/%3E%3Ccircle cx='46' cy='46' r='34' fill='none' stroke='%232f9a72' stroke-width='11' stroke-dasharray='5 9'/%3E%3Cg fill='%23d21c26' stroke='%23221b3d' stroke-width='1'%3E%3Ccircle cx='46' cy='12' r='2.8'/%3E%3Ccircle cx='17' cy='29' r='2.8'/%3E%3Ccircle cx='75' cy='29' r='2.8'/%3E%3Ccircle cx='14' cy='58' r='2.8'/%3E%3Ccircle cx='78' cy='58' r='2.8'/%3E%3C/g%3E%3Cg fill='%23d21c26' stroke='%23221b3d' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M44 82L37 97L42 94L45 98L47 84Z'/%3E%3Cpath d='M48 82L55 97L50 94L47 98L45 84Z'/%3E%3Cpath d='M46 80C38 70 28 72 30 80C28 88 38 90 46 80Z'/%3E%3Cpath d='M46 80C54 70 64 72 62 80C64 88 54 90 46 80Z'/%3E%3Ccircle cx='46' cy='80' r='3.6'/%3E%3C/g%3E%3C/svg%3E") center / 92px 100px no-repeat; pointer-events: none; }
html[data-season="winter"] .doors-grid .door h3 { margin-top: 32px; }
html[data-season="winter"] .door-frame .door-number { margin-top: 24px; margin-bottom: 12px; }   /* room for the wreath inside the door frame */

/* The Santa hat: a Christmas-only prop in the prop bag. It is a new drawing (assets/santa-hat.png), not Palace artwork. */
.prop[data-prop="santa"] { display: none; }
html[data-season="winter"] .prop[data-prop="santa"] { display: grid; }
.prop[data-prop="santa"] .prop-art img { width: 46px; height: 32px; }   /* real size */
.santa-on { width: 104.545%; max-width: none; left: 0; top: -45.455%; }   /* 46 pixels wide on the 44-pixel smiley, so it is shown at its real size */
/* Three props side by side need a slightly wider bag, so the bag also drops under the room a little sooner */
html[data-season="winter"] .props { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-season="winter"] .prop { padding-inline: 2px; }
html[data-season="winter"] .window-body { grid-template-columns: 132px minmax(0, 512px) 284px; }
@media (min-width: 1024px) and (max-width: 1070px) {   /* not quite wide enough for the room list at the side: it becomes the strip of tabs a little sooner */
  html[data-season="winter"] .window-body { grid-template-columns: minmax(0, 512px) 284px; grid-template-areas: "rooms rooms" "room bag"; }
  html[data-season="winter"] .rooms-rail { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-right: 0; border-bottom: 2px solid var(--ink); }
  html[data-season="winter"] .rooms-rail .rail-label { padding: 0; }
  html[data-season="winter"] .room-choices { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  html[data-season="winter"] .room-choice { grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px; }
  html[data-season="winter"] .room-choice span { padding: 0; }
}
@media (max-width: 1023px) { html[data-season="winter"] .window-body { grid-template-columns: minmax(0, 512px) 284px; } }
@media (max-width: 940px) {
  html[data-season="winter"] .window-body { grid-template-columns: minmax(0, 512px); grid-template-areas: "rooms" "room" "bag"; }
  html[data-season="winter"] .bag { flex-direction: row; border-left: 0; border-top: 2px solid var(--ink); }
  html[data-season="winter"] .bag-props { flex: 1 1 58%; }
  html[data-season="winter"] .bag-guide { flex: 1 1 42%; border-top: 0; border-left: 2px dashed var(--line); }
}
@media (max-width: 640px) {
  html[data-season="winter"] .bag { flex-direction: column; }
  html[data-season="winter"] .bag-guide { border-left: 0; border-top: 2px dashed var(--line); }
}

/* The holiday track: the song player on the homepage. Christmas only. */
html[data-season="winter"] .palace-tracks { display: grid; }

/* Snow piled along the top of the footer */
html[data-season="winter"] .footer::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 32px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='32' viewBox='0 0 360 32'%3E%3Cpath d='M0 20C20 16 55 5 92 12S150 27 186 16S252 3 292 11S340 24 360 20V32H0Z' fill='%23fff'/%3E%3Cpath d='M0 20C20 16 55 5 92 12S150 27 186 16S252 3 292 11S340 24 360 20' fill='none' stroke='%23221b3d' stroke-width='2'/%3E%3C/svg%3E") repeat-x center bottom / 360px 32px; pointer-events: none; }

@media print { .snowfall, html[data-season="winter"] .site-header::before, html[data-season="winter"] .site-header::after { display: none; } }
