/* Anonymous Night – styles on top of Tailwind (prebuilt) */

:root {
  --ink: #070B14;
  --plum: #0E1424;
  --plum-2: #161F36;
  --plum-3: #212C4A;
  --lilac: #9AA8FF;
  --glow: #5B7CFF;
  --white: #FFFFFF;
  --mist: #A3ACC6;
  --rose: #FF7A93;
  --line: rgba(255, 255, 255, .14);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; font-family: var(--sans); overflow-x: hidden; }
::selection { background: var(--glow); color: #fff; }

/* This file loads after Tailwind, so restate utilities that component classes below would otherwise override */
.fav-chip.hidden, .tool-btn.hidden, .btn-secondary.hidden, .rec-timer.hidden,
.stage-msg.hidden, .choice-card.hidden, .q-card.hidden, .toast.hidden { display: none; }

.focus-ring:focus-visible,
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
}

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Public page ---------- */
.night-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70% 40% at 50% 8%, rgba(91, 124, 255, .16), transparent 70%),
    var(--ink);
}
.night-hero {
  position: absolute; left: 0; right: 0; top: 0; z-index: -1; height: min(118vw, 560px);
  pointer-events: none; overflow: hidden;
}
.night-hero img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 96%);
          mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 96%);
  opacity: .9;
}
.night-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,11,20,.80) 0%, rgba(7,11,20,.15) 40%, rgba(7,11,20,0) 100%);
}

.presents {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font: 500 11px/1 var(--sans); letter-spacing: .5em; margin-right: -.5em; color: rgba(255,255,255,.88);
}
.presents::before, .presents::after { content: ''; width: 34px; height: 1px; background: rgba(255,255,255,.55); }

.night-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 10.6vw, 66px); line-height: 1;
  letter-spacing: .16em; margin-right: -.16em;
  text-transform: uppercase; text-align: center; color: #fff;
  text-shadow: 0 0 28px rgba(91, 124, 255, .85), 0 0 2px rgba(255,255,255,.4);
}
.night-tagline {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font: italic 500 clamp(14px, 4.2vw, 18px)/1.2 var(--serif); letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.92);
}
.night-tagline::before, .night-tagline::after { content: ''; flex: none; width: 22px; height: 1px; background: rgba(255,255,255,.55); }
.night-date { font: 500 12px/1 var(--sans); letter-spacing: .34em; color: rgba(255,255,255,.8); text-align: center; }

.ask-card {
  background: rgba(14, 20, 36, .72);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color .2s, box-shadow .2s;
}
.ask-card:focus-within { border-color: rgba(154,168,255,.7); box-shadow: 0 0 0 4px rgba(91,124,255,.18), 0 0 40px -8px rgba(91,124,255,.5); }
.ask-input {
  display: block; width: 100%; min-height: 150px; resize: none;
  background: transparent; border: 0; outline: none !important;
  padding: 20px 20px 10px; color: #fff;
  font: 500 22px/1.35 var(--serif);
}
.ask-input::placeholder { color: rgba(163,172,198,.65); font-style: italic; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 14px;
  background: #fff; color: var(--ink);
  font: 600 15px/1 var(--sans); letter-spacing: .06em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 10px 40px -10px rgba(91,124,255,.9);
  transition: transform .08s, box-shadow .15s, opacity .15s;
}
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .7; cursor: progress; }

