/* Blast Vault — Simple Board Games
   Direction: a bank security vault seen from above — cold steel
   floor plates, bronze deposit cells, gunmetal pillars and hot
   orange detonation fire. The site chrome around it stays whatever
   styles.css decides. */
:root {
    --bv-bg: #0b1016;
    --bv-panel: #121a23;
    --bv-surface: #18232e;
    --bv-line: #26333f;
    --bv-text: #eaf1f6;
    --bv-muted: #93a4b2;
    --bv-fire: #ff8c42;
    --bv-fire-deep: #9c3d0a;
    --bv-amber: #ffb545;
    --bv-teal: #3ec7b6;
    --bv-teal-deep: #14554e;
    --bv-danger: #ff5d5d;
    --bv-steel: #8494a2;
    --bv-display: 'Arial Black', 'Helvetica Neue', Impact, system-ui, sans-serif;
    --bv-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Scoped reset — no `*` rule, it would reach the whole document. */
body,
button,
input {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bv-bg);
    color: var(--bv-text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.bv-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px;
    text-align: center;
}

.bv-container .hidden {
    display: none !important;
}

.bv-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Header --------------------------------------------------------- */

.bv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bv-line);
}

.bv-back {
    color: var(--bv-teal);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 4px;
}

.bv-back:hover {
    color: var(--bv-fire);
}

.bv-title {
    margin: 0;
    font-family: var(--bv-display);
    font-size: clamp(1.3rem, 5vw, 1.9rem);
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--bv-amber);
    text-shadow: 0 2px 0 var(--bv-fire-deep), 0 0 26px rgba(255, 140, 66, 0.3);
}

.bv-header-actions {
    display: flex;
    gap: 6px;
}

