/* My Litle Gallery -- cosy pixel-ish theme */

:root {
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", "Segoe UI", system-ui, sans-serif;
  --paper: #f7edda;
  --paper-2: #efe0c4;
  --card: #fffaf0;
  --ink: #4a3b32;
  --ink-soft: #877163;
  --line: #e0cda8;
  --accent: #c9714f;
  --wall: #cdbfa6;
  --wood: #c69a63;
  --wood-dk: #9a6b3f;
  --shadow: rgba(74, 59, 50, 0.18);
  --ok: #6f9c6f;
  --warn: #b5563f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, #ffe9c9, transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, #ffd9c7, transparent 55%),
    linear-gradient(180deg, #f9efdd, #f1e2c6);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { color: inherit; }

.mono {
  font-family: ui-monospace, "SF Mono", "Menlo", Consolas, monospace;
  letter-spacing: 0.06em;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- buttons ---------- */

.btn {
  border: 2.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.btn:hover { background: #fff4df; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: 0 3px 0 var(--ink); transform: none; }
.btn--big { padding: 13px 22px; font-size: 1.05rem; border-radius: 16px; }
.btn--sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 11px; box-shadow: 0 2px 0 var(--ink); }
.btn--block { width: 100%; justify-content: center; margin-top: 8px; }
.btn--ghost { background: transparent; box-shadow: 0 2px 0 var(--ink); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.45); }
.btn.danger { border-color: var(--warn); color: var(--warn); box-shadow: 0 2px 0 var(--warn); }

.icon-btn {
  border: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 5px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
.icon-btn:hover { background: rgba(74, 59, 50, 0.1); }
.icon-btn.danger { color: var(--warn); }
.icon { display: block; }

.linkish {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 800;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- landing ---------- */

.landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.landing-hero { text-align: center; }
.hero-house {
  position: relative;
  width: 220px;
  margin: 0 auto 6px;
}
.hero-avatar {
  position: absolute;
  right: -18px;
  bottom: -6px;
}
.house-svg { display: block; }

.logo {
  font-size: clamp(2.1rem, 7vw, 3rem);
  margin: 6px 0 4px;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.6);
}
.tagline {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 30rem;
  margin: 0 auto 22px;
  line-height: 1.5;
}
.landing-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.visit-form { display: flex; gap: 8px; }
.visit-form input,
.text-input,
.name-input {
  border: 2.5px solid var(--ink);
  background: var(--card);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
}
.visit-form input { width: 150px; text-transform: uppercase; letter-spacing: 0.08em; }

.saved-galleries { margin-top: 40px; }
.saved-galleries h2 { font-size: 1.1rem; margin: 0 0 12px; }
.saved-list { display: flex; flex-direction: column; gap: 10px; }
.saved-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 3px 0 var(--ink);
}
.saved-av { line-height: 0; }
.saved-meta { flex: 1; display: flex; flex-direction: column; }
.saved-meta strong { font-size: 0.98rem; }
.saved-meta .mono { font-size: 0.78rem; color: var(--ink-soft); }

.footnote {
  margin-top: 34px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
}

/* ---------- gallery screen ---------- */

.gallery-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 250, 240, 0.8);
  backdrop-filter: blur(6px);
  border-bottom: 2.5px solid var(--ink);
  flex-shrink: 0;
  z-index: 40;
}
.brand {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2.5px solid var(--ink);
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
}
.gallery-title { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.gallery-title h1 {
  font-size: 1.15rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.name-input { max-width: 260px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.music-btn { padding-left: 8px; padding-right: 8px; }
.music-btn.is-on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
/* the diagonal slash means "muted" -- hide it whenever music is playing */
.music-btn .music-slash { display: inline; }
.music-btn.is-on .music-slash { display: none; }
.landing-music {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 10px; font-size: 0.82rem; font-weight: 700;
  color: var(--ink-soft);
}
.avatar-chip {
  border: 2.5px solid var(--ink);
  background: var(--card);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
}
/* the crop viewBox is already centred on the face, so just fill the circle */
.avatar-chip .avatar-svg { width: 100%; height: 100%; margin: 0; }

.room-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
/* full-screen: the room fills the screen; no tabs, no add/decorate bar,
   just a slim bar with the room name and Exit (arrow keys change rooms) */
.gallery-screen.is-fullscreen .topbar {
  padding: 5px 14px;
  background: rgba(255, 250, 240, 0.7);
}
.gallery-screen.is-fullscreen .gallery-title { justify-content: center; }
.fs-title {
  font-size: 0.9rem !important;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0;
}
.gallery-screen.is-fullscreen .stage-wrap { padding: 6px; }
.gallery-screen.is-fullscreen .stage {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  max-width: none;
}
.room-tabs::-webkit-scrollbar { display: none; }
.room-tab {
  flex: 1 0 auto;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 3px 0 var(--ink);
  position: relative;
}
.room-tab.is-active { background: var(--accent); color: #fff; }
.room-tab-count {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.68rem;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.stage-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px 16px;
}
.stage {
  position: relative;
  height: 100%;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 0 var(--shadow), 0 18px 36px rgba(74, 59, 50, 0.2);
  background: var(--wall);
}
.room-back {
  position: absolute;
  inset: 0 0 32% 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wall) 88%, white), var(--wall));
  border-bottom: 3px solid rgba(74, 59, 50, 0.25);
}
.room-back.wall-stripes {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 14px, transparent 14px 34px),
    linear-gradient(180deg, color-mix(in srgb, var(--wall) 88%, white), var(--wall));
}
.room-back.wall-dots {
  background:
    radial-gradient(rgba(255, 255, 255, 0.28) 2px, transparent 2.5px) 0 0 / 26px 26px,
    linear-gradient(180deg, color-mix(in srgb, var(--wall) 88%, white), var(--wall));
}
.room-back.wall-stars {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M18 6 L20.2 14.4 L28.6 16.6 L20.2 18.8 L18 27.2 L15.8 18.8 L7.4 16.6 L15.8 14.4 Z' fill='rgba(255,255,255,0.6)'/%3E%3Cpath d='M50 40 L51.6 46 L57.6 47.6 L51.6 49.2 L50 55.2 L48.4 49.2 L42.4 47.6 L48.4 46 Z' fill='rgba(255,255,255,0.42)'/%3E%3Ccircle cx='46' cy='13' r='1.4' fill='rgba(255,255,255,0.5)'/%3E%3Ccircle cx='11' cy='52' r='1.1' fill='rgba(255,255,255,0.42)'/%3E%3Ccircle cx='63' cy='23' r='1' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E") 0 0 / 72px 72px,
    linear-gradient(180deg, color-mix(in srgb, var(--wall) 88%, white), var(--wall));
}
.room-back.wall-flowers {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88'%3E%3Cg fill='rgba(255,255,255,0.55)'%3E%3Ccircle cx='22' cy='13' r='4'/%3E%3Ccircle cx='31' cy='20' r='4'/%3E%3Ccircle cx='27' cy='30' r='4'/%3E%3Ccircle cx='17' cy='30' r='4'/%3E%3Ccircle cx='13' cy='20' r='4'/%3E%3C/g%3E%3Ccircle cx='22' cy='21' r='3' fill='rgba(255,236,170,0.85)'/%3E%3Cg fill='rgba(255,255,255,0.4)'%3E%3Ccircle cx='62' cy='54' r='3.4'/%3E%3Ccircle cx='69' cy='60' r='3.4'/%3E%3Ccircle cx='64' cy='68' r='3.4'/%3E%3Ccircle cx='56' cy='66' r='3.4'/%3E%3Ccircle cx='55' cy='58' r='3.4'/%3E%3C/g%3E%3Ccircle cx='62' cy='61' r='2.5' fill='rgba(255,236,170,0.7)'/%3E%3Cpath d='M42 44 q7 -3 10 3 q-7 3 -10 -3z' fill='rgba(255,255,255,0.32)'/%3E%3Cpath d='M8 58 q6 -3 9 2 q-6 3 -9 -2z' fill='rgba(255,255,255,0.28)'/%3E%3C/svg%3E") 0 0 / 88px 88px,
    linear-gradient(180deg, color-mix(in srgb, var(--wall) 88%, white), var(--wall));
}
.room-back.wall-panel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  background: color-mix(in srgb, var(--wall) 70%, white);
  border-top: 3px solid rgba(74, 59, 50, 0.22);
  box-shadow: inset 0 6px 10px rgba(74, 59, 50, 0.08);
}
.room-floor {
  position: absolute;
  inset: 68% 0 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(74, 59, 50, 0.14) 0 2px, transparent 2px 60px),
    linear-gradient(180deg, color-mix(in srgb, var(--floor) 90%, white), var(--floor));
}
.room-floor.floor-wide {
  background:
    repeating-linear-gradient(90deg, rgba(74, 59, 50, 0.14) 0 3px, transparent 3px 120px),
    linear-gradient(180deg, color-mix(in srgb, var(--floor) 90%, white), var(--floor));
}
.room-floor.floor-checker {
  background:
    conic-gradient(rgba(74, 59, 50, 0.12) 0 25%, transparent 0 50%, rgba(74, 59, 50, 0.12) 0 75%, transparent 0) 0 0 / 54px 54px,
    linear-gradient(180deg, color-mix(in srgb, var(--floor) 90%, white), var(--floor));
}
.room-floor.floor-plain {
  background: linear-gradient(180deg, color-mix(in srgb, var(--floor) 92%, white), var(--floor));
}
.wall-media {
  position: absolute;
  /* the wall display runs down to exactly where the floor begins (68% from top) */
  inset: 12px 16px 32% 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  padding: 4px 6px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 59, 50, 0.35) transparent;
  overscroll-behavior: contain;
  /* books / movies / records are laid out in full-height "bands" that snap into
     the same spot as you scroll, so nothing is ever cut off at the floor line */
  container-type: size;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}
