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

html, body {
    height: 100%;
    background: #0a0e18;
    color: #e8e2d4;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

#stage { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#fx { position: absolute; pointer-events: none; }

/* ---------- HUD ---------- */
#hud {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    pointer-events: none;
}
#hud > * { pointer-events: auto; }
#title {
    font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
    color: rgba(230,215,180,.5);
}
#hud button {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(235,225,200,.8);
    border-radius: 8px;
    width: 34px; height: 34px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s;
}
#hud button:hover { background: rgba(255,255,255,.14); }

/* ---------- status / hint / peek ---------- */
#status {
    position: absolute; left: 0; right: 0; bottom: 18px;
    text-align: center;
    font-size: 12.5px; letter-spacing: .05em;
    color: rgba(225,210,175,.6);
    pointer-events: none;
    transition: opacity .5s;
}
#hint {
    position: absolute; left: 0; right: 0; bottom: 44px;
    text-align: center; font-size: 13px;
    color: rgba(255,220,160,.9);
    opacity: 0; transition: opacity .35s;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
#hint.show { opacity: 1; }
#peek {
    position: absolute; left: 50%; bottom: 96px;
    transform: translateX(-50%) translateY(8px);
    max-width: 260px;
    background: rgba(20,26,40,.92);
    border: 1px solid rgba(255,200,120,.25);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px; line-height: 1.45;
    color: #f3e6c8;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    text-align: center;
}
#peek.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#peek .w { font-style: italic; }
#peek .d { display:block; margin-top:3px; font-size:11px; color:rgba(220,200,160,.55); }

/* ---------- CTA ---------- */
#cta {
    position: absolute; left: 50%; bottom: 60px;
    transform: translateX(-50%);
    z-index: 5;
    min-width: 170px;
}

/* ---------- buttons ---------- */
button.primary, button.ghost {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
}
button.primary { background: #c96a2a; color: #fff3df; box-shadow: 0 4px 18px rgba(220,120,40,.35); }
button.primary:hover { background: #db7a34; }
button.ghost { background: transparent; color: rgba(230,215,190,.75); border-color: rgba(220,190,140,.25); }
button.ghost:hover { background: rgba(255,255,255,.06); }

/* ---------- overlays ---------- */
.overlay {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(5,8,14,.72);
    backdrop-filter: blur(4px);
    z-index: 10;
}
.overlay.open { display: flex; }
.card {
    width: min(320px, 88vw);
    background: #171e30;
    border: 1px solid rgba(230,190,120,.18);
    border-radius: 16px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.card h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.card .sub { font-size: 12.5px; color: rgba(225,205,170,.6); margin-bottom: 14px; }
.card .priv { font-size: 11px; color: rgba(220,200,165,.45); margin-top: 12px; text-align: center; }
.card .row { display: flex; gap: 10px; margin-top: 16px; }
.card .row button { flex: 1; }
.card.paper { text-align: center; }
.card .seal { font-size: 30px; margin-bottom: 6px; }
#wishText {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(230,190,120,.22);
    border-radius: 10px;
    color: inherit;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
}
#wishText:focus { outline: none; border-color: rgba(255,190,110,.5); }

/* ---------- SVG ---------- */
.star { fill: #cfe0ff; }
#lanternG { cursor: pointer; }
#lamp, #tassel { transform-box: fill-box; transform-origin: top center; }
#lamp.breathe { animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.015); }
}
#tassel { animation: tasselSw 4.2s ease-in-out infinite; }
@keyframes tasselSw {
    0%, 100% { transform: rotate(-2.4deg); }
    50% { transform: rotate(2.4deg); }
}
#lanternG.lit #paperBody { fill: url(#paperLit); }
#lanternG.lit #ribs { stroke: rgba(120,60,10,.4); }
