:root {
  --ink: #3b2a2a;
  --soft: #8a6b6b;
  --cream: #fff7f0;
  --pink: #f7c6d0;
  --gold: #e8b86d;
  --warm: #ffd9a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1214; }
body { font-family: "Noto Serif SC", "Songti SC", serif; color: var(--ink); }

#app, #c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#c { cursor: grab; }
#c.dragging { cursor: grabbing; }

.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background:
    radial-gradient(700px 420px at 20% 10%, rgba(255, 180, 160, .28), transparent 55%),
    radial-gradient(600px 380px at 90% 80%, rgba(232, 184, 109, .22), transparent 50%),
    rgba(18, 10, 12, .55);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.overlay.hidden, .panel.hidden, .hud.hidden { display: none !important; }

.card {
  width: min(520px, 100%);
  background: linear-gradient(180deg, #fffaf6, #ffe8ef);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 24px;
  padding: 28px 26px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  animation: rise .55s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.eyebrow {
  margin: 0 0 8px; letter-spacing: .18em; text-transform: uppercase;
  font-size: 12px; color: #c26b7b; font-family: "ZCOOL XiaoWei", serif;
}
h1, h2 { margin: 0 0 12px; font-weight: 700; line-height: 1.35; }
h1 { font-size: clamp(26px, 5vw, 34px); }
h2 { font-size: 28px; }
.lead, .wish-card p, .finale-card p { margin: 0 0 10px; line-height: 1.8; color: var(--ink); }
.hint, .soft { color: var(--soft); font-size: 14px; line-height: 1.7; }
.hint { margin: 14px 0 18px; }

button {
  appearance: none; border: 0; cursor: pointer;
  border-radius: 999px; padding: 12px 20px;
  font: inherit; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #f3a6b5, #e8b86d);
  color: #4a2a2a;
  box-shadow: 0 10px 24px rgba(232, 140, 150, .35);
  transition: transform .15s ease, filter .15s ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.03); }

.hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  pointer-events: none; padding: 16px 18px;
}
.hud-top { display: flex; justify-content: space-between; gap: 12px; }
.brand, .eggs {
  pointer-events: none;
  background: rgba(255,247,240,.86);
  border: 1px solid rgba(255,255,255,.5);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.hud-tip {
  margin: 12px auto 0; width: fit-content; max-width: min(92vw, 520px);
  text-align: center; font-size: 13px; color: #fff7f0;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
  background: rgba(40, 20, 24, .28);
  border-radius: 999px; padding: 8px 14px;
}

.panel {
  position: fixed; z-index: 15; left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 28px));
  background: rgba(255, 250, 246, .95);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
  animation: rise .35s ease both;
}
.panel-close {
  position: absolute; right: 10px; top: 8px;
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; background: #ffe4ea; box-shadow: none;
  color: #8a4a56; font-size: 20px; line-height: 1;
}
.panel h3 { margin: 0 0 8px; font-size: 20px; }
.panel p { margin: 0 0 8px; line-height: 1.75; font-size: 14px; }
.panel .meta { color: var(--soft); font-size: 12px; margin-top: 8px; }

.book-pages {
  background: #fff; border-radius: 12px; padding: 14px 16px;
  border: 1px solid #f0ddd0; min-height: 120px; margin: 8px 0 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.book-nav { display: flex; gap: 8px; }
.book-nav button { flex: 1; background: linear-gradient(135deg, #ffd3dc, #ffe2b8); box-shadow: none; }

.letter {
  white-space: pre-wrap; line-height: 1.85; font-size: 14px;
  background: linear-gradient(180deg, #fff, #fff4e8);
  border-left: 3px solid var(--gold);
  padding: 12px 14px; border-radius: 0 12px 12px 0;
}

@media (max-width: 640px) {
  .card { padding: 22px 18px; }
  .hud { padding: 12px; }
}
