/*
 * Settled In (was draft-house) v3. Since 2026-12-03 there is ONE view, the lived-in one below:
 * rooms and tenants both move in it. The PLAN rules are kept for reference (planSVG, view-plan).
 * PLAN = an architect's drawing: ink walls on drafting paper, door leaves with swing arcs,
 *   room names lettered in condensed capitals. No fill colour at all. Rooms move here.
 * MOVE IN = the same plan, lived in: flat floor colours per room, a few furniture glyphs,
 *   softer brown walls, tenants as coloured tokens in their bedrooms.
 * Rules: square cells only, no hex/terrain look; no cards or shadows; hairlines for structure;
 * a met want is ink + tick, an unmet one pencil grey; side panel lowercase in one sans family.
 * Placeholder pass: CSS/SVG only, no image assets.
 * PALETTE IS A PLACEHOLDER — not reviewed, to be proposed properly if this survives.
 */
:root {
  --paper: #f7f7f5;
  --grid: #e2e3df;
  --ink: #1e1f1d;
  --muted: #7b7d78;
  --ok: #1e1f1d;
  --room: #ffffff;
  --brick: #c27a5e;
  --t0: #d4522f;
  --t1: #1d8584;
  --t2: #c3951a;
  --t3: #8a4f86;
  --t4: #3d679a; /* provisional: only the five-tenant playtest knob uses it */
  --cell: min(100px, 21vw);
  /* move-in view */
  --wall: #4f4237;
  --floor-bed: #f1e4d3;
  --floor-bed-2: #d9b9a0;
  --floor-kitchen: #f4e7b8;
  --floor-bath: #d6e8ee;
  --floor-nursery: #f5dde1;
  --floor-music: #e6ddf0;
  --floor-study: #ecdcc6;
  --floor-workshop: #dcd8d0;
  --floor-sunroom: #fbf0c8;
  --lettering: "Avenir Next Condensed", "DIN Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background-color 450ms ease, color 450ms ease;
}
/* drafting grid on its own layer so it can fade out in the move-in view */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 25px 25px;
  transition: opacity 450ms ease;
}
main { max-width: 920px; margin: 0 auto; padding: 20px 16px 40px; }
header h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.sub { margin: 2px 0 18px; color: var(--muted); }

.play { display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; }
.left { flex: none; width: calc(var(--cell) * 4 + 2px); }
.plot {
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  border: 1px dashed var(--muted);
  background: var(--paper);
  touch-action: none;
}
.edge { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 13px; color: var(--muted); height: 24px; align-items: center; }
.edge.top { display: block; text-align: center; }
.edge span { text-align: center; white-space: nowrap; }
.edge .mark { color: var(--ink); font-weight: 600; }

.cell { position: relative; outline: 1px solid var(--grid); }
.cell.drop:hover { background: #fff; cursor: pointer; }
.room { position: absolute; inset: 0; cursor: grab; touch-action: none; user-select: none; }
.room svg { display: block; width: 100%; height: 100%; }
.room.sel svg { outline: 3px solid var(--ink); outline-offset: -3px; }
.room.cut svg { opacity: 0.4; }
.room.cut::after { content: "cut off"; position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; }
.room.target { cursor: pointer; }
.room.target svg { outline: 2px dashed var(--ink); outline-offset: -6px; }

.token {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; cursor: grab; touch-action: none; user-select: none;
  border: 2px solid var(--ink); flex: none;
}
.room .token { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); }
.token.sel { outline: 3px solid var(--ink); outline-offset: 2px; }
.token.placeholder { background: none !important; border-style: dashed; border-color: var(--muted); color: var(--muted); cursor: default; }

.tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: calc(var(--cell) * 0.7 + 14px); padding: 6px 0; margin-top: 6px; border-top: 2px solid var(--ink); }
.tray .room { position: relative; width: calc(var(--cell) * 0.7); height: calc(var(--cell) * 0.7); }
.tray.drop { background: #fff; }
.tray:empty { min-height: 0; }

/* keyboard focus sits outside the piece; the selection (solid) and drop targets (dashed) sit inside */
.room:focus { outline: none; }
.room:focus-visible, .cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 2; }
.cell:focus:not(:focus-visible) { outline: 1px solid var(--grid); }
.token:focus { outline: none; }
.token:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.token.sel:focus-visible { outline-width: 3px; outline-offset: 2px; }

