/* Pip's Habitat on Seidr Labs.
   Layout: a lantern-lit stage (the world, with glass overlays and a dock of round actions) beside a journal of cards.
   Palette: the Seidr night (css/seidr.css). Type: Cormorant for voice and names, Hanken Grotesk for reading, JetBrains Mono for labels. */
:root {
  color-scheme: dark;
  --night: #060b0d; --night-2: #0a1316; --moss: #0f1d1d; --moss-2: #152827;
  --line: rgba(186, 226, 212, .11); --line-2: rgba(186, 226, 212, .22);
  --bone: #ede6d5; --mist: #a3b6af; --mist-2: #7f948c;
  --sap: #f3b75f; --aurora: #7ee8c9; --aurora-deep: #2f9f84; --ember: #e8784f; --violet: #ae96ff; --frost: #9fd4ff; --rose: #f29bb8;
  --glass: rgba(6, 11, 13, .66); --glass-line: rgba(237, 230, 213, .14);
  --scene-floor: #6E9460; --scene-floor2: #577D4C; --water: #4E93A8; --wood: #8A5F3B; --wood2: #6A4529; --stone: #8A9398;
  --plant: #4E8C53; --plant2: #5F9C5E; --creature: #A79FF7; --creature-shade: #8278E6; --belly: #D9D5FC;
  --berry: #E0566A; --ball: #F2B33D; --scene-ink: #151B2E; --eye: #FFFFFF;
  --f-display: "Cormorant", "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r-l: 26px; --r-m: 18px; --r-s: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; color: var(--bone); font: 16px/1.55 var(--f-body);
  background:
    radial-gradient(900px 520px at 22% -10%, rgba(126, 232, 201, .09), transparent 60%),
    radial-gradient(800px 600px at 95% 10%, rgba(174, 150, 255, .10), transparent 60%),
    var(--night);
  min-height: 100vh;
}
[hidden] { display: none !important; }
img, canvas, svg { max-width: 100%; }
.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 1em; height: 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--aurora); outline-offset: 3px; }
a { color: var(--aurora); }

.page { max-width: 1260px; margin: 0 auto; padding-block: 14px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- masthead ---------- */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.back { color: var(--mist); text-decoration: none; font-size: .9rem; border-radius: 8px; padding: 4px 2px; }
.back:hover { color: var(--bone); }
.wordmark { white-space: nowrap; }
@media (max-width: 420px) {
  .back { display: inline-grid; place-items: center; min-width: 42px; min-height: 42px; font-size: 1.2rem; }
  .back-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wordmark { font-size: 1.3rem; }
}
.wordmark { margin: 0; font-family: var(--f-display); font-style: italic; font-size: 1.5rem; font-weight: 500; letter-spacing: .01em; }
.wordmark .rune { font-family: "Noto Sans Runic", serif; font-style: normal; color: var(--violet); margin-right: 4px; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-line); background: rgba(237, 230, 213, .04); font-size: 20px; transition: background .2s, transform .15s var(--spring); }
.iconbtn:hover { background: rgba(237, 230, 213, .1); }
.iconbtn:active { transform: scale(.92); }
.iconbtn[aria-pressed="true"] { color: var(--aurora); }
.iconbtn.glass { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.mast-actions { display: flex; align-items: center; gap: 8px; }
.acctbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--glass-line);
  background: rgba(237, 230, 213, .04); color: var(--bone); font-weight: 600; font-size: .9rem; max-width: 190px; transition: background .2s, transform .15s var(--spring); }
.acctbtn:hover { background: rgba(237, 230, 213, .1); }
.acctbtn:active { transform: scale(.96); }
.acctbtn svg { width: 18px; height: 18px; flex: none; color: var(--violet); }
.acctbtn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctbtn.in svg { color: var(--aurora); }
@media (max-width: 520px) {
  /* keep the word "Sign in" visible on phones: an icon alone is easy to miss */
  .acctbtn { padding: 0 12px 0 10px; gap: 6px; font-size: .85rem; max-width: 132px; }
}
@media (max-width: 420px) {
  .masthead { gap: 6px; }
  .wordmark { font-size: 1.1rem; }
  .mast-actions { gap: 6px; }
}

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* ---------- the stage ---------- */
.stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); padding: 10px 10px 14px; border-radius: var(--r-l);
  background: linear-gradient(180deg, rgba(21, 40, 39, .9), rgba(10, 19, 22, .92)); border: 1px solid var(--line-2);
  box-shadow: 0 40px 90px -50px rgba(126, 232, 201, .35), inset 0 1px 0 rgba(255, 255, 255, .04); }
