/* ===========================================================================
   UFORIA — product shell chrome.
   The 3D world renders at 1080p Anti-alias behind everything; this stylesheet
   is the BLACK-AND-WHITE OLD-TV interface that sits on top: monochrome palette,
   a TV-set bezel, faint scanlines + grain on chrome, premium type. Honors
   02-The-Vibe.md (contrast, light, restraint, "would a stranger screenshot it").
   =========================================================================== */
:root {
  --ink: #f4f6f8;        /* near-white "phosphor" text (on dark screens) */
  --ink-dim: #aab0b8;
  --ink-faint: #6c7178;
  --ink-contrast: #06070a; /* text that sits ON a filled --ink button */
  --tv-black: #07080a;
  --tv-panel: rgba(10, 11, 13, 0.72);
  --tv-line: rgba(244, 246, 248, 0.16);
  --glow: 0 0 18px rgba(244, 246, 248, 0.28);
  --accent: #5ce1ff;          /* one restrained neon — the rave energy (selection + play) */
  --accent-soft: rgba(92, 225, 255, 0.5);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* White screens (avatar / profile) flip the UI to a dark-on-light theme so the
   "invisible" (chrome-less) controls stay legible on white. */
.screen.clear {
  --ink: #0c0e12;
  --ink-dim: #3b4046;
  --ink-faint: #757a82;
  --ink-contrast: #ffffff;
  --tv-line: rgba(0, 0, 0, 0.22);
  --glow: 0 0 16px rgba(0, 0, 0, 0.12);
  color: var(--ink); /* re-anchor text color to the DARK ink here (body's `color` resolved the light value and would otherwise be inherited → white-on-white) */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { display: none !important; } /* hide the dev FPS HUD in the product */

/* ---- screen router: each screen is a full overlay; only .active shows ---- */
#uforia { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.2vh;
  padding: max(4vh, env(safe-area-inset-top)) 5vw max(4vh, env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: auto;
}
.screen.active { display: flex; animation: ufFadeIn 0.45s ease both; }
@keyframes ufFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- the "TV standby" backdrop for the gate screens (login/welcome/install) */
.screen.tvdark {
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(20, 22, 26, 0.55), rgba(3, 4, 5, 0.96) 78%);
}
/* faint horizontal scanlines + corner vignette = old CRT, drawn only on chrome */
.screen.tvdark::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
  mix-blend-mode: multiply;
  opacity: 0.6;
  animation: ufFlicker 5.5s steps(60) infinite;
}
@keyframes ufFlicker { 0%, 97%, 100% { opacity: 0.6; } 98% { opacity: 0.42; } 99% { opacity: 0.7; } }

/* ---- content block (no window/bezel — "invisible", just centered content) ---- */
.tv {
  position: relative;
  max-width: min(520px, 92vw);
  width: 100%;
  padding: clamp(16px, 4vh, 36px) clamp(14px, 4vw, 32px);
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---- type ---- */
.uf-brand {
  font-weight: 900;
  font-size: clamp(40px, 11vh, 104px);
  letter-spacing: 0.16em;
  margin: 0;
  text-shadow: var(--glow);
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.12));
}
.uf-tagline {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: clamp(10px, 1.8vh, 14px);
  color: var(--ink-dim);
  margin: 0;
}
.uf-title { font-weight: 800; font-size: clamp(22px, 4.6vh, 40px); letter-spacing: 0.04em; margin: 0; }
.uf-sub { font-size: clamp(13px, 2.1vh, 17px); color: var(--ink-dim); line-height: 1.5; margin: 0; max-width: 26em; }
.uf-label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.3em; font-size: 11px; color: var(--ink-faint); }
/* "studio" sub-word in the wordmark lockup (UFORIX studio) — sized in em so it
   scales with whatever brand it sits in (welcome hero, top bar, rail). */
.brand-studio {
  font-family: var(--mono); font-weight: 500; font-size: 0.4em;
  letter-spacing: 0.26em; text-transform: lowercase; opacity: 0.55;
  margin-left: 0.5em; vertical-align: 0.22em; text-shadow: none;
}
/* welcome lockup: the sub-word ("space out") sits UNDER the brand, CENTERED under it */
.uf-lockup { display: inline-block; }
.brand-studio-under {
  display: block; text-align: center; margin: -0.1em 0 0; padding-left: 0.22em; /* offset the trailing letter-spacing so it centres true */
  font-family: var(--mono); font-weight: 500; text-transform: lowercase;
  font-size: clamp(15px, 2.6vh, 26px); letter-spacing: 0.22em; color: var(--ink-dim); opacity: 0.75; text-shadow: none;
}
/* the rail wordmark: a LARGER "studio", baseline-aligned to the bottom of UFORIX */
.rail-brand .brand-studio { font-size: 0.62em; vertical-align: baseline; letter-spacing: 0.18em; margin-left: 0.42em; opacity: 0.6; }

