/* Twilight over a shrine: violet and rose rather than the site's navy, because
   this one is a Japanese shooter and its whole look is the point. */
:root {
    --bg: #150e1f;
    --panel: #221730;
    --line: #3a2a4c;
    --ink: #f6eef7;
    --muted: #a793b8;
    --rose: #ff6b9d;
    --gold: #ffcf6b;
    --violet: #b06bff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
    background: var(--bg); color: var(--ink);
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic',
                 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    user-select: none; -webkit-user-select: none;
}

.shell {
    display: flex; flex-direction: column; height: 100%;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; }
.toolbar-spacer { flex: 1; }
.icon-btn {
    min-width: 40px; height: 38px; padding: 0 10px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.08);
    color: var(--ink); font-size: 17px; text-decoration: none; cursor: pointer;
    font-family: inherit;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.16); }
.icon-btn-text { font-size: 13px; font-weight: 700; }

.hud { display: flex; justify-content: space-around; gap: 6px; padding: 4px 12px 6px; }
.hud span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.hud b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.hud i { font-size: 10px; font-style: normal; color: var(--muted); letter-spacing: 0.1em; }
#livesValue { color: var(--rose); }
#bombValue { color: var(--gold); }

.stage {
    flex: 1; min-height: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 0 8px 8px;
}
#field {
    display: block; touch-action: none;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 50px rgba(0, 0, 0, 0.5);
}

/* One button, bottom right, where a thumb already is. */
.pad { position: absolute; right: 16px; bottom: 18px; pointer-events: none; }
.pad-btn {
    pointer-events: auto;
    width: 62px; height: 62px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    border: 1px solid rgba(255, 207, 107, 0.5);
    background: rgba(60, 40, 20, 0.55); backdrop-filter: blur(3px);
    color: var(--gold); font: inherit; font-size: 10px; cursor: pointer;
}
.pad-btn i { font-size: 20px; font-style: normal; }
.pad-btn:active { background: rgba(255, 207, 107, 0.28); }
.pad-btn[disabled] { opacity: 0.3; }

.overlay {
    position: fixed; inset: 0; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(12, 8, 18, 0.9); backdrop-filter: blur(6px); z-index: 20;
}
.overlay.is-open { display: flex; }
.panel {
    width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
    padding: 24px 22px; border-radius: 20px; text-align: center;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(176, 107, 255, 0.22), transparent 62%),
        var(--panel);
    border: 1px solid var(--line);
}
.kicker {
    margin: 0 0 4px; font-size: 11px; letter-spacing: 0.34em; color: var(--violet);
}
.title {
    margin: 0 0 10px; font-size: 38px; font-weight: 800; letter-spacing: 0.14em;
    background: linear-gradient(180deg, #fff2f7, var(--rose));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.panel-title { margin: 0 0 6px; font-size: 25px; font-weight: 800; }
.panel-note { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.subtitle { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

.legend { text-align: left; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.legend h3 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0.14em; }
.legend-row { display: flex; gap: 12px; margin-bottom: 9px; font-size: 13px; line-height: 1.55; }
.legend-row b { flex: 0 0 22px; color: var(--rose); font-size: 15px; text-align: center; }
.legend-row span { color: var(--muted); }

.result { display: flex; justify-content: center; gap: 20px; margin: 4px 0 18px; flex-wrap: wrap; }
.result div { display: flex; flex-direction: column; gap: 3px; }
.result b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result i { font-size: 10px; font-style: normal; color: var(--muted); letter-spacing: 0.1em; }

.btn {
    display: block; width: 100%; margin-top: 9px; padding: 14px;
    border: 0; border-radius: 13px; font: inherit; font-size: 15px; font-weight: 700;
    letter-spacing: 0.1em; cursor: pointer;
}
.btn-primary { background: linear-gradient(180deg, var(--rose), #e0417d); color: #2a0a19; }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--ink); }

@media (max-height: 620px) {
    .hud { padding: 0 12px 4px; }
    .hud b { font-size: 15px; }
    .toolbar { padding: 4px 10px 2px; }
}
