/* CineLune — Moon Goddess Marquee
   Vaporwave goddess × magical-girl sparkle × Y2K chrome, after midnight.
   All colors live in the theme blocks below; components only use variables. */

:root,
[data-theme="midnight"] {
  --bg: #14102E;
  --surface: #221A4A;
  --surface-2: #2C2260;
  --border: #3A2E7A;
  --text: #F4EEFF;
  --muted: #B9AEDB;
  --gold: #FFE14D;
  --pink: #FF4FA3;
  --on-pink: #14102E;
  --lilac: #D7B8F5;
  --accent-text: #FFE14D;      /* headings and active tab */
  --link: #D7B8F5;
  --success: #7BE0B0;
  --error: #FF6B8A;
  --glow: radial-gradient(circle, rgba(255,225,77,0.4) 0%, rgba(255,79,163,0.16) 42%, rgba(255,79,163,0) 68%);
  --poster-glow: 0 0 36px rgba(255,225,77,0.45), 0 16px 36px rgba(0,0,0,0.5);
  --poster-border: 1px solid rgba(255,255,255,0.35);
  --nav-bg: rgba(34,26,74,0.95);
  --star-glow: rgba(255,225,77,0.55);
  --page-bg: var(--bg);
  color-scheme: dark;
}

[data-theme="moonrise"] {
  --bg: #F7F2FF;
  --surface: #FFFFFF;
  --surface-2: #EDE3FF;
  --border: #E2D6FA;
  --text: #14102E;
  --muted: #4E4570;
  --gold: #FFE14D;
  --pink: #C21E6E;
  --on-pink: #FFFFFF;
  --lilac: #6A3FB8;
  --accent-text: #6A3FB8;
  --link: #6A3FB8;
  --success: #1E7A50;
  --error: #C8234A;
  --glow: radial-gradient(circle, rgba(255,184,218,0.85) 0%, rgba(255,233,168,0.5) 42%, rgba(255,233,168,0) 70%);
  --poster-glow: 0 0 34px rgba(255,184,218,0.9), 0 14px 30px rgba(20,16,46,0.25);
  --poster-border: 2px solid #FFFFFF;
  --nav-bg: rgba(255,255,255,0.94);
  --star-glow: rgba(255,184,218,0.9);
  --page-bg: linear-gradient(180deg, #E6D9FF 0%, #FFE3EF 55%, #FFF4DC 100%);
  color-scheme: light;
}

[data-theme="rose"] {
  --bg: #2A0F2E;
  --surface: #3D1742;
  --surface-2: #4F2055;
  --border: #6A2D70;
  --text: #FFF0F7;
  --muted: #E7B9D3;
  --gold: #FFE14D;
  --pink: #FF4FA3;
  --on-pink: #2A0F2E;
  --lilac: #FFC8E6;
  --accent-text: #FF8CC6;
  --link: #FFC8E6;
  --success: #7BE0B0;
  --error: #FF8FA6;
  --glow: radial-gradient(circle, rgba(255,79,163,0.5) 0%, rgba(255,79,163,0.14) 45%, rgba(255,79,163,0) 70%);
  --poster-glow: 0 0 36px rgba(255,79,163,0.5), 0 16px 36px rgba(0,0,0,0.5);
  --poster-border: 1px solid rgba(255,255,255,0.35);
  --nav-bg: rgba(61,23,66,0.95);
  --star-glow: rgba(255,79,163,0.6);
  --page-bg: var(--bg);
  color-scheme: dark;
}

[data-theme="starlit"] {
  --bg: #111111;
  --surface: #1C1C1C;
  --surface-2: #2A2A2A;
  --border: #3A3A3A;
  --text: #F1F0EB;
  --muted: #BDBAB0;
  --gold: #FFE14D;
  --pink: #FFE14D;
  --on-pink: #111111;
  --lilac: #D7B8F5;
  --accent-text: #FFE14D;
  --link: #FFE14D;
  --success: #7BE0B0;
  --error: #FF6B8A;
  --glow: radial-gradient(circle, rgba(255,225,77,0.42) 0%, rgba(255,225,77,0.12) 45%, rgba(255,225,77,0) 70%);
  --poster-glow: 0 0 36px rgba(255,225,77,0.45), 0 16px 36px rgba(0,0,0,0.6);
  --poster-border: 1px solid rgba(255,255,255,0.3);
  --nav-bg: rgba(28,28,28,0.95);
  --star-glow: rgba(255,225,77,0.55);
  --page-bg: var(--bg);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overscroll-behavior-y: contain; /* our own pull-to-refresh replaces the browser's */ }
body {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* faint film grain on the background only */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
a { color: var(--link); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.display { font-family: 'Anton', Impact, sans-serif; font-weight: 400; letter-spacing: 0.04em; line-height: 1.05; text-transform: uppercase; }

/* ---------- Layout ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 20px) 24px calc(env(safe-area-inset-bottom) + 120px);
}
.view { animation: fadeUp 250ms ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .display { font-size: 30px; color: var(--accent-text); letter-spacing: 0.06em; }
[data-theme="moonrise"] .brand .display { color: var(--text); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--lilac); background: var(--surface); color: var(--lilac);
  font-weight: 700; display: grid; place-items: center; text-decoration: none;
}
.page-title { font-size: 34px; color: var(--accent-text); margin: 0; }
.eyebrow { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.section-title { font-size: 16px; color: var(--accent-text); margin: 24px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Buttons and chips ---------- */
.btn {
  min-height: 48px; padding: 0 22px; border-radius: 24px; border: none;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 150ms ease-out, filter 150ms ease-out;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pink); color: var(--on-pink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; color: var(--lilac); border: 1.5px dashed var(--lilac); font-weight: 400; }
.btn[disabled] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; margin-top: 18px; }
.btn-row .btn-primary { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  min-height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--gold); color: #14102E; font-weight: 700; }
.chip.tag { background: var(--pink); color: var(--on-pink); font-weight: 700; }
.chip.add { background: transparent; border: 1px dashed var(--lilac); color: var(--lilac); }
.chip.outline { background: transparent; border-color: var(--border); color: var(--muted); }
.chip.outline[aria-pressed="true"] { border-color: var(--gold); color: var(--accent-text); background: transparent; }

/* ---------- Tonight: Moonrise Deck ---------- */
.deck { position: relative; height: 330px; margin-top: 8px; touch-action: pan-y; }
.deck .glow { position: absolute; left: 50%; top: -20px; width: 380px; height: 380px; margin-left: -190px; border-radius: 50%; background: var(--glow); }
.deck .moon { position: absolute; left: 50%; top: -4px; margin-left: 2px; width: 170px; height: 170px; }
[data-theme="moonrise"] .deck .moon path { stroke: #14102E; stroke-width: 1.5; }
.deck .card {
  position: absolute; left: 50%; border-radius: 14px; overflow: hidden;
  width: 140px; height: 210px; transition: transform 300ms ease-out, opacity 300ms ease-out;
}
.deck img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.deck .card img, .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck .back-left { top: 60px; margin-left: -128px; transform: rotate(-11deg); opacity: 0.85; }
.deck .back-right { top: 56px; margin-left: -12px; transform: rotate(10deg); opacity: 0.9; }
.deck .front {
  top: 34px; width: 170px; height: 255px; margin-left: -85px;
  border: var(--poster-border); box-shadow: var(--poster-glow);
}
.deck .front.swap { animation: swapIn 420ms ease-out; }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
.deck .sparkle { position: absolute; }
.dots { position: absolute; left: 0; right: 0; top: 304px; display: flex; justify-content: center; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-2); transition: width 200ms; }
.dots span.on { width: 18px; background: var(--accent-text); }

.pick-info { text-align: center; }
.pick-title { font-size: 32px; margin: 4px 0 0; display: inline-flex; align-items: center; gap: 8px; }
.pick-why { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.pick-meta { margin: 4px 0 0; font-size: 11px; color: var(--lilac); }

.row-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }

/* ---------- Posters and grid ---------- */
.poster {
  position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 3;
  text-decoration: none; color: #F4EEFF; background: var(--surface-2); border: none; padding: 0; width: 100%;
}
.poster .fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px; font-family: 'Anton', Impact, sans-serif; font-size: 15px; line-height: 1.05; letter-spacing: 0.04em; }
.poster-wrap { position: relative; }
.sticker {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  padding: 3px 8px; border-radius: 10px; font-size: 9px; font-weight: 700; color: #14102E; letter-spacing: 0.04em;
}
.sticker.want { background: #D7B8F5; }
.sticker.watching { background: #FFE14D; }
.sticker.watched { background: #FF4FA3; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(20,16,46,0.6); }
.progress span { display: block; height: 4px; background: #FF4FA3; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; margin-top: 18px; }
.mini-poster { flex: 0 0 76px; }

/* ---------- Moods: ticket cards ---------- */
.tickets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ticket {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 140px; padding: 14px; border-radius: 16px; color: #14102E; text-decoration: none; border: none; text-align: left;
}
.ticket::before, .ticket::after { content: ""; position: absolute; top: 84px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); }
.ticket::before { left: -9px; } .ticket::after { right: -9px; }
[data-theme="moonrise"] .ticket::before, [data-theme="moonrise"] .ticket::after { background: #FFE9F1; }
.ticket .admit { font-size: 9px; letter-spacing: 0.2em; }
.ticket .name { font-family: 'Anton', Impact, sans-serif; font-size: 20px; line-height: 1.05; }
.ticket .tag { border-top: 2px dashed rgba(20,16,46,0.35); padding-top: 8px; font-size: 10px; }
.ticket.new { background: transparent; border: 1.5px dashed var(--lilac); color: var(--lilac); align-items: center; justify-content: center; gap: 6px; font-size: 12px; }
.ticket.new::before, .ticket.new::after { display: none; }

/* ---------- Me ---------- */
.profile { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.profile .avatar { width: 58px; height: 58px; background: var(--lilac); color: #14102E; border: none; font-family: 'Anton', Impact, sans-serif; font-size: 24px; box-shadow: 0 0 20px rgba(255,225,77,0.35); }
.panel { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--surface); }
.panel.dashed { background: transparent; border: 1px dashed var(--lilac); }
.panel h2 { margin: 0; font-size: 12px; color: var(--lilac); }
.week { display: flex; justify-content: space-between; margin-top: 10px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.week span { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--gold); background: transparent; }
.week span.full { background: var(--gold); }
.week span.half { background: linear-gradient(90deg, transparent 50%, var(--gold) 50%); }
.theme-rows { display: flex; flex-direction: column; gap: 8px; }
.theme-row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px 0 7px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); text-align: left; font-size: 13px;
}
.theme-row[aria-checked="true"] { border: 1.5px solid var(--gold); }
.orb { position: relative; flex: 0 0 30px; height: 30px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.orb i { position: absolute; left: 13px; top: 2px; width: 20px; height: 26px; border-radius: 50%; }
.theme-row .check { margin-left: auto; color: var(--accent-text); font-weight: 700; }
.segmented { display: flex; margin-top: 12px; padding: 4px; border-radius: 22px; background: var(--surface); }
.segmented button { flex: 1; min-height: 36px; border-radius: 18px; border: none; background: transparent; color: var(--muted); font-size: 12px; }
.segmented button[aria-pressed="true"] { background: var(--gold); color: #14102E; font-weight: 700; }
.credit { margin-top: 18px; font-size: 10px; color: var(--muted); }

/* ---------- Bottom nav: floating pill + sparkle star ---------- */
.nav {
  position: fixed; z-index: 20;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  width: min(528px, calc(100% - 32px));
  height: 70px; border-radius: 35px; background: var(--nav-bg);
  border: 1px solid var(--border); box-shadow: 0 0 24px rgba(215,184,245,0.22);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 0 6px;
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10px; min-height: 44px; justify-content: center; }
.nav a[aria-current="page"] { color: var(--accent-text); font-weight: 700; }
.nav svg { width: 22px; height: 22px; }
.nav .save { margin-top: -30px; }
.nav .save svg { width: 68px; height: 68px; /* Tight pink glow first so the star's edge still reads over gold, then the soft gold bloom. */ filter: drop-shadow(0 0 3px rgba(255,79,163,0.95)) drop-shadow(0 0 9px rgba(255,79,163,0.7)) drop-shadow(0 0 20px var(--star-glow)); transition: transform 200ms ease-out; }
.nav .save:hover svg { transform: rotate(12deg) scale(1.05); }
[data-theme="moonrise"] .nav .save .star { stroke: #14102E; stroke-width: 1.5; }

/* ---------- Sheets (Quick save, Title details) ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(11,8,32,0.7); animation: fade 200ms ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 31; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); max-height: 92dvh; overflow-y: auto;
  border-radius: 28px 28px 0 0; background: var(--surface);
  padding: 12px 24px calc(env(safe-area-inset-bottom) + 28px);
  animation: slideUp 300ms cubic-bezier(.2,.8,.2,1);
}
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.handle { width: 44px; height: 5px; border-radius: 3px; background: var(--surface-2); margin: 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface-2); display: grid; place-items: center; color: var(--text); }
.search {
  display: flex; align-items: center; gap: 10px; min-height: 52px; margin-top: 16px; padding: 0 16px;
  border-radius: 16px; border: 1.5px solid var(--gold); background: var(--bg);
  box-shadow: 0 0 12px rgba(255,225,77,0.25);
}
.search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font-size: 16px; }
.results { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.result {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px;
  border: 1.5px solid transparent; background: var(--bg); text-align: left; width: 100%;
}
.result[aria-pressed="true"] { border-color: var(--gold); background: var(--surface-2); }
.result .poster { flex: 0 0 44px; width: 44px; border-radius: 8px; }
.result .poster .fallback { font-size: 0; }
.result .r-title { font-family: 'Anton', Impact, sans-serif; font-size: 16px; letter-spacing: 0.04em; display: block; }
.result .r-meta { font-size: 11px; color: var(--muted); }
.field-label { margin: 20px 0 10px; font-size: 12px; font-weight: 700; color: var(--lilac); }
.empty-note { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }

.details-hero { position: relative; height: 210px; margin: -12px -24px 0; overflow: hidden; border-radius: 28px 28px 0 0; background: var(--surface-2); }
.details-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.details-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(180deg, transparent, var(--surface)); }
.details-hero .icon-btn { position: absolute; right: 16px; top: 16px; z-index: 2; background: rgba(20,16,46,0.7); color: #F4EEFF; }
.details-top { display: flex; gap: 16px; margin-top: -70px; position: relative; z-index: 2; }
.details-top .poster { flex: 0 0 104px; width: 104px; border: var(--poster-border); box-shadow: var(--poster-glow); }
.details-top h2 { font-size: 26px; margin: 76px 0 0; }
.status { display: flex; margin-top: 18px; padding: 4px; border-radius: 22px; background: var(--bg); }
.status button { flex: 1; min-height: 38px; border-radius: 19px; border: none; background: transparent; color: var(--muted); font-size: 12px; }
.status button[aria-pressed="true"] { background: var(--gold); color: #14102E; font-weight: 700; }
.upnext { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 6px; background: var(--pink); transition: width 300ms ease-out; }
.hearts { display: flex; gap: 8px; }
.hearts button { border: none; background: transparent; padding: 4px; min-width: 44px; min-height: 44px; }
.hearts svg { width: 30px; height: 28px; transition: transform 200ms ease-out; }
.hearts button:active svg { transform: scale(1.2); }
textarea.note { width: 100%; border-radius: 14px; border: 1.5px solid var(--surface-2); background: var(--bg); font-size: 16px; padding: 10px 14px; resize: vertical; }

/* ---------- Ribbon (toast) ---------- */
.ribbon {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 100px);
  width: min(480px, calc(100% - 48px)); min-height: 48px; border-radius: 24px;
  background: var(--gold); color: #14102E; box-shadow: 0 0 24px rgba(255,225,77,0.5);
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 18px;
  font-size: 13px; font-weight: 700; animation: ribbonIn 300ms ease-out;
}
.ribbon.error { background: var(--surface); color: var(--text); border: 1.5px solid var(--error); box-shadow: none; font-weight: 400; }
.ribbon button { min-height: 36px; padding: 0 16px; border-radius: 18px; border: none; background: #14102E; color: #FFE14D; font-weight: 700; font-size: 12px; }
@keyframes ribbonIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Sparkle burst ---------- */
.burst { position: fixed; z-index: 50; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; width: 14px; height: 14px; margin: -7px; background: var(--gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: burst 600ms ease-out forwards; }
@keyframes burst { from { transform: translate(0,0) scale(0.4); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }

/* ---------- Welcome ---------- */
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 32px; }
.welcome .emblem { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.welcome .emblem .glow { position: absolute; inset: -110px; pointer-events: none;
  /* Many soft stops so the glow fades out with no visible edge. */
  background: radial-gradient(closest-side at 42% 52%,
    rgba(255,225,77,0.42) 0%, rgba(255,200,110,0.28) 18%, rgba(255,120,170,0.16) 38%,
    rgba(255,79,163,0.07) 56%, rgba(215,184,245,0.03) 74%, rgba(215,184,245,0) 100%);
  filter: blur(18px); }
[data-theme="moonrise"] .welcome .emblem .glow { background: radial-gradient(closest-side at 42% 52%,
    rgba(255,255,255,0.9) 0%, rgba(255,233,168,0.6) 22%, rgba(255,184,218,0.35) 45%, rgba(255,184,218,0.12) 68%, rgba(255,184,218,0) 100%); }
.welcome .emblem .pixel-moonrise { position: relative; width: 240px; height: 240px; }
.welcome .emblem .ring { position: absolute; inset: 20px; border-radius: 50%; border: 1.5px solid var(--gold); }
.welcome h1 { font-size: 52px; color: var(--accent-text); margin: 28px 0 0; letter-spacing: 0.08em; }
.welcome form { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 32px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--lilac); }
.field input { min-height: 50px; border-radius: 14px; border: 1.5px solid var(--surface-2); background: var(--surface); font-size: 16px; padding: 0 16px; }
.field input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 12px rgba(255,225,77,0.35); }
.field .err { color: var(--error); }
.steps { display: flex; gap: 8px; margin-top: 28px; }
.steps span { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.steps span.on { width: 22px; background: var(--gold); }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  #app { max-width: 1180px; padding-left: 32px; padding-right: 32px; }
  .tonight-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .tonight-layout .deck { height: 480px; margin-top: 56px; transform: scale(1.35); transform-origin: 50% 0; }
  .tonight-layout .pick-info { text-align: left; }
  .tonight-layout .pick-title { font-size: 56px; }
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tickets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- Layer 2: accounts ---------- */
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash .moon { width: 96px; height: 96px; filter: drop-shadow(0 0 28px rgba(255, 225, 77, 0.55)); animation: splash-pulse 1.6s ease-in-out infinite; }
@keyframes splash-pulse { 50% { opacity: 0.55; transform: scale(0.94); } }
.welcome form .err, .welcome p.err { color: var(--error); font-size: 14px; }
.welcome .panel { width: 100%; margin-top: 28px; }
.welcome > .btn { width: 100%; margin-top: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.linkish { background: none; border: none; padding: 8px 0; min-height: 44px; color: var(--lilac); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.welcome > .linkish { margin-top: 10px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .splash .moon { animation: none; } }
/* An already-open sheet that updates shouldn't slide in again. */
#sheet-root.steady .sheet, #sheet-root.steady .scrim { animation: none; }

/* ---------- Pull to refresh ---------- */
#ptr { position: fixed; z-index: 40; left: 50%; top: calc(env(safe-area-inset-top) - 52px); width: 44px; height: 44px; margin-left: -22px;
  display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--gold);
  box-shadow: 0 0 18px var(--star-glow); opacity: 0; pointer-events: none; transition: transform 260ms ease-out, opacity 200ms ease-out; }
#ptr svg { width: 22px; height: 22px; transition: transform 120ms; }
#ptr.dragging { transition: none; }
#ptr.ready { box-shadow: 0 0 22px var(--star-glow), 0 0 8px rgba(255,79,163,0.7); }
#ptr.spinning svg { animation: ptr-spin 900ms linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #ptr.spinning svg { animation: none; opacity: 0.7; } }