/* ---- buttons ---- */
.uf-btn {
  appearance: none;
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: clamp(13px, 1.9vh, 16px);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: clamp(12px, 1.7vh, 17px) clamp(26px, 4vw, 44px);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.2s ease, filter 0.15s ease;
}
.uf-btn:hover { background: var(--ink); color: var(--ink-contrast); box-shadow: var(--glow); }
.uf-btn:active { transform: scale(0.96); }
.uf-btn.primary { background: var(--ink); color: var(--ink-contrast); }
.uf-btn.primary:hover { filter: brightness(1.12); box-shadow: var(--glow); }
.uf-btn.ghost { border-color: var(--tv-line); color: var(--ink-dim); background: transparent; }
.uf-btn.ghost:hover { color: var(--ink); background: transparent; }
.uf-btn.big { font-size: clamp(16px, 2.6vh, 22px); padding: clamp(16px, 2.4vh, 22px) clamp(40px, 7vw, 80px); }

.uf-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* ---- text field (name) ---- */
.uf-field {
  font-family: var(--font);
  font-size: clamp(15px, 2.2vh, 19px);
  text-align: center;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--tv-line);
  border-radius: 0;
  padding: 10px 6px;
  width: min(320px, 80vw);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.uf-field:focus { border-color: var(--ink); box-shadow: var(--glow); }
.uf-field::placeholder { color: var(--ink-faint); }

