/* Bottle Breaker: game-specific styles. Loaded after games.css. */

/* Stage sized so the whole 3:4 canvas fits in one desktop screen. */
.stage-wrap.bk-stage {
    max-width: min(560px, calc((100vh - 140px) * 0.75 + 28px));
    min-width: 0;
    margin-top: 18px;
}

@supports (height: 100svh) {
    .stage-wrap.bk-stage {
        max-width: min(560px, calc((100svh - 140px) * 0.75 + 28px));
    }
}

/* Phones: reclaim the page gutters so the stall is as wide as the screen allows. */
@media (max-width: 520px) {
    .stage-wrap.bk-stage {
        max-width: none;
        margin-left: -12px;
        margin-right: -12px;
        padding: 0;
    }
    .bk-stage .stage-frame { padding: 6px; border-radius: 14px; }
    .bk-stage .stage-overlay { inset: 6px; }
    .bk-stage .bk-hud { padding: 0 4px; }
}

#start-overlay.bk-overlay {
    background: radial-gradient(120% 80% at 50% 40%, rgba(13, 32, 27, 0.62), rgba(13, 32, 27, 0.86));
}

.bk-stage .stage-frame canvas {
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    background: #0b241d;
    cursor: grab;
}

.bk-stage .stage-frame canvas:active { cursor: grabbing; }

.bk-hud {
    flex-wrap: nowrap;
    gap: 8px;
}

.bk-hud .hud-stat { min-width: 0; flex: 1 1 0; }

.bk-hud .hud-actions { flex: 0 0 auto; }

.bk-balls-stat .v {
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    color: #b97f1f;
}

.bk-mute { min-width: 92px; }
.bk-mute[aria-pressed="true"] { opacity: 0.75; }

@media (max-width: 400px) {
    .bk-hud .hud-stat .k { font-size: 0.6rem; letter-spacing: 0.06em; }
    .bk-hud .hud-stat .v { font-size: 1rem; }
    .bk-mute { min-width: 0; padding: 7px 10px; font-size: 0.75rem; }
}

/* Overlays */
.bk-overlay {
    justify-content: safe center;
    gap: 10px;
    overflow-y: auto;
    padding: 18px 16px;
    animation: bk-fade 0.22s ease-out;
}

@keyframes bk-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.bk-goal {
    font-size: 0.85rem !important;
    color: #e8c15c !important;
    margin: 0;
}

.bk-goal:empty { display: none; }

.bk-result-score {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.4rem, 11vw, 3.4rem) !important;
    font-weight: 700;
    line-height: 1 !important;
    color: #fbf3e2 !important;
    font-variant-numeric: tabular-nums;
}

.bk-result-best {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem !important;
}

.bk-result-best.is-new { color: #e8c15c !important; }

.bk-result-stats { font-size: 0.85rem !important; }

.bk-earned {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    max-width: 34ch;
}

.bk-earned[hidden] { display: none; }

.bk-earned li {
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(232, 193, 92, 0.14);
    color: #f7e3ae;
}

.bk-earned li.is-skin { background: rgba(127, 211, 255, 0.16); color: #d5f0ff; }

.bk-skins {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 320px;
}

.bk-skin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(242, 237, 226, 0.25);
    background: rgba(242, 237, 226, 0.06);
    color: #f2ede2;
    cursor: pointer;
}

.bk-skin .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}

.bk-skin[aria-checked="true"] {
    border-color: #e8c15c;
    background: rgba(232, 193, 92, 0.18);
}

.bk-skin:disabled { cursor: default; opacity: 0.45; }
.bk-skin:focus-visible { outline: 2px solid #f7f3e8; outline-offset: 2px; }

@media (max-height: 640px), (max-width: 380px) {
    .bk-overlay p { font-size: 0.85rem; }
    .bk-overlay .overlay-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bk-overlay { animation: none; }
}

/* Ball swatches show the generated ball art once it has loaded */
.bk-skin .dot.is-art { width: 16px; height: 16px; border: 0; }
