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

html, body {
    height: 100%;
    background: #0b111d;
    color: #dfe8f5;
    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(200,215,240,.55);
}
#hud button {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(220,232,250,.8);
    border-radius: 8px;
    width: 34px; height: 34px;
    cursor: pointer;
    margin-left: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s;
}
#hud button:hover { background: rgba(255,255,255,.14); }

/* ---------- status + hint ---------- */
#status {
    position: absolute; left: 0; right: 0; bottom: 18px;
    text-align: center;
    font-size: 12.5px; letter-spacing: .05em;
    color: rgba(190,205,230,.62);
    pointer-events: none;
    transition: opacity .5s;
}
#hint {
    position: absolute; left: 0; right: 0; bottom: 44px;
    text-align: center;
    font-size: 13px;
    color: rgba(170,195,235,.9);
    opacity: 0;
    transition: opacity .35s;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
#hint.show { opacity: 1; }

/* ---------- overlays ---------- */
.overlay {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(6,10,18,.72);
    backdrop-filter: blur(4px);
    z-index: 10;
}
.overlay.open { display: flex; }
.card {
    width: min(320px, 88vw);
    background: #141d2e;
    border: 1px solid rgba(140,170,220,.18);
    border-radius: 16px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.card h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.card .sub { font-size: 12.5px; color: rgba(180,198,225,.6); margin-bottom: 14px; }
.card .lbl { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(170,190,220,.55); margin: 14px 0 6px; }
.card .row { display: flex; gap: 10px; margin-top: 16px; }

button.primary, button.ghost {
    flex: 1; padding: 10px 0;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
button.primary { background: #2f62b8; color: #eaf1fd; }
button.primary:hover { background: #3a70cc; }
button.ghost { background: transparent; color: rgba(200,214,238,.75); border-color: rgba(150,175,215,.25); }
button.ghost:hover { background: rgba(255,255,255,.06); }

/* ---------- design grid ---------- */
#designGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.dchip {
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(150,175,215,.18);
    border-radius: 12px;
    padding: 10px 4px 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
    color: rgba(215,228,248,.85);
    font-family: inherit;
}
.dchip:hover { background: rgba(255,255,255,.10); }
.dchip.sel { border-color: #5d93e8; background: rgba(80,130,220,.16); }
.dchip .glyph { font-size: 22px; display: block; margin-bottom: 3px; }
.dchip .nm { font-size: 10.5px; letter-spacing: .04em; }

.customRow { display: flex; gap: 8px; align-items: center; }
#emojiIn {
    width: 64px; text-align: center;
    font-size: 22px;
    padding: 7px 4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(150,175,215,.22);
    border-radius: 10px;
    color: inherit;
}
#swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw {
    width: 26px; height: 26px; border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}
.sw.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(120,170,255,.5); }

/* ---------- SVG animation classes ---------- */
.star { fill: #cfe0ff; }
#charmG { cursor: pointer; }
.blinking #eyeballWrap {
    animation: blink .22s ease-in-out;
}
#eyeballWrap {
    transform-box: fill-box;
    transform-origin: center;
}
@keyframes blink {
    0%, 100% { transform: scaleY(1); }
    45%, 60% { transform: scaleY(.06); }
}
#pulse.go {
    animation: pulseOut .8s ease-out forwards;
}
@keyframes pulseOut {
    0%   { opacity: .85; transform: scale(.55); stroke-width: 4; }
    100% { opacity: 0;   transform: scale(1.9); stroke-width: .5; }
}
#halo.dim { transition: opacity 1s; }
#pulse { transform-box: fill-box; transform-origin: center; }