/* ---- login ---- */
.login-providers { display: flex; flex-direction: column; gap: 14px; align-items: center; }
#googleBtnHost { min-height: 44px; display: flex; justify-content: center; }
.gbtn {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #1f1f1f;
  border: none; border-radius: 999px;
  font-family: var(--font); font-weight: 600; font-size: 16px;
  padding: 13px 26px; cursor: pointer;
  box-shadow: 0 2px 14px rgba(0,0,0,0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.gbtn:hover { box-shadow: 0 4px 22px rgba(255,255,255,0.25); }
.gbtn:active { transform: scale(0.97); }
.gbtn .g-g { font-weight: 800; font-size: 18px; }
.login-note { font-size: 11px; color: var(--ink-faint); max-width: 22em; line-height: 1.5; }
.login-or { font-family: var(--mono); letter-spacing: 0.3em; font-size: 10px; color: var(--ink-faint); }

/* ---- top bar (brand + profile), shown on avatar/select ---- */
.uf-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 12;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 22px 14px;
  pointer-events: none;
}
.uf-topbar > * { pointer-events: auto; }
.uf-topbar-left { display: flex; align-items: center; gap: 14px; }
.uf-topbar .mark { font-weight: 900; letter-spacing: 0.22em; font-size: 18px; text-shadow: var(--glow); }
.uf-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: transparent; border: none; border-radius: 999px;
  padding: 4px 4px; cursor: pointer; color: var(--ink);
  font-size: 13px; transition: opacity 0.2s ease;
}
.uf-chip:hover { opacity: 0.7; }
/* white screens: flip the (out-of-screen) topbar to dark text */
body.uf-light .uf-topbar { color: #0c0e12; }
body.uf-light .uf-topbar .mark { color: #0c0e12; text-shadow: none; }
body.uf-light .uf-chip { color: #0c0e12; }
.uf-chip .ava {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #0a0c12;
  border: 1px solid rgba(0,0,0,0.12); box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  display: grid; place-items: center; font-weight: 800; overflow: hidden;
}
.uf-chip .ava img { width: 100%; height: 100%; object-fit: cover; }

/* ---- avatar room: a vertically-centred stack (avatar / name / Continue) over the
   3D avatar, which is raised in frame via resetCamera(0, raiseY) ---- */
.screen.clear { background: transparent; justify-content: flex-end; gap: 2.4vh; }
.avatar-dock { /* Continue — positioned just below the name, not glued to the bottom */
  position: absolute; top: 80%; left: 50%; transform: translateX(-50%); z-index: 12;
  background: none; border: none; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; gap: 14px; width: auto;
}
/* "new look" button — a round WHITE button (no outline) with just the arrow, to the
   RIGHT of the avatar and a little lower */
.avatar-regen {
  position: absolute; top: 48%; left: calc(50% + clamp(150px, 18vw, 300px)); transform: translateY(-50%);
  width: 64px; height: 64px; border-radius: 50%; cursor: pointer; z-index: 13;
  border: none; background: #fff; color: #0a0c12;
  font-size: 31px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.22s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.avatar-regen:hover { box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28); transform: translateY(-50%) rotate(180deg); }
.avatar-regen:active { transform: translateY(-50%) scale(0.92); }
/* name field sits just UNDER the avatar, above the Continue button */
.avatar-name {
  position: absolute; top: 72%; left: 50%; transform: translate(-50%, -50%); z-index: 12;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* ---- track select ---- */
/* Track studio: a left panel lists the tracks; the canvas behind plays a live
   preview of the selected level's signature section. The panel is positioned
   absolutely so the live scene fills the whole canvas to its right. */
.screen.select { padding: 0; } /* the .track-panel is absolutely positioned; the screen still shows/hides via .screen / .screen.active */
.track-panel {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 12;
  width: min(248px, 80vw);
  display: flex; flex-direction: column; gap: 13px;
  padding: max(16px, env(safe-area-inset-top)) 17px max(16px, env(safe-area-inset-bottom));
  background: rgba(9, 10, 13, 0.72);
  border-right: 1px solid var(--tv-line);
  backdrop-filter: blur(16px) saturate(40%); -webkit-backdrop-filter: blur(16px) saturate(40%);
}
/* rail header: the UFORIX wordmark (left) + a square "+ new track" button (right),
   then a small search box below. */
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.rail-brand { font-weight: 900; letter-spacing: 0.2em; font-size: 19px; color: var(--ink); text-shadow: var(--glow); }
.rail-add {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: 0 0 auto;
  border: 1.5px solid var(--ink-faint); background: transparent; color: var(--ink-dim);
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}
.rail-add:hover { color: var(--ink); border-color: var(--ink); }
.rail-add:active { transform: scale(0.92); }
.rail-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--tv-line);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.rail-search:focus-within { border-color: var(--ink-dim); background: rgba(255,255,255,0.1); }
.rail-search svg { color: var(--ink-faint); flex: 0 0 auto; }
.rail-search input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--ink); font-family: var(--font); font-size: 13px; letter-spacing: 0.01em;
}
.rail-search input::placeholder { color: var(--ink-faint); }
.rail-label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.34em; font-size: 11px; color: var(--ink-faint); padding: 0 2px; }
.track-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 3px; }
/* cover-forward rows: the album art is the hero (titles live big in the preview),
   so each row is the full cover with a small, muted caption underneath. */