.bv-icon-btn {
    background: linear-gradient(180deg, #1d2833, #101820);
    border: 1px solid var(--bv-line);
    color: var(--bv-text);
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 10px;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.bv-icon-btn:active {
    transform: scale(0.94);
}

/* --- HUD ------------------------------------------------------------- */

.bv-hud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bv-chip {
    background: linear-gradient(180deg, #1b2733, #101821);
    border: 1px solid var(--bv-line);
    border-radius: 10px;
    padding: 5px 12px;
    min-width: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.bv-chip-label {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    color: var(--bv-muted);
    font-weight: 700;
}

.bv-chip-value {
    font-family: var(--bv-mono);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--bv-text);
}

.bv-chip-power {
    min-width: 132px;
}

.bv-chip-power .bv-chip-value {
    color: var(--bv-teal);
    font-size: 0.86rem;
}

.bv-chip-shield .bv-chip-value {
    color: #59c2ff;
}

#hudTime.is-warn {
    color: var(--bv-danger);
    animation: bv-blink 1s steps(2, start) infinite;
}

@keyframes bv-blink {
    50% { opacity: 0.35; }
}

/* --- Stage ----------------------------------------------------------- */

.bv-stage {
    position: relative;
    width: 100%;
    max-width: 416px;
    margin: 0 auto 14px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--bv-line);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    background: #0a0f14;
}

#blastVaultCanvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

/* --- Touch controls -------------------------------------------------- */

.bv-touch {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 416px;
    margin: 0 auto 14px;
    user-select: none;
}

.bv-dpad {
    display: grid;
    grid-template-columns: repeat(3, 58px);
    grid-template-rows: repeat(3, 52px);
    gap: 5px;
}

.bv-dir {
    background: linear-gradient(180deg, #22303d, #131c25);
    border: 1px solid var(--bv-line);
    color: var(--bv-text);
    border-radius: 12px;
    font-size: 1.15rem;
    cursor: pointer;
    touch-action: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.bv-dir:active {
    background: linear-gradient(180deg, var(--bv-teal-deep), #0e3d37);
    transform: scale(0.95);
}

.bv-dir-up { grid-area: 1 / 2; }
.bv-dir-left { grid-area: 2 / 1; }
.bv-dir-right { grid-area: 2 / 3; }
.bv-dir-down { grid-area: 3 / 2; }

.bv-bomb {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 3px solid rgba(255, 181, 69, 0.55);
    background: radial-gradient(circle at 34% 30%, var(--bv-amber), var(--bv-fire) 46%, var(--bv-fire-deep));
    color: #1a0d04;
    font-family: var(--bv-display);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    cursor: pointer;
    touch-action: none;
    box-shadow: 0 8px 22px rgba(255, 100, 30, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.bv-bomb:active {
    transform: scale(0.93);
}

@media (max-width: 820px), (pointer: coarse) {
    .bv-touch {
        display: flex;
    }
}

@media (max-width: 400px) {
    .bv-dpad {
        grid-template-columns: repeat(3, 50px);
        grid-template-rows: repeat(3, 46px);
    }

    .bv-bomb {
        width: 88px;
        height: 88px;
        font-size: 0.95rem;
    }
}

/* --- Overlays and panels ---------------------------------------------- */

.bv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 14, 0.82);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 40;
}

.bv-panel {
    background: linear-gradient(180deg, var(--bv-panel), #0d141b);
    border: 1px solid var(--bv-line);
    border-radius: 18px;
    padding: 24px 22px;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.bv-kicker {
    margin: 0 0 6px;
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    font-weight: 700;
    color: var(--bv-fire);
    text-transform: uppercase;
}

.bv-panel-title {
    margin: 0 0 8px;
    font-family: var(--bv-display);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bv-amber);
}

.bv-tagline {
    margin: 0 0 16px;
    color: var(--bv-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.bv-label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bv-muted);
    font-weight: 700;
}

.bv-name-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 14px;
    text-align: left;
}

.bv-input {
    background: #0c131a;
    border: 1px solid var(--bv-line);
    border-radius: 10px;
    color: var(--bv-text);
    font-size: 1rem;
    padding: 10px 12px;
    outline: none;
}

.bv-input:focus {
    border-color: var(--bv-teal);
}

.bv-diff-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: center;
    margin-bottom: 16px;
}

.bv-diff-btns {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: center;
}

.bv-diff-btn {
    background: #14202b;
    border: 1px solid var(--bv-line);
    color: var(--bv-muted);
    border-radius: 10px;
    padding: 9px 15px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.bv-diff-btn.is-active {
    background: linear-gradient(180deg, var(--bv-teal), var(--bv-teal-deep));
    border-color: var(--bv-teal);
    color: #04211d;
}

.bv-btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 9px;
}

.bv-btn-primary {
    background: linear-gradient(180deg, var(--bv-amber), var(--bv-fire));
    color: #1c0d03;
    box-shadow: 0 8px 20px rgba(255, 120, 40, 0.32);
}

.bv-btn-primary:active {
    transform: scale(0.98);
}

.bv-btn-ghost {
    background: transparent;
    border: 1px solid var(--bv-line);
    color: var(--bv-text);
}

.bv-controls-hint {
    margin-top: 10px;
    border-top: 1px solid var(--bv-line);
    padding-top: 12px;
}

.bv-controls-hint p {
    margin: 0 0 7px;
    font-size: 0.84rem;
    color: var(--bv-muted);
    line-height: 1.5;
}

.bv-over-reason {
    margin: 0 0 14px;
    color: var(--bv-danger);
    font-weight: 600;
}

.bv-results {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bv-result {
    background: #101a23;
    border: 1px solid var(--bv-line);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 86px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bv-result-label {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    color: var(--bv-muted);
    font-weight: 700;
}

.bv-result-value {
    font-family: var(--bv-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bv-amber);
}

/* --- Own guide / tips section ----------------------------------------- */

.game-extras {
    max-width: 720px;
    margin: 26px auto 8px;
    padding: 0 12px;
    text-align: left;
}

.game-extras h2 {
    font-family: var(--bv-display);
    color: var(--bv-amber);
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    margin: 0 0 14px;
}

.game-extras h3 {
    color: var(--bv-teal);
    font-size: 1.02rem;
    margin: 0 0 6px;
}

.bv-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.bv-tips-card {
    background: linear-gradient(180deg, var(--bv-surface), #0f1720);
    border: 1px solid var(--bv-line);
    border-radius: 14px;
    padding: 14px 16px;
}

.bv-tips-card p {
    margin: 0;
    color: var(--bv-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.game-extras > p {
    color: var(--bv-muted);
    line-height: 1.65;
    font-size: 0.92rem;
}
