/* app.css — Renaissance × flirty design tokens + components */

/* ---------- tokens ---------- */
:root {
  --midnight: #0A0F1A;
  --midnight-2: #121A2C;
  --ink: #060912;
  --pink: #FF5C8A;
  --pink-deep: #E03E70;
  --blush: #FFC8DD;
  --blush-soft: #FFE3EC;
  --ember: #FF8A3D;
  --gold: #E8C46B;
  --gold-deep: #B8923A;
  --cream: #FBEFE6;
  --wine: #6E1430;
  --paper: #FFFFFF;
  --fg: #FBEFE6;
  --fg-dim: rgba(251,239,230,0.62);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-script: "Caveat", cursive;
  --font-ui: "Archivo", system-ui, sans-serif;

  --r-1: 6px;
  --r-2: 14px;
  --r-3: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --accent: var(--pink);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--midnight);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* full-bleed warm vignette over midnight */
.app-root {
  position: relative;
  min-height: 100vh;
  width: 100%;
  isolation: isolate;
}
.app-root::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 18% 8%, rgba(255,138,61,0.18), transparent 55%),
    radial-gradient(120% 90% at 88% 96%, rgba(255,92,138,0.20), transparent 55%),
    linear-gradient(160deg, #0c1322 0%, #0A0F1A 55%, #0a0710 100%);
}

/* ---------- type helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: none;
}
.serif { font-family: var(--font-serif); }
.script { font-family: var(--font-script); }
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--accent);
}
.dropcap::first-letter {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.9em;
  line-height: 0.7;
  float: left;
  padding: 6px 8px 0 0;
  color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 16px 30px;
  cursor: pointer;
  transition: transform .2s var(--ease-out), background .2s var(--ease), box-shadow .2s var(--ease);
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary {
  background: var(--accent);
  color: #2a0414;
  box-shadow: 0 10px 30px -8px rgba(255,92,138,0.6);
}
.btn-primary:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 16px 40px -8px rgba(255,92,138,0.7); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: rgba(251,239,230,0.06);
  color: var(--fg);
  border: 1px solid rgba(251,239,230,0.22);
}
.btn-ghost:hover { background: rgba(251,239,230,0.12); transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(180deg, #f3d98a, var(--gold) 55%, var(--gold-deep));
  color: #2a1c05;
  box-shadow: 0 10px 28px -10px rgba(232,196,107,0.6);
}
.btn-gold:hover { transform: translateY(-2px); }

/* ---------- gold painting frame ---------- */
.frame {
  position: relative;
  border-radius: 4px;
  background: #0b0d14;
  box-shadow:
    0 0 0 2px var(--gold-deep),
    0 0 0 9px #1a1410,
    0 0 0 11px var(--gold),
    0 30px 70px -20px rgba(0,0,0,0.8);
  overflow: hidden;
}
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame-photo-tint::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,7,16,0.55));
  mix-blend-mode: multiply;
}

/* circular cameo (sticker-friendly crop of a painting) */
.cameo {
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px #1a1410, 0 0 0 8px var(--gold-deep),
    0 12px 30px -8px rgba(0,0,0,0.7);
}
.cameo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- roman-numeral side nav ---------- */
.romannav { display: flex; flex-direction: column; gap: 2px; }
.romannav .rn-row {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 14px;
  padding: 4px 0; cursor: pointer; color: var(--fg);
  border: none; background: none; text-align: left; font-family: var(--font-ui);
  transition: color .15s var(--ease), padding-left .2s var(--ease-out);
}
.romannav .rn-row .rn-name { font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.romannav .rn-row .rn-num { font-family: var(--font-serif); font-size: 14px; color: var(--fg-dim); }
.romannav .rn-row:hover { color: var(--accent); padding-left: 8px; }

/* ---------- progress dots ---------- */
.progress { display: flex; gap: 8px; align-items: center; }
.progress .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(251,239,230,0.22); transition: all .3s var(--ease-out); }
.progress .dot.done { background: var(--accent); }
.progress .dot.active { background: var(--accent); width: 26px; border-radius: 999px; box-shadow: 0 0 14px rgba(255,92,138,0.6); }

/* ---------- screen wrapper + transitions ---------- */
.screen { min-height: 100vh; width: 100%; }
.fade-enter { animation: fadeUp .5s var(--ease-out) both; }
@keyframes fadeUp { from { transform: translateY(14px); } to { transform: translateY(0); } }

/* utility */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.center { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; }
.row { display: flex; }
.gap-s { gap: 10px; } .gap-m { gap: 20px; } .gap-l { gap: 36px; }
.tilt-l { transform: rotate(-3deg); } .tilt-r { transform: rotate(3deg); }

