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

html, body {
    height: 100%;
    background: #0a0f1a;
    color: #e6e9f0;
    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(210,222,240,.5);
}
#hud button {
    background: rgba(20,28,44,.35);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(235,240,250,.85);
    border-radius: 8px;
    width: 34px; height: 34px;
    cursor: pointer;
    margin-left: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s;
    backdrop-filter: blur(3px);
}
#hud button:hover { background: rgba(40,52,76,.55); }

/* ---------- status + hint ---------- */
#status {
    position: absolute; left: 0; right: 0; bottom: 18px;
    text-align: center;
    font-size: 12.5px; letter-spacing: .05em;
    color: rgba(215,226,244,.6);
    pointer-events: none;
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
#hint {
    position: absolute; left: 0; right: 0; bottom: 44px;
    text-align: center; font-size: 13px;
    color: rgba(235,242,255,.92);
    opacity: 0; transition: opacity .35s;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
#hint.show { opacity: 1; }

/* ---------- overlays ---------- */
.overlay {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(6,10,18,.66);
    backdrop-filter: blur(4px);
    z-index: 10;
}
.overlay.open { display: flex; }
.card {
    width: min(320px, 88vw);
    max-height: 86vh;
    overflow-y: auto;
    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: 10px; }
.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; }
.card .row button { flex: 1; }

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: #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); }

.optRow { display: flex; gap: 6px; flex-wrap: wrap; }
.opt {
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(150,175,215,.18);
    border-radius: 9px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(215,228,248,.85);
    font-family: inherit;
    transition: border-color .15s, background .15s;
}
.opt:hover { background: rgba(255,255,255,.10); }
.opt.sel { border-color: #5d93e8; background: rgba(80,130,220,.18); }

.customRow { display: flex; gap: 10px; align-items: center; }
#sailIn {
    width: 60px; text-align: center;
    font-size: 21px;
    padding: 6px 4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(150,175,215,.22);
    border-radius: 10px;
    color: inherit;
}
.customRow .note { font-size: 11.5px; color: rgba(180,198,225,.5); }

/* ---------- SVG ---------- */
.star { fill: #cfe0ff; }
#chimeG { cursor: pointer; }
#skyDay, #skyNight, #sun, #sunHalo, #nightBits { transition: opacity 1.4s ease; }
.tube { transform-box: fill-box; transform-origin: top center; }
