/* The Worlds page (owner, 2026-10-16): you have stepped through the window; the world fills the screen and you change
   the world around you. One world at a time, nothing in the way, everything else quiet. */
:root { --bg: #0B1022; --text: #EFE8DB; --title: #FFC867; --glow: #FFE6A8; --ink: #070A14; --gold: #FFC867;
  --side: clamp(18px, 3vw, 48px); }
html, body.worlds { height: 100%; overflow: hidden; }
body.worlds { margin: 0; background: var(--bg); color: var(--text); transition: background-color 1.2s ease; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The world: full bleed, pixel-exact (the shared stage picks whole-number scales), The Quiet Isle on its smooth stage. */
.world { position: fixed; inset: 0; z-index: 0; }
.world .layer { position: absolute; inset: 0; transition: opacity 1.2s ease; }
.world .layer.off { opacity: 0; pointer-events: none; }

/* Quiet scrims so the words always read, tinted with the world's own darkest colour. */
.scrim { position: fixed; left: 0; right: 0; z-index: 1; pointer-events: none; transition: background 1.2s ease; }
.scrim-top { top: 0; height: 150px; background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 55%, transparent), transparent); }
.scrim-bottom { bottom: 0; height: min(52vh, 420px);
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 78%, transparent) 0%, color-mix(in srgb, var(--ink) 40%, transparent) 45%, transparent 100%); }

/* Top bar: the same as the home page. */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 18px var(--side); }
.bar .wordmark { font-family: var(--pixel); font-size: 18px; letter-spacing: .08em; color: #F1EADF; text-decoration: none; }
.bar nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); }
.bar .back { font-family: var(--tiny); font-size: 12px; letter-spacing: .06em; color: #F1EADF; text-decoration: none; opacity: .85; transition: opacity .3s; }
.bar .back:hover { opacity: 1; }
.bar .get { font-family: var(--tiny); font-size: 12px; letter-spacing: .07em; color: #1F1915; background: var(--gold); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.bar a:focus-visible, .ctl:focus-visible, .rail button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

main { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 0 var(--side) clamp(20px, 4vh, 40px); }

/* The plate: like the app's own window plate. Name, one line, what it costs, and the three controls. */
.plate { max-width: 520px; }
.kicker { margin: 0 0 8px; font-family: var(--tiny); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
  text-shadow: 0 1px 8px color-mix(in srgb, var(--ink) 90%, transparent); }   /* full opacity over busy art (review S4) */
.plate h1 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: clamp(34px, 4.2vw, 60px); line-height: 1; color: var(--title);
  text-shadow: 0 2px 18px color-mix(in srgb, var(--ink) 70%, transparent); transition: color 1.2s ease; }
.plate .sub { margin: 10px 0 12px; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.45; color: var(--text); text-shadow: 0 1px 10px color-mix(in srgb, var(--ink) 80%, transparent); }
.tags { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--tiny); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 6px 9px; border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 55%, transparent); border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); color: var(--text); }
.tag.free { background: var(--gold); color: #1F1915; border-color: var(--gold); }
.ctrls { display: flex; gap: 8px; flex-wrap: wrap; }
.ctl { font-family: var(--tiny); font-size: 11px; letter-spacing: .06em; padding: 9px 13px; border-radius: 8px; cursor: pointer; line-height: 1;
  color: var(--text); background: color-mix(in srgb, var(--ink) 50%, transparent); border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .3s, border-color .3s; }
@media (hover: hover) { .ctl:hover { background: color-mix(in srgb, var(--ink) 30%, transparent); border-color: color-mix(in srgb, var(--text) 40%, transparent); } }
.ctl[data-pause][aria-pressed="true"] { border-color: var(--title); }
.snd { padding: 6px 9px; line-height: 0; }
.snd .ico-on { display: none; }
.snd[aria-pressed="true"] .ico-on { display: inline; }
.snd[aria-pressed="true"] .ico-off { display: none; }
.snd[aria-pressed="true"] { color: var(--title); border-color: var(--title); }
.snd[disabled] { opacity: .45; cursor: default; }

/* The rail: eleven small swatches (not windows), the current one lit. Names appear on hover and focus. */
.rail { display: flex; align-items: center; gap: 8px; }
.rail ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 7px; }
.rail li { position: relative; }
.rail .sw { display: block; width: clamp(44px, 3.6vw, 62px); aspect-ratio: 16 / 9; padding: 0; border-radius: 5px; overflow: hidden; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); background: #000; opacity: .62;
  transition: opacity .35s, transform .35s, border-color .35s, box-shadow .35s; }