/* ---------- custom cursor + sparkles ---------- */
.cursor-on, .cursor-on * { cursor: none !important; }
.heart-cursor {
  position: fixed; left: 0; top: 0; z-index: 9998; pointer-events: none;
  font-size: 26px; transform: translate(-50%,-50%); will-change: transform;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); transition: scale .12s var(--ease-out);
}
.heart-cursor.press { scale: 0.7; }
.sparkle {
  position: fixed; z-index: 9997; pointer-events: none; transform: translate(-50%,-50%);
  font-size: 14px; animation: sparkfade .7s var(--ease-out) forwards;
}
@keyframes sparkfade {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(0.4) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%,-110%) scale(1.1) rotate(40deg); }
}

/* ---------- draggable stickers ---------- */
.sticker {
  position: fixed; z-index: 50; user-select: none; -webkit-user-select: none;
  cursor: grab; touch-action: none; will-change: transform;
  transition: filter .18s var(--ease);
}
.sticker:active { cursor: grabbing; }
.sticker.emoji {
  font-size: 46px; line-height: 1;
  filter: drop-shadow(2px 3px 0 rgba(255,255,255,0.9)) drop-shadow(-1px -1px 0 rgba(255,255,255,0.7)) drop-shadow(0 8px 12px rgba(0,0,0,0.45));
}
.sticker.cameo-st { width: 78px; height: 78px; }
.sticker:hover { filter: drop-shadow(0 0 16px rgba(255,92,138,0.55)); }
.sticker .peel { display: block; }

/* svg heart/sparkle stickers */
.sticker.shape svg { display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4)); }

/* hint chip */
.hint {
  font-family: var(--font-script); font-size: 22px; color: var(--blush);
  display: inline-flex; align-items: center; gap: 6px; transform: rotate(-2deg);
}

/* ---------- option cards ---------- */
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.opt-card {
  position: relative; text-align: left; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1.5px solid rgba(251,239,230,0.16);
  border-radius: var(--r-2); padding: 22px 22px 20px; color: var(--fg);
  font-family: var(--font-ui); transition: all .2s var(--ease-out);
}
.opt-card:hover { transform: translateY(-3px) rotate(-0.6deg); border-color: var(--accent); background: rgba(255,92,138,0.10); }
.opt-card.sel { border-color: var(--accent); background: rgba(255,92,138,0.16); box-shadow: 0 0 0 4px rgba(255,92,138,0.18); }
.opt-card .ol { font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.opt-card .on { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: var(--fg-dim); margin: 0; }
.opt-card.flag.sel { border-color: var(--ember); box-shadow: 0 0 0 4px rgba(255,138,61,0.2); }

/* ---------- slider ---------- */
.flirt-slider { width: 100%; }
.fs-track {
  position: relative; height: 16px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(91,168,255,0.5), var(--blush), var(--pink));
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
}
.fs-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--pink)); }
.fs-knob {
  position: absolute; top: 50%; width: 54px; height: 54px; transform: translate(-50%,-50%);
  border-radius: 50%; background: var(--paper);
  box-shadow: 0 8px 20px -4px rgba(0,0,0,0.5), 0 0 0 5px rgba(255,92,138,0.25);
  display: grid; place-items: center; font-size: 28px; cursor: grab; touch-action: none;
}
.fs-knob:active { cursor: grabbing; }
.fs-ends { display: flex; justify-content: space-between; margin-top: 14px; font-family: var(--font-serif); font-style: italic; font-size: 19px; color: var(--fg-dim); }
.fs-readout { font-family: var(--font-display); font-weight: 900; font-size: 64px; color: var(--accent); line-height: 1; }

/* ---------- red-flag meter ---------- */
.meter-track {
  position: relative; height: 64px; border-radius: var(--r-2); overflow: hidden;
  background: linear-gradient(90deg, #2f7d52 0%, #d9c24a 50%, #c0392b 100%);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.45);
}
.meter-ticks { position: absolute; inset: 0; display: flex; }
.meter-ticks span { flex: 1; border-right: 1px dashed rgba(0,0,0,0.18); }
.flag-handle {
  position: absolute; bottom: 0; transform: translateX(-50%);
  font-size: 40px; cursor: grab; touch-action: none; line-height: 1;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.5));
}
.flag-handle:active { cursor: grabbing; }