.track-row {
  display: flex; flex-direction: column; gap: 9px; width: 100%; text-align: left;
  padding: 0; border: none; background: none; cursor: pointer; color: var(--ink);
}
.track-row .tr-cover {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; object-fit: cover; display: block;
  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
  filter: grayscale(0.7) brightness(0.58); opacity: 0.64;
  transition: filter 0.22s ease, opacity 0.22s ease, transform 0.2s ease, box-shadow 0.24s ease;
}
.track-row:hover .tr-cover { filter: grayscale(0.2) brightness(0.92); opacity: 0.9; transform: translateY(-2px); }
.track-row.selected .tr-cover {
  filter: none; opacity: 1; transform: translateY(-2px);
  box-shadow: 0 16px 42px rgba(0,0,0,0.6);
}
.track-row .tr-cap { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.track-row .tr-title { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; color: var(--ink); opacity: 0.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s ease; }
.track-row.selected .tr-title, .track-row:hover .tr-title { opacity: 0.95; }
.track-row .tr-artist { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em; font-size: 9.5px; color: var(--ink-faint); }
/* Netflix-style hero over the live preview: artist + big title + Play/Remix. */
.track-hero {
  position: absolute; z-index: 12; pointer-events: none;
  left: calc(min(248px, 80vw) + clamp(24px, 4vw, 56px));
  bottom: clamp(40px, 11vh, 110px); max-width: 46vw; width: fit-content;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  color: #f4f6f8; text-shadow: 0 1px 18px rgba(0,0,0,0.42);
}
/* the artist sits above the title, flush with the title's RIGHT edge */
.hero-artist { align-self: flex-end; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.28em; font-size: clamp(11px, 1.6vh, 14px); color: #c8cdd6; }
.hero-title { font-weight: 900; font-size: clamp(40px, 9vh, 96px); letter-spacing: -0.01em; line-height: 0.95; }
.hero-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; pointer-events: auto; }
.hero-play {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #06070a; display: grid; place-items: center;
  box-shadow: 0 10px 34px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.55) inset;
  transition: transform 0.14s ease, box-shadow 0.24s ease;
}
.hero-play svg { transform: translateX(2px); display: block; } /* optically centre the triangle */
.hero-play:hover { transform: scale(1.08); box-shadow: 0 10px 34px rgba(0,0,0,0.5), 0 0 34px var(--accent-soft); }
.hero-play:active { transform: scale(0.95); }
.hero-remix {
  height: 50px; padding: 0 28px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.55); color: #fff;
  font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.hero-remix:hover { background: rgba(255,255,255,0.16); border-color: #fff; }
.hero-remix:active { transform: scale(0.97); }

/* Loading: covers ONLY the canvas area (right of the rail) — an abstract dark
   field with a static "loading..." in the middle. Never covers the rail itself. */
.uf-loading {
  position: fixed; top: 0; right: 0; bottom: 0; left: min(248px, 80vw); z-index: 13;
  pointer-events: none; display: none; align-items: center; justify-content: center;
  background:
    radial-gradient(130% 110% at 50% 36%, rgba(48,54,70,0.5), rgba(8,10,14,0.92) 76%),
    #0a0c11;
}
.uf-loading.show { display: flex; }
.loading-inner { display: flex; align-items: center; gap: 16px; }
.loading-inner img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0,0,0,0.5)); animation: ufFloat 2.6s ease-in-out infinite; }
.loading-word { font-family: var(--mono); text-transform: lowercase; letter-spacing: 0.34em; font-size: 14px; color: var(--ink-dim); }

/* phones: the rail becomes a bottom sheet with a horizontal cover carousel; the
   hero sits above it. */
@media (max-width: 720px) {
  .track-panel {
    top: auto; right: 0; left: 0; width: auto; max-height: none; gap: 12px;
    border-top: 1px solid var(--tv-line);
    background: linear-gradient(0deg, rgba(5,6,9,0.96), rgba(5,6,9,0.72));
    padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  }
  .rail-head { padding: 0; }
  .rail-label { display: none; }
  .uf-loading { left: 0; } /* the rail is a bottom sheet on phones — cover the full canvas */
  .track-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 12px; }
  .track-row { width: 118px; flex: 0 0 auto; }
  .track-hero { left: clamp(18px, 5vw, 32px); right: clamp(18px, 5vw, 32px); bottom: calc(34vh + 14px); max-width: none; }
  .hero-title { font-size: clamp(32px, 7vh, 54px); }
}

/* ---- the TV switch-off/on transition overlay ---- */
#tvWipe {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0;
  background: #000; display: grid; place-items: center;
}
#tvWipe .bar { width: 100%; height: 0; background: #fff; box-shadow: 0 0 60px 20px rgba(255,255,255,0.8); }
#tvWipe .dot { position: absolute; width: 0; height: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 80px 30px rgba(255,255,255,0.9); }
.tv-off { animation: tvOff 0.42s ease forwards; }
.tv-on { animation: tvOn 0.5s ease forwards; }
@keyframes tvOff { /* collapse the picture to a bright horizontal line, then a dot */
  0% { opacity: 1; } 100% { opacity: 1; }
}

/* ---- shared pulse used by rules screen + LIVE badge ---- */
@keyframes eeePulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes ufPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- hide the in-ride DOM overlays during the silent preview attract render */
body.uf-preview #rideflash,
body.uf-preview #ridecount,
body.uf-preview #ridetaphint,
body.uf-preview #rideintro,
body.uf-preview #rideend { display: none !important; }

/* while actually riding, hide all UFORIA chrome (the ride owns the screen) */
body.uf-riding #uforia,
body.uf-riding .uf-topbar { display: none !important; }

/* Game "TV" overlay (CSS scanlines) — kept for reference but OFF: the game now
   uses the WebGL RGB CRT (its own scanlines), so this would double up. To use the
   CSS-scanline look instead, render the ride in AA (setStyle 0) and re-enable the
   `body.uf-riding #gameTV { display: block }` rule below. */
#gameTV {
  position: fixed; inset: 0; z-index: 6; pointer-events: none; display: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.22) 2px 3px);
  mix-blend-mode: multiply;
  opacity: 0.6;
  animation: ufFlicker 5.5s steps(60) infinite;
}

