/* The rooms (rooms.tsx, App/Rooms.swift). The page sets html[data-room] so
   the ground lies under everything, the tab bar included. */

.room-page { gap: 32px; padding-bottom: 32px; }

.room-title { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.room-title-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.room-title h1 { font-size: clamp(38px, 13vw, 56px); line-height: 0.92; font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; }

.section-title { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--text); }
.section-title h2 { flex: 1; font-size: 20px; font-weight: 800; text-transform: uppercase; }
.section-title-trailing { font-size: 14px; font-weight: 700; }

.hairline { height: 0.5px; background: color-mix(in srgb, var(--text) 14%, transparent); }
.plain-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; text-align: left; width: 100%; }
.plain-row-title { font-size: 17px; font-weight: 800; }

/* ---------- The grounds ---------- */

/* Museum: black, the lights off. Crew: the night of the Horizon. Both dark,
   whatever the phone is set to. */
html[data-room="museum"], html[data-room="crew"] {
  color-scheme: dark;
  --text: #FFFFFF;
  --secondary: rgba(235, 235, 245, 0.68);
  --tertiary: rgba(235, 235, 245, 0.3);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(40, 38, 46, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --bar: rgba(22, 22, 24, 0.8);
  --fill: rgba(120, 120, 128, 0.24);
  --accent-ink: var(--orange);
  --lg-tint: rgba(255, 255, 255, 0.04);
  --lg-fill: rgba(255, 255, 255, 0.12);
  --lg-rim-hi: rgba(255, 255, 255, 0.6);
  --lg-rim-lo: rgba(255, 255, 255, 0.08);
  --lg-glow: inset 0 0 18px rgba(255, 255, 255, 0.05);
  --lg-drop: 0 10px 30px rgba(0, 0, 0, 0.45);
  --lg-card: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
}
html[data-room="museum"] { --bg: #000000; }
html[data-room="museum"] body { background: #000000; }
html[data-room="museum"] body::before { display: none; }

html[data-room="crew"] { --bg: #07071A; }
html[data-room="crew"] body { background: #07071A; }
html[data-room="crew"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: none; filter: none; height: auto;
  background:
    radial-gradient(130% 42% at 50% 24%, rgba(96, 89, 255, 0.42), rgba(134, 78, 229, 0.18) 45%, rgba(21, 8, 79, 0) 72%),
    radial-gradient(120% 40% at 50% 112%, rgba(56, 166, 191, 0.28), rgba(56, 166, 191, 0) 70%),
    linear-gradient(180deg, #07071A 0%, #1A1340 52%, #08081A 100%);
}

/* Missions: daylight, sky blue at the top, a soft pink from the bottom. */
@media (prefers-color-scheme: light) {
  html[data-room="missions"] { --bg: #EEF3FA; }
  html[data-room="missions"] body::before {
    background:
      radial-gradient(140% 45% at 90% -4%, rgba(92, 143, 180, 0.34), rgba(92, 143, 180, 0) 70%),
      radial-gradient(150% 55% at 15% 108%, rgba(242, 184, 217, 0.62), rgba(242, 184, 217, 0) 72%),
      linear-gradient(180deg, #EEF3FA 0%, #F8F6FB 48%, #FCEFF6 100%);
  }
}

/* Under the status bar the room's own colour, fading into the page. */
.room-strip { background: var(--bg); }
.room-strip::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none;
  background: linear-gradient(180deg, var(--bg), transparent);
}

/* A plain glass pill, for buttons on the rooms. */
.pill-glass {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px;
  font-weight: 700; font-size: 15px; color: var(--text);
  background: color-mix(in srgb, var(--text) 14%, transparent);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--text) 35%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
/* The Crew tab: what styles.css doesn't already have. */

/* A sheet with its own small bar, like a NavigationStack in a .sheet. */
.cs-sheet { display: flex; flex-direction: column; }
.cs-bar {
  position: sticky; top: 0; z-index: 2; height: 52px; flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px;
  background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.cs-bar .navbar-title { justify-self: center; }
.cs-close { justify-self: start; color: var(--orange); font-weight: 600; padding: 8px; font-size: 17px; }
.cs-grabber { position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--tertiary); }
.cs-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; }

/* Lists in sheets: the scanner and disc fallbacks. */
.cs-list-head { font-size: 13px; color: var(--secondary); padding: 0 4px 8px; text-transform: none; }
.cs-list { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 12px; overflow: hidden; }
.cs-list > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; text-align: left; border-top: 0.5px solid var(--line); }
.cs-list > button:first-child { border-top: 0; }

/* The top of the tab: the ring to the next rank, the latest patch inside. */
.rank-ring { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.rank-ring > svg { position: absolute; inset: 0; }
.rank-badge { display: inline-flex; gap: 2px; padding: 8px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--orange); }

/* Scanning floats over the page, centred above the tab bar; the page ends
   with room for it. */
.crew-scan {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 29;
  bottom: calc(max(14px, calc(var(--safe-bottom) - 8px)) + var(--tabbar-h) + 12px);
  height: 54px; padding: 0 28px; font-size: 16px; font-weight: 800; color: #fff;
}
.crew-about { padding-bottom: 66px; }

/* Rows that push a screen or leave the app. */
.about-link { display: flex; align-items: center; width: 100%; padding: 12px 0; border-bottom: 0.5px solid var(--line); font-size: 15px; font-weight: 600; text-align: left; }

.patch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px 12px; align-items: start; }
.patch-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* The wall of 100 codes. */
.qr-wall { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.qr-cell {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 5px;
  font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff;
}
.qr-cell.open { color: var(--secondary); border: 1px dashed color-mix(in srgb, var(--secondary) 55%, transparent); }
.qr-key { width: 14px; height: 14px; border-radius: 3px; flex: none; }

/* The camera. */
.scanner { position: relative; height: min(70dvh, 620px); background: #000; overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .pill {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); white-space: nowrap;
  padding: 14px; border-radius: 99px; font-size: 15px; font-weight: 700;
  background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* Postcards. */
.postcard { height: 130px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.postcard img { width: 100%; height: 100%; object-fit: cover; }

/* Widgets, drawn as they look on the phone. */
.w-tile { border-radius: 24px; overflow: hidden; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); position: relative; flex: none; }
.lock { border-radius: 30px; padding: 22px 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; background: linear-gradient(#2B1E4A, #0E1A2B); }
.lock-time { font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif; font-size: 64px; font-weight: 600; line-height: 1; color: rgba(255, 255, 255, 0.9); }
.island { width: 230px; height: 38px; border-radius: 99px; background: #000; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; align-self: center; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.field { width: 100%; padding: 12px; border-radius: 12px; border: 0; background: var(--fill); font: inherit; color: inherit; }
.destructive { color: #FF3B30; }
/* The Museum tab and the artwork page (App/MuseumView.swift,
   App/ArtworkDetailView.swift, App/MetaverseView.swift). */

/* ArtGrid: three to a row, square, edge to edge, no captions. */
.mm-artgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mm-artgrid > a { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.mm-unseen { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 1.5px #fff; transition: opacity 0.6s ease-in-out; }

/* WallGrid: like works on a wall, a label under each. Columns of at least
   150px, as GridItem(.adaptive(minimum: 150)). */
.mm-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 10px; row-gap: 22px; align-items: start; }
.mm-wall-img { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.mm-wall-unseen { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 0 1.5px #000000; transition: opacity 0.6s ease-in-out; }
.mm-wall-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* The Museum room: the T-Plus line, the dome edge to edge, the sort pills. */
.mm-tplus { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; white-space: nowrap; }
@media (max-width: 380px) { .mm-tplus { font-size: 34px; } }
.mm-dome { position: relative; margin: 0 -16px; aspect-ratio: 1.1; overflow: hidden; }
.mm-dome > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mm-sort { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  color: #FFFFFF; background: rgba(255, 255, 255, 0.1); }
.mm-sort[aria-pressed="true"] { color: #000000; background: #FFFFFF; font-weight: 700; }

/* MissionClock */
.mm-clock-digits { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mm-clock-label { text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: 1.6px; color: rgba(255, 255, 255, 0.55); }

/* The artwork page */
.mm-artwork-hero { display: block; width: 100%; border-radius: 22px; overflow: hidden; background: var(--cream);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.12); cursor: zoom-in; }
.mm-artwork-hero img { width: 100%; height: auto; max-height: 520px; object-fit: contain; background: var(--cream); }
.mm-section p { font-size: 16px; line-height: 1.6; }
.mm-linkrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 0; text-align: left; border-bottom: 0.5px solid var(--line); }
.mm-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mm-pager .card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; min-width: 0; }
.mm-oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Plain systemBackground under the page, without the night glow. */
.mm-plain-bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); pointer-events: none; }
.mm-toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); transform: translateX(-50%); z-index: 70;
  padding: 10px 16px; border-radius: 99px; background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 14px; font-weight: 600; animation: fade 0.2s ease-out; }

/* ZoomView: pinch and pan over the full image. */
.mm-zoom { touch-action: none; overflow: hidden; user-select: none; -webkit-user-select: none; }
.mm-zoom img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: center; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.mm-zoom img.settle { transition: transform 0.3s cubic-bezier(.2, .9, .3, 1); }
.mm-roundclose { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); color: #fff; display: grid; place-items: center; }

/* The metaverse */
.mm-metaverse { position: relative; display: block; width: 100%; overflow: hidden; border-radius: 24px; text-align: left; color: #fff; background: #000; }
.mm-metaverse > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mm-metaverse-shade { position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.85)); }
.mm-metaverse-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mm-capsule-dark { display: inline-flex; border-radius: 99px; background: rgba(0, 0, 0, 0.4); }
.mm-world { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.mm-world-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; pointer-events: none; }
.mm-world-state button { pointer-events: auto; }
.mm-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: mm-spin 0.9s linear infinite; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
.mm-leave-world { position: absolute; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + var(--safe-bottom));
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; color: #fff; font-size: 13px; font-weight: 700;
  background: rgba(40, 40, 44, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
/* The Missions tab, a mission's page and Mission 0 (App/MissionsView.swift,
   App/MissionZero.swift, App/MissionArtView.swift). */

/* The small heavy capitals over a black header, without the eyebrow's dot. */
.mm-kicker { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--orange); }

/* Black, like the top of a mission on moonmars.com. */
.mm-black { background: #000; color: #fff; }

/* Edge to edge inside the page's 16px gutter, straight under the nav bar. */
.mm-bleed { margin: -16px -16px 0; }

.mm-clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mm-clamp3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.mm-line1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A picture that fills a fixed frame, so a wide one can't widen the tile. */
.mm-frame { position: relative; overflow: hidden; }
.mm-frame > img, .mm-frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* The next flight: the one panel on the Missions tab. */
.mm-next { display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; }
.mm-next-kicker { font-size: 12px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--orange); }
.mm-next-name { font-size: 26px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.mm-follow-live { display: grid; place-items: center; height: 48px; border-radius: 99px; background: var(--orange); color: var(--night); font-size: 15px; font-weight: 800; }

/* The flight log: the entries hang on one line through the middle of their dots. */
.mm-flightlog { position: relative; display: flex; flex-direction: column; }
.mm-flightlog::before { content: ""; position: absolute; top: 30px; bottom: 30px; left: 6px; width: 2px; background: rgba(21, 8, 79, 0.16); }
@media (prefers-color-scheme: dark) { .mm-flightlog::before { background: rgba(21, 8, 79, 0.6); } }
.mm-flightlog > a { position: relative; display: block; }
.mm-entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-align: left; }
.mm-dot-slot { position: relative; flex: none; width: 14px; height: 14px; margin-right: 2px; display: grid; place-items: center; }
.mm-dot { flex: none; border-radius: 50%; }
.mm-dot.flown { width: 14px; height: 14px; background: var(--text); }
.mm-dot.upcoming { width: 14px; height: 14px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--text); }
.mm-dot.landed { width: 20px; height: 20px; background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 22%, transparent); }
.mm-when { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--secondary); }
.mm-thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; }

/* An upcoming mission's page: the art stays secret, follow it instead. */
.mm-follow { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 18px; border-radius: 24px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.mm-follow-btn { width: 100%; height: 50px; border-radius: 99px; font-size: 16px; font-weight: 800; background: var(--orange); color: var(--night); }
.mm-follow-btn.on { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }

.mm-facts { padding: 0 14px; border-radius: 16px; }
.mm-fact { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; font-size: 14px; }
.mm-fact + .mm-fact { border-top: 0.5px solid var(--line); }
.mm-fact > :last-child { margin-left: auto; text-align: right; font-weight: 600; }

/* The works, three to a row (MuseumView.swift ArtGrid). */
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mm-grid a { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.mm-unseen { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 1.5px #fff; }

.mm-num { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 7px; border-radius: 99px;
  background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.mm-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding-top: 4px; }
.mm-works button { display: flex; flex-direction: column; gap: 4px; text-align: left; min-width: 0; }

.mm-mask { display: block; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* The round frosted play button on a film. */
.mm-play { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,0.22); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.mm-pill { position: absolute; display: flex; align-items: center; gap: 4px; color: #fff; background: rgba(0,0,0,0.45); border-radius: 99px; }

/* Fallen Astro, full screen with its music (App/IntroView.swift). */
.mm-intro { display: flex; flex-direction: column; }
.mm-intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mm-intro-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-top)) 20px 12px; }
.mm-intro-foot { position: relative; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 20px calc(12px + var(--safe-bottom)); text-align: center; }
/* The Play tab, the arcade: Tonight's MoonArt, the MoonGrid, the Lander and Moondle. */

/* A full-screen cover over the tabs (fullScreenCover / sheet in the app). */
.play-cover.play-cover {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; background: var(--bg); color: var(--text);
  animation: rise 0.32s cubic-bezier(.2,.9,.3,1);
}
.play-cover .navbar { position: sticky; }
.navbar.play-dark-bar { background: rgba(8, 7, 15, 0.82); border-bottom-color: rgba(255,255,255,0.12); color: #fff; }

/* The night backdrop behind a cover, as Backdrop() in the app. */
.play-backdrop { background: var(--bg); }
@media (prefers-color-scheme: dark) {
  .play-backdrop { background:
    radial-gradient(90vw 55vw at 50% 0%, rgba(235, 112, 192, 0.24), rgba(134, 78, 229, 0.12) 55%, transparent 80%), var(--bg); }
}

/* Cards that are buttons. */
.play-tap { display: block; width: 100%; text-align: left; transition: transform 0.15s; }
.play-tap:active { transform: scale(0.98); }

/* ---------- The MoonGrid ---------- */
.moongrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; }
.moongrid-place { position: relative; aspect-ratio: 1; background-color: #05050A; background-image: url(/files/card/card-deepfield.jpg); background-size: 700% 700%; }
.moongrid-place img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.moongrid-place::after { content: ""; position: absolute; inset: 0; border: var(--edge, 1px) solid rgba(255,255,255,var(--edge-a, 0.22)); pointer-events: none; }
.moongrid-place.lit { z-index: 1; animation: grid-pulse 0.7s ease-in-out 3 alternate forwards; }
@keyframes grid-pulse { to { transform: scale(1.12); } }

/* ---------- The reveal ---------- */
/* Above the patch celebration (75), as in the app: a patch the claim earns shows once the reveal has closed. */
.reveal { position: fixed; inset: 0; z-index: 76; background: #08070F; color: #fff; overflow-y: auto; display: grid; place-items: center; animation: fade 0.25s ease-out; }
.reveal-art {
  width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid rgba(233, 127, 65, 0.9);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6); transform-origin: 88% 35%;
  transform: scale(0.03); opacity: 0.3;
  transition: transform 2.3s cubic-bezier(0.22, 0.64, 0.18, 1) 0.25s, opacity 2.3s cubic-bezier(0.22, 0.64, 0.18, 1) 0.25s;
}
.reveal-art.grown { transform: scale(1); opacity: 1; }
.reveal-words { opacity: 0; transition: opacity 0.7s ease-in 1.6s; }
.reveal-words.grown { opacity: 1; }

/* ---------- Moondle ---------- */
.moondle-pic { position: relative; aspect-ratio: 1; background: #000; border-radius: 22px; overflow: hidden; }
.moondle-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: moondle-out 0.6s ease-in-out; }
@keyframes moondle-out { from { opacity: 0; transform: scale(1.6); } }
.moondle-choice {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px;
  background: var(--fill); min-width: 0; transition: opacity 0.2s;
}
.moondle-choice:disabled { opacity: 0.35; cursor: default; text-decoration: line-through; }
.moondle-choice .name { font-size: 15px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- The posters (App/PlayView.swift) ---------- */
/* Each game a tall poster in its own colour: the brand's huge capitals. */
.play-poster { display: flex; flex-direction: column; align-items: stretch; padding: 22px; border-radius: 30px; overflow: hidden; }
.play-poster-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.play-poster-title { font-size: 30px; font-weight: 800; line-height: 1.05; text-transform: uppercase; }

/* Tonight's MoonArt: the KesselsKramer night, the work still blurred in it. */
.tonight-poster { color: #fff; background: radial-gradient(circle 420px at 50% 30%, #3B2A8C, #15084F 50%, #0B0726); }
.tonight-work {
  position: relative; width: 168px; height: 168px; margin: 0 auto 18px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 70px rgba(242, 184, 217, 0.55); isolation: isolate;
}
.tonight-work::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid rgba(255, 255, 255, 0.3); }
.tonight-work > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 800; color: rgba(255, 255, 255, 0.9); }
.tonight-reveal {
  align-self: flex-start; display: inline-flex; align-items: center; height: 46px; padding: 0 20px; margin-top: 6px; border-radius: 99px;
  font-size: 16px; font-weight: 800; color: #000; background: var(--orange);
}

/* Moondle: pink, the close-up as a round window with a white ring. */
.moondle-name { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -1px; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 360px) { .moondle-name { font-size: 34px; } }
.moondle-window { position: relative; width: 116px; height: 116px; flex: none; border-radius: 50%; overflow: hidden; background: #000; }
.moondle-window img { width: 100%; height: 100%; object-fit: cover; }
.moondle-window::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.55); }
.moondle-window-q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: rgba(255, 255, 255, 0.9); text-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }

/* ---------- Lander (App/Lander.swift) ---------- */
.lander { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* The whole screen is the thumb's: no scrolling, no zooming, no text to pick. */
.lander-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.lander-hud { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-direction: column; gap: 14px; padding: calc(var(--safe-top) + 4px) 16px 0; pointer-events: none; }
.lander-close {
  pointer-events: auto; width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
}
.lander-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.lander-readout { flex: 1; align-items: center; gap: 2px; min-width: 0; }
.lander-readout-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.lander-readout-value { font-size: 17px; font-weight: 800; white-space: nowrap; }
.lander-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.lander-card {
  pointer-events: auto; width: min(420px, 100%); padding: 22px; border-radius: 30px; display: flex; flex-direction: column; gap: 12px;
  background: rgba(11, 7, 38, 0.86); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); color: #fff;
}
.lander-card.fade-in { animation: fade 0.35s ease-out; }
.lander-title { font-size: 30px; font-weight: 800; line-height: 1.05; text-transform: uppercase; }
.lander-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 99px; font-size: 16px; font-weight: 800; }
.lander-primary { color: #000; background: var(--orange); align-self: flex-start; margin-top: 4px; }
.lander-share { color: #fff; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3); margin-top: 4px; }

/* Today: the parts the shared classes don't cover. */

/* The header's two lines: tight, as with the app's negative line spacing. */
.today-title { font-size: 30px; font-weight: 800; line-height: 1.04; text-transform: uppercase; color: #fff; }
/* Top left, across from the logo: what MoonMars is, in one line. */
.today-kicker { position: absolute; top: 24px; left: 20px; right: 70px; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The tapped landmark's caption slides up from under the Moon. */
.hero-caption { animation: caption-in 0.3s cubic-bezier(.2,.9,.3,1); }
@keyframes caption-in { from { opacity: 0; transform: translateY(12px); } }

.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Weather on the Moon: three pages, swiped ---------- */
.weather-card {
  position: relative; height: 472px; border-radius: 26px; overflow: hidden;
  background: #07060F; color: #fff;
  --secondary: rgba(235, 235, 245, 0.62);
}
.weather-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid rgba(255,255,255,0.08); pointer-events: none; }
.weather-pager { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.weather-pager::-webkit-scrollbar { display: none; }
.weather-page { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; }
.weather-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.weather-dots button { pointer-events: auto; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.weather-dots button.on { background: #fff; }
.weather-info { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: rgba(255,255,255,0.7); }

/* ---------- The lead story and the plain rows ---------- */
.today-lead { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; }
.today-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 6px 4px; text-align: left; }

/* ---------- Find the Moon: always at night ---------- */
.mm-dark {
  --bg: #000000; --text: #FFFFFF;
  --secondary: rgba(235, 235, 245, 0.62); --tertiary: rgba(235, 235, 245, 0.3);
  --line: rgba(255, 255, 255, 0.12); --glass: rgba(40, 38, 46, 0.62); --glass-edge: rgba(255, 255, 255, 0.10);
  --bar: rgba(22, 22, 24, 0.8); --fill: rgba(120, 120, 128, 0.24); --shadow: none;
  background: var(--bg); color: var(--text); min-height: 100dvh; color-scheme: dark;
}
.mm-dark .statusbar { background: var(--bg); }
.finder-dial { position: relative; width: 300px; height: 300px; flex: none; }
.finder-ring { position: absolute; border: 1px solid; border-radius: 50%; }
.finder-turn { position: absolute; inset: 0; transition: transform 0.3s ease-out; }
.finder-arrow { position: absolute; left: 130px; top: 130px; transition: color 0.3s; }
/* The news cards and the launch sheets (App/SpaceDaily.swift, App/LaunchControl.swift). */

.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.news-thumb { width: 72px; height: 72px; flex: none; border-radius: 12px; object-fit: cover; background: rgba(120, 120, 128, 0.1); }
/* Art in space: a pull quote, a 3px pink bar down the left. */
.pull-quote { position: relative; padding-left: 16px; }
.pull-quote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--pink); }

/* The next launch: the one thing in Launch control with a panel, a black bar. */
.launch-bar { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 18px; text-align: left; border-radius: 22px;
  background: var(--night); color: #fff; color-scheme: dark;
  --text: #FFFFFF; --secondary: rgba(235, 235, 245, 0.6); --tertiary: rgba(235, 235, 245, 0.3); }


.status-chip {
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--c); padding: 4px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.dest-badge {
  display: inline-flex; align-items: center; gap: 3px; flex: none; white-space: nowrap;
  font-size: 10px; font-weight: 800; color: #fff; padding: 4px 8px; border-radius: 99px;
}
.dest-badge.small { font-size: 9px; padding: 2px 6px; }
.dest-icon { flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* The sheets: an inset grouped list, iOS style. */
.grouped-bg { background: #F2F2F7; }
.grouped-bg .list-group { background: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .grouped-bg { background: #000000; }
  .grouped-bg .list-group { background: #1C1C1E; }
}
.list-header { font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--secondary); padding: 0 16px; }
.list-group { border-radius: 10px; overflow: hidden; }
.list-cell { display: flex; width: 100%; padding: 11px 16px; text-align: left; gap: 8px; }
.list-group > .list-cell + .list-cell { border-top: 0.5px solid var(--line); }
/* The MoonMars palette, from moonmars.com/styles.css and the logo's four dots
   (Shared/Theme.swift). Light like moonmars.com; dark follows the phone. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/files/PlusJakartaSans.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --orange: #E97F41;
  --pink: #EB70C0;
  --purple: #864EE5;
  --teal: #38A6BF;
  --night: #000000;
  --cream: #F4F2EC;
  --muted: #767068;

  --bg: #FFFFFF;
  --text: #000000;
  --secondary: rgba(60, 60, 67, 0.68);
  --tertiary: rgba(60, 60, 67, 0.3);
  --line: #E2DDD5;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --bar: rgba(255, 255, 255, 0.8);
  --fill: rgba(120, 120, 128, 0.12);
  --shadow: 0 8px 28px rgba(180, 60, 120, 0.08);
  --accent-ink: #9A4210;

  /* Liquid glass, as on iOS 26 (see .lg below): almost clear, the world
     behind bent at the edges, a rim that catches light top-left and
     bottom-right, a glow inside and a soft lift off the sky. */
  --lg-tint: rgba(255, 255, 255, 0.12);
  --lg-fill: rgba(30, 20, 40, 0.07);
  --lg-rim-hi: rgba(255, 255, 255, 0.95);
  --lg-rim-lo: rgba(255, 255, 255, 0.22);
  --lg-glow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.04), inset 0 0 18px rgba(255, 255, 255, 0.35);
  --lg-drop: 0 8px 28px rgba(20, 16, 30, 0.12), 0 1px 4px rgba(20, 16, 30, 0.08);
  --lg-card: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));

  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light dark;
  font-family: "Plus Jakarta Sans", -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #FFFFFF;
    --secondary: rgba(235, 235, 245, 0.62);
    --tertiary: rgba(235, 235, 245, 0.3);
    --line: rgba(255, 255, 255, 0.12);
    --glass: rgba(40, 38, 46, 0.62);
    --glass-edge: rgba(255, 255, 255, 0.10);
    --bar: rgba(22, 22, 24, 0.8);
    --fill: rgba(120, 120, 128, 0.24);
    --shadow: none;
    --accent-ink: #F09A66;
    --lg-tint: rgba(255, 255, 255, 0.04);
    --lg-fill: rgba(255, 255, 255, 0.12);
    --lg-rim-hi: rgba(255, 255, 255, 0.6);
    --lg-rim-lo: rgba(255, 255, 255, 0.08);
    --lg-glow: inset 0 0 18px rgba(255, 255, 255, 0.05);
    --lg-drop: 0 10px 30px rgba(0, 0, 0, 0.45);
    --lg-card: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

/* The daylight backdrop: white, as on moonmars.com, with a very faint pink
   rising from the bottom and a touch of sky blue at the top. */
@media (prefers-color-scheme: light) {
  body { background: transparent; }
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(130% 60% at 50% 115%, rgba(242, 184, 217, 0.28), transparent 72%),
      radial-gradient(110% 45% at 85% -5%, rgba(92, 143, 180, 0.10), transparent 70%),
      linear-gradient(180deg, #FAFCFF 0%, #FFFFFF 40%, #FFF9FC 100%);
  }
}

/* The night backdrop: the horizon's light coming up behind the glass. */
@media (prefers-color-scheme: dark) {
  body::before {
    content: ""; position: fixed; inset: -20vw -40vw auto; height: 110vw; z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, rgba(96, 89, 255, 0.34), rgba(125, 96, 193, 0.20), transparent);
    transform: translateY(-55%); filter: blur(30px);
  }
}

/* ---------- Layout ---------- */
.screen { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 32px); }
.page { max-width: 720px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 18px; }
.page.tight { gap: 12px; }
.statusbar { position: sticky; top: 0; z-index: 20; height: var(--safe-top); background: var(--bg); }

/* The navigation bar: back, title, an action. Large title below, iOS style. */
.navbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-top);
  /* No bar, as on iOS 26: the content blurs out softly under the glass. */
  background: linear-gradient(180deg, var(--bar) 0%, transparent 100%);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  padding-bottom: 12px; margin-bottom: -12px;
}
.navbar-row { height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px; max-width: 720px; margin: 0 auto; }
.navbar-title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
/* Back: a glass pill, as in iOS 26. */
.navbar-back {
  justify-self: start; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 10px; border-radius: 99px;
  color: var(--text); font-size: 15px; font-weight: 700;
}
.navbar-action { justify-self: end; display: flex; gap: 8px; align-items: center; color: var(--accent-ink); font-weight: 700; }
.large-title { font-size: 38px; font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; padding: 6px 16px 8px; max-width: 720px; margin: 0 auto; }

/* ---------- Tab bar: a floating glass capsule, the active tab a brighter drop in it ---------- */
.tabbar {
  position: fixed; left: 16px; right: 16px; bottom: max(14px, calc(var(--safe-bottom) - 8px)); z-index: 30;
  max-width: 520px; margin: 0 auto; height: var(--tabbar-h); padding: 4px; border-radius: 32px;
}
.tabbar-row { height: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 28px; color: var(--secondary); font-size: 10px; font-weight: 600; transition: background 0.25s, box-shadow 0.25s; }
.tab.active { color: var(--accent-ink); font-weight: 700; }
.tab-icon { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* ---------- Cards ---------- */
.card {
  background: var(--lg-card); border: 1px solid var(--lg-rim-hi); border-radius: 22px;
  backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: var(--lg-glow), 0 10px 30px rgba(21, 8, 79, 0.10);
}
.card.pad { padding: 16px; }
/* The big moments: the KesselsKramer night, with light on its top edge. */
.dark-card { background: linear-gradient(180deg, #15084F, #000000); color: #fff; border-radius: 22px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 12px 30px rgba(21, 8, 79, 0.25); --secondary: rgba(235, 235, 245, 0.62); --glass: rgba(255,255,255,0.08); --glass-edge: rgba(255,255,255,0.1); --line: rgba(255,255,255,0.12); }
.dark-card.pad { padding: 16px; }
.row { display: flex; align-items: center; gap: 14px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.secondary { color: var(--secondary); }
.tertiary { color: var(--tertiary); }
.center { text-align: center; }
.chevron { color: var(--tertiary); font-size: 20px; line-height: 1; }

/* ---------- Type ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--c, var(--orange)); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip { display: inline-block; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 5px 9px; border-radius: 99px; color: var(--c, var(--orange)); background: color-mix(in srgb, var(--c, var(--orange)) 16%, transparent); }
.t11 { font-size: 11px; } .t12 { font-size: 12px; } .t13 { font-size: 13px; } .t14 { font-size: 14px; } .t15 { font-size: 15px; }
.t16 { font-size: 16px; } .t17 { font-size: 17px; } .t20 { font-size: 20px; } .t22 { font-size: 22px; } .t28 { font-size: 28px; }
.w6 { font-weight: 600; } .w7 { font-weight: 700; } .w8 { font-weight: 800; }
.upper { text-transform: uppercase; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Icons ---------- */
.site-icon { flex: none; display: grid; place-items: center; background: var(--c, var(--orange)); }
.site-icon > span { background: #fff; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.credit { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.9); background: rgba(0,0,0,0.4); padding: 3px 7px; border-radius: 99px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 99px; font-weight: 700; font-size: 15px; transition: transform 0.15s; }
.btn:active { transform: scale(0.97); }
/* The main action: glass tinted Mars orange (see .lg), dark ink for contrast. */
.btn.prominent { color: #000000; font-weight: 800; }
/* Everything else: clear glass. */
.btn.bordered { color: var(--text); }
.btn.wide { width: 100%; }
.link { color: var(--accent-ink); font-weight: 700; }

/* ---------- Sheets and dialogs ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.35); display: grid; place-items: center; padding: 24px; animation: fade 0.2s ease-out; }
.dialog { width: min(300px, 100%); background: var(--bar); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-radius: 18px; text-align: center; overflow: hidden; }
.dialog-body { padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.dialog-actions button { display: block; width: 100%; padding: 12px; border-top: 0.5px solid var(--line); color: var(--orange); font-size: 17px; }
.dialog-actions button.cancel { font-weight: 700; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 51; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding-bottom: var(--safe-bottom); animation: rise 0.28s cubic-bezier(.2,.9,.3,1); }
.fullscreen { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }

/* ---------- Bits ---------- */
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.search { width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: var(--fill); font: inherit; color: inherit; font-size: 17px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 99px; }
.segmented button { padding: 7px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.segmented button.on { font-weight: 700; }
.toggle { position: relative; width: 51px; height: 31px; border-radius: 99px; background: var(--fill); transition: background 0.2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.2s; }
.toggle.on { background: #34C759; }
.toggle.on::after { transform: translateX(20px); }

/* On a big screen: the app in an iPhone-sized frame, see PhoneFrame.tsx. */
.phone-stage { position: fixed; inset: 0; display: grid; place-items: center; background: #1c1c1e; overflow: hidden; }
.phone { box-sizing: content-box; flex: none; border-style: solid; border-color: #000; border-radius: 64px;
  overflow: hidden; background: #000; box-shadow: 0 0 0 2px #3a3a3c, 0 30px 80px rgba(0,0,0,.5); }
.phone iframe { display: block; border: 0; border-radius: 52px; background: #fff; }

/* ---------- Liquid glass ----------
   The controls float over the content as glass, as on iOS 26: clear in the
   middle, the world behind bent at the curved edge, a thin rim of light where
   the edge catches it, a soft shadow under it. Chrome takes a lens made for
   each element's size (ui/glass.ts); elsewhere it stays clear, lightly
   frosted glass with the rim drawn here. */
:where(.lg, .tabbar, .navbar-back, .btn.bordered, .btn.prominent, .segmented) {
  position: relative; isolation: isolate; border: 0;
  background: var(--lg-tint);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  box-shadow: var(--lg-glow), var(--lg-drop);
}
.lens :is(.lg, .tabbar, .navbar-back, .btn.bordered, .btn.prominent, .segmented) {
  backdrop-filter: var(--lg-lens, blur(8px)) saturate(170%) brightness(1.04);
}
/* The rim, where there's no lens to draw it: a hairline of light, brightest
   top left and bottom right. */
html:not(.lens) :is(.lg, .tabbar, .navbar-back, .btn.bordered, .btn.prominent, .segmented)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, var(--lg-rim-hi) 0%, var(--lg-rim-lo) 30%, transparent 50%, var(--lg-rim-lo) 70%, var(--lg-rim-hi) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (prefers-color-scheme: light) { .tabbar .tab:not(.active) { color: #2C2830; } }
/* Over dark content the glass goes dark, its labels light (ui/glass.ts). */
[data-on="dark"]:is(.lg, .tabbar, .navbar-back, .btn.bordered, .segmented) {
  --lg-tint: rgba(20, 16, 24, 0.22); --lg-fill: rgba(255, 255, 255, 0.16); --accent-ink: #F5A274;
  --lg-glow: inset 0 0 18px rgba(255, 255, 255, 0.06);
  color: #fff;
}
.tabbar[data-on="dark"] .tab:not(.active) { color: #fff; }
.navbar[data-on="dark"] { --bar: rgba(0, 0, 0, 0.45); color: #fff; }
.navbar[data-on="dark"] .navbar-back { --lg-tint: rgba(20, 16, 24, 0.22); --lg-glow: inset 0 0 18px rgba(255, 255, 255, 0.06); color: #fff; }
.tabbar, .tab, .navbar-back, .btn.bordered, .segmented { transition: color 0.3s ease, background-color 0.3s ease; }
/* The selected tab: a soft fill in the glass, its label in Mars orange. */
.tab.active, .segmented button.on { background: var(--lg-fill); box-shadow: none; }
/* Glass tinted Mars orange for the one main action. */
.btn.prominent {
  background: linear-gradient(180deg, rgba(240, 140, 84, 0.86), rgba(233, 127, 65, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 24px rgba(233, 127, 65, 0.32), 0 1px 3px rgba(154, 66, 16, 0.2);
}