/* ---------- swipe ---------- */
.swipe-stage { position: relative; width: 320px; height: 420px; margin: 0 auto; }
.swipe-card {
  position: absolute; inset: 0; border-radius: var(--r-3); overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8), 0 0 0 2px var(--gold-deep), 0 0 0 8px #1a1410, 0 0 0 10px var(--gold);
  cursor: grab; touch-action: none; will-change: transform;
}
.swipe-card:active { cursor: grabbing; }
.swipe-card img { width: 100%; height: 100%; object-fit: cover; }
.swipe-stamp {
  position: absolute; top: 28px; font-family: var(--font-display); font-weight: 900;
  font-size: 34px; padding: 6px 16px; border-radius: 10px; border: 4px solid; opacity: 0;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.swipe-stamp.yes { left: 22px; color: #36d27a; border-color: #36d27a; transform: rotate(-14deg); }
.swipe-stamp.no  { right: 22px; color: var(--ember); border-color: var(--ember); transform: rotate(14deg); }

/* ---------- result love meter ---------- */
.love-bar { position: relative; height: 30px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,0.4); }
.love-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--pink), var(--blush)); transition: width 1.4s var(--ease-out); }

/* ---------- profile pill + local history ---------- */
.lq-pill-wrap { position: fixed; left: 18px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lq-pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 13px; color: var(--fg);
  background: rgba(10,12,20,0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(251,239,230,0.16); border-radius: 999px; padding: 9px 15px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6); transition: transform .18s var(--ease-out), border-color .18s var(--ease);
}
.lq-pill:hover { transform: translateY(-2px); border-color: var(--accent); }
.lq-pill-heart { color: var(--accent); font-size: 15px; }
.lq-pill-init { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lq-pill-badge { background: var(--accent); color: #2a0414; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.lq-panel {
  width: 290px; max-height: 62vh; overflow-y: auto;
  background: rgba(12,16,26,0.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(251,239,230,0.16); border-radius: var(--r-2); padding: 16px;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,0.8);
}
.lq-panel-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lq-x { background: none; border: none; color: var(--fg-dim); cursor: pointer; font-size: 14px; line-height: 1; }
.lq-x:hover { color: var(--fg); }
.lq-who { font-size: 14px; color: var(--fg-dim); margin-bottom: 12px; }
.lq-who b { color: var(--accent); }
.lq-empty { font-size: 15px; font-style: italic; color: var(--fg-dim); margin: 0 0 12px; line-height: 1.4; }
.lq-hist { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.lq-hist-row { display: grid; grid-template-columns: 22px 1fr; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(251,239,230,0.08); }
.lq-hist-emoji { font-size: 18px; }
.lq-hist-meta { font-size: 13px; color: var(--fg); }
.lq-hist-meta b { color: var(--accent); }
.lq-hist-meta em { font-style: normal; color: var(--fg-dim); font-size: 11px; }
.lq-hist-verdict { grid-column: 2; font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--blush); }
.lq-switch { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.lq-input {
  flex: 1; min-width: 0;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--fg);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(251,239,230,0.2); border-radius: 999px; padding: 9px 14px; outline: none;
}
.lq-input:focus { border-color: var(--accent); }
.lq-input::placeholder { color: var(--fg-dim); font-weight: 600; }
.lq-signout { background: none; border: none; color: var(--fg-dim); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 4px 0 0; }
.lq-signout:hover { color: var(--ember); }
.lq-google { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 12px; }
.lq-google > div:first-child { min-height: 40px; }
.lq-or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--fg-dim); font-size: 12px; }
.lq-or::before, .lq-or::after { content: ""; flex: 1; height: 1px; background: rgba(251,239,230,0.16); }

/* readings / ranking tabs */
.lq-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: rgba(255,255,255,0.05); border-radius: 999px; padding: 3px; }
.lq-tab { flex: 1; font-family: var(--font-ui); font-weight: 700; font-size: 12px; color: var(--fg-dim); background: none; border: none; border-radius: 999px; padding: 7px 0; cursor: pointer; transition: all .15s var(--ease); }
.lq-tab.on { background: var(--accent); color: #2a0414; }

/* ranking list */
.lq-rank { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.lq-rank-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(251,239,230,0.08); }
.lq-rank-n { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--fg-dim); text-align: center; }
.lq-rank-name { font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: var(--fg); }
.lq-rank-name em { font-style: normal; color: var(--fg-dim); font-size: 11px; }
.lq-rank-score { font-family: var(--font-display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }

/* result-screen save block */
.rs-save { margin: 22px 0 0; padding: 16px 18px; background: rgba(255,255,255,0.04); border: 1px solid rgba(251,239,230,0.14); border-radius: var(--r-2); }
.rs-save .eyebrow { display: block; margin-bottom: 8px; }
.rs-save-lbl { font-size: 16px; font-style: italic; color: var(--fg-dim); margin: 0 0 12px; }
.rs-save .lq-input { width: 100%; margin-bottom: 10px; }
.rs-save-fields { display: flex; flex-direction: column; }
.rs-save-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.rs-save-row .lq-signout { padding: 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .opt-grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .fs-readout { font-size: 48px; }
}