@media (max-width: 920px) { .stage { position: static; } }
.viewport { position: relative; border-radius: calc(var(--r-l) - 8px); overflow: hidden; background: #1d2b4d; }
#scene { display: block; width: 100%; height: auto; aspect-ratio: 400 / 280; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.hud-top, .hud-bottom { position: absolute; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud-top { top: 10px; align-items: flex-start; }
.hud-bottom { bottom: 10px; align-items: flex-end; }
.hud-top > *, .hud-bottom > * { pointer-events: auto; }
.glasspanel, .pips .pipchip, .rings, .map, .toast { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--glass-line); }
.pips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pipchip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; transition: transform .15s var(--spring), border-color .2s; }
.pipchip .dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); flex: none; }
.pipchip .nm { font-family: var(--f-display); font-weight: 600; font-size: 1.12rem; line-height: 1; }
.pipchip .st { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mist); display: block; margin-top: 2px; }
.pipchip[aria-pressed="true"] { border-color: rgba(237, 230, 213, .7); background: rgba(237, 230, 213, .16); box-shadow: 0 0 0 1px rgba(237, 230, 213, .25); }
.pipchip:active { transform: scale(.96); }
.rings { display: flex; gap: 4px; padding: 5px; border-radius: 999px; }
.ring { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.ring svg.arc { position: absolute; inset: 0; width: 34px; height: 34px; transform: rotate(-90deg); }
.ring .glyph { width: 15px; height: 15px; }
.ring.urgent .glyph { animation: throb 1.4s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.18); } }
.map { position: relative; display: flex; border-radius: 999px; overflow: hidden; }
.map button { border: 0; background: transparent; min-height: 40px; padding: 7px 12px 11px; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.map button:hover { color: var(--bone); background: rgba(237, 230, 213, .06); }
.map-dot { position: absolute; bottom: 3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 6px var(--violet); transition: left .3s linear; }
.toast { pointer-events: none !important; position: absolute; left: 50%; top: 58px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 9px 16px; border-radius: 999px; font-size: .9rem; text-align: center; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.status { padding: 14px 8px 4px; min-height: 86px; }
.now { margin: 0; font-family: var(--f-display); font-size: clamp(1.45rem, 2.6vw, 1.9rem); line-height: 1.15; font-weight: 500; text-wrap: balance; }
.now em { font-style: italic; color: var(--violet); }
.sub { margin: 4px 0 0; color: var(--mist); font-size: .95rem; }

.dock { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 10px 2px 4px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; border-radius: 16px; }
.act .orb { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; font-size: 24px; color: var(--night);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2), inset 0 2px 0 rgba(255, 255, 255, .35), 0 10px 24px -10px var(--glow, rgba(0, 0, 0, .6));
  transition: transform .18s var(--spring), filter .2s; }
.act:hover .orb { transform: translateY(-3px); filter: brightness(1.08); }
.act:active .orb { transform: scale(.9); }
.act .lbl { font-size: .84rem; color: var(--mist); letter-spacing: .01em; white-space: nowrap; }
.act:hover .lbl { color: var(--bone); }
.orb.pet { background: radial-gradient(circle at 35% 30%, #ffc2d6, var(--rose)); --glow: rgba(242, 155, 184, .7); }
.orb.feed { background: radial-gradient(circle at 35% 30%, #ff9aa8, var(--berry)); --glow: rgba(224, 86, 106, .7); }
.orb.play { background: radial-gradient(circle at 35% 30%, #ffe0a3, var(--sap)); --glow: rgba(243, 183, 95, .7); }
.orb.talk { background: radial-gradient(circle at 35% 30%, #d9ceff, var(--violet)); --glow: rgba(174, 150, 255, .7); }
.orb.read { background: radial-gradient(circle at 35% 30%, #c6fbe8, var(--aurora)); --glow: rgba(126, 232, 201, .7); }
.orb.night { background: radial-gradient(circle at 35% 30%, #d6ecff, var(--frost)); --glow: rgba(159, 212, 255, .7); }
@media (max-width: 420px) { .act .orb { width: 52px; height: 52px; font-size: 21px; } .act .lbl { font-size: .8rem; } .dock { gap: 3px; } }
.saveline { margin: 8px 8px 0; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .05em; color: var(--mist-2); }

/* ---------- the journal ---------- */
.journal { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.intro { padding: 6px 4px; display: flex; flex-direction: column; gap: 14px; }
.eyebrow, .label { margin: 0; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mist); }
.intro h1 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.02; text-wrap: balance; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.promises li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--bone); }
.promises svg { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: rgba(174, 150, 255, .12); color: var(--violet); }
.begin { margin: 4px 0 0; padding: 14px 16px; border-radius: var(--r-m); background: rgba(126, 232, 201, .08); border: 1px solid rgba(126, 232, 201, .25); }
.note { margin: 0; color: var(--mist); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.note:empty { display: none; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(12, 22, 24, .94); border: 1px solid var(--line); position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 5; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 999px; font-family: var(--f-display); font-weight: 600; font-size: 1.08rem; color: var(--mist); }
.tabs button[aria-selected="true"] { background: var(--bone); color: var(--night); }
.tabs button:hover:not([aria-selected="true"]) { color: var(--bone); }
.page-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { padding: 18px; border-radius: var(--r-m); background: rgba(15, 29, 29, .72); border: 1px solid var(--line); min-width: 0; }
.card h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; text-wrap: balance; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.small { margin: 0; font-size: .86rem; color: var(--mist); }
.quote { margin: 0 0 12px; font-family: var(--f-display); font-size: 1.45rem; line-height: 1.25; font-style: italic; min-height: 1.25em; text-wrap: pretty; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(237, 230, 213, .05); font-weight: 600; font-size: .92rem; }
.pill:hover { background: rgba(237, 230, 213, .1); }
.pill.solid { background: var(--bone); color: var(--night); border-color: var(--bone); }
.pill.solid:hover { background: #fff; }
.pill svg { width: 16px; height: 16px; color: var(--violet); }
.pill.solid svg { color: var(--night); }
.ghost { align-self: flex-start; padding: 9px 16px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--bone); font-weight: 600; }
.ghost:hover { border-style: solid; }
.ghost.danger { color: #ffb39b; border-color: rgba(232, 120, 79, .4); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meter { height: 8px; border-radius: 999px; background: rgba(237, 230, 213, .08); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--aurora-deep), var(--aurora)); transition: width .6s var(--ease); }
.meter.warm i { background: linear-gradient(90deg, var(--rose), var(--sap)); }

.mood-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; }
.mood-orb { width: 72px; height: 72px; border-radius: 50%; position: relative; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--mc, #ae96ff) 55%, color-mix(in srgb, var(--mc, #ae96ff) 70%, #000) 100%);
  box-shadow: 0 0 calc(10px + var(--ma, .5) * 30px) color-mix(in srgb, var(--mc, #ae96ff) 60%, transparent); transition: background 1s, box-shadow 1s; }
.mood-orb span { position: absolute; inset: 22%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .4; } }
.mood-name { margin: 2px 0; font-family: var(--f-display); font-weight: 600; font-size: 2rem; line-height: 1; }
.trust { grid-column: 1 / -1; display: grid; gap: 6px; }

#feelSvg { width: 100%; height: auto; display: block; }
.feel-label { font-family: var(--f-mono); font-size: 12px; fill: var(--mist); }
.next, .firsts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.next li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.next li::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: rgba(174, 150, 255, .14); border: 1px solid rgba(174, 150, 255, .35); }
.next b { display: block; font-weight: 600; }
.firsts li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .95rem; }
.firsts li::before { content: ""; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--line-2); }
.firsts li.done::before { background: var(--aurora); border-color: var(--aurora); box-shadow: 0 0 8px rgba(126, 232, 201, .6); }
.firsts li:not(.done) { color: var(--mist); }
.firsts time { font-family: var(--f-mono); font-size: .68rem; color: var(--mist-2); margin-left: 6px; }
.friend-cta { display: grid; gap: 14px; background: linear-gradient(135deg, rgba(126, 232, 201, .12), rgba(174, 150, 255, .12)); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile { padding: 12px; border-radius: var(--r-s); background: rgba(237, 230, 213, .04); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .w { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; line-height: 1.1; overflow-wrap: anywhere; }
.tile .m { font-size: .86rem; color: var(--mist); }
.tile .tag { align-self: flex-start; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(237, 230, 213, .08); color: var(--bone); }
.tag.likes { background: rgba(126, 232, 201, .16); color: var(--aurora); }
.tag.avoids { background: rgba(232, 120, 79, .18); color: #ffb39b; }
.tag.from { background: rgba(174, 150, 255, .16); color: var(--violet); }
.dots { display: flex; gap: 3px; margin-top: 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(237, 230, 213, .14); }
.dots i.on { background: var(--aurora); }
.empty { color: var(--mist); font-size: .92rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: rgba(237, 230, 213, .06); border: 1px solid var(--line); }
.habits { display: grid; gap: 8px; }
.habit { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 2.6rem; gap: 10px; align-items: center; font-size: .92rem; }
.habit .meter { height: 6px; }
.habit .v { font-family: var(--f-mono); font-size: .76rem; color: var(--mist); text-align: right; }
details.how summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
details.how ul { margin: 10px 0 0; padding-left: 18px; color: var(--mist); display: grid; gap: 6px; font-size: .92rem; }

.portrait-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; }
#portrait { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, rgba(126, 232, 201, .12), rgba(6, 11, 13, .4)); border: 1px solid var(--line-2); }
.self-name { font-size: 2.2rem !important; margin: 2px 0 6px !important; }
.who { margin: 0; color: var(--bone); font-size: .98rem; text-wrap: pretty; }
@media (max-width: 420px) { .portrait-card { grid-template-columns: 1fr; justify-items: start; } }
.growth { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.growth::before { content: ""; position: absolute; top: 13px; left: 10%; right: 10%; height: 2px; background: var(--line-2); }
.growth li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .8rem; color: var(--mist); text-align: center; }
.growth li::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--night-2); border: 2px solid var(--line-2); z-index: 1; }
.growth li.done::before { background: var(--aurora-deep); border-color: var(--aurora); }
.growth li.here { color: var(--bone); font-weight: 600; }
.growth li.here::before { background: var(--aurora); box-shadow: 0 0 12px rgba(126, 232, 201, .7); }
.traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.trait .tl { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: .9rem; margin-bottom: 5px; }
.trait .tl span:last-child { font-family: var(--f-mono); font-size: .78rem; color: var(--bone-2, var(--mist)); margin-left: auto; text-align: right; }
@media (max-width: 520px) { .traits { grid-template-columns: 1fr; } }
.trait .meter i { background: linear-gradient(90deg, #6d5fd6, var(--violet)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat { padding: 10px; border-radius: var(--r-s); background: rgba(237, 230, 213, .04); }
.stat b { display: block; font-family: var(--f-display); font-size: 1.6rem; line-height: 1; }
.stat span { font-size: .78rem; color: var(--mist); }
.selfbox { display: grid; gap: 12px; }
.soultext { width: 100%; min-height: 120px; font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--night-2); color: var(--bone); padding: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
#dreams.timeline { max-height: 460px; overflow-y: auto; }
.timeline li.more, .timeline li.empty { display: block; color: var(--mist); }
.timeline li.more { padding-top: 14px; }
.timeline li { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.timeline li:first-child { border-top: 0; }
.timeline time { font-family: var(--f-mono); font-size: .68rem; color: var(--mist-2); padding-top: 3px; }
.timeline .core { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); margin-left: 6px; }
.timeline li.diary span { font-style: italic; font-family: var(--f-display); font-size: 1.1rem; }
.shelfitem { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.shelfitem:first-child { border-top: 0; }
.spine { width: 44px; height: 58px; border-radius: 4px 8px 8px 4px; box-shadow: inset 4px 0 0 rgba(0, 0, 0, .25); }
.shelfitem b { font-family: var(--f-display); font-size: 1.15rem; }
.shelfitem ul { margin: 4px 0 0; padding-left: 16px; font-size: .9rem; color: var(--mist); }

.foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

/* ---------- sheets ---------- */
dialog.sheet { width: min(560px, 100%); max-height: min(86vh, 760px); margin: auto auto 0; padding: 18px max(18px, env(safe-area-inset-left, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-right, 0px));
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #13282a, #0a1316); color: var(--bone); overflow-y: auto; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-bottom: 1px solid var(--line-2); border-radius: 26px; } }
dialog.sheet[open] { animation: sheet .3s var(--ease); display: flex; flex-direction: column; gap: 12px; }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
dialog::backdrop { background: rgba(2, 5, 6, .74); }   /* no blur: blurring the whole page behind a sheet every frame is slow on phones */
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-head h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.7rem; }
.talklog { display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 38vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 14px; border-radius: 18px; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.msg.you { align-self: flex-end; background: var(--violet); color: #140f2b; border-bottom-right-radius: 6px; }
.msg.it { align-self: flex-start; background: rgba(237, 230, 213, .07); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.it .who { display: block; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); margin-bottom: 2px; }
.msg.it em { color: var(--mist); }
.talklog:empty::before { content: "Say hello. It may not understand yet, but it will hear you."; color: var(--mist); font-size: .92rem; }
.cues { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(237, 230, 213, .05); font-weight: 600; font-size: .88rem; }
.chipbtn:hover { background: rgba(237, 230, 213, .12); }
.chipbtn.active { background: var(--violet); color: #140f2b; border-color: var(--violet); }
.chipbtn.good { background: rgba(126, 232, 201, .16); border-color: rgba(126, 232, 201, .45); color: var(--aurora); }
.chipbtn.bad { background: rgba(232, 120, 79, .14); border-color: rgba(232, 120, 79, .45); color: #ffb39b; }
.talkform, .ownstory { display: flex; gap: 8px; }
.ownstory { flex-direction: column; }
.talkform input, .ownstory textarea { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--night-2); color: var(--bone); }
.ownstory textarea { border-radius: var(--r-m); resize: vertical; min-height: 96px; }
.ownstory .row { justify-content: space-between; }
.check { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--mist); }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.book { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 3 / 4; padding: 14px 12px 12px 18px; border-radius: 6px 14px 14px 6px; border: 0; text-align: left; color: #fff;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, .25), 0 14px 30px -18px rgba(0, 0, 0, .9); transition: transform .2s var(--spring); }
.book:hover { transform: translateY(-4px) rotate(-1deg); }
.book .bt { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; line-height: 1.05; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.book .bm { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.book .moonish { position: absolute; right: 12px; top: 40%; width: 34px; height: 34px; border-radius: 50%; opacity: .9; }
.small-sheet #noteBody { display: grid; gap: 12px; }
.small-sheet form { display: flex; gap: 8px; flex-wrap: wrap; }
.small-sheet form input { flex: 1 1 160px; min-width: 0; font: inherit; font-size: 16px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--night-2); color: var(--bone); }
.small-sheet ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* phones: the HUD sits in a slim bar above the world so the scene stays clear */
@media (max-width: 640px) {
  .viewport { overflow: visible; background: none; border-radius: 0; display: flex; flex-direction: column; }
  .hud-top { order: -1; }
  #scene { border-radius: 16px; }
  .hud-top { position: static; padding: 0 0 8px; }
  .hud-top .pipchip, .hud-top .rings { background: rgba(237, 230, 213, .05); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pipchip .st { display: none; }
  .pipchip { padding: 4px 10px 4px 4px; }
  .pipchip .dot { width: 22px; height: 22px; }
  .pips { flex-wrap: nowrap; }
  .ring, .ring svg.arc { width: 30px; height: 30px; }
  .ring .glyph { width: 13px; height: 13px; }
  .hud-bottom { position: static; padding: 8px 0 0; align-items: center; }
  .hud-bottom .map, .hud-bottom .iconbtn.glass { background: rgba(237, 230, 213, .05); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .map button { padding: 6px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- account sheet ---------- */
.acct-view { display: flex; flex-direction: column; gap: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--night-2); border: 1px solid var(--line); }
.seg button { padding: 9px 12px; border-radius: 999px; border: 0; background: transparent; color: var(--mist); font-weight: 600; font-size: .92rem; }
.seg button[aria-pressed="true"] { background: rgba(174, 150, 255, .18); color: var(--bone); box-shadow: inset 0 0 0 1px rgba(174, 150, 255, .45); }
.fields { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input { width: 100%; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--night-2); color: var(--bone); }
.field input:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: var(--ember); }
.field .hint { margin: 0; font-size: .8rem; color: var(--mist-2); }
.pw { position: relative; display: flex; }
.pw input { padding-right: 74px; }
.showpw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; border: 0; background: rgba(237, 230, 213, .07); color: var(--mist); font-size: .8rem; font-weight: 600; }
.showpw:hover, .showpw[aria-pressed="true"] { color: var(--bone); background: rgba(237, 230, 213, .13); }
.formmsg { margin: 0; font-size: .9rem; color: #ffb39b; }
.formmsg.good { color: var(--aurora); }
.formmsg:empty { display: none; }
.pill.wide { justify-content: center; width: 100%; padding: 12px 16px; font-size: 1rem; }
.pill[disabled], .ghost[disabled] { opacity: .55; cursor: progress; }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.linkbtn { min-height: 40px; padding: 8px 0; border: 0; background: none; color: var(--violet); font: inherit; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(174, 150, 255, .4); }
.linkbtn:hover { color: var(--bone); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: rgba(237, 230, 213, .04); color: var(--bone); text-align: left; }
.choice:hover { background: rgba(174, 150, 255, .1); border-color: rgba(174, 150, 255, .45); }
.choice b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.who-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-m); background: rgba(126, 232, 201, .06); border: 1px solid rgba(126, 232, 201, .2); }
.who-card .avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(126, 232, 201, .14); color: var(--aurora); flex: none; }
.who-card .avatar svg { width: 24px; height: 24px; }
.who-card .label { margin: 0; }
.acct-name { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; overflow-wrap: anywhere; }
.acct-view > .pill { align-self: flex-start; }
.acct-more { border-top: 1px solid var(--line); padding-top: 12px; }
.acct-more summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.acct-more[open] summary { margin-bottom: 12px; }
.acct-more .fields > .pill, .acct-more .fields > .ghost { align-self: flex-start; }
.danger-zone summary { color: #ffb39b; }
.privacy { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.privacy ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .82rem; color: var(--mist); }
.privacy li::marker { color: var(--aurora-deep); }
/* floating Talk button (shown when the care buttons have scrolled out of view) */
.talk-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--violet); color: #1a1530; font-weight: 700; font-size: 1rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.talk-fab[hidden] { display: none; }
.talk-fab svg { width: 22px; height: 22px; fill: currentColor; }
.talk-fab:active { transform: scale(.96); }
/* games */
dialog.gamesheet { max-height: min(92vh, 860px); }
.gmenu { display: grid; gap: 10px; margin-top: 12px; }
.gcard { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line-2); background: rgba(237, 230, 213, .05); position: relative; color: inherit; font: inherit; cursor: pointer; }
.gcard:hover { background: rgba(237, 230, 213, .1); }
.gcard b { font-size: 1.05rem; }
.gbest { position: absolute; right: 14px; top: 14px; font-family: var(--f-mono); font-size: .78rem; color: var(--aurora); }
.gbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 6px; }
.gstat { font-family: var(--f-mono); font-size: .78rem; color: var(--mist); text-align: center; min-height: 1.3em; }
.gcanvas { display: block; width: 100%; max-width: 380px; aspect-ratio: 320 / 384; margin: 8px auto; border-radius: 18px; touch-action: none; background: #0d1030; border: 1px solid var(--line-2); }
.gend { text-align: center; padding: 18px 0 6px; }
.gend h3 { margin: 0; font-family: var(--f-display); font-size: 1.5rem; }
.gscore { font-family: var(--f-display); font-size: 2.6rem; margin: 6px 0; }
.gend .row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.gcard.on { border-color: var(--aurora); background: rgba(126, 232, 201, .08); }
.gcard:disabled { opacity: .5; cursor: not-allowed; }

/* phones: the journal's time sits above each entry so the words get the full width */
@media (max-width: 520px) {
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .timeline time { padding-top: 0; }
  .tile .tag { font-size: .74rem; }

}

/* a chip never pushes the page wider, whatever text it holds */
.chip { max-width: 100%; overflow-wrap: anywhere; }

/* ---- fixes from the independent review ---- */
/* creature chips: names of any length fit; on a phone the second chip wraps under the first, never under the rings */
.hud-top .pips { flex: 1 1 0; min-width: 0; }
.hud-top .rings { flex: none; }
.rings:empty { display: none; }
.pipchip { max-width: 100%; min-height: 40px; min-width: 0; }
.pipchip > span:last-child { min-width: 0; }
.pipchip .nm { display: block; max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .pipchip .nm { max-width: 5.4em; } .hud-top .pips { flex-direction: row; flex-wrap: nowrap; align-items: center; } }
/* a toast is a rounded box, so long messages don't turn into a lens shape */
.toast { border-radius: 16px !important; width: max-content; max-width: min(460px, calc(100% - 24px)); }
/* empty messages in a grid of tiles use the full width */
.tiles > .empty, .tiles > p { grid-column: 1 / -1; }
/* game header: "All games" on one line */
.gbar .linkbtn { white-space: nowrap; }
/* storybooks in a row you can swipe, so "your own words" is always in view */
.books { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
.book { scroll-snap-align: start; aspect-ratio: 4 / 5; }
/* room at the bottom of the page for the floating Talk button */
@media (max-width: 920px) { .page { padding-bottom: 96px; } }

/* Twenty Questions */
.tq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; text-align: center; padding: 4px 2px 8px; }
.tq-q { margin: 2px 0 0; font-family: var(--f-display); font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.tq-q.big { font-size: 1.6rem; }
.tq-n { margin: 0; font-family: var(--f-mono); font-size: .74rem; color: var(--mist); letter-spacing: .04em; text-transform: uppercase; }
.tq-help { margin: 0; }
.tq-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tq-answers .pill { justify-content: center; padding: 12px 10px; font-size: 1rem; }
.tq-answers .pill[disabled] { cursor: default; }
.tq-teach { display: flex; gap: 8px; min-width: 0; }
.tq-teach .pill { flex: none; }
.tq-teach input { flex: 1; width: 100%; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(237, 230, 213, .06); color: inherit; font: inherit; }
.tq-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tq-chips .chipbtn { font-size: .82rem; }
.tq-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; text-align: left; max-height: 220px; overflow-y: auto; }
.tq-log li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(237, 230, 213, .04); font-size: .88rem; }
.tq-a { white-space: nowrap; }
.tq-a.yes { color: var(--aurora); } .tq-a.no { color: #ffb39b; } .tq-a.sometimes { color: #f3d36b; }
.tq-fact { display: flex; align-items: center; gap: 8px; text-align: left; }
.tq-fact span { flex: 1; font-size: .92rem; }
.tq-end { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.gcanvas.tq-stage { max-width: 380px; }

/* Visitor book */
.vbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.vtile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(237, 230, 213, .03); }
.vtile canvas { width: 60px; height: 45px; flex: none; }
.vtile div { display: grid; gap: 2px; min-width: 0; }
.vtile.met { border-color: var(--line-2); background: rgba(237, 230, 213, .06); }
.vtile:not(.met) b { color: var(--mist); letter-spacing: .1em; }

/* ---------- Watch: the full-screen view ---------- */
.hud-actions { display: flex; gap: 8px; align-items: center; }
.watchbtn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--glass-line); color: var(--bone); font: 600 .9rem var(--f-body); }
.watchbtn svg { width: 18px; height: 18px; }
.watchbtn.glass { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.watchbtn:hover { background: rgba(237, 230, 213, .12); }
.cozy-caption, .cozybar { display: none; }
body.cozy { overflow: hidden; }
body.cozy .stage { position: static; z-index: auto; transform: none; filter: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.cozy .talk-fab, body.cozy .tabs, body.cozy .masthead { display: none !important; }
body.cozy .viewport { position: fixed; inset: 0; z-index: 1000; border-radius: 0; background: #0d1430; display: block; height: 100vh; height: 100dvh; }
body.cozy #scene { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
body.cozy .hud-top, body.cozy .hud-bottom { display: none; }
body.cozy .toast { top: calc(env(safe-area-inset-top, 0px) + 60px) !important; }
body.cozy .cozy-caption:not([hidden]) { display: block; position: absolute; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 12px); max-width: min(90vw, 640px); margin: 0;
  padding: 8px 16px; border-radius: 999px; background: rgba(6, 11, 13, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--bone); font-size: .95rem; text-align: center; transition: opacity .6s var(--ease); pointer-events: none; }
body.cozy .cozybar:not([hidden]) { display: flex; align-items: center; gap: 8px; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  max-width: calc(100vw - 16px); padding: 6px; border-radius: 999px; background: rgba(6, 11, 13, .7); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity .6s var(--ease); }
.cozyviews { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cozyviews::-webkit-scrollbar { display: none; }
.cozybtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--bone); font: 600 .92rem var(--f-body); white-space: nowrap; }
.cozybtn svg { width: 18px; height: 18px; }
.cozybtn:hover { background: rgba(237, 230, 213, .1); }
.cozybtn[aria-pressed="true"] { background: var(--bone); color: var(--night); }
.cozybtn.exit { background: rgba(237, 230, 213, .12); }
.cozybtn.icon { padding: 0; }
body.cozy.cozy-idle .cozybar, body.cozy.cozy-idle .cozy-caption { opacity: 0; pointer-events: none; }
body.cozy.cozy-idle #scene { cursor: none; }
/* a tiny always-there way out, even when the bar has faded (so nobody gets stuck) */
body.cozy.cozy-idle .viewport::after { content: ""; position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px); width: 10px; height: 10px; border-radius: 50%; background: rgba(237, 230, 213, .35); }
@media (max-width: 520px) { .watchbtn span { display: none; } .watchbtn { padding: 0; width: 42px; justify-content: center; } .hud-actions { gap: 6px; } .cozybtn { padding: 0 11px; font-size: .88rem; } }
.tq-more { justify-self: center; }
.adaptwhy { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .88rem; color: var(--mist); }
.adaptwhy .empty { list-style: none; margin-left: -18px; }
.gsection { margin: 18px 0 2px; font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.gsection:first-child { margin-top: 4px; }
.gsub { margin: 0; }
.tq-answers.six { grid-template-columns: 1fr 1fr; }
.tq-answers.six .pill { padding: 11px 8px; font-size: .95rem; }
.tq-muse { margin: 0; font-style: italic; color: var(--violet); font-size: .95rem; min-height: 1.3em; }
.tq-muse.big { font-family: var(--f-display); font-size: 1.5rem; font-style: normal; color: var(--bone); padding: 24px 0; }

/* trips */
.tripbar:not([hidden]) { display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tripname { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--bone); font: 600 .88rem var(--f-body); }
.tripname svg { width: 16px; height: 16px; color: var(--sap); }
.homebtn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--bone); color: var(--night); font: 700 .88rem var(--f-body); }
@media (max-width: 640px) { .hud-bottom .tripbar { background: rgba(237, 230, 213, .05); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.seg.three { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 12px; }
.placelist { display: grid; gap: 10px; margin: 6px 0 12px; }
.placecard { display: grid; gap: 4px; position: relative; text-align: left; padding: 18px 16px; border-radius: 18px; border: 1px solid var(--line-2); color: #fff; font: inherit; cursor: pointer; min-height: 96px; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.placecard::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(0deg, rgba(8, 14, 30, .42), rgba(8, 14, 30, 0) 75%); pointer-events: none; }   /* keeps the white words readable over the pale sky and sand */
.placecard > * { position: relative; }
.placecard .gbest { justify-self: end; position: absolute; top: 10px; right: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(8, 14, 30, .55); color: #f4efe6; font-size: .8rem; text-shadow: none; }
.placecard b { font-family: var(--f-display); font-size: 1.35rem; }
.placecard .small { color: rgba(255, 255, 255, .88); max-width: 34ch; }
.placecard:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; }
.placecard.beach { background: linear-gradient(180deg, #7fbfe8 0%, #6fc4d6 45%, #e9d39f 46%, #dcc187 100%); }
.placecard.meadow { background: linear-gradient(180deg, #86c0e6 0%, #b8dcef 50%, #8fc46f 51%, #6ea85a 100%); }
.placecard.woods { background: linear-gradient(180deg, #2f6b4a 0%, #3d5f45 55%, #5b7d43 56%, #476a35 100%); }
.placecard.hill { background: radial-gradient(circle at 78% 22%, #edeaf9 0 5%, transparent 6%), linear-gradient(180deg, #0b1030 0%, #25305a 55%, #244a3e 56%, #16302b 100%); }
.albumrow { display: grid; gap: 4px; margin-bottom: 10px; }
.chip.got { border-color: var(--line-2); background: rgba(126, 232, 201, .1); }
.chip.got.rare { background: rgba(174, 150, 255, .16); }
.chip.got.vrare { background: rgba(243, 183, 95, .2); }
.chip:not(.got) { color: var(--mist-2); letter-spacing: .08em; }

/* ---------- Talk docks beside or below the world (no backdrop), so the creatures stay in view while you talk ---------- */
dialog.sheet.docked[open] { position: fixed; margin: 0; height: auto; min-height: 0; z-index: 900; max-width: none; gap: 10px; padding-top: 14px; overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45); }
dialog.sheet.docked[data-side="below"] { border-radius: 22px 22px 0 0; border-bottom: 0; }
dialog.sheet.docked[data-side="right"] { border-radius: 22px; border-bottom: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
dialog.sheet.docked .sheet-head h2 { font-size: 1.35rem; flex: none; }
dialog.sheet.docked .sheet-head .iconbtn { margin-left: auto; flex: none; }
dialog.sheet.docked .talklog { flex: 1 1 auto; min-height: 56px; max-height: none; }
dialog.sheet.docked .cues { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex: none; }
dialog.sheet.docked .cues::-webkit-scrollbar { display: none; }
dialog.sheet.docked .chipbtn { flex: none; }
dialog.sheet.docked .talkform, dialog.sheet.docked .talkhelp, dialog.sheet.docked .check { flex: none; }
dialog.sheet.docked.tight { gap: 7px; padding-top: 10px; }
dialog.sheet.docked.tight .talkhelp, dialog.sheet.docked.tight .check { display: none; }
.talklog:empty::before { content: attr(data-empty); }
.talkwho { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.talkwho[hidden] { display: none; }
.whobtn { display: inline-flex; align-items: center; gap: 7px; padding: 4px 13px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(237, 230, 213, .04); color: var(--mist); font-weight: 600; font-size: .95rem; white-space: nowrap; min-height: 40px; }
.whobtn .dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); flex: none; }
.whobtn[aria-pressed="true"] { background: var(--bone); color: #13282a; border-color: var(--bone); }
.whobtn:focus-visible { outline: 2px solid var(--aurora); outline-offset: 2px; }
.talkhelp summary { cursor: pointer; color: var(--mist); font-size: .88rem; }
.talkhelp p { margin: 8px 0 0; }
body.talking .talk-fab { display: none; }
body.talking #talkBtn .orb { box-shadow: 0 0 0 3px var(--bone); }
body.cozy dialog.sheet.docked { display: none; }
dialog.sheet.docked[data-side="right"] .cues { flex-wrap: wrap; overflow: visible; }

/* With a mouse, the buttons and badges over the world fade away when the pointer is off it and come back as soon as it is over it (or something in it has keyboard focus). Touch screens keep them. */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
  .viewport .hud-top, .viewport .hud-bottom { opacity: 0; transition: opacity .45s ease 1.2s; }
  .viewport:hover .hud-top, .viewport:hover .hud-bottom, .viewport:focus-within .hud-top, .viewport:focus-within .hud-bottom { opacity: 1; transition: opacity .15s ease 0s; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 641px) and (prefers-reduced-motion: reduce) { .viewport .hud-top, .viewport .hud-bottom { transition-duration: 0s; transition-delay: 0s; } }