.btn-secondary {
  align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 14px;
  background: transparent; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: .04em;
  border: 1px solid rgba(255,255,255,.3);
}
.btn-secondary:hover { background: rgba(255,255,255,.06); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(7,11,20,.2); border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}
.spinner.light { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.sent-mark {
  width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 0 40px rgba(91,124,255,.7), inset 0 0 20px rgba(91,124,255,.35);
  animation: fade-in .6s ease-out both;
}
@keyframes fade-in { from { opacity: 0; transform: scale(.9); } }

.partners { background: #fff; border-radius: 14px; overflow: hidden; }
.partners img { display: block; width: 100%; height: auto; }

/* ---------- Admin ---------- */
.admin-body { background: var(--ink); }
.brand-word { font: 600 19px/1 var(--serif); letter-spacing: .04em; }

.surface { background: var(--plum); border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }

.stat-tile {
  display: block; padding: 16px; border-radius: 18px;
  background: var(--plum); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  transition: background .15s;
}
.stat-tile:hover { background: var(--plum-2); }
.stat-num { font: 600 38px/1 var(--serif); font-variant-numeric: tabular-nums lining-nums; }

.q-card {
  position: relative; padding: 16px 16px 12px; border-radius: 20px;
  background: var(--plum); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.q-card[data-fav="1"] { box-shadow: inset 0 0 0 1px rgba(154,168,255,.55), 0 0 30px -14px rgba(91,124,255,.9); }
.q-card[data-status="answered"] .q-text { color: rgba(255,255,255,.55); }
.q-card.is-new { animation: flash-in 1.2s ease-out; }
@keyframes flash-in { from { background: var(--plum-3); } }
.q-text { font: 600 20px/1.32 var(--serif); color: #fff; overflow-wrap: anywhere; }

.status-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.status-chip.is-pending { background: rgba(154,168,255,.14); color: var(--lilac); }
.status-chip.is-answered { background: rgba(52,211,153,.14); color: #6EE7B7; }
.fav-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--lilac); font-weight: 600; }
.fav-chip svg { fill: currentColor; }

.btn-answer {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 12px; white-space: nowrap;
  background: #fff; color: var(--ink); font-weight: 600; font-size: 13px;
}
.btn-snap {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 11px; margin-right: auto; border-radius: 12px; white-space: nowrap;
  background: transparent; color: #fff; font-weight: 600; font-size: 13px;
  border: 1px solid rgba(255,255,255,.28);
}
.btn-snap:hover { background: rgba(255,255,255,.06); }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: var(--mist); background: rgba(255,255,255,.04);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
.icon-btn.is-fav { color: var(--lilac); }
.icon-btn.is-fav svg { fill: currentColor; }
.icon-btn:disabled { opacity: .5; }

.filter-tab {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 36px; padding: 0 14px; border-radius: 999px;
  color: var(--mist); font-size: 13.5px; font-weight: 600;
  background: rgba(255,255,255,.04);
}
.filter-tab[aria-current="page"] { background: #fff; color: var(--ink); }
.filter-tab .n { font-variant-numeric: tabular-nums; opacity: .7; }

.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--mist); }
.field {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; border: 1px solid rgba(255,255,255,.12);
  font-size: 16px; /* ≥16px stops iOS zooming into inputs */
}
.field:focus { border-color: var(--lilac); outline: none; box-shadow: 0 0 0 3px rgba(91,124,255,.25); }
textarea.field { min-height: 110px; }
.field.pl-10 { padding-left: 2.5rem; }
.field.pr-10 { padding-right: 2.5rem; }
.field.pr-12 { padding-right: 3rem; }
.field::placeholder { color: rgba(163,172,198,.6); }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--plum-3); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--glow); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--lilac); outline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.is-error { background: var(--rose); }
@media (min-width: 768px) { .toast { bottom: 28px; } }

/* Sheets (confirm + Snapchat preview) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(3,5,10,.7); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 420px; max-height: calc(100dvh - 24px); overflow-y: auto; margin: 12px; padding: 22px; border-radius: 24px; background: var(--plum-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); animation: sheet-up .2s ease-out; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.snap-preview { display: block; width: min(100%, calc((100dvh - 330px) * 9 / 16)); aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 16px; background: var(--ink); object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }

/* ---------- Composer ---------- */
body.composer-open .mobile-tabs { display: none; }
body.composer-open main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.composer-stage {
  position: relative; margin: 0 auto;
  width: min(100%, calc((100vh - 290px) * 9 / 16), calc((100dvh - 290px) * 9 / 16), 420px);
  aspect-ratio: 9 / 16; border-radius: 20px; overflow: hidden;
  background: #04060C; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 60px -30px rgba(0,0,0,.8);
  touch-action: none;
}
.composer-stage canvas, .composer-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.composer-stage .stage-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--mist); font-size: 14px; }

.shutter {
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.25);
  display: grid; place-items: center; transition: transform .1s;
}
.shutter:active { transform: scale(.92); }
.shutter:disabled { opacity: .4; }
.shutter.is-rec { background: transparent; box-shadow: 0 0 0 5px #fff; }
.shutter.is-rec::after { content: ''; width: 30px; height: 30px; border-radius: 8px; background: #FF3B5C; }
.shutter.rec-ready::after { content: ''; width: 58px; height: 58px; border-radius: 50%; background: #FF3B5C; }

.rec-timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.55);
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px;
}
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #FF3B5C; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.choice-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 18px; border-radius: 20px; text-align: left;
  background: var(--plum); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  transition: background .15s;
}
.choice-card:hover { background: var(--plum-2); }
.choice-card.is-lead { box-shadow: inset 0 0 0 1px rgba(154,168,255,.6), 0 0 40px -16px rgba(91,124,255,.9); }
.choice-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }

.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: 12px;
  background: rgba(255,255,255,.07); color: #fff; font-weight: 600; font-size: 14.5px;
}
.tool-btn:hover { background: rgba(255,255,255,.12); }
.tool-btn.primary { background: #fff; color: var(--ink); box-shadow: 0 10px 30px -12px rgba(91,124,255,.9); }
.tool-btn.primary:hover { background: #fff; filter: brightness(.97); }
.tool-btn:disabled { opacity: .45; pointer-events: none; }

input[type=range].zoom { accent-color: var(--lilac); width: 100%; }

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