:root {
  --night: #0b0b1e;
  --surface: #141428;
  --field: #15152a;
  --border: #2a2448;
  --muted: #a8a4b8;
  --purple: #5b2d91;
  --purple-soft: #9b8cff;
  --pink: #e94e77;
  --peach: #ffb366;
  --success: #3ddc97;
  --danger: #ff5c7a;
  --white: #ffffff;
  --grad: linear-gradient(90deg, #7b3ff2 0%, #e94e77 50%, #ff9a4a 100%);
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Syne", "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--night);
  color: var(--white);
}
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient cave atmosphere — pure CSS, low cost (transform/opacity only) */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(123, 63, 242, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 40%, rgba(233, 78, 119, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(91, 45, 145, 0.2), transparent 50%),
    linear-gradient(180deg, #0b0b1e 0%, #0e0e24 50%, #0b0b1e 100%);
}
.ambient-aurora {
  position: absolute;
  left: -20%;
  right: -20%;
  top: -15%;
  height: 55%;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(123, 63, 242, 0.14) 40%,
    rgba(233, 78, 119, 0.1) 55%,
    rgba(255, 154, 74, 0.06) 68%,
    transparent 82%
  );
  filter: blur(28px);
  opacity: 0.55;
  transform: translate3d(0, 0, 0);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  opacity: 0.55;
}
.ambient-orb-a {
  width: min(340px, 70vw);
  height: min(340px, 70vw);
  left: -12%;
  bottom: -8%;
  background: rgba(91, 45, 145, 0.55);
  animation: orb-float-a 18s ease-in-out infinite alternate;
}
.ambient-orb-b {
  width: min(280px, 60vw);
  height: min(280px, 60vw);
  right: -10%;
  top: 18%;
  background: rgba(233, 78, 119, 0.28);
  animation: orb-float-b 24s ease-in-out infinite alternate;
}
.ambient-orb-c {
  width: min(200px, 45vw);
  height: min(200px, 45vw);
  left: 40%;
  top: 8%;
  background: rgba(155, 140, 255, 0.18);
  animation: orb-float-c 20s ease-in-out infinite alternate;
  opacity: 0.4;
}
.ambient-spark {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.2px 1.2px at 48% 18%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 72% 42%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 88% 78%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.2px 1.2px at 18% 88%, rgba(255,255,255,.28), transparent),
    radial-gradient(1px 1px at 62% 12%, rgba(255,255,255,.32), transparent);
  animation: spark-breathe 8s ease-in-out infinite alternate;
}
.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 65% at 50% 40%, transparent 30%, rgba(11, 11, 30, 0.55) 100%);
}

