:root {
  --bg-abyss: #060714;
  --bg-nebula: #130b24;
  --pink-petal: #ff9ec4;
  --pink-glow: #ff6ba8;
  --pink-soft: #ffd6e8;
  --text-starlight: #fbf7fa;
  --text-muted: #c9b5c4;
  --panel-bg: rgba(14, 12, 29, 0.72);
  --border-rose: rgba(255, 158, 196, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(ellipse at bottom, #190d2c 0%, var(--bg-abyss) 75%);
  color: var(--text-starlight);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#cosmos-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.botanical-corner {
  position: fixed;
  width: 220px;
  height: 220px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}
.top-left { top: 0; left: 0; }

.hidden { display: none !important; }

.viewport-center {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.obsidian-bloom-panel {
  max-width: 440px;
  width: 100%;
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-rose);
  border-radius: 28px;
  padding: 3rem 2.25rem;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75), 0 0 40px rgba(255, 107, 168, 0.12);
}

.blossom-emblem {
  font-size: 2.2rem;
  color: var(--pink-petal);
  text-shadow: 0 0 20px var(--pink-glow);
  margin-bottom: 0.75rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--pink-petal);
  margin-bottom: 0.6rem;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  background: linear-gradient(120deg, #ffffff 20%, var(--pink-soft) 60%, var(--pink-petal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  margin: 0.9rem 0 1.8rem;
  font-size: 0.95rem;
}

#unlock-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

#passphrase-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-rose);
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#passphrase-input:focus {
  border-color: var(--pink-petal);
  box-shadow: 0 0 22px rgba(255, 158, 196, 0.3);
}

#unlock-btn {
  background: linear-gradient(135deg, #ff7eb3, #ff5497);
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  color: #160713;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}

#unlock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 107, 168, 0.45);
}

.error-msg {
  color: #ff8aa8;
  font-size: 0.88rem;
  margin-top: 0.9rem;
  min-height: 1.2em;
}

/* Sanctuary View */
#sanctuary-view {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
  text-align: center;
}

.chrono-strip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
  margin-top: 2rem;
  padding: 1.1rem 1.8rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-rose);
  border-radius: 999px;
  backdrop-filter: blur(14px);
}

.chrono-unit span {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--pink-soft);
}

.chrono-unit label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.chrono-sep { color: var(--pink-petal); font-size: 0.9rem; }

/* Constellation Interactive Map */
.constellation-section { margin-top: 4.5rem; }
.constellation-section h2 { font-size: 2.4rem; color: var(--pink-soft); }
.section-hint { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.35rem; }

.star-map {
  position: relative;
  height: 380px;
  margin: 2rem auto 1.5rem;
  background: radial-gradient(circle at center, rgba(255, 158, 196, 0.1), rgba(8, 9, 24, 0.7));
  border: 1px solid var(--border-rose);
  border-radius: 28px;
  overflow: hidden;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.star-nodes-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.star-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 22%, var(--pink-petal) 58%, rgba(255, 107, 168, 0.25) 75%, transparent 80%);
  border: none;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 0 18px var(--pink-glow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.star-node:hover, .star-node.active {
  transform: translate(-50%, -50%) scale(1.55);
  box-shadow: 0 0 28px #ffffff, 0 0 40px var(--pink-glow);
}

.memory-drawer {
  background: var(--panel-bg);
  border: 1px solid var(--border-rose);
  border-radius: 22px;
  padding: 1.8rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.flower-bloom-art {
  margin-bottom: 0.6rem;
  min-height: 142px;
  display: grid;
  place-items: center;
}

.bloom-svg {
  animation: gentleBloom 0.55s cubic-bezier(0.22, 1, 0.36, 1), slowSpin 24s linear infinite;
  filter: drop-shadow(0 0 14px rgba(255, 130, 188, 0.45));
}

@keyframes gentleBloom {
  from { opacity: 0; transform: scale(0.45) rotate(-25deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.memory-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--pink-petal);
}

.memory-drawer h3 { font-size: 1.8rem; margin: 0.3rem 0 0.5rem; }
.memory-drawer p { color: var(--text-muted); line-height: 1.65; }

/* Wax Seal & Love Letter */
.letter-section { margin-top: 4.5rem; }

.wax-seal {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8ebc, #c93b76);
  border: 2px solid rgba(255, 224, 238, 0.6);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 35px rgba(201, 59, 118, 0.5);
  transition: transform 0.3s;
}

.wax-seal span { font-size: 2rem; }
.wax-seal small { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.2rem; }
.wax-seal:hover { transform: scale(1.08) rotate(-4deg); }

.parchment-letter {
  max-width: 660px;
  margin: 2rem auto 0;
  background: linear-gradient(180deg, rgba(28, 17, 42, 0.9), rgba(14, 11, 26, 0.94));
  border: 1px solid var(--border-rose);
  border-radius: 26px;
  padding: 2.8rem 2.4rem;
  text-align: left;
}

.parchment-letter.collapsed { display: none; }
.parchment-letter h2 { font-size: 2.1rem; color: var(--pink-soft); margin-bottom: 1.2rem; }
.parchment-letter p { line-height: 1.85; color: #f1e6ee; margin-bottom: 1.1rem; font-size: 1.05rem; }
.signature { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.45rem !important; color: var(--pink-petal) !important; margin-top: 1.5rem; }