.shelf-band, .record-band {
  min-height: 100cqh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-top: 26px;
  box-sizing: border-box;
}
.shelf-band { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.record-band {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px 16px;
  align-content: flex-start;
  justify-items: center;
  width: 100%;
  max-width: 760px;
}
.wall-media::-webkit-scrollbar { width: 8px; }
.wall-media::-webkit-scrollbar-thumb { background: rgba(74, 59, 50, 0.3); border-radius: 8px; }
/* the media fills the width; the room stays put behind it */
.wall-media > .record-wall,
.wall-media > .bookcase,
.wall-media > .movie-shelf,
.wall-media > .art-wall { width: 100%; }
.wall-media .room-empty { margin: auto; }

.drag-hint {
  position: sticky;
  top: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.92);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 2px;
}
.drag-item { touch-action: none; }
.drag-item.dragging {
  opacity: 0.9;
  z-index: 999 !important;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(74, 59, 50, 0.4));
  cursor: grabbing;
}
.stage.is-decorating .wall-media {
  opacity: 0.28;
  pointer-events: none;
}
/* while decorating, bring furniture forward so you can see & handle it */
.stage.is-decorating .furni-layer { z-index: 40; }
.room-empty {
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
  border: 2.5px dashed var(--ink);
  border-radius: 14px;
  padding: 16px 20px;
  max-width: 24rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.45;
}

