/* billiards-controls.css — Pyramid / Pool 8-Ball controls: SHOOT power ring, SKIP face, spin disc, decision panel. House dark glass (fg-* tokens). */

.bl-controls {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    color: #fff;
    font: 600 12px/1.3 var(--font-mono, monospace);
    letter-spacing: 0;
}
.bl-controls.fg-touch-hidden { display: none; }
.bl-controls [hidden] { display: none !important; }

/* SHOOT (X / J and its RT twin): the conic ring is the power meter while charging or pulling back */
.bl-charging .sgp-btn.bl-shoot {
    background: conic-gradient(#7c4dff var(--bl-charge, 0deg), rgba(17, 17, 17, 0.55) 0);
    box-shadow: 0 0 16px rgba(124, 77, 255, 0.5);
}
.bl-charge-pct {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font: 700 11px/1 var(--font-mono, monospace);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}
.bl-charging .bl-charge-pct { display: flex; }
.bl-charging .bl-shoot > .sgp-glyph, .bl-charging .bl-shoot > .sgp-kbd { visibility: hidden; }
/* SKIP ×4 stays pressable while balls roll: undo the pad's dimmed face */
.sgp-btn.bl-shoot.bl-skip { border-color: rgba(255, 214, 0, 0.6); }
.bl-skip.sgp-dim > .sgp-glyph, .bl-skip.sgp-dim > .sgp-kbd, .bl-skip.sgp-dim > .sgp-badge { opacity: 1; }

/* spin disc: centred above the right stick (the RB / RT row now sits above the faces); idle keeps its box so the table
   fit never moves between turns */
.bl-spin {
    position: absolute;
    z-index: 1;
    right: calc(var(--sgp-r) + var(--sgp-cluster) + var(--sgp-rs-gap) + (var(--sgp-rs) - 64px) / 2);
    bottom: calc(var(--sgp-bottom) + var(--sgp-rs) + 8px);
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: auto;
    touch-action: none;
}
/* desktop keycaps put the T F G H legend right above the right stick: clear it (a static class, so the box never moves) */
.sgp-desktop .bl-spin { bottom: calc(var(--sgp-bottom) + var(--sgp-rs) + 32px); }
/* a phone keyboard switches modality live, so the disc cannot move (the table fit would jump): its T F G H cross already
   names the keys, and the legend it would hide under goes */
@media (max-height: 450px) { .sgp:not(.sgp-desktop):has(> .bl-spin) .sgp-rs > .sgp-legend { display: none; } }
/* narrow portrait: the right stick is in the centre column under the top row, so the disc goes above that row */
@media (max-width: 520px) and (orientation: portrait) {
    .sgp .bl-spin {
        right: auto;
        left: calc(50% - 32px);
        bottom: calc(var(--sgp-bottom) + var(--sgp-cluster) + var(--sgp-cap) + var(--sgp-sh-h) + var(--sgp-cap) + 8px);
    }
}
.bl-spin.bl-idle { visibility: hidden; pointer-events: none; }
.bl-spin-disc {
    position: relative;
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: crosshair;
    touch-action: none;
}
.bl-spin-ball {
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 32%, #fff 0, #ece7da 42%, #b9b2a2 100%);
    pointer-events: none;
}
.bl-spin-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #ff1744;
    box-shadow: 0 0 0 1.5px rgba(17, 17, 17, 0.9), 0 0 6px rgba(255, 23, 68, 0.6);
    pointer-events: none;
}
.bl-spin-cap {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.88);
    font: 700 8px/10px var(--font-mono, monospace);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}

/* decision panel: top-centre under the HUD (JS sets top from the HUD's measured bottom) */
.bl-decide {
    position: absolute;
    left: 50%;
    top: calc(var(--fg-topbar-h, 44px) + 44px);
    transform: translateX(-50%);
    z-index: 2;
    width: max-content;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(17, 17, 17, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    /* only the buttons take input: a table tap behind the title or background still reaches the canvas (a penalty ball) */
    pointer-events: none;
}
.bl-decide-title {
    margin-bottom: 8px;
    color: #ffd600;
    font: 700 10px/1.2 var(--font-mono, monospace);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.bl-decide.bl-waiting { pointer-events: none; }
.bl-decide.bl-waiting .bl-decide-title { margin: 0; color: rgba(255, 255, 255, 0.75); }
.bl-decide-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bl-decide-opts:empty { display: none; }
.bl-decide button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font: 600 11px var(--font-mono, monospace);
    white-space: nowrap;
    cursor: pointer;
    touch-action: none;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}
.bl-decide button:disabled { opacity: 0.4; cursor: default; }
.bl-decide button:not(:disabled):active { background: rgba(124, 77, 255, 0.5); border-color: #9579ff; }
.bl-decide button:focus-visible { outline: 2px solid #9579ff; outline-offset: 2px; }
@media (max-width: 420px) {
    .bl-decide { padding: 8px; }
    .bl-decide button { min-height: 32px; padding: 0 10px; font-size: 10px; }
}
