/* ============================================
   Accessible controls: buttons that replaced clickable spans, divs and headings.
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Heading text that is also a control: looks like the heading, acts as a button. */
.heading-button,
.card-toggle {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    text-shadow: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.card-toggle {
    width: 100%;
}

/* Default focus indicator: white ring against the control, dark ring against the page, so it
   reads on the light modals, the purple page and the dark Net Grid panels alike (3:1 or more on each).
   :where() keeps specificity at zero: component rules with their own indicator still win. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 0;
    box-shadow: 0 0 0 6px #1b1b1b;
}

/* The form rules above remove the outline on :focus, which would also hide this indicator. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 0;
    box-shadow: 0 0 0 6px #1b1b1b;
}

/* Touch targets of at least 44 x 44 px on phones (WCAG 2.5.8 asks 24, 2.5.5 recommends 44). */
@media (max-width: 640px) {
    button {
        min-height: 44px;
    }

    .close,
    .btn-remove-player {
        min-width: 44px;
        min-height: 44px;
    }

    .close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Language switch (IT / EN): top of the home, 44px touch targets */
.lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

.lang-switch button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 2px solid #ffffff;
    border-radius: 22px;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
    background: #ffffff;
    color: #333366;
}

.lang-switch button:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
}