.bar { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.bar .views { margin-bottom: 0; }
.tools { display: flex; gap: 14px; }
.tools[hidden] { display: none; }
.tools button.link { font-size: 13px; color: var(--muted); }
.tools button.link:hover:not(:disabled) { color: var(--ink); }

.ghost { position: fixed; pointer-events: none; z-index: 10; opacity: 0.9; }
.ghost.room-ghost { width: var(--cell); height: var(--cell); }
.ghost svg { width: 100%; height: 100%; }

.hint { color: var(--muted); font-size: 13px; margin: 8px 0; }

.side { flex: 1; min-width: 280px; }
.status { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
#score { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
#perfect-note { color: var(--muted); font-size: 14px; }

.tenants { list-style: none; margin: 0; padding: 0; }
.tenants li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.tenants .who { font-weight: 700; }
.tenants .where { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.want { display: block; font-size: 14px; color: var(--muted); }
.want::before { content: "○ "; }
.want.ok { color: var(--ink); }
.want.ok::before { content: "✓ "; font-weight: 700; }
/* weighted wants (2026-12-03): a fixed mark column, "must" or the wish's points */
.want .wt { display: inline-block; min-width: 3.4em; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.want.need .wt { font-weight: 700; color: var(--ink); }
.want.need:not(.ok) { color: var(--ink); }
.key { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.key span { display: block; }
.key span + span { margin-top: 3px; }

button#finish {
  margin-top: 16px; font: inherit; font-size: 15px; background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); padding: 7px 16px; cursor: pointer;
}
button:hover:not(:disabled) { background: #fff; }
button:disabled { opacity: 0.4; cursor: default; }

.end-card pre { font: 14px/1.35 ui-monospace, Menlo, monospace; background: #f6f0e6; border-left: 3px solid #2b241e; padding: 8px 12px; white-space: pre-wrap; }
.end-card .end-actions button:hover:not(:disabled) { background: #4a3e33; }
.end-card .end-actions button.quiet:hover:not(:disabled) { background: #f6f0e6; }
.copied { margin-left: 10px; font-size: 14px; }

footer { margin-top: 34px; font-size: 13px; color: var(--muted); }
footer a { color: var(--ink); }
code { font-size: 12px; }

@media (max-width: 640px) {
  :root { --cell: 22vw; }
  .play { gap: 14px; }
  header h1 { font-size: 22px; }
}

/* ---- the two views ---- */
.views { display: flex; gap: 18px; margin-bottom: 6px; }
.views button { font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 2px 0; cursor: pointer; color: var(--muted); }
.views button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.letter { font-family: var(--lettering); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink); }
.letter.small { font-size: 11px; font-weight: 500; }
.live-label { font: 600 11px system-ui, sans-serif; fill: var(--wall); }
.live-label.star { font-size: 13px; fill: var(--ink); }

.view-plan .plot { background: transparent; }
.view-live .plot { background: #e9e4dc; border-style: solid; border-color: var(--wall); }
.view-live .cell { outline: 1px dashed #d6c8b5; outline-offset: -1px; }
.view-live .room .token { left: 72%; top: 58%; width: 30px; height: 30px; font-size: 14px; }
.tenants .token.housed { opacity: 0.45; }

.specials { list-style: none; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.specials li { padding: 3px 0; }
.specials .want { display: inline; margin-left: 6px; } /* name and conditions share a line */
.sp-name { font-weight: 700; }
.pts { color: var(--muted); font-size: 13px; }

/* ---- page-wide view palettes ---- */
body.view-plan h1 { font-family: var(--lettering); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
body.view-live {
  --paper: #f5ece0;
  --ink: #3b2f26;
  --muted: #8b7a6a;
  --grid: #e9dccb;
}
body.view-live::before { opacity: 0; }
body.view-live h1 { font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; font-weight: 800; }
body.view-live .tenants li { border-bottom-color: #e6d7c3; }

/* rooms paint in, one after another, when switching to move in */
@keyframes paint { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
body.painting.view-live #plot .room { animation: paint 300ms ease both; animation-delay: calc(var(--i, 0) * 25ms); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 350ms; }

/* ---- fixed features ---- */
#garden span, #street span { display: inline-flex; justify-content: center; align-items: center; gap: 3px; }
.feat { color: var(--ink); font-weight: 600; }
.glyph { width: 18px; height: 18px; flex: none; }
:root { --leaf: #6f8f5f; --bark: #7a5a3f; }
.plot-wrap { position: relative; }
.bakery {
  position: absolute; top: 0; bottom: 0; left: -17px; width: 14px;
  background: repeating-linear-gradient(45deg, transparent 0 4px, var(--muted) 4px 5px);
  border: 1px solid var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.bakery.right { left: auto; right: -17px; }
.bakery[hidden] { display: none; }
.bakery span {
  writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600;
  background: var(--paper); padding: 4px 0; color: var(--ink); white-space: nowrap;
}
.bakery.right span { transform: none; }

/* ---- handing over the keys: dusk, then lights on room by room from the front door ---- */
#plot.dusk .room { filter: brightness(0.38) saturate(0.35); }
#plot.dusk.lights .room { filter: none; transition: filter 380ms ease; transition-delay: calc(var(--d, 0) * 140ms + 300ms); }
@keyframes keypop { 0% { transform: translate(-50%, -50%) scale(0.5); } 60% { transform: translate(-50%, -50%) scale(1.25); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes keydrop { from { opacity: 0; transform: translateY(-14px) rotate(-30deg); } to { opacity: 1; transform: none; } }
#plot.dusk.lights .room .token:not(.placeholder) { animation: keypop 420ms ease both; animation-delay: calc(var(--d, 0) * 140ms + 520ms); }
#plot.dusk.lights .room .token:not(.placeholder)::after {
  content: ""; position: absolute; right: -9px; top: -7px; width: 9px; height: 13px;
  background: #e3b341; border: 1.5px solid var(--wall); border-radius: 2px 2px 5px 5px;
  animation: keydrop 360ms ease both; animation-delay: calc(var(--d, 0) * 140ms + 560ms);
}

/* ---- the result card: centred in the screen, rising in from below ---- */
.end-card {
  position: fixed; left: 50%; top: 50%; z-index: 20; width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow-y: auto; /* never taller than the screen */
  transform: translate(-50%, -50%); background: #fffdf8; color: #2b241e;
  border: 2px solid #2b241e; box-shadow: 6px 6px 0 #2b241e; padding: 18px 20px 16px;
}
.end-card[hidden] { display: none; }
@keyframes slideup { from { transform: translate(-50%, 60vh); } to { transform: translate(-50%, -50%); } }
@keyframes thump { 0% { opacity: 0; transform: rotate(-9deg) scale(1.9); } 70% { opacity: 1; transform: rotate(-9deg) scale(0.94); } 100% { opacity: 1; transform: rotate(-9deg) scale(1); } }
.end-card.fresh { animation: slideup 420ms cubic-bezier(.2,.9,.3,1.15) both; }
.end-card.fresh .stamp { animation: thump 380ms ease-out 380ms both; }
.stamp {
  position: absolute; right: 18px; top: 16px; transform: rotate(-9deg);
  font: 700 15px/1 var(--lettering); letter-spacing: 0.12em; text-transform: uppercase;
  color: #8b7a6a; border: 3px double currentColor; padding: 6px 10px 5px;
}
.stamp.perfect { color: #c2412d; font-size: 18px; }
.end-card .end-score { margin: 0 0 4px; color: inherit; font-size: 52px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.end-score .of { font-size: 24px; font-weight: 600; color: #8b7a6a; }
.end-card h2 { margin: 8px 0 2px; font-size: 19px; }
.end-card p { margin: 0 0 8px; font-size: 14px; color: #5d4f43; }
.end-tenants { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 14px; }
.end-tenants li { display: flex; align-items: center; gap: 6px; }
.end-tenants .ticks { margin-left: auto; letter-spacing: 1px; }
.token.mini { width: 20px; height: 20px; font-size: 11px; border-width: 1.5px; cursor: default; }
.token.mini[data-t="0"] { background: var(--t0); }
.token.mini[data-t="1"] { background: var(--t1); }
.token.mini[data-t="2"] { background: var(--t2); }
.token.mini[data-t="3"] { background: var(--t3); }
.token.mini[data-t="4"] { background: var(--t4); }
.token.mini.star { background: #2b241e; }
.end-card pre { margin: 6px 0 0; font-size: 13px; }
.end-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.end-actions button { margin-top: 10px; font: inherit; font-size: 15px; background: #2b241e; color: #fffdf8; border: 1.5px solid #2b241e; padding: 7px 16px; cursor: pointer; }
.end-actions button.quiet { background: none; color: #2b241e; }
.reopen { position: fixed; right: 16px; bottom: 16px; z-index: 19; font: inherit; font-size: 14px; background: #fffdf8; border: 2px solid #2b241e; box-shadow: 3px 3px 0 #2b241e; padding: 6px 14px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  body, body::before { transition: none; }
  body.painting.view-live #plot .room, .end-card.fresh, .end-card.fresh .stamp { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* weekly difficulty, said quietly in the subtitle */
.difficulty { font-style: italic; }

/* ---- retries and the perfect-house gallery ---- */
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link:hover:not(:disabled) { background: none; text-decoration-thickness: 2px; }
.end-card .end-best { margin: -4px 0 8px; font-size: 14px; font-weight: 600; color: #2b241e; }
.end-card .end-best.seen { color: #8b7a6a; }
.end-more { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e6d7c3; font-size: 14px; color: #2b241e; }
/* today's other puzzles: plain lines under a hairline, in the card's own ink, no boxes */
.others { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e6d7c3; font-size: 13px; color: #5d4f43; }
.end-card .others-h { display: flex; justify-content: space-between; margin: 0 0 2px; font-size: 13px; font-style: italic; color: #8b7a6a; }
.others ul { list-style: none; margin: 0; padding: 0; }
.others li { line-height: 1.5; }
.others a { color: #2b241e; font-weight: 600; text-underline-offset: 3px; }
.others-h a { font-style: normal; font-weight: 400; }
.spoiler { font-size: 12px; font-style: italic; color: #8b7a6a; }
.reveal-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 14px; }
.reveal-bar button:not(.link) { font: inherit; font-size: 16px; line-height: 1; width: 28px; height: 28px; padding: 0; border: 1.5px solid currentColor; background: none; color: inherit; cursor: pointer; }
.reveal-bar #rv-back { margin-left: auto; }
.reveal-bar[hidden] { display: none; }
/* a revealed house is not yours: dashed frame, no picking up */
body.revealing #plot { outline: 2px dashed var(--muted); outline-offset: 2px; }
body.revealing #plot .room, body.revealing .tenants .token { cursor: default; }
#rv-label { line-height: 1.2; }
#rv-label small { display: block; font-size: 12px; color: var(--muted); }
.reveal-bar #rv-back { white-space: nowrap; }

/* Endless playtest bar (?endless): a dev tool, so plain: hairlines above and below, no box. */
.playtest { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--grid); padding: 8px 0 10px; margin: -6px 0 18px; font-size: 13px; }
.pt-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.pt-levels { display: flex; gap: 10px; }
.pt-levels .link { font-size: 13px; color: var(--muted); text-decoration: none; }
.pt-levels .link.on { color: var(--ink); text-decoration: underline; }
.pt-next { margin-left: auto; padding: 3px 12px; }
.pt-tags { margin: 8px 0 6px; gap: 6px; }
.pt-tag { font-size: 12px; padding: 2px 8px; border-radius: 0; }
.pt-tag[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
#pt-note { width: 100%; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--grid); background: var(--room); color: var(--ink); resize: vertical; }
.pt-foot { margin-top: 4px; color: var(--muted); }
.pt-foot .link { font-size: 13px; }
.pt-out { font-size: 12px; max-height: 320px; overflow: auto; background: var(--room); border: 1px solid var(--grid); padding: 8px; margin: 8px 0 0; white-space: pre-wrap; }

/* the house rules fold into the finish button: "needed: …" while one is unmet */
#finish:has(.fin-need:not(:empty)) .fin-go { display: none; }

/* ---- one screen, no scrolling (2026-12-03) ----
 * The page is exactly one viewport tall on a laptop and a phone. The plot's cell size follows
 * the viewport height, so plot + tray always fit; tenants sit two by two beside the plot; the
 * house rules are named in the finish button. Information stays on screen, nothing hides behind a tap. */
:root { --cell: clamp(58px, min(calc((100vw - 620px) / 4), calc((100dvh - 296px - var(--trim, 0px)) / 4.4)), 124px); }
main { max-width: 1140px; min-height: 100dvh; padding: 14px 28px 8px; display: flex; flex-direction: column; }
header { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; }
header h1 { font-size: 26px; }
/* terms / privacy: in the footer on a laptop, under the room tray on a phone; neither adds height */
footer .legal { display: inline; }
.legal-phone { display: none; }
.sub { margin: 0 0 10px; }
.play { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: start; align-content: center; padding-bottom: 2vh; }
.hint { font-size: 12.5px; margin: 6px 0 0; max-width: calc(var(--cell) * 4); }
.tray { margin-top: 4px; }

.status { padding-bottom: 4px; }
.tenants { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.tenants li { gap: 10px; padding: 8px 0; }
.want { font-size: 13.5px; line-height: 1.35; }
.want .wt { min-width: 3em; }
.key { margin: 6px 0 2px; }
.specials { padding: 6px 0; }
.side > button#finish { margin-top: 10px; }
footer { margin-top: auto; padding-top: 8px; font-size: 12px; }
/* short laptop screens: special rooms and key lines run on, one line each where they fit */
@media (min-width: 861px) and (max-height: 820px) {
  .specials li { padding: 1px 0; }
  .key span { display: inline; }
  .key span + span::before { content: " · "; }
  .tenants li { padding: 6px 0; }
  .sub { margin-bottom: 4px; }
  .play { padding-bottom: 0; }
}
/* a long day on any laptop screen: app.js adds .snug when the page would scroll, and the same
 * compaction applies as on a short screen */
@media (min-width: 861px) {
  :root.snug .specials li { padding: 1px 0; }
  :root.snug .key span { display: inline; }
  :root.snug .key span + span::before { content: " · "; }
  :root.snug .tenants li { padding: 6px 0; }
  :root.snug .sub { margin-bottom: 4px; }
  :root.snug .play { padding-bottom: 0; }
}
/* a long day on a phone: the plot is already as narrow as the screen allows, so the wish and
 * special lines close up a little instead */
@media (max-width: 860px) {
  :root.snug .want, :root.snug .specials li, :root.snug .key { line-height: 1.18; }
}

@media (max-width: 860px) {
  /* phone: the room tray stands beside the plot (it empties as rooms go down), tenants two by
   * two below; the hint shows only until the first move. */
  :root { --cell: clamp(56px, min(calc((100vw - 136px) / 4), calc((100dvh - 540px - var(--trim, 0px)) / 3)), 116px); }
  main { padding: 8px 14px 4px 20px; }
  header h1 { font-size: 20px; }
  .left > .legal-phone { display: flex; flex-direction: column; grid-column: 2; grid-row: 5; align-self: stretch; justify-content: flex-end; padding: 0 0 2px 10px; border-left: 2px solid var(--ink); font-size: 11px; line-height: 1.25; }
  .legal-phone a { color: var(--muted); }
  .sub { font-size: 13px; margin-bottom: 2px; }
  .play { grid-template-columns: minmax(0, 1fr); gap: 2px; align-content: start; padding-bottom: 0; }
  .left { justify-self: center; width: auto; display: grid; grid-template-columns: calc(var(--cell) * 4 + 2px) calc(var(--cell) * 1.04 + 16px); column-gap: 10px; align-items: start; }
  .left > .reveal-bar { grid-column: 1 / -1; }
  /* undo / clear stack at the top of the tray column, beside the garden row */
  .left > .bar { grid-column: 2; grid-row: 3; margin: 0; padding-left: 10px; justify-content: flex-start; }
  .left .tools { flex-direction: column; gap: 0; line-height: 1.15; }
  .tools button.link { font-size: 11px; text-align: left; padding: 0; }
  /* the how-to sits inside the empty plot, so it costs no height; it goes at the first move */
  .left > .hint { grid-column: 1; grid-row: 4; z-index: 1; pointer-events: none; align-self: center; margin: 0 10px; padding: 4px 6px; text-align: center; color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, transparent); }
  .left > #garden { grid-column: 1; grid-row: 3; }
  .left > .plot-wrap { grid-column: 1; grid-row: 4; }
  .left > #street { grid-column: 1; grid-row: 5; }
  .left > .tray { grid-column: 2; grid-row: 4; align-self: stretch; margin: 0; padding: 0 0 0 8px;
    border-top: 0; border-left: 2px solid var(--ink); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px;
    contain: size; min-height: 0; } /* sized by the plot beside it, never the other way */
  .tray .room { width: calc(var(--cell) * 0.5); height: calc(var(--cell) * 0.5); }
  .edge { font-size: 11px; height: auto; min-height: 24px; padding: 2px 0; }
  .edge span { white-space: normal; line-height: 1.05; } /* "front door ↑" is wider than a phone cell */
  .hint { max-width: none; font-size: 12px; }
  .side { width: 100%; min-width: 0; }
  .tenants { column-gap: 12px; }
  .tenants li { display: block; padding: 2px 0; }
  .tenants li > div:first-child { float: left; margin: 0 6px 0 0; }
  .tenants .token { width: 22px; height: 22px; font-size: 11px; }
  .tenants .who { display: block; line-height: 22px; margin-bottom: 1px; }
  .want { font-size: 12px; line-height: 1.3; }
  .want .wt { min-width: 0; margin-right: 4px; font-size: 11px; }
  #score { font-size: 19px; }
  #perfect-note, .key { font-size: 11.5px; }
  .specials li { font-size: 12px; padding: 1px 0; }
  .specials .want { font-size: 12px; margin-left: 4px; }
  .key span { display: inline; }
  .key span + span::before { content: " · "; }
  .key { margin: 2px 0 0; }
  .specials { padding: 2px 0; }
  .status { padding-bottom: 2px; }
  .sub { margin-bottom: 0; }
  #finish .fin-need { font-size: 12.5px; }
  .side > button#finish { width: 100%; margin-top: 4px; }
  footer { display: none; }
  .hint.started { display: none; }
}

/* ---- optional sign-in (Long Rest Games account) ----
 * A quiet text link in the footer (laptop) or under terms / privacy (phone), shown only when the
 * server says sign-in is there. Its panel is fixed in a corner, like the result card's paper
 * slip, so it never adds height to the one-screen layout. */
.acct-slot[hidden] { display: none; }
footer .acct-link { font-size: 12px; color: var(--ink); }
footer .sound-toggle { font-size: 12px; color: var(--ink); }
.legal-phone .sound-toggle { font-size: inherit; line-height: inherit; color: var(--muted); text-align: left; }
.legal-phone .acct-link { font-size: inherit; line-height: inherit; color: var(--muted); text-align: left; }
/* a third line in the phone column would outgrow the street row on tall-tray days: set it tighter */
.left > .legal-phone:has(.acct-slot:not([hidden])) { font-size: 10px; line-height: 1.15; }
.acct-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(340px, calc(100vw - 24px));
  background: #fffdf8; color: #2b241e; border: 2px solid #2b241e; box-shadow: 4px 4px 0 #2b241e;
  padding: 14px 16px 12px; font-size: 13.5px; line-height: 1.4;
}
.acct-panel[hidden], .acct-panel [hidden] { display: none; }
.acct-panel p { margin: 0 0 8px; }
.acct-panel a { color: inherit; }
.acct-panel button.acct-close { float: right; margin: 0 0 4px 12px; font-size: 12px; color: #8b7a6a; }
.acct-msg { font-weight: 600; }
.acct-what { color: #5d4f43; font-size: 12.5px; }
.acct-go { display: inline-block; font-size: 14px; background: #2b241e; color: #fffdf8 !important; text-decoration: none; padding: 6px 16px; }
.acct-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.acct-actions button.link, .acct-confirm button.link { font-size: 13px; }
.acct-confirm { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #e6d7c3; font-size: 12.5px; }
.acct-confirm button:not(.link) { font: inherit; font-size: 13px; background: #c2412d; color: #fffdf8; border: 0; padding: 4px 12px; margin: 6px 8px 0 0; cursor: pointer; }

/* house-ad slot on the result card, filled by a shared promo module; nothing shows while empty */
.house-ad { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e6d7c3; font-size: 13px; color: #5d4f43; }
.house-ad[hidden], .house-ad:empty { display: none; }