.cap-badge {
  position: absolute;
  left: 10px;
  bottom: 8px;
  background: rgba(74, 59, 50, 0.82);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  z-index: 30;
}

.avatar-stage {
  position: absolute;
  left: 50%;
  top: 98.5%;
  /* width is a share of the stage, so the avatar scales with the room
     (in full-screen too, where the stage is much larger) */
  width: 17.5%;
  transform: translate(-50%, -100%);
  pointer-events: none;
  /* stands on the floor, but drawn in front of everything on the wall */
  z-index: 32;
  filter: drop-shadow(0 6px 4px rgba(74, 59, 50, 0.25));
  transition: filter 0.12s ease;
}
.avatar-stage .avatar-svg { width: 100%; height: auto; display: block; }
.avatar-stage.is-draggable { pointer-events: auto; cursor: grab; touch-action: none; }
.avatar-stage.dragging { cursor: grabbing; filter: drop-shadow(0 12px 10px rgba(74, 59, 50, 0.4)); }
.stage.is-decorating .avatar-stage { z-index: 45; }

/* ---- record wall (scrolls inside .wall-media, in snap-aligned bands) ---- */
.record-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.record-tile {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.record-tile:hover { transform: translateY(-4px) rotate(-1deg); }
.record-tile .cover, .record-tile svg { width: 100%; height: auto; display: block; }
.record-wall.is-edit .record-tile { cursor: grab; touch-action: none; }

/* ---- bookcase ---- */
.bookcase {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}
.shelf { position: relative; }
.shelf-books {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 108px;
  padding: 0 6px;
  overflow: visible;
}
/* an empty shelf is just a slim ledge -- "room to grow", not a big gap */
.shelf-books:empty { min-height: 26px; }
.shelf-cases { gap: 6px; min-height: 116px; align-items: flex-end; }
.movie-bookcase .movie-case { flex: 0 0 auto; }
.spine {
  height: 104px;
  border: none;
  border-radius: 2px 2px 0 0;
  padding: 0;
  overflow: hidden;
  transform-origin: bottom center;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, margin 0.1s ease;
  flex: 0 0 auto;
}
.spine:hover { transform: translateY(-8px) !important; }
.spine .spine-svg { width: 100%; height: 100%; display: block; }
.shelf-plank {
  height: 12px;
  background: linear-gradient(180deg, var(--wood), var(--wood-dk));
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 0 5px 7px rgba(74, 59, 50, 0.28);
}

/* ---- movie shelf ---- */
.movie-shelf { width: 100%; max-width: 660px; }
.movie-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-end;
  padding: 0 8px 8px;
}
.movie-case {
  width: 66px;
  border: none;
  border-left: 4px solid rgba(0, 0, 0, 0.28);
  border-radius: 2px 4px 4px 2px;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  box-shadow: 2px 4px 7px rgba(74, 59, 50, 0.3);
  transition: transform 0.1s ease;
}
.movie-case:hover { transform: translateY(-5px) rotate(1deg); }
.movie-case .cover { width: 100%; height: auto; }
.shelf-plank--wide { max-width: 660px; }