/* no count-in/teach overlays — rides start directly with a 2s audio fade-in. The
   ride's own start hint is also suppressed (kept minimal). */
#rideintro { display: none !important; }

/* ---- responsive: phones get a single column + bigger hit targets ---- */
@media (max-width: 720px) {
  .uf-row { flex-direction: column; }
}

/* ---- Profile = a DARK drawer that SLIDES OVER the live preview (an overlay, not a
   page swap): avatar render on top, controls directly below (no inner white card).
   The overlay container is pointer-events:none so it never blocks the preview/rail;
   only the drawer itself is interactive. ---- */
.uf-profile { position: fixed; inset: 0; z-index: 14; pointer-events: none; }
.profile-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; pointer-events: auto;
  width: min(380px, 30vw);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 2vw, 28px) max(22px, env(safe-area-inset-bottom));
  text-align: left; overflow-y: auto;
  background: rgba(10, 11, 14, 0.92);
  border-left: 1px solid var(--tv-line);
  backdrop-filter: blur(18px) saturate(60%); -webkit-backdrop-filter: blur(18px) saturate(60%);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); /* slides in/out; resting state below */
}
/* shadow ONLY when open — otherwise the off-screen closed drawer bleeds a shadow onto the screen */
.uf-profile.open .profile-drawer { transform: translateX(0); box-shadow: -30px 0 70px rgba(0, 0, 0, 0.5); }
.drawer-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--tv-line); background: transparent; color: var(--ink);
  font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: background 0.16s ease, color 0.16s ease;
}
.drawer-close:hover { background: var(--ink); color: var(--ink-contrast); }
.drawer-stage {
  display: grid; place-items: center; padding: 20px;
  background: #fff; border-radius: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}
.drawer-stage img { width: min(82%, 270px); aspect-ratio: 1 / 1; object-fit: contain; }
.drawer-body { display: flex; flex-direction: column; gap: 14px; }
.studio-h { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.3em; font-size: 11px; color: var(--ink-faint); }
.drawer-body .uf-field { width: 100%; text-align: left; }
.studio-rows { display: flex; flex-direction: column; gap: 10px; }
.studio-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.studio-row-info { display: flex; flex-direction: column; min-width: 0; }
.studio-row-info .cyc-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.studio-row-arrows { display: flex; gap: 6px; flex: 0 0 auto; }
.studio-row-arrows .cyc { padding: 7px 13px; }
.studio-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-sw { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--tv-line); cursor: pointer; padding: 0; transition: transform 0.12s ease; }
.studio-sw:hover { transform: scale(1.15); }
.studio-generate {
  align-self: flex-start; margin-top: 4px; cursor: pointer;
  background: transparent; border: none; border-bottom: 1px solid var(--tv-line);
  color: var(--ink-dim); font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.18em; font-size: 12px; padding: 6px 2px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.studio-generate:hover { color: var(--ink); border-color: var(--ink); }
/* phones: the drawer is near-full-width (a quarter is too narrow to use) */
@media (max-width: 720px) {
  .profile-drawer { width: 86vw; }
}

/* ---- "Coming soon" modal: a random avatar over an animated speech bubble ---- */
.uf-modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center;
  background: rgba(3, 4, 7, 0.66);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.uf-modal.show { display: flex; animation: ufFadeIn 0.2s ease both; }
.uf-modal-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; }
.modal-ava {
  width: 156px; height: 156px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(92,225,255,0.2), rgba(10,12,18,0) 70%);
  animation: ufModalPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), ufFloat 3s 0.5s ease-in-out infinite;
}
.modal-ava img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 16px 32px rgba(0,0,0,0.5)); }
.modal-bubble {
  position: relative; background: #fff; color: #0a0c12;
  font-weight: 800; letter-spacing: 0.01em; font-size: 18px;
  padding: 13px 24px; border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
  animation: ufBubble 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-bubble::after { /* tail pointing DOWN at the avatar below */
  content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-bottom: none; border-top-color: #fff;
}
@keyframes ufModalPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ufBubble { from { transform: scale(0.5) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes ufFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* install / PWA instruction screen (Phase 7) */
.install-steps { display: flex; flex-direction: column; gap: 14px; max-width: 30em; text-align: left; }
.install-step { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--ink-dim); }
.install-step b { color: var(--ink); }
.install-step .n { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--ink); }