/* Auth screens: static gradient only (blur + animated orbs hurt scroll/input perf) */
body.is-auth .ambient-aurora,
body.is-auth .ambient-orb,
body.is-auth .ambient-spark {
  display: none;
}
body.is-auth .ambient-mesh {
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(123, 63, 242, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(233, 78, 119, 0.07), transparent 50%),
    linear-gradient(180deg, #0b0b1e 0%, #101028 100%);
}
body.is-auth .ambient-vignette {
  opacity: 0.45;
}

@keyframes aurora-drift {
  from { transform: translate3d(-4%, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.05); }
}
@keyframes orb-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8%, -10%, 0) scale(1.08); }
}
@keyframes orb-float-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-10%, 8%, 0) scale(1.06); }
}
@keyframes orb-float-c {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(12%, 14%, 0); }
}
@keyframes spark-breathe {
  from { opacity: 0.22; }
  to { opacity: 0.48; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-aurora,
  .ambient-orb,
  .ambient-spark {
    animation: none !important;
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 22px 32px;
}

.screen { animation: fade .25s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 44px;
}
.topbar img.logo-rect {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.topbar .grow { flex: 1; }
.icon-btn {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 8px 0 20px;
}
.brand img.login-logo {
  height: 140px;
  width: auto;
  object-fit: contain;
}
.brand h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand p, .muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: .95rem;
}

.field {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 14px;
  margin-bottom: 12px;
  min-height: 54px;
}
.field:focus-within {
  border-color: rgba(91, 45, 145, .85);
}
.field .ico {
  color: var(--muted);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ui-svg {
  width: 20px;
  height: 20px;
  display: block;
}
.field .ghost .ui-svg { width: 18px; height: 18px; }
.icon-btn .ui-svg { width: 20px; height: 20px; }
.action-icon .ui-svg { width: 24px; height: 24px; }
.action-card .chev .ui-svg { width: 18px; height: 18px; opacity: 0.85; }
.profile-tile .action-icon .ui-svg { width: 20px; height: 20px; }
.field input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-size: 15px;
  padding: 14px 0;
  min-width: 0;
}
.field input::placeholder { color: rgba(168,164,184,.85); }
.field button.ghost {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
}
.field-error {
  color: var(--danger);
  font-size: 12px;
  margin: -6px 4px 10px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0 14px;
}
.link {
  color: var(--purple-soft);
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 0;
}
.link:hover { text-decoration: underline; }
.text-right { text-align: right; width: 100%; }

.btn {
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  min-height: 54px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.98); }
.btn-grad {
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(233, 78, 119, .28);
}
.btn-purple {
  background: var(--purple);
  border-radius: 16px;
  min-width: 90px;
  min-height: 54px;
}
.btn-outline {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 999px;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.btn-ghost:active {
  color: #fff;
}

.auth-foot {
  margin-top: 18px;
  text-align: center;
  color: rgba(255,255,255,.72);
  font-size: 14px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.12);
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.social-tile {
  background: #151528;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 500;
}
.social-tile img { width: 28px; height: 28px; object-fit: contain; }

.card {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
}
.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  border: 0;
  margin-bottom: 12px;
  color: #fff;
}
.action-card.primary {
  background: var(--grad);
  box-shadow: 0 8px 16px rgba(233, 78, 119, .25);
}
.action-card.secondary {
  background: var(--field);
  border: 1px solid var(--border);
}
.action-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.1);
  color: #fff;
  flex-shrink: 0;
}
.action-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.action-card p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.72);
  line-height: 1.3;
}
.chev { margin-left: auto; opacity: .55; display: grid; place-items: center; color: rgba(255,255,255,.7); }

.price {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.price-sub { color: rgba(255,255,255,.6); font-size: 14px; margin-left: 6px; }
.saved { color: var(--success); font-weight: 600; margin-top: 8px; font-size: 14px; }

.coupon-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.coupon-row .field { flex: 1; margin-bottom: 0; }

.hint {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  margin: 4px 2px 12px;
}
.ok-line { color: var(--success); font-weight: 600; margin-bottom: 8px; }
.error-line { color: var(--danger); font-size: 14px; margin: 8px 0; }

.lobby-code {
  text-align: center;
  letter-spacing: 3px;
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1c1c36;
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 50;
  max-width: min(90vw, 420px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 14px;
}
.toast[hidden] { display: none; }

.center {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.label {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  font-weight: 600;
  margin-bottom: 6px;
}
.account-name {
  font-weight: 600;
  margin-bottom: 14px;
}

@media (min-width: 720px) {
  .app { padding-top: 36px; padding-bottom: 48px; }
  .brand img.login-logo { height: 160px; }
}

/* ── Live watch room ───────────────────────────────── */
body.room-mode .app {
  max-width: 720px;
  padding-bottom: 12px;
}
body.room-mode .ambient { opacity: 0.55; }
body.room-mode .ambient-aurora { animation-duration: 40s; }

.access-row {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}
.access-chip {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--field);
  color: rgba(255,255,255,.75);
  border-radius: 12px;
  padding: 10px 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.access-chip.active {
  background: rgba(155, 140, 255, 0.28);
  color: #fff;
  border-color: rgba(155, 140, 255, 0.55);
}

.room-screen { display: flex; flex-direction: column; min-height: calc(100vh - 40px); }
.room-title-block { flex: 1; min-width: 0; }
.room-title {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-code-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--purple-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.4px;
}
.host-badge {
  background: rgba(155, 140, 255, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.player-shell iframe,
.player-shell #yt-player-mount {
  width: 100% !important;
  height: 100% !important;
}
.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  pointer-events: none;
}
.player-placeholder-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  display: grid;
  place-items: center;
  opacity: 0.7;
}

.url-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.url-input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
}
.icon-fill {
  width: 42px; height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--purple-soft);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-ghost {
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,.75);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 0;
  min-height: 32px;
}
.small { font-size: 12px; }