/* ---- art wall ---- */
.art-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 20px;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  padding: 10px 2px;
}
.painting {
  margin: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease;
  flex: 0 0 auto;
}
.painting:hover { transform: translateY(-4px); }

/* paintings hung freely: drag anywhere on the wall */
.art-free-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.art-free-layer .room-empty { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); pointer-events: auto; }
.painting-free {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.painting-free:hover { transform: translate(-50%, -50%) translateY(-4px); }
.painting-free.is-free { cursor: grab; touch-action: none; }
.painting-free.dragging {
  transform: translate(-50%, -50%) scale(1.05);
  z-index: 60;
  cursor: grabbing;
  filter: drop-shadow(0 10px 12px rgba(74, 59, 50, 0.4));
}
.picture-light {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 22px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 235, 180, 0.85), transparent 70%);
  pointer-events: none;
}
/* no mat / white lining -- the frame sits straight on the painting */
.frame-inner {
  border-radius: 1px;
  background: transparent;
  padding: 0;
  line-height: 0;
  min-width: 48px;
  min-height: 64px;
}
/* paintings keep their true proportions: same height, width follows the ratio.
   Sized against the wall (a size container), so they scale up with the room
   in full-screen instead of staying small. */
.painting-img {
  display: block;
  height: clamp(88px, 15cqw, 264px);
  width: auto;
  max-width: 26cqw;
  object-fit: contain;
  background: #efe6d4;
}
/* ---- frame styles (choose per painting) ---- */
.painting[class*="frame--"] { padding: 7px; border: 2px solid rgba(0, 0, 0, 0.35); border-radius: 3px; }
.frame--gold       { background: linear-gradient(135deg, #e6c260, #b98f34); border-color: #7c5f22; }
.frame--silver     { background: linear-gradient(135deg, #d7dade, #9aa0a6); border-color: #6b7075; }
.frame--walnut     { background: linear-gradient(135deg, #9c6b40, #6f4526); border-color: #4a2f19; }
.frame--oak        { background: linear-gradient(135deg, #dcc19a, #b9986e); border-color: #7c5f3c; }
.frame--ebony      { background: #26221f; border-color: #000; }
.frame--black      { background: #26221f; border-color: #000; }
.frame--ivory      { background: linear-gradient(135deg, #f6f2ea, #e4ddcd); border-color: #cfc6b6; }
.frame--rose       { background: linear-gradient(135deg, #e6a9b8, #c9788c); border-color: #9c5568; }
.frame--sage       { background: linear-gradient(135deg, #adc3a6, #7f9c78); border-color: #5c7355; }
.frame--navy       { background: linear-gradient(135deg, #4a5f86, #2f3d5b); border-color: #1e2740; }
.frame--plum       { background: linear-gradient(135deg, #9a6fa8, #6f4a86); border-color: #4c3060; }
.frame--teal       { background: linear-gradient(135deg, #63b3ab, #3f8880); border-color: #2c5f59; }
.frame--terracotta { background: linear-gradient(135deg, #d98f6f, #b5654a); border-color: #7c4230; }
.frame--none       { padding: 2px; background: transparent; border: 2px solid rgba(74, 59, 50, 0.3); }
.frame--natural    { background: linear-gradient(135deg, #dcc19a, #b9986e); border-color: #7c5f3c; }
.frame--white      { background: linear-gradient(135deg, #f6f2ea, #e4ddcd); border-color: #cfc6b6; }
.placard {
  margin-top: 8px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 0.68rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.placard strong { font-size: 0.72rem; }
.placard em { color: var(--ink-soft); font-style: italic; }
.painting-missing {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 90px;
  background: #efe6d4;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 2px;
}
.painting-missing.big { min-height: 220px; }

/* ---- furniture ---- */
.furni-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* the TV is a fixed fixture in the records + books rooms (sponsor slot); it can be
   moved in Decorate but not removed. In other rooms it's optional furniture. */
.room-tv {
  position: absolute;
  top: 80%;
  left: 85%;
  width: 21%;
  z-index: 25;
  line-height: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 5px rgba(74, 59, 50, 0.22));
}
.room-tv > svg { width: 100%; height: auto; display: block; overflow: visible; }
.room-tv .tv-screen { pointer-events: auto; }
/* outside decorate, the whole TV is clickable so it can open the ad's link */
.room-tv:not(.is-draggable) > svg { pointer-events: auto; }
.room-tv.is-draggable { pointer-events: auto; cursor: grab; touch-action: none; }
.room-tv.is-draggable .tv-screen { pointer-events: none; }
.room-tv .tv-toolbar { pointer-events: auto; }
.room-tv.dragging { cursor: grabbing; filter: drop-shadow(0 12px 10px rgba(74, 59, 50, 0.4)); }
.stage.is-decorating .room-tv { z-index: 46; }

.furni-item {
  position: absolute;
  pointer-events: auto;
  line-height: 0;
  touch-action: none;
}
.furni-item .furni { width: 100%; height: auto; display: block; overflow: visible; }
.decorate-drawer ~ .stage-wrap .furni-item,
.gallery-screen .furni-item { }
.furni-item.is-sel { outline: 2.5px dashed var(--accent); outline-offset: 3px; border-radius: 6px; cursor: grab; }
.furni-toolbar {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 3px 0 var(--ink);
  z-index: 50;
}
.tv-screen {
  position: absolute;
  /* matches the dark screen hole in the TV sprite (x18-72, y37-75 of its 100x100 box) */
  left: 19%;
  top: 38%;
  width: 52%;
  height: 36%;
  border-radius: 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3px;
  overflow: hidden;
  font-size: 6.5px;
  line-height: 1.15;
  gap: 1px;
}
.tv-screen > * { max-width: 100%; }
.tv-screen strong { font-size: 7.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.tv-screen .ad-emoji { font-size: 13px; line-height: 1; }
.tv-screen .ad-line { opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.tv-ad-img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* visible "this ad links out" ribbon along the bottom of the screen */
.tv-visit {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 4.6px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 1.5px 2px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.room-tv [data-tv-knob], .furni-item [data-tv-knob] { cursor: pointer; }
.tv-sponsor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 5.5px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 1px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- bottom bar / decorate ---------- */

.bottombar,
.visit-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.visit-banner {
  background: rgba(255, 250, 240, 0.85);
  border-top: 2.5px solid var(--ink);
}

.decorate-drawer {
  background: var(--card);
  border-top: 3px solid var(--ink);
  padding: 10px 14px 14px;
  max-height: 38vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.drawer-head strong { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.furni-group { margin-bottom: 8px; }
.furni-group-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.furni-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 4px;
  scrollbar-width: thin;
}
.furni-btn {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 6px 4px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.furni-btn:hover { background: #fff4df; }
.furni-thumb { width: 52px; height: 52px; line-height: 0; }
.furni-thumb .furni { width: 100%; height: 100%; }
.drawer-tip { font-size: 0.75rem; color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- side panel (add) ---------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(45, 34, 28, 0.32);
  z-index: 100;
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(430px, 94vw);
  background: var(--card);
  border-left: 3px solid var(--ink);
  z-index: 101;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(74, 59, 50, 0.25);
  animation: slideIn 0.18s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0.4; } }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 2.5px solid var(--ink);
}
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.panel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
}
.panel-search input { border: none; outline: none; width: 100%; font-size: 0.95rem; font-weight: 700; background: transparent; color: var(--ink); }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.panel-loading, .panel-note { color: var(--ink-soft); padding: 14px; text-align: center; font-weight: 700; }
.panel-note.warn { color: var(--warn); }
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 2px solid var(--line);
}
.result-thumb {
  width: 60px;
  min-width: 60px;
  border-radius: 5px;
  overflow: hidden;
  line-height: 0;
  border: 2px solid var(--ink);
  background: #eee;
}
.result-thumb .cover, .result-thumb img { width: 100%; height: auto; display: block; }
.result-thumb img { aspect-ratio: 1; object-fit: cover; }
.thumb-missing { display: grid; place-items: center; width: 60px; height: 60px; color: var(--ink-soft); font-weight: 800; }
.result-meta { flex: 1; min-width: 0; font-size: 0.82rem; line-height: 1.3; }
.result-meta strong { display: block; font-size: 0.9rem; }
.result-meta em { color: var(--ink-soft); font-style: normal; }
.panel-foot { border-top: 2.5px solid var(--ink); padding: 12px 16px; }
.manual-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.manual-form input { border: 2px solid var(--ink); border-radius: 10px; padding: 8px; font-weight: 700; font-size: 0.85rem; }
.manual-form input[name="title"] { grid-column: 1 / -1; }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 22px;
  z-index: 101;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 14px 0 var(--shadow), 0 30px 60px rgba(74, 59, 50, 0.3);
  animation: pop 0.16s ease;
}
@keyframes pop { from { transform: translate(-50%, -46%) scale(0.96); opacity: 0.5; } }
.modal-x { position: absolute; top: 10px; right: 10px; }

/* ---------- study desk ---------- */
.study-setup { width: 340px; text-align: center; }
.study-setup h2 { margin: 0 0 6px; }
.study-dial {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 16px 0 12px;
}
.study-min { display: flex; flex-direction: column; line-height: 1; min-width: 92px; }
.study-min strong { font-size: 2.6rem; font-weight: 800; color: var(--ink); }
.study-min span { font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.08em; }
.study-presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 16px; }
.study-confirm { width: 320px; text-align: center; }
.study-confirm h2 { margin: 0 0 4px; }
.study-confirm-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

.ad-visit { width: 340px; text-align: center; }
.ad-visit h2 { margin: 0 0 6px; }
.ad-visit-url {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(74, 59, 50, 0.06);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 10px 0 2px;
  word-break: break-all;
}
.ad-visit-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* floating focus chip -- the room view is unchanged, this just sits on top */
.study-hud {
  position: absolute;
  left: 50%; top: 10px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 12px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--shadow);
  z-index: 40;
  white-space: nowrap;
}
.study-hud-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cf5b5b;
  animation: study-pulse 1.6s ease-in-out infinite;
}
@keyframes study-pulse { 50% { opacity: 0.3; } }
.study-hud .study-clock {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 0.95rem;
}
.study-hud .study-bar {
  width: 64px; height: 6px;
  background: rgba(74, 59, 50, 0.16);
  border-radius: 999px;
  overflow: hidden;
}
.study-hud .study-bar-fill {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.9s linear;
}
/* the avatar tucked in at the desk: the desk is redrawn here, above the avatar,
   so its front panel hides the avatar's legs -> "seated" */
.avatar-stage.is-studying { transition: none; }
.study-desk-front {
  position: absolute;
  z-index: 34;
  line-height: 0;
  pointer-events: none;
}
.study-desk-front .furni { width: 100%; height: auto; display: block; overflow: visible; }

.detail-modal { width: 460px; text-align: center; }
.detail-cover, .detail-modal .detail-art { display: inline-block; margin: 6px auto 4px; }
.detail-art { max-width: 100%; max-height: 56vh; border: 6px solid #d8b25a; border-radius: 3px; background: #f3ede0; }
.detail-cover .cover { border: 3px solid var(--ink); border-radius: 3px; }
.detail-info { text-align: left; margin-top: 12px; }
.detail-info h2 { margin: 0 0 8px; font-size: 1.25rem; }
.detail-line { margin: 3px 0; font-size: 0.92rem; }
.pd-note { color: var(--ok); font-weight: 800; display: flex; align-items: center; gap: 4px; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.detail-src { margin-top: 10px; font-size: 0.76rem; color: var(--ink-soft); }

.share-modal { width: 400px; }
.share-modal h2 { margin: 0 0 6px; }
.muted { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.45; margin: 6px 0; }
.code-big {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper);
  border: 2.5px dashed var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.code-big .mono { font-size: 1.4rem; font-weight: 800; }
.edit-link { margin-top: 12px; border-top: 2px solid var(--line); padding-top: 10px; }
.edit-link summary { font-weight: 800; cursor: pointer; color: var(--warn); }

.creator-modal { width: min(640px, 94vw); }
.creator-grid { display: grid; grid-template-columns: 170px 1fr; gap: 18px; }
.creator-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview-stage {
  background: radial-gradient(circle at 50% 40%, #fff, var(--paper));
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 12px;
  line-height: 0;
}
.creator-controls { min-width: 0; }
.ctl-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 12px 0 5px;
}
.creator-controls .ctl-label:first-child { margin-top: 0; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2.5px solid var(--ink);
  padding: 0;
}
.chip.is-on { outline: 3px solid var(--accent); outline-offset: 1px; }
.species-btn {
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
/* crop viewBox is centred on the face — just fill the square */
.species-btn .avatar-svg { width: 100%; height: 100%; margin: 0; }
.species-btn.is-on { background: #fff; outline: 3px solid var(--accent); outline-offset: 1px; }
.pill {
  border: 2.5px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 11px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--ink);
  text-transform: capitalize;
}
.pill.is-on { background: var(--accent); color: #fff; }
.creator-foot { margin-top: 18px; }

/* ---------- toasts ---------- */

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  align-items: center;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(74, 59, 50, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast--warn { background: var(--warn); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .stage { aspect-ratio: 4 / 5; }
  .room-back { inset: 0 0 34% 0; }
  .room-floor { inset: 66% 0 0 0; }
  .creator-grid { grid-template-columns: 1fr; }
  .creator-preview { flex-direction: row; justify-content: center; }
  .detail-modal, .share-modal { width: 94vw; }
  .topbar { flex-wrap: wrap; }
  .gallery-title { order: 3; flex-basis: 100%; }
  .manual-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- decorate: tabs + walls/floors ---------- */

.drawer-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.drawer-tabs::-webkit-scrollbar { display: none; }
.drawer-tab {
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 0.78rem;
}
.drawer-tab.is-on { background: var(--accent); color: #fff; }

.wf-picker { display: flex; gap: 22px; flex-wrap: wrap; padding: 4px 2px 8px; }
.wf-col { flex: 1 1 220px; }
.wf-col .ctl-label:first-child { margin-top: 2px; }

/* ---------- draggable items ---------- */

.bookcase.is-edit .spine,
.art-wall.is-edit .painting,
.record-wall.is-edit .record-tile,
.movie-shelf.is-edit .movie-case { cursor: grab; touch-action: none; }
.spine.dragging,
.painting.dragging,
.record-tile.dragging,
.movie-case.dragging {
  opacity: 0.55;
  transform: scale(1.06) !important;
  filter: drop-shadow(0 8px 10px rgba(74, 59, 50, 0.35));
}
.drop-marker {
  flex: 0 0 auto;
  align-self: stretch;
  width: 4px;
  min-height: 60px;
  margin: 0 2px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.art-wall .drop-marker { min-height: 120px; }
.record-wall .drop-marker { min-height: 110px; }

.shelf-hint {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.7);
  border-radius: 8px;
  padding: 3px 8px;
  margin: 6px auto 0;
}

/* ---------- frame picker chips ---------- */

/* ---------- world map room -- the map IS the wall ---------- */
.worldmap-wrap {
  position: absolute;
  inset: 0 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #cfe4ee;
  border-radius: 6px;
  overflow: hidden;
}
.worldmap {
  width: 100%;
  height: 100%;
  display: block;
}
.worldmap .wm-country { cursor: default; }
.worldmap .wm-on { cursor: pointer; }
.worldmap .wm-on:hover { filter: brightness(1.08); }
.wm-empty {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: rgba(255, 250, 240, 0.9);
  border: 2.5px dashed var(--ink);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  text-align: center;
  max-width: 20rem;
}
.wm-detail .wm-detail-swatch {
  width: 100%;
  height: 90px;
  border-radius: 12px;
  border: 3px solid var(--ink);
}
.result-row--plain { padding: 10px 6px; }

/* ---------- fridge: an open-fridge POV ---------- */
.furni-item.furni-clickable { cursor: pointer; }
.fridge-modal { width: min(500px, 94vw); text-align: center; padding: 16px; }
.fridge-view {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  max-height: 72vh;
  margin: 4px auto 10px;
  display: flex;
  flex-direction: column;
  border: 12px solid #e7e2d7;          /* the open door / cabinet */
  border-radius: 16px;
  background: linear-gradient(180deg, #eef4f5, #dfe9ea 60%, #d3e0e1);
  box-shadow:
    inset 0 0 0 2px rgba(74, 59, 50, 0.25),
    inset 0 30px 50px rgba(255, 255, 255, 0.5),
    inset 0 -20px 40px rgba(60, 80, 90, 0.16),
    0 14px 0 var(--shadow), 0 28px 50px rgba(74, 59, 50, 0.3);
  overflow: hidden;
}
/* interior light glow from the top */
.fridge-light {
  position: absolute;
  left: 10%; right: 10%; top: -6%;
  height: 26%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 240, 0.9), transparent 72%);
  pointer-events: none;
  z-index: 3;
}
/* angled side walls -> depth / point-of-view */
.fridge-wall {
  position: absolute;
  top: 0; bottom: 0;
  width: 16%;
  background: linear-gradient(90deg, rgba(90, 110, 120, 0.22), rgba(90, 110, 120, 0));
  pointer-events: none;
  z-index: 1;
}
.fridge-wall--l { left: 0; clip-path: polygon(0 0, 100% 10%, 100% 90%, 0 100%); }
.fridge-wall--r { right: 0; background: linear-gradient(270deg, rgba(90, 110, 120, 0.22), rgba(90, 110, 120, 0)); clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 90%); }

.fridge-shelf {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
}
.fridge-items {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  padding: 6px 10% 8px;
}
.fridge-glass {
  height: 9px;
  margin: 0 3%;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(210, 225, 228, 0.5));
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 12px rgba(60, 80, 90, 0.22);
}
.fridge-slot {
  border: none;
  background: none;
  padding: 2px;
  line-height: 0;
  transition: transform 0.1s ease;
}
.fridge-slot .food-art {
  width: clamp(52px, 15vw, 88px);
  height: auto;
  display: block;
  filter: drop-shadow(0 7px 5px rgba(60, 80, 90, 0.32));
}
.fridge-slot[data-action] { cursor: pointer; }
.fridge-slot[data-action]:hover { transform: translateY(-4px) scale(1.06); }
.fridge-slot[data-action]:active { transform: translateY(0) scale(0.95); }

.frame-picker { margin: 10px 0 4px; }
.frame-chip {
  width: 30px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid var(--ink);
  padding: 0;
}
.frame-chip.frame--none { background: repeating-linear-gradient(45deg, #eee 0 4px, #fff 4px 8px); padding: 0; border: 2px solid var(--ink); }
.frame-chip.is-on { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------- poster paint editor ---------- */

.poster-modal { width: min(460px, 94vw); text-align: center; }
.poster-editor { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 12px 0; }
.poster-grid {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  width: min(320px, 78vw);
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  background: #fdf7ea;
  touch-action: none;
  cursor: crosshair;
}
.pcell { display: block; width: 100%; height: 100%; box-shadow: inset 0 0 0 0.5px rgba(74, 59, 50, 0.08); }
.poster-palette { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pchip {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--ink);
  border-radius: 7px;
  padding: 0;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}
.pchip.is-on { outline: 3px solid var(--accent); outline-offset: 1px; }
.poster-foot { display: flex; gap: 10px; justify-content: center; align-items: center; }