.rail .sw img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.rail .sw img.smooth { image-rendering: auto; }
.rail .sw[aria-current="true"] { opacity: 1; border-color: var(--title); box-shadow: 0 0 0 1px var(--title), 0 0 18px color-mix(in srgb, var(--glow) 40%, transparent); }
@media (hover: hover) { .rail .sw:hover { opacity: .95; } }
.rail .tip { position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--tiny); font-size: 11px; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; color: #F1EADF;
  background: rgba(10, 10, 14, .82); opacity: 0; transition: opacity .25s; }
@media (hover: hover) { .rail li:hover .tip { opacity: 1; } }
.rail li:focus-within .tip { opacity: 1; }
.rail .free-dot { position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.step { width: 30px; height: 30px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); cursor: pointer;
  background: color-mix(in srgb, var(--ink) 45%, transparent); color: var(--text); font-size: 18px; line-height: 1; }

.draft { position: fixed; right: var(--side); top: 64px; z-index: 3; margin: 0; font-family: var(--tiny); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(241, 234, 223, .45); }
.nojs-note { position: fixed; inset: auto 20px 20px; z-index: 4; color: #F1EADF; }

/* Narrower screens: the rail moves above the plate, scrolls sideways if it must, and never shrinks below a tappable size. */
@media (max-width: 1300px) {   /* (was 1100: at 1129 the plate shared a row with the rail and its controls wrapped untidily, review S3) */
  main { flex-direction: column-reverse; align-items: stretch; gap: 18px; }
  .rail { justify-content: center; }
  .rail ul { overflow-x: auto; scrollbar-width: none; padding: 12px 2px 4px; }
}
@media (max-width: 640px) {
  .bar .back { font-size: 0; } .bar .back span { font-size: 18px; }
  .rail .step { display: none; }
  .rail .sw { width: 52px; }
  .ctl .label { display: none; }
  .draft { display: none; }
}
@media (prefers-reduced-motion: reduce) { .world .layer, .scrim, body.worlds, .plate h1 { transition: none; } }

/* Handover between worlds: the incoming layer sits on top and fades in over the outgoing one, which never moves. */
.world .layer.top { z-index: 2; }

/* Owner note 28, upgrade 1: the interface melts away when you are still, leaving the world (as in Ambient Mode).
   A faint wordmark stays so the page never feels broken. Any movement brings everything back quickly. */
.bar nav, main, .scrim, .draft, .bar .wordmark { transition: opacity .25s ease; }
body.idle .bar nav, body.idle main, body.idle .scrim, body.idle .draft { opacity: 0; transition: opacity 1.5s ease; }
body.idle .bar .wordmark { opacity: .28; transition: opacity 1.5s ease; }
body.idle { cursor: none; }

/* Upgrade 3: the invitation to listen. */
.invite { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text);
  opacity: 0; transform: translateY(4px); transition: opacity .6s ease, transform .6s ease; }
.invite.show { opacity: 1; transform: none; }
.invite span { text-shadow: 0 1px 10px color-mix(in srgb, var(--ink) 80%, transparent); }
.invite #inv-on { background: var(--title); color: #1F1915; border-color: var(--title); }
.ctl.ghost { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  body.idle .bar nav, body.idle main, body.idle .scrim, body.idle .draft, body.idle .bar .wordmark, .invite { transition: none; }
}

