/* ============================================================
   Pizzastrology — dark-mode-only, mobile-first single screen
   ============================================================ */

:root {
  --bg: #0b0710;
  --bg-2: #1a0f1c;
  --ink: #f4e9d8;
  --ink-dim: #b9a98f;
  --gold: #f3c46b;
  --gold-soft: #e0a94a;
  --ember: #d8813a;
  --line: rgba(243, 196, 107, 0.22);

  /* Pizza stage geometry (mobile defaults; overridden for desktop).
     vh fallback for ancient browsers, dvh on anything modern so the pizza
     tracks iOS Safari's URL-bar state correctly. */
  --disc: 128vh;          /* square side = disc diameter (mobile) */
  --cy: 90vh;             /* y of disc center within viewport */
  --cx: 50vw;             /* x of disc center */
}
@supports (height: 1dvh) {
  :root {
    --disc: 128dvh;
    --cy: 90dvh;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L",
               Palatino, Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(140vmax 105vmax at 50% 4%,  #3c1f68 0%, transparent 55%),
    radial-gradient(120vmax 95vmax at 84% 96%,  #14264f 0%, transparent 52%),
    linear-gradient(180deg, #1c0d38 0%, #140b2d 28%, #0b0822 58%, #050410 100%);
}

/* Twinkling starfield (stars injected by app.js) */
.sky {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #ffd95a;
  box-shadow: 0 0 3px 0 rgba(255, 213, 90, 0.55);
  opacity: 0.5;
  will-change: opacity, transform;
  animation: twinkle var(--tw, 4s) ease-in-out var(--td, 0s) infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.12; transform: scale(0.65); }
  to   { opacity: 1;    transform: scale(1); }
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(80vmax 80vmax at 50% 88%,
              transparent 40%, rgba(2,1,8,0.55) 100%);
}

/* ---------- Chrome: wordmark + date ---------- */
/* Mobile-first: centered, stacked. Desktop layout is the override below. */
.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0;
  pointer-events: none;
}
.chrome-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
}
.wordmark {
  font-size: clamp(0.86rem, 4.4vw, 1.16rem);
  letter-spacing: 0.26em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-dim);
}
.wm-star { margin-right: 0.5em; color: var(--ink-dim); -webkit-text-fill-color: var(--ink-dim); }
.wm-star-right { margin-right: 0; margin-left: 0.5em; }   /* mobile: star on both sides */
.date-display {
  margin-top: 0.1rem;
  font: inherit;
  font-size: clamp(0.56rem, 2.8vw, 0.7rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  /* Faint purple pill — barely there at rest, more visible on hover/focus */
  background: rgba(140, 100, 200, 0.04);
  border: 1px solid rgba(140, 100, 200, 0.06);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.date-display:hover {
  background: rgba(140, 100, 200, 0.20);
  border-color: rgba(140, 100, 200, 0.32);
  color: var(--ink);
}
.date-display:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  background: rgba(140, 100, 200, 0.20);
  border-color: rgba(140, 100, 200, 0.32);
  color: var(--ink);
}
.date-display > time {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---------- Screen + readout ---------- */
.screen {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.readout {
  position: absolute;
  top: clamp(3.5rem, 11.5vh, 5.8rem);   /* clears the centered mobile header */
  left: 0; right: 0;
  text-align: center;
  z-index: 20;
  pointer-events: none;
  padding: 0 1rem;
}
.readout-kicker, .cta-hint {
  font-size: clamp(0.62rem, 2.7vw, 0.78rem);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.sign-name {
  font-size: clamp(2.4rem, 11vw, 4.6rem);
  font-weight: 700;
  line-height: 1.22;
  padding-bottom: 0.08em;
  margin: 0.05em 0 0.5em;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff2d2, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 28px rgba(243, 196, 107, 0.18);
}
.cta-hint { transition: opacity 0.3s; }
.cta-hint.is-hidden { opacity: 0; }

/* ---------- Pizza stage ---------- */
.stage {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: var(--disc);
  height: var(--disc);
  transform: translate(-50%, -50%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  z-index: 10;
}
.stage.is-dragging { cursor: grabbing; }
.stage:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -6px;
  border-radius: 50%;
}

.rotor {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform: rotate(0deg);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.pizza-base { filter: drop-shadow(0 0 26px rgba(0, 0, 0, 0.5)); }

/* Synthetic lit-slice glow: a brightened copy clipped to the active wedge */
.pizza-glow {
  opacity: 0;
  filter: brightness(1.5) saturate(1.32) contrast(1.04);
  transition: opacity 0.32s ease;
  clip-path: polygon(50% 50%, 50% 50%, 50% 50%); /* set by JS */
}
.pizza-glow.is-idle { opacity: 0.30; }      /* mobile: faint glow on centered slice */
.pizza-glow.is-hot  { opacity: 0.92; }      /* hover / armed */
.pizza-glow.is-pulse { animation: slice-pulse 560ms ease-out 1; }
@keyframes slice-pulse {
  0%   { opacity: 0.30; filter: brightness(1.4) saturate(1.3); }
  35%  { opacity: 1;    filter: brightness(2.05) saturate(1.7); }
  100% { opacity: 0.92; filter: brightness(1.5) saturate(1.32); }
}

.hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.hotspots path {
  fill: rgba(0,0,0,0);
  pointer-events: all;
}

/* ---------- Desktop / wide: whole pizza, centered ---------- */
@media (min-width: 820px) {
  :root {
    /* Reserve a band for the readout, then size/place the disc to live
       strictly below it and never overflow the bottom. */
    --readout-zone: max(20vh, 168px);
    --disc: min(70vmin, calc(96vh - var(--readout-zone)));
    --cy: calc(var(--readout-zone) + var(--disc) / 2 + 2vh);
  }
  .readout { top: clamp(1.4rem, 4vh, 3rem); }

  /* Restore the original desktop chrome (corners, non-interactive wordmark) */
  .chrome {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    text-align: left;
    padding: max(0.9rem, env(safe-area-inset-top)) 1.1rem 0;
  }
  .chrome-left { align-items: flex-start; gap: 0.3rem; }
  .wordmark { letter-spacing: 0.34em; }
  .wm-star-right { display: none; }   /* desktop: single star, as before */
  .date-display {
    margin-top: 0;
    font-size: clamp(0.66rem, 2.6vw, 0.82rem);
    letter-spacing: 0.18em;
  }
}

/* ---------- Horoscope overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.overlay[hidden] { display: none; }
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 12, 0.74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in 0.28s ease both;
}
.card {
  position: relative;
  z-index: 1;
  width: min(34rem, 100%);
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 1.6rem 1.6rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216,129,58,0.16), transparent 60%),
    linear-gradient(180deg, #1c1020, #130b16);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.4) inset;
  animation: card-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.card-close {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink-dim);
  font-size: 1rem;
  cursor: pointer;
}
.card-close:hover { color: var(--ink); border-color: var(--gold-soft); }
.card-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 0.5rem;
}
.card-glyph { margin-right: 0.45em; font-size: 1.05em; }
.card-pizza {
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.1;
  background: linear-gradient(180deg, #fff2d2, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-style {
  font-size: 0.95rem;
  color: var(--ink-dim);
  font-style: italic;
  margin: 0.25rem 0 1rem;
}
.card-ingredients {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.card-ingredients li {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(243,196,107,0.05);
}
.card-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.1rem;
  row-gap: 0.5rem;
  align-items: baseline;
  margin: 0.2rem 0 0.7rem;
}
.card-pair .pk {
  justify-self: end;
  text-align: right;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.card-pair .pv {
  justify-self: start;
  text-align: left;
  font-size: 0.95rem;
  color: var(--ink);
}
.card-pairing-summary {
  font-size: 0.88rem;
  color: var(--ink-dim);
  font-style: italic;
  margin: 0.2rem 0 1rem;
}
.card-desc {
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.card-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }
.btn-x { padding-left: 1.05rem; padding-right: 1.05rem; }
.btn {
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--gold-soft);
  background: linear-gradient(180deg, rgba(243,196,107,0.18), rgba(216,129,58,0.12));
  color: var(--gold);
  cursor: pointer;
}
.btn:hover { background: linear-gradient(180deg, rgba(243,196,107,0.3), rgba(216,129,58,0.2)); }

/* ---------- Date picker ---------- */
.date-picker {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.date-picker[hidden] { display: none; }
.dp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 12, 0.74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in 0.28s ease both;
}
.dp-panel {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.4rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(124, 78, 196, 0.18), transparent 60%),
    linear-gradient(180deg, #1c1020, #130b16);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.4) inset;
  animation: card-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.dp-close {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink-dim);
  font-size: 1rem;
  cursor: pointer;
}
.dp-close:hover { color: var(--ink); border-color: var(--gold-soft); }
.dp-title {
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 0.9rem;
}
.dp-list {
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.1rem 0;
}
.dp-item {
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(243,196,107,0.04);
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  transition: background 0.15s, border-color 0.15s;
}
.dp-item:hover, .dp-item:focus-visible {
  background: rgba(243,196,107,0.10);
  border-color: var(--gold-soft);
  outline: none;
}
.dp-item.is-current {
  border-color: var(--gold-soft);
  background: rgba(243,196,107,0.14);
}
.dp-item-weekday {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.4rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  background: #20131f;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
}
.toast[hidden] { display: none; }

/* ---------- Share menu (mobile + desktop, identical) ---------- */
.share-menu {
  position: fixed;
  inset: 0;
  z-index: 300;                /* above the horoscope overlay */
  display: grid;
  place-items: center;
  padding: 1rem;
}
.share-menu[hidden] { display: none; }
.sm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 12, 0.74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in 0.22s ease both;
}
.sm-panel {
  position: relative;
  width: min(22rem, 100%);
  padding: 1.6rem 1.3rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216,129,58,0.14), transparent 60%),
    linear-gradient(180deg, #1c1020, #130b16);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  animation: card-in 0.28s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.sm-close {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink-dim);
  cursor: pointer;
}
.sm-close:hover { color: var(--ink); border-color: var(--gold-soft); }
.sm-title {
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1rem;
}
.sm-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sm-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.sm-item:hover { background: rgba(243,196,107,0.08); border-color: var(--gold-soft); }
.sm-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem; height: 2.1rem;
  flex: none;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  line-height: 0;
}
/* Icons live in /icons/*.svg, loaded as <img> (edit those files directly).
   Brand colors are baked into each SVG file, not driven from CSS. */
.sm-ic img { display: block; width: 1.3rem; height: 1.3rem; }
.sm-ic-copy { color: var(--ink-dim); }
/* Single-path marks whose interior is negative space (Reddit snoo, FB "f"):
   give them a white disc so the cut-outs read white, not the menu bg. */
.sm-ic-disc { background: radial-gradient(circle at 50% 50%, #fff 0 49%, transparent 50%); }
.sm-ic-disc img { width: 100%; height: 100%; }
.sm-contact {
  display: block;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
}
.sm-contact:hover { color: var(--gold); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pizza-glow, .overlay-backdrop, .card { transition: none; animation: none; }
  .pizza-glow.is-pulse { animation: none; }
  .sm-backdrop, .sm-panel { animation: none; }
  .star { animation: none; opacity: 0.55; }
}