.room-tabs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.room-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.55);
  font-weight: 600;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}
.room-tab.active {
  background: rgba(155, 140, 255, 0.22);
  color: #fff;
}

.room-panel {
  flex: 1;
  min-height: 140px;
  max-height: 36vh;
  overflow-y: auto;
  margin-top: 6px;
  padding: 4px 2px 8px;
}
.center-pad { text-align: center; padding: 24px 8px; }

.chat-sys {
  text-align: center;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  font-style: italic;
  margin: 6px 0;
}
.chat-msg { margin: 8px 0; }
.chat-who {
  color: var(--purple-soft);
  font-size: 12px;
  font-weight: 700;
}
.chat-body { color: #fff; line-height: 1.35; font-size: 14px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.list-title { font-weight: 600; font-size: 14px; }
.list-sub { color: rgba(255,255,255,.5); font-size: 12px; margin-top: 2px; }
.list-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.link.danger { color: var(--danger); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(155, 140, 255, 0.35);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-composer {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.chat-composer input {
  flex: 1;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
}

@media (min-width: 720px) {
  body.room-mode .app { max-width: 860px; }
  .room-panel { max-height: 42vh; }
}

.admit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(155, 140, 255, 0.18);
  border: 1px solid rgba(155, 140, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 4px;
  font-weight: 600;
  font-size: 13px;
}
.admit-banner[hidden] { display: none !important; }

.yt-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #000;
}
.search-row { cursor: pointer; }
.chat-msg.mine { margin-left: auto; max-width: 85%; }
.chat-reply {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  background: rgba(0,0,0,.25);
  padding: 4px 6px;
  border-radius: 6px;
  margin: 4px 0;
}
.chat-edited { font-size: 10px; color: rgba(255,255,255,.35); }
.chat-reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.react-pill {
  border: 0;
  background: rgba(0,0,0,.3);
  color: #fff;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.reply-chip {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--field);
  color: rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}
.reply-chip[hidden] { display: none !important; }
.composer-row { display: flex; gap: 8px; width: 100%; }
.composer-row input { flex: 1; }

/* Mini player when chat focuses (SyncStream keyboard mode) */
body.room-mode.chat-mini .player-shell {
  aspect-ratio: auto;
  height: 72px;
  border-radius: 0;
}
body.room-mode.chat-mini .player-shell iframe,
body.room-mode.chat-mini .player-shell #yt-player-mount {
  pointer-events: none;
}
body.room-mode.chat-mini .url-row,
body.room-mode.chat-mini .sync-row {
  display: none;
}
body.room-mode.chat-mini .room-panel {
  max-height: none;
  flex: 1;
}
body.room-mode.chat-mini .room-screen {
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.chat-tick {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  margin-top: 2px;
  color: rgba(255,255,255,.5);
}
.chat-tick.read { color: #5eb8ff; }
.people-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* Profile page */
.profile-hero { text-align: center; margin: 12px 0 22px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(91, 45, 145, 0.4); font-size: 28px; font-weight: 700;
}
.profile-section-label {
  color: rgba(255,255,255,0.45); font-size: 12px; font-weight: 700;
  letter-spacing: 0.6px; margin: 18px 0 8px; text-transform: uppercase;
}
.profile-tile {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 12px 14px; color: #fff; text-align: left;
  margin-bottom: 8px; cursor: pointer;
}
.profile-tile-text { flex: 1; min-width: 0; }
.profile-tile-text strong { display: block; font-size: 15px; }
.profile-tile-text small { display: block; color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 2px; }
.btn-logout {
  width: 100%; margin-top: 24px; height: 48px; border-radius: 14px;
  background: transparent; color: #ff5c7a;
  border: 1px solid rgba(255,92,122,0.45); font-weight: 700; cursor: pointer;
}
.profile-history { margin: 4px 0 12px; }
.history-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px; margin-bottom: 8px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}
.history-row small { display: block; color: rgba(255,255,255,0.5); margin-top: 4px; font-size: 12px; }
.history-amt { text-align: right; }
.profile-sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.profile-sheet-card {
  width: 100%; max-width: 460px; background: #141428; border-radius: 20px 20px 0 0;
  padding: 20px 22px 28px; color: #fff;
}
.profile-sheet-card h3 { margin: 0 0 12px; }
.profile-sheet-card p { color: rgba(255,255,255,0.78); line-height: 1.45; font-size: 14px; margin: 0 0 16px; }
.hidden { display: none !important; }

/* ── Home layout (phone column → desktop split) ───── */
.screen-home {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.home-topbar {
  margin-bottom: 12px;
}

.profile-chip {
  width: auto !important;
  min-width: 40px;
  padding: 0 12px;
  gap: 8px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.profile-chip-label {
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.home-kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peach);
  font-weight: 600;
}
.home-hello {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.home-email { margin: 0; }
.home-lead {
  margin: 14px 0 0;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
  max-width: 36ch;
  font-size: 1.02rem;
}
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.home-actions .action-card { margin-bottom: 0; }

.home-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-visual {
  position: relative;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-visual-glow {
  position: absolute;
  width: min(420px, 90%);
  height: min(320px, 50vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 63, 242, 0.28), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}
.home-lottie-wrap {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  min-height: 200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-lottie-wrap #homeLottie {
  width: min(100%, 340px);
  height: min(40vh, 280px);
}

/* Widen shell on home / profile desktop */
body.is-wide .app {
  max-width: 460px;
  transition: max-width 0.2s ease;
}

@media (min-width: 900px) {
  body.is-wide .app {
    max-width: 1080px;
    padding: 28px 40px 48px;
  }
  body.is-home .app {
    max-width: 1120px;
  }

  .home-topbar {
    margin-bottom: 8px;
    min-height: 52px;
  }
  .home-topbar .logo-rect {
    height: 40px;
    max-width: 180px;
  }
  .profile-chip {
    height: 44px;
    border-radius: 14px;
    padding: 0 16px;
  }
  .profile-chip-label { display: inline; }

  .home-stage {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(300px, 0.95fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 12px 0 24px;
  }

  .home-copy {
    max-width: 460px;
  }
  .home-actions {
    max-width: 420px;
    margin-top: 32px;
  }
  .home-actions .action-card {
    padding: 20px 18px;
    border-radius: 22px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
  }
  .home-actions .action-card:hover {
    transform: translateY(-2px);
  }
  .home-actions .action-card.primary:hover {
    box-shadow: 0 14px 32px rgba(233, 78, 119, 0.35);
  }
  .home-actions .action-card.secondary:hover {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.04);
  }

  .home-visual {
    margin-top: 0;
    min-height: 420px;
    border-radius: 32px;
    background:
      linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)),
      radial-gradient(ellipse at 40% 40%, rgba(91,45,145,0.25), transparent 65%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    overflow: hidden;
  }
  .home-visual-glow {
    width: 70%;
    height: 70%;
  }
  .home-lottie-wrap {
    min-height: 380px;
    margin: 0;
    padding: 20px;
  }
  .home-lottie-wrap #homeLottie {
    width: min(100%, 440px);
    height: min(52vh, 420px);
  }
}

@media (min-width: 1100px) {
  .home-hello { font-size: 2.75rem; }
  .home-lead { font-size: 1.08rem; max-width: 40ch; }
}


/* Profile subscription + sheets (polished) */
.sub-banner {
  width: 100%; text-align: left; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px; padding: 16px; color: #fff; cursor: pointer; margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(91,45,145,0.45), rgba(233,78,119,0.22), #1a1530);
}
.sub-banner.empty {
  background: rgba(255,255,255,0.04);
  display: flex; flex-direction: column; gap: 4px;
}
.sub-banner.empty small { color: rgba(255,255,255,0.55); }
.sub-banner-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sub-banner-top strong { font-size: 16px; }
.sub-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(61,220,151,0.18); color: #3ddc97;
}
.sub-badge:not(.on) { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); text-transform: uppercase; }
.sub-banner-facts { display: flex; gap: 18px; margin-bottom: 10px; }
.sub-banner-facts small { display: block; color: rgba(255,255,255,0.5); font-size: 11px; }
.sub-banner-facts b { font-size: 13px; }
.sub-banner-cta { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.75); }
.sub-hero { margin-bottom: 14px; }
.sub-hero h4 { margin: 8px 0 0; font-size: 18px; }
.detail-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px; margin-bottom: 8px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7); font-size: 13px;
}
.detail-row strong { color: #fff; font-weight: 600; text-align: right; }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.18);
  margin: 0 auto 12px;
}
.sheet-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 18px; }
.sheet-x { font-size: 14px !important; }
.sheet-body { max-height: 55vh; overflow: auto; padding-bottom: 8px; }
.sheet-p { color: rgba(255,255,255,0.78); line-height: 1.5; font-size: 14.5px; margin: 0 0 12px; }
.sheet-sub { color: rgba(255,255,255,0.55); font-size: 13px; margin: 0 0 14px; line-height: 1.4; }
.sheet-field { display: block; margin-bottom: 12px; }
.sheet-field span { display: block; font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
.sheet-field input {
  width: 100%; box-sizing: border-box; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: #fff; padding: 12px 14px; font-size: 15px;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; height: 46px; border-radius: 14px; border: 0; font-weight: 700; cursor: pointer; }
.btn-secondary-soft {
  background: transparent; color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.16) !important;
}
.btn-danger-soft { background: rgba(255,92,122,0.2); color: #ff5c7a; }
.history-card {
  padding: 14px; margin-bottom: 10px; border-radius: 16px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
}
.history-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.history-card-top small { display: block; color: rgba(255,255,255,0.5); margin-top: 4px; font-size: 12px; }
.history-card-amt { margin-top: 10px; font-weight: 800; font-size: 16px; }
.hist-empty { text-align: center; padding: 24px 8px; color: rgba(255,255,255,0.55); }
.hist-empty strong { display: block; color: #fff; margin-bottom: 8px; font-size: 16px; }
.profile-sheet-card { max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; }


/* ── Auth screens (login / signup / otp) ─────────────── */
.screen-auth {
  min-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.auth-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-bottom: 0;
  z-index: 2;
}
.auth-panel {
  position: relative;
  padding: 24px 18px 20px;
  border-radius: 16px;
  background: rgba(18, 18, 36, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  animation: panel-in 0.28s ease both;
}
.auth-panel::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  opacity: 0.7;
}
.auth-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}
.auth-sub {
  margin: 0 0 22px !important;
  text-align: center;
}
.auth-email {
  font-weight: 600;
  margin: 4px 0 8px;
  text-align: center;
  word-break: break-all;
}
.auth-hint {
  color: var(--purple-soft) !important;
  margin-bottom: 20px !important;
  text-align: center;
}
.screen-auth .brand {
  margin-top: 4px;
  margin-bottom: 16px;
}
.screen-auth .field {
  background: rgba(12, 12, 28, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.screen-auth .field:focus-within {
  border-color: rgba(155, 140, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(123, 63, 242, 0.15);
}
.screen-auth .btn-grad {
  margin-top: 4px;
  box-shadow: 0 10px 28px rgba(233, 78, 119, 0.32);
}
.screen-auth .auth-foot {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel {
    animation: none !important;
  }
}


/* ── Create / Join / Subscribe flow (phone → desktop) ─ */
.screen-flow {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.flow-topbar {
  margin-bottom: 8px;
}
.flow-topbar strong {
  font-size: 1.05rem;
  font-weight: 700;
}
.flow-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-aside {
  text-align: center;
}
.flow-brand {
  margin: 4px 0 12px;
}
.flow-brand .login-logo {
  height: 130px !important;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 12px 28px rgba(91, 45, 145, 0.35));
}
.screen-subscribe .flow-aside .flow-brand { display: none; }

.flow-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peach);
  font-weight: 600;
  text-align: left;
}
.flow-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: left;
}
.flow-lead {
  margin: 0 0 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
  text-align: left;
  font-size: 0.98rem;
}
.flow-lead.ok-line {
  color: var(--success);
  font-weight: 600;
}
.muted-soft {
  color: rgba(255,255,255,0.55) !important;
  font-weight: 400 !important;
}
.flow-points {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  text-align: left;
  display: none; /* phone: keep tight; desktop shows */
}
.flow-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 0.94rem;
  line-height: 1.35;
}
.flow-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-soft), var(--pink));
  box-shadow: 0 0 10px rgba(233, 78, 119, 0.35);
}
.flow-panel {
  margin-top: 8px;
  padding: 0;
}
.flow-panel-title {
  display: none;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.flow-panel .btn-ghost {
  margin-bottom: 10px;
}
.flow-panel .btn-grad {
  margin-top: 4px;
}
.coupon-block {
  margin-top: 18px;
  margin-bottom: 8px;
}
.flow-fineprint {
  text-align: center;
  margin-top: 14px !important;
}
.plan-card {
  border-radius: 20px;
  border-color: rgba(155, 140, 255, 0.22);
  background:
    linear-gradient(165deg, rgba(123, 63, 242, 0.12), rgba(20, 20, 40, 0.6));
}
.plan-card .price {
  font-family: var(--font-display);
}

@media (min-width: 900px) {
  body.is-wide .app {
    max-width: 1080px;
    padding: 28px 40px 48px;
  }
  body.is-home .app {
    max-width: 1120px;
  }

  .flow-topbar {
    min-height: 52px;
    margin-bottom: 12px;
  }

  .flow-stage {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(340px, 440px);
    gap: clamp(36px, 5vw, 72px);
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 8px 0 24px;
  }

  .flow-aside {
    text-align: left;
    max-width: 480px;
  }
  .flow-brand {
    justify-content: flex-start;
    align-items: flex-start;
    margin: 0 0 20px;
  }
  .flow-brand .login-logo {
    height: min(200px, 26vh) !important;
    margin: 0;
  }
  .flow-title {
    font-size: clamp(2rem, 3vw, 2.55rem);
  }
  .flow-lead {
    max-width: 38ch;
    font-size: 1.05rem;
  }
  .flow-points {
    display: block;
    margin-top: 22px;
  }

  .flow-panel {
    margin-top: 0;
    padding: 24px 22px 22px;
    border-radius: 16px;
    background: rgba(18, 18, 36, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  }
  .flow-panel-title {
    display: block;
  }
  .flow-panel .btn-ghost {
    margin-bottom: 12px;
  }
  .flow-panel .btn-grad {
    margin-top: 8px;
  }
  .plan-card {
    padding: 22px 20px;
  }
  .plan-card .price {
    font-size: 42px;
  }

  /* Subscribe: swap so plan is focal on larger screens with brand story left */
  .screen-subscribe .flow-aside {
    padding-right: 8px;
  }
}

@media (max-width: 899px) {
  .flow-kicker,
  .flow-title,
  .flow-lead {
    text-align: center;
  }
  .flow-title {
    font-size: 1.4rem;
  }
  .screen-create .flow-aside .flow-points,
  .screen-join .flow-aside .flow-points,
  .screen-subscribe .flow-aside .flow-points {
    display: none;
  }
  .screen-create .flow-panel-title,
  .screen-join .flow-panel-title,
  .screen-subscribe .flow-panel-title {
    display: none;
  }
}