/* Owner note 30, upgrade 2: live light sampled from the world (registered so it can ease smoothly). */
@property --live { syntax: "<color>"; inherits: true; initial-value: #15121a; }
@property --live-hi { syntax: "<color>"; inherits: true; initial-value: #ffe3b0; }
:root { transition: --live .4s linear, --live-hi .4s linear; }
.scrim-bottom { background: linear-gradient(to top, color-mix(in srgb, color-mix(in srgb, var(--ink) 90%, var(--live)) 86%, transparent) 0%, color-mix(in srgb, var(--ink) 48%, transparent) 45%, transparent 100%); } /* readability first: the world tints the shading only lightly */
.plate h1 { text-shadow: 0 2px 18px color-mix(in srgb, var(--ink) 70%, transparent), 0 0 28px color-mix(in srgb, var(--live-hi) 35%, transparent); }
.ctl { box-shadow: 0 0 18px -6px color-mix(in srgb, var(--live-hi) 45%, transparent); }
.rail .sw[aria-current="true"] { box-shadow: 0 0 0 1px var(--title), 0 0 22px color-mix(in srgb, var(--live-hi) 55%, transparent); }

/* Upgrade 9: the name builds in pixels over the real heading. */
.plate h1 { position: relative; }
.plate h1.building { color: transparent; text-shadow: none; }
.plate h1 .name-build { position: absolute; image-rendering: pixelated; pointer-events: none; transition: opacity .18s ease; }

/* Upgrade 3: the arrival line about the visitor's own time of day. */
.clock { margin: -2px 0 10px; font-size: 13px; color: var(--text); opacity: 0; transition: opacity .8s ease;
  text-shadow: 0 1px 10px color-mix(in srgb, var(--ink) 85%, transparent); }
.clock.show { opacity: .85; }

/* Upgrade 5: the tags are links to pricing. */
a.tag { text-decoration: none; transition: background .3s, border-color .3s; }
a.tag.buy { border-color: color-mix(in srgb, var(--title) 55%, transparent); }
@media (hover: hover) { a.tag.buy:hover { background: color-mix(in srgb, var(--ink) 30%, transparent); border-color: var(--title); } a.tag.free:hover { filter: brightness(1.06); } }
a.tag:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { :root { transition: none; } .clock { transition: none; } }

/* Names stay on one line (so the pixel build matches the heading exactly); the plate is a little wider to allow it. */
.plate { max-width: min(640px, 92vw); }
.plate h1 { white-space: nowrap; font-size: clamp(28px, 3.4vw, 54px); }
@media (max-width: 640px) { .plate h1 { font-size: clamp(24px, 7.4vw, 34px); } }

/* Owner note 33: the pixel title stays as the visible title (no hand-over jump). */
.plate h1.building { color: inherit; }
.plate h1.pixeled { color: transparent; text-shadow: none; }
.plate h1 .name-build { filter: drop-shadow(0 2px 12px color-mix(in srgb, var(--ink) 75%, transparent)) drop-shadow(0 0 16px color-mix(in srgb, var(--live-hi) 32%, transparent)); }

/* Owner note 37: Pixel Worlds and Voxel Worlds. */
.single .rail .step { display: none; }
.rail li.x { display: flex; align-items: center; margin-left: 8px; }
.xlink { font-family: var(--tiny); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap;
  padding: 8px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); background: color-mix(in srgb, var(--ink) 45%, transparent); }
@media (hover: hover) { .xlink:hover { border-color: var(--title); } }
.xlink:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.about { margin: -4px 0 12px; font-size: 14px; color: color-mix(in srgb, var(--text) 82%, transparent); max-width: 34em; text-shadow: 0 1px 10px color-mix(in srgb, var(--ink) 85%, transparent); }

/* Review S2 (Voxel Worlds on a phone): one world, so the page scrolls: The Quiet Isle sits under the header, its frame's
   edges fading into the page (no hard rectangle), then the words, then the rail. */
@media (max-width: 640px) {
  html:has(body.single), body.worlds.single { height: auto; overflow: auto; }
  .single .world { position: absolute; inset: auto 0 auto 0; top: 64px; height: calc(100vw * 9 / 16 * 1.19);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%); }
  .single .scrim-bottom { display: none; }
  .single main { position: relative; inset: auto; margin-top: calc(64px + 100vw * 9 / 16 * 1.19 - 8px); flex-direction: column; gap: 22px; }
  .single .rail { justify-content: flex-start; }
}
