/* ============================================================
   The 22nd Birthday Mystery — a notpron-flavoured theme ✦ refined
   Dark, dreamy, a little cryptic. Rose glows in the velvet void.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;1,9..144,400&family=Comfortaa:wght@400;700&family=Nunito:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --rose:      #ff8fb1;
  --rose-deep: #ffd0df;
  --glow:      rgba(255, 143, 177, 0.55);
  --ink:       #f3e6ee;
  --muted:     #b69bac;
  --panel:     rgba(30, 17, 30, 0.62);
  --line:      rgba(255, 143, 177, 0.26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px 22px 76px;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 720px at 50% -12%, #45183a 0%, transparent 60%),
    radial-gradient(820px 620px at 88% 112%, #1d2746 0%, transparent 55%),
    radial-gradient(700px 520px at 8% 90%, #3a1530 0%, transparent 55%),
    linear-gradient(160deg, #160b16 0%, #1c0f1f 60%, #110914 100%);
  background-attachment: fixed;
}

/* drifting stars + a soft nebula */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent),
    radial-gradient(1.3px 1.3px at 70% 60%, #ffd0df 50%, transparent),
    radial-gradient(1.7px 1.7px at 40% 80%, #fff 50%, transparent),
    radial-gradient(1.3px 1.3px at 85% 25%, #fff 50%, transparent),
    radial-gradient(1.4px 1.4px at 10% 70%, #ffd0df 50%, transparent),
    radial-gradient(1.2px 1.2px at 58% 12%, #fff 50%, transparent),
    radial-gradient(1.2px 1.2px at 30% 50%, #ffe9f1 50%, transparent);
  opacity: .55;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .28; } to { opacity: .62; } }

/* faint grain */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
  mix-blend-mode: overlay;
}

.panel {
  position: relative;
  max-width: 540px;
  width: 100%;
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2.6em 2.1em;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 40px rgba(255, 143, 177, .05);
  animation: panelIn .7s cubic-bezier(.2, .8, .2, 1) both;
}
/* a soft sheen along the top edge */
.panel::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 38%);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: .82;
  margin-bottom: 1.5em;
}

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 26px var(--glow);
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.9rem, 6.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 5vw, 1.85rem); }

.riddle {
  font-size: 1.12rem;
  line-height: 1.72;
  color: var(--rose-deep);
  margin: 1.2em 0 1.6em;
}
.riddle em { color: #fff; font-style: italic; }

.cipher {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .18em;
  font-size: 1.25rem;
  color: #fff;
  background: rgba(255,143,177,.08);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: .7em 1em;
  display: inline-block;
  margin: .4em 0 1.2em;
  user-select: all;
  box-shadow: inset 0 0 22px rgba(255,143,177,.06);
}

/* ---- gate (the password box) ---- */
.gate { display: flex; flex-direction: column; align-items: center; gap: .9em; }
.gate input {
  width: 100%;
  max-width: 340px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9em 1em;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.gate input::placeholder { color: rgba(255,255,255,.35); }
.gate input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255,143,177,.18), 0 0 22px var(--glow); background: rgba(0,0,0,.42); }

.btn {
  position: relative;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #2a0f1d;
  background: linear-gradient(135deg, #ffe0ea, #ff8fb1);
  border: none;
  border-radius: 999px;
  padding: .85em 2.1em;
  cursor: pointer;
  box-shadow: 0 8px 26px var(--glow);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
/* a shine sweep on hover */
.btn::after {
  content: '';
  position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent);
  transform: skewX(-18deg);
  transition: left .6s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--glow); filter: brightness(1.03); }
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(0); }

.gate-msg { min-height: 1.4em; font-size: .98rem; margin: 0; }
.gate-msg.ok  { color: #9be8b0; }
.gate-msg.no  { color: #ff9aa6; }

/* ---- reward / next door ---- */
.reward { margin-top: 1.6em; animation: panelIn .5s ease both; }
.reward[hidden] { display: none; }
.next-door {
  display: inline-block;
  margin-top: .6em;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.18rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid var(--rose);
  padding-bottom: 2px;
  text-shadow: 0 0 16px var(--glow);
  transition: letter-spacing .25s, border-color .25s;
}
.next-door:hover { letter-spacing: .03em; border-bottom-color: var(--rose-deep); }

.hint {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 1.9em;
  font-style: italic;
}
.tiny { font-size: .72rem; color: var(--muted); opacity: .6; }
kbd {
  font-family: 'JetBrains Mono', monospace; font-size: .78rem;
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  border-radius: 6px; padding: .12em .5em; color: #fff;
}

/* invisible ink — text you can only find by selecting or peeking */
.invisible-ink { color: rgba(255,255,255,0.02); user-select: all; }
.invisible-ink::selection { background: var(--rose); color: #160b16; }

a.home-whisper { color: var(--muted); font-size: .8rem; text-decoration: none; opacity:.55; margin-top: 2em; transition: opacity .25s; }
a.home-whisper:hover { opacity: 1; }

/* ---- motion-safe ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
