/* =========================================================================
   Arrow Battle - arena overlay, HUD and touch controls.
   Loaded by the game page only; everything is prefixed with "ab-".
   ========================================================================= */

.ab-arena {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow: hidden;
    background: #9ad7f5;
    color-scheme: light;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    animation: ab-arena-in .3s ease-out;
}

.ab-arena:focus,
.ab-arena:focus-visible {
    outline: none;
}

@keyframes ab-arena-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

html.ab-playing,
html.ab-playing body {
    overflow: hidden;
    overscroll-behavior: none;
}

.ab-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.ab-input {
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

.ab-tags {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ------------------------------------------------------------ loading */

.ab-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: #10304a;
    font-weight: 800;
    font-size: 15px;
}

.ab-loading__spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .55);
    border-top-color: #ffffff;
    animation: ab-spin .8s linear infinite;
}

@keyframes ab-spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------ name tags */

.ab-tag {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.ab-tag__inner {
    display: grid;
    justify-items: center;
    gap: 2px;
    transform: translate(-50%, -100%);
}

.ab-tag__name {
    display: inline-block;
    padding: 1px 8px 2px;
    border-radius: 999px;
    background: rgba(16, 24, 38, .58);
    box-shadow: inset 0 -2px 0 var(--ab-tag-color, #fff);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.ab-tag--local .ab-tag__name {
    background: var(--ab-tag-color, #3d8bff);
    box-shadow: 0 2px 8px rgba(16, 24, 38, .25);
}

.ab-tag__hp {
    position: relative;
    display: block;
    width: 56px;
    height: 7px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(16, 24, 38, .55);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85);
}

.ab-tag__hp-fill {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    background: linear-gradient(180deg, #7ee06a, #3fbf3a);
    transition: transform .18s ease-out;
}

.ab-tag__hp-fill.is-low { background: linear-gradient(180deg, #ff8a7a, #e5484d); }

.ab-tag__hp-value {
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
    text-shadow: 0 1px 2px rgba(16, 24, 38, .7);
    font-variant-numeric: tabular-nums;
}

.ab-number {
    position: absolute;
    left: 0;
    top: 0;
    margin: -12px 0 0 -30px;
    width: 60px;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 2px 0 rgba(120, 20, 30, .6), 0 0 6px rgba(120, 20, 30, .45);
    will-change: transform, opacity;
    pointer-events: none;
}

.ab-number--strong { color: #ffe066; font-size: 22px; text-shadow: 0 2px 0 rgba(120, 60, 0, .7), 0 0 8px rgba(120, 60, 0, .5); }
.ab-number--self { color: #ff6b6b; text-shadow: 0 2px 0 rgba(60, 0, 0, .55); }
.ab-number--info { color: #9ef0a0; font-size: 20px; text-shadow: 0 2px 0 rgba(10, 70, 20, .6); }
.ab-number--heal { color: #ff8aa0; text-shadow: 0 2px 0 rgba(120, 10, 40, .6), 0 0 8px rgba(255, 60, 100, .5); }

/* ------------------------------------------------------------ radar */

.ab-radar {
    position: absolute;
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    width: 128px;
    height: 128px;
    border-radius: 50%;
    pointer-events: none;
    filter: drop-shadow(0 4px 14px rgba(10, 14, 22, .35));
}

/* ------------------------------------------------------------ HUD */

.ab-hud {
    position: absolute;
    inset: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) calc(env(safe-area-inset-right, 0px) + 12px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 12px);
    pointer-events: none;
    color: #172033;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.ab-hud__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ab-hud__spacer { flex: 1; }

.ab-hud__right {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.ab-hud__buttons {
    display: flex;
    gap: 8px;
}

.ab-hud__button {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    color: #172033;
    box-shadow: 0 4px 16px rgba(20, 44, 74, .18);
    cursor: pointer;
    pointer-events: auto;
    transition: transform .12s ease;
}

.ab-hud__button:active { transform: scale(.92); }
.ab-hud__button[hidden] { display: none; }

/* Tablet/laptop/desktop only - phones keep the radar as their only "who's out there" readout, the
   bottom-left corner stays free for the joystick and there is less room to spare. Both width and
   height have to clear the phone range, so a phone held sideways (wide but short) still stays out -
   width alone would let a big phone's landscape width sneak past a plain "min-width: 768px" check. */
.ab-hud__players {
    display: none;
    position: absolute;
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    gap: 3px;
    min-width: 150px;
    max-width: min(260px, 50vw);
    margin: 0;
    padding: 8px 12px;
    list-style: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 4px 16px rgba(20, 44, 74, .16);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    pointer-events: none;
}

@media (min-width: 768px) and (min-height: 600px) {
    .ab-hud__players { display: grid; }
}

.ab-hud__player {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.ab-hud__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ab-hud__hearts {
    flex: none;
    display: inline-flex;
    gap: 1px;
    font-size: 11px;
    line-height: 1;
}

.ab-heart { color: #ef3f55; }
.ab-heart.is-half { color: #f59aa6; }
.ab-heart.is-empty { color: rgba(23, 32, 51, .18); }
.ab-heart--skull { font-size: 12px; }

.ab-hud__kills {
    flex: none;
    min-width: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ab-hud__player--local .ab-hud__name { color: #0b5fd9; }
.ab-hud__player--out { opacity: .5; }
.ab-hud__player--out .ab-hud__name { text-decoration: line-through; }

.ab-hud__dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 0 0 3px rgba(23, 32, 51, .12);
}

.ab-hud__stats {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 4px 16px rgba(20, 44, 74, .16);
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ab-hud__stats[hidden] { display: none; }

.ab-stat { white-space: nowrap; }
.ab-stat + .ab-stat { padding-left: 8px; border-left: 1px solid rgba(23, 32, 51, .12); }
.ab-stat--time.is-urgent { color: #e5484d; }

.ab-hud__feed {
    display: grid;
    justify-items: end;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ab-feed__item {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(16, 24, 38, .6);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    animation: ab-feed-in .25s ease-out;
    transition: opacity .5s ease;
}

.ab-feed__item b { font-weight: 900; }
.ab-feed__item.is-leaving { opacity: 0; }
.ab-feed__icon { opacity: .8; }

@keyframes ab-feed-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}

/* Phones in landscape have little height - keep the top bar slim. */
@media (max-height: 520px) {
    .ab-hud__button {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .ab-hud__players {
        gap: 0;
        min-width: 128px;
        padding: 5px 10px;
        border-radius: 12px;
        font-size: 11.5px;
    }

    .ab-hud__dot {
        width: 8px;
        height: 8px;
    }

    .ab-hud__stats { font-size: 12px; padding: 4px 8px; }
}

.ab-hud__banner {
    position: absolute;
    left: 50%;
    top: 24%;
    transform: translateX(-50%);
    color: #fff;
    font-size: clamp(28px, 6vw, 46px);
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
    text-shadow: 0 3px 0 rgba(16, 32, 56, .22), 0 10px 28px rgba(16, 32, 56, .32);
    transition: opacity .3s ease;
}

.ab-hud__banner.is-in { animation: ab-banner-in .38s cubic-bezier(.2, 1.4, .4, 1); }
.ab-hud__banner.is-leaving { opacity: 0; }
.ab-hud__banner[hidden] { display: none; }
.ab-hud__banner--countdown { top: 30%; font-size: clamp(56px, 14vw, 110px); }
.ab-hud__banner--win { color: #ffe066; text-shadow: 0 3px 0 rgba(120, 70, 0, .45), 0 10px 28px rgba(120, 70, 0, .35); }
.ab-hud__banner--lose { color: #ffd6d6; }

@keyframes ab-banner-in {
    from { opacity: 0; transform: translateX(-50%) scale(.7); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.ab-hud__respawn {
    position: absolute;
    left: 50%;
    top: calc(24% + 58px);
    transform: translateX(-50%);
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(16, 24, 38, .62);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
}

.ab-hud__respawn[hidden] { display: none; }

.ab-hud__spectate {
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 32px);
    min-height: 44px;
    padding: 0 8px 0 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(16, 24, 38, .72);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.ab-hud__spectate:active { transform: translateX(-50%) scale(.96); }
.ab-hud__spectate[hidden] { display: none; }
.ab-hud__spectate-name { overflow: hidden; text-overflow: ellipsis; }

.ab-hud__spectate-next {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    font-size: 18px;
    line-height: 1;
}

.ab-hud__bottom {
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 24px);
}

.ab-hud__charge {
    position: relative;
    width: 180px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 24, 38, .45);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}

.ab-hud__charge i {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    background: linear-gradient(90deg, #ffffff, #ffd35a);
}

.ab-hud__charge.is-full i { background: linear-gradient(90deg, #ffd35a, #ff8c42); animation: ab-pulse .35s ease-in-out infinite alternate; }
.ab-hud__charge[hidden] { display: none; }

@keyframes ab-pulse {
    to { filter: brightness(1.25); }
}

.ab-hud__hint {
    max-width: calc(100vw - 32px);
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(16, 24, 38, .62);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .4s ease;
}

.ab-hud__hint.is-leaving { opacity: 0; }
.ab-hud__hint[hidden] { display: none; }

.ab-hud__actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ab-hud__actions[hidden] { display: none; }

.ab-slot,
.ab-dodge {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
    color: #172033;
    box-shadow: 0 4px 14px rgba(20, 44, 74, .18);
}

.ab-slot { cursor: pointer; pointer-events: auto; transition: transform .12s ease, box-shadow .12s ease; }
.ab-slot:active { transform: scale(.93); }
.ab-slot.is-selected { box-shadow: 0 0 0 3px #ffb321, 0 4px 14px rgba(20, 44, 74, .22); }
.ab-slot--heavy .ab-slot__icon { color: #39404d; }
.ab-slot--bounce .ab-slot__icon { color: #0fb89b; }

.ab-slot__icon,
.ab-dodge__icon {
    display: block;
    width: 28px;
    height: 28px;
}

.ab-slot__icon svg,
.ab-dodge__icon svg { display: block; width: 100%; height: 100%; }

.ab-slot__key,
.ab-dodge__key {
    position: absolute;
    right: 4px;
    bottom: 2px;
    font-size: 10px;
    font-weight: 900;
    opacity: .55;
}

.ab-dodge { width: 62px; }
.ab-dodge__key { left: 0; right: 0; text-align: center; }

.ab-slot__cooldown,
.ab-dodge__cooldown {
    position: absolute;
    inset: 0;
    transform: scaleY(0);
    transform-origin: bottom center;
    background: rgba(23, 32, 51, .45);
}

.ab-slot.is-cooling,
.ab-dodge.is-cooling { color: rgba(23, 32, 51, .45); }

@media (pointer: coarse) {
    .ab-hud__actions { display: none; }
}

/* ------------------------------------------------------------ results */

.ab-results {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(12, 24, 40, .35);
    pointer-events: auto;
    animation: ab-arena-in .3s ease-out;
}

.ab-results[hidden] { display: none; }

.ab-results__card {
    width: min(420px, 100%);
    max-height: 100%;
    overflow-y: auto;
    padding: 20px 20px 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(12, 24, 40, .35);
    text-align: center;
    animation: ab-results-in .45s cubic-bezier(.2, 1.3, .4, 1);
}

@keyframes ab-results-in {
    from { opacity: 0; transform: scale(.85) translateY(12px); }
    to { opacity: 1; transform: none; }
}

.ab-results__title { font-size: clamp(26px, 7vw, 34px); font-weight: 900; letter-spacing: -.02em; }
.ab-results__card--win .ab-results__title { color: #e59400; }
.ab-results__card--lose .ab-results__title { color: #e5484d; }
.ab-results__subtitle { margin-top: 2px; color: #5c6479; font-weight: 700; }

.ab-results__table {
    width: 100%;
    margin: 14px 0 6px;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.ab-results__table th {
    padding: 0 6px 6px;
    color: #8a91a5;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: right;
}

.ab-results__table td { padding: 7px 6px; border-top: 1px solid rgba(23, 32, 51, .08); text-align: right; font-weight: 700; }
.ab-results__table tr.is-local td { background: rgba(61, 139, 255, .08); }
.ab-results__rank { width: 28px; text-align: center !important; }
.ab-results__name { text-align: left !important; }
.ab-results__name .ab-hud__dot { margin-right: 8px; vertical-align: 1px; }
.ab-results__note { margin-top: 8px; color: #5c6479; font-size: 13px; font-weight: 600; }

.ab-results__actions { display: grid; gap: 8px; margin-top: 14px; }

.ab-results__button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: #eef0f7;
    color: #172033;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.ab-results__button--primary { background: linear-gradient(150deg, #2193ff, #21d4fd); color: #fff; }

.ab-hud__debug {
    position: absolute;
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .72);
    color: #0d2238;
    font: 600 11px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.ab-hud__debug[hidden] { display: none; }

/* ------------------------------------------------------------ touch joystick */

.ab-joystick {
    position: absolute;
    left: 0;
    top: 0;
    width: 112px;
    height: 112px;
    margin: -56px 0 0 -56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .75);
    background: rgba(255, 255, 255, .2);
    box-shadow: 0 6px 22px rgba(20, 44, 74, .16);
    pointer-events: none;
}

.ab-joystick[hidden] { display: none; }

.ab-joystick__knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 12px rgba(20, 44, 74, .28);
}

/* ------------------------------------------------------------ page (start screen, lobby) */

.ab-controls {
    display: grid;
    gap: var(--woop-space-2, 8px);
}

.ab-controls[data-mode="touch"] [data-input="keyboard"],
.ab-controls[data-mode="keyboard"] [data-input="touch"] {
    display: none;
}

.ab-controls__row {
    display: flex;
    align-items: center;
    gap: var(--woop-space-3, 12px);
    font-size: .92rem;
}

.ab-controls__keys {
    display: inline-flex;
    gap: 4px;
    flex: none;
    min-width: 132px;
}

.ab-key {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 7px;
    background: var(--woop-surface-2, #eef0f7);
    box-shadow: inset 0 -2px 0 var(--woop-border-strong, rgba(20, 22, 31, .16));
    font-size: .78rem;
    font-weight: 800;
}

.ab-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.ab-notice[hidden] { display: none; }

/* ------------------------------------------------------------------ bot match sheet */

.ab-difficulty { display: flex; width: 100%; }
.ab-difficulty button { flex: 1 1 0; }

/* .stack sets display:grid, which would otherwise beat the [hidden] attribute's default styling. */
[data-bots-fields][hidden],
[data-training-fields][hidden] { display: none; }

.ab-opponent { display: flex; width: 100%; }
.ab-opponent button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 0;
}

.ab-opponent__icon { font-size: 1.05em; line-height: 1; }

.ab-start__icon { font-size: 1.15em; line-height: 1; }

.ab-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: var(--woop-space-2, 8px);
}

.ab-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--woop-space-3, 12px) var(--woop-space-2, 8px);
    border: 2px solid transparent;
    border-radius: var(--woop-radius-md, 18px);
    background: var(--woop-surface-2);
    color: var(--woop-text-muted);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
}

.ab-mode-card:active { transform: scale(.96); }

.ab-mode-card.is-active {
    background: var(--woop-surface);
    border-color: var(--woop-brand-from);
    color: var(--woop-text);
    box-shadow: var(--woop-shadow-sm);
}

.ab-mode-card__icon { font-size: 1.6rem; line-height: 1; }
.ab-mode-card__label { font-size: .78rem; font-weight: 700; text-align: center; }

/** Guests see the exact same lobby settings as the host, just unable to touch them. */
.ab-settings--readonly { pointer-events: none; }

[data-lobby-teams] button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0 var(--woop-space-3, 12px);
}

.ab-team-flag { display: block; }

/* ------------------------------------------------------------------ touch controls (right thumb) */

.ab-touch {
    position: absolute;
    inset: 0;
    pointer-events: none;
    --ab-touch-right: calc(env(safe-area-inset-right, 0px) + 22px);
    --ab-touch-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.ab-touch[hidden] { display: none; }
.ab-touch-mode .ab-hud__actions { display: none; }

.ab-touch__fire,
.ab-touch__dodge,
.ab-touch__arrow {
    position: absolute;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: #172033;
    box-shadow: 0 6px 18px rgba(20, 44, 74, .24);
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* The fire button only marks the spot: touches fall through to the aim stick underneath. */
.ab-touch__fire {
    right: var(--ab-touch-right);
    bottom: var(--ab-touch-bottom);
    width: 88px;
    height: 88px;
    pointer-events: none;
    transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.ab-touch__fire.is-held {
    transform: scale(.92);
    background: rgba(255, 255, 255, .28);
    box-shadow: none;
}

.ab-touch__fire-icon { display: block; width: 42px; height: 42px; transition: opacity .12s ease; }
.ab-touch__fire-icon svg { display: block; width: 100%; height: 100%; }
.ab-touch__fire.is-held .ab-touch__fire-icon { opacity: 0; }

.ab-touch__ring {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: conic-gradient(#ff9a3d calc(var(--charge, 0) * 1turn), rgba(255, 255, 255, .35) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
    opacity: 0;
    transition: opacity .12s ease;
}

.ab-touch__fire.is-drawing .ab-touch__ring { opacity: 1; }
.ab-touch__fire.is-full .ab-touch__ring { background: #ff7a1a; animation: ab-pulse .35s ease-in-out infinite alternate; }

.ab-touch__dodge {
    right: calc(var(--ab-touch-right) + 88px + 16px);
    bottom: calc(var(--ab-touch-bottom) + 4px);
    width: 64px;
    height: 64px;
    overflow: hidden;
    pointer-events: auto;
}

.ab-touch__arrows {
    position: absolute;
    right: var(--ab-touch-right);
    bottom: calc(var(--ab-touch-bottom) + 88px + 16px);
    display: flex;
    gap: 10px;
    pointer-events: none;
}

.ab-touch__arrow {
    position: relative;
    width: 46px;
    height: 46px;
    overflow: hidden;
    pointer-events: auto;
}

.ab-touch__arrow.is-selected { box-shadow: 0 0 0 3px #ffb321, 0 6px 18px rgba(20, 44, 74, .24); }
.ab-touch__arrow--heavy .ab-touch__icon { color: #39404d; }
.ab-touch__arrow--bounce .ab-touch__icon { color: #0fb89b; }

.ab-touch__icon { display: block; width: 28px; height: 28px; }
.ab-touch__dodge .ab-touch__icon { width: 34px; height: 34px; }
.ab-touch__icon svg { display: block; width: 100%; height: 100%; }

.ab-touch__cooldown {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(rgba(23, 32, 51, .5) calc(var(--cooldown, 0) * 1turn), transparent 0);
}

.ab-touch__dodge.is-cooling,
.ab-touch__arrow.is-cooling { color: rgba(23, 32, 51, .4); }
.ab-touch__dodge.is-pressed,
.ab-touch__arrow.is-pressed { transform: scale(.9); }

.ab-joystick--aim { border-color: rgba(255, 190, 110, .9); background: rgba(255, 160, 70, .16); }
.ab-joystick--aim .ab-joystick__knob { background: rgba(255, 226, 190, .96); }

/* ------------------------------------------------------------------ network status (group matches) */

.ab-hud__status {
    position: absolute;
    left: 50%;
    top: calc(env(safe-area-inset-top, 0px) + 72px);
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(16, 24, 38, .7);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    animation: ab-status-pulse 1.6s ease-in-out infinite;
}

.ab-hud__status[hidden] { display: none; }

@keyframes ab-status-pulse {
    50% { opacity: .72; }
}

.ab-score {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--woop-surface-2, rgba(23, 32, 51, .06));
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .ab-hud__you { display: none; }
}

/* Touch layouts: the fire button shows the charge, and the control hint sits in the movement half. */
.ab-touch-mode .ab-hud__charge { display: none; }

.ab-touch-mode .ab-hud__hint {
    white-space: normal;
    border-radius: 16px;
    line-height: 1.35;
}

/* Exactly whenever the player list is hidden (see its own min-width/min-height check above) - from
   the tablet breakpoint up, the player list already owns that corner. */
@media (max-width: 767px), (max-height: 599px) {
    .ab-touch-mode .ab-hud__bottom {
        left: calc(env(safe-area-inset-left, 0px) + 16px);
        transform: none;
        justify-items: start;
        max-width: calc(50% - 24px);
    }
}
