/* ==========================================================================
   Squadaroa
   Global Application Styles
   ========================================================================== */


@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/vendor/inter/InterVariable.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/vendor/inter/InterVariable-Italic.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */

:root {
    --theme-primary: #000000;
    --theme-primary-hover: #242424;
    --theme-on-primary: #ffffff;
    --theme-accent: #d8282c;

    --color-canvas: #f5f5f5;
    --color-surface: #ffffff;
    --color-surface-muted: #fafafa;
    --color-text: #171717;
    --color-text-muted: #686868;
    --color-border: #dedede;
    --color-border-strong: #b8b8b8;
    --color-focus: #262626;

    --color-primary: var(--theme-primary);
    --color-primary-hover: var(--theme-primary-hover);
    --color-primary-soft: #f1f1f1;
    --color-accent: var(--theme-accent);
    --color-accent-soft: #fff1f1;

    --color-bg: var(--color-canvas);

    --color-neutral: #525252;
    --color-neutral-soft: #f5f5f5;
    --color-neutral-border: #d4d4d4;

    --color-danger: #b42318;
    --color-danger-soft: #fef2f2;
    --color-danger-border: #fecaca;

    --color-warning: #92400e;
    --color-warning-soft: #fffbeb;
    --color-warning-border: #fde68a;

    --color-success: #166534;
    --color-success-soft: #f0fdf4;
    --color-success-border: #bbf7d0;

    --color-info: #1d4ed8;
    --color-info-soft: #eff6ff;
    --color-info-border: #bfdbfe;

    --color-on-primary-muted: rgba(255, 255, 255, 0.72);
    --color-on-primary-border: rgba(255, 255, 255, 0.45);
    --color-on-primary-hover: rgba(255, 255, 255, 0.1);
    --color-focus-ring: rgba(0, 0, 0, 0.28);
    --color-focus-ring-soft: rgba(0, 0, 0, 0.18);

    --shadow-sm: none;

    --shadow-md:
        0 12px 36px rgba(0, 0, 0, 0.14);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 16px;

    --content-width: 1280px;
}


/* --------------------------------------------------------------------------
   Reset / Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-bg);
}

body {
    min-height: 100vh;
    margin: 0;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.5;

    color: var(--color-text);
    background: var(--color-bg);

    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* --------------------------------------------------------------------------
   Application Shell
   -------------------------------------------------------------------------- */

/* The second navigation level belongs to the dark application header. */
.section-nav {
    color: var(--theme-on-primary);
    background: var(--theme-primary-hover);
    border-top: 1px solid #353535;
}
.section-nav__inner {
    display: flex;
    gap: 4px;
    width: min(calc(100% - 64px), var(--content-width));
    margin-inline: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #686868 transparent;
}
.section-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 12px;
    flex: 0 0 auto;
    color: #cfcfcf;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.section-nav a:hover,
.section-nav a[aria-current="page"] {
    color: var(--theme-on-primary);
    text-decoration: none;
}
.section-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 3px;
    left: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-accent);
}
.section-nav a:focus-visible {
    outline: 2px solid var(--theme-on-primary);
    outline-offset: -3px;
}
@media (max-width: 959px) {
    .section-nav__inner {
        width: calc(100% - 32px);
    }
}
.destination-list { display: grid; }
.destination-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 12px 16px;
    color: var(--color-text);
    text-decoration: none;
}
.destination-list a + a { border-top: 1px solid var(--color-border); }

.app-shell {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(255, 255, 255, 0.96);

    border-bottom:
        1px solid var(--color-border);

    box-shadow: var(--shadow-sm);

    backdrop-filter: blur(12px);
}

.app-header__inner {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    min-height: 70px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 32px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    flex-shrink: 0;

    color: var(--color-text);

    font-size: 19px;
    font-weight: 800;

    letter-spacing: -0.02em;
}

.app-brand:hover {
    text-decoration: none;
}

.app-brand__mark {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: var(--color-primary);
    color: #fff;

    font-size: 20px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 5px;

    flex: 1;
}

.app-nav__link {
    display: inline-flex;
    align-items: center;

    padding: 9px 12px;

    border-radius: var(--radius-sm);

    color: var(--color-text-muted);

    font-size: 14px;
    font-weight: 650;
}

.app-nav__link:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);

    text-decoration: none;
}

.app-nav__link--active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.app-header__account {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
}

.app-header__user {
    max-width: 220px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--color-text-muted);

    font-size: 13px;
}


/* --------------------------------------------------------------------------
   Event Navigation
   -------------------------------------------------------------------------- */

.event-nav {
    background: #fff;

    border-bottom:
        1px solid var(--color-border);
}

.event-nav__inner {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    margin: 0 auto;

    min-height: 54px;

    display: flex;
    align-items: center;
    gap: 8px;

    overflow-x: auto;
}

.event-nav__title {
    margin-right: 10px;

    color: var(--color-text);

    font-size: 14px;
    font-weight: 750;

    white-space: nowrap;
}

.event-nav__link {
    padding: 7px 10px;

    border-radius: 7px;

    color: var(--color-text-muted);

    font-size: 13px;
    font-weight: 650;

    white-space: nowrap;
}

.event-nav__link:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);

    text-decoration: none;
}

.event-nav__link--active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}


/* --------------------------------------------------------------------------
   Main
   -------------------------------------------------------------------------- */

.app-main {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    margin: 0 auto;

    padding: 38px 0 64px;

    flex: 1;
}

.app-footer {
    padding: 0 16px;

    border-top:
        1px solid var(--color-border);

    color: var(--color-text-muted);

    background: #fff;

    text-align: center;
    font-size: 13px;
}

.app-footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 24px;
    margin-top: 0;
}

.app-footer__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}


/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3 {
    color: var(--color-text);

    line-height: 1.2;

    letter-spacing: -0.025em;
}

h1 {
    margin: 0 0 8px;

    font-size: clamp(
        28px,
        4vw,
        38px
    );
}

h2 {
    margin: 0 0 18px;

    font-size: 21px;
}

.planning-content h2,
.games-page h2,
.tournaments-page h2 {
    margin: 0 0 16px;
    font-size: 1.12rem;
}

h3 {
    margin: 0 0 12px;

    font-size: 17px;
}

p {
    margin-top: 0;
}

.text-muted {
    color: var(--color-text-muted);
}

.page-header {
    margin-bottom: 28px;
}

.page-header__eyebrow {
    margin-bottom: 5px;

    color: var(--color-primary);

    font-size: 13px;
    font-weight: 750;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.page-header__subtitle {
    max-width: 760px;

    margin: 0;

    color: var(--color-text-muted);

    font-size: 16px;
}


/* --------------------------------------------------------------------------
   Cards / Sections
   -------------------------------------------------------------------------- */

.card {
    padding: 24px;

    border:
        1px solid var(--color-border);

    border-radius: var(--radius-lg);

    background: var(--color-surface);

    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 20px;
}

/* A real stretched link makes the complete card operable, including without JS. */
.linked-card { position: relative; isolation: isolate; cursor: pointer; }
.linked-card:hover { border-color: var(--color-border-strong); background: var(--color-surface-muted); }
.linked-card__open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.linked-card:has(.linked-card__open:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.linked-card .planning-item__tournament,
.linked-card .dashboard-response__actions { position: relative; z-index: 2; }
.badge.game-outcome { max-width: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }

/* Club colors identify an opponent; they never replace semantic or action colors. */
.club-color-accent {
    position: relative;
    overflow: hidden;
}

.club-color-accent::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: linear-gradient(to bottom, var(--club-primary) 0 50%, var(--club-secondary) 50% 100%);
    box-shadow: inset -1px 0 rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.club-color-mark {
    width: 8px;
    height: 32px;
    flex: 0 0 8px;
    display: inline-block;
    border-radius: 999px;
    background: linear-gradient(to bottom, var(--club-primary) 0 50%, var(--club-secondary) 50% 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.club-color-mark--tiny {
    width: 7px;
    height: 20px;
    flex-basis: 7px;
}

.club-color-mark--list {
    width: 8px;
    height: 32px;
    flex-basis: 8px;
}

.club-color-mark--heading {
    width: 10px;
    height: 42px;
    flex-basis: 10px;
}

.club-color-mark--preview {
    width: 12px;
    height: 38px;
    flex-basis: 12px;
}

.club-color-preview {
    min-height: 58px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-muted);
}

.club-color-preview[hidden] {
    display: none;
}

.club-color-preview strong,
.club-color-preview small {
    display: block;
}

.club-color-preview small {
    margin-top: 2px;
    color: var(--color-text-muted);
    font-size: 12px;
}

.club-color-identity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card__header {
    margin-bottom: 20px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.card__title {
    margin: 0;
}

.card__subtitle {
    margin: 5px 0 0;

    color: var(--color-text-muted);

    font-size: 14px;
}

.confirmation-panel {
    max-width: 760px;
    margin-bottom: 24px;
    padding: 20px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    scroll-margin-top: 160px;
}

.confirmation-panel--inline {
    max-width: none;
    margin: 16px 0 0;
    border-radius: var(--radius-sm);
}

.confirmation-panel__icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.confirmation-panel__icon .ui-icon {
    width: 21px;
    height: 21px;
}

.confirmation-panel h2,
.confirmation-panel h3,
.confirmation-panel p {
    margin: 0;
}

.confirmation-panel p {
    margin-top: 5px;
    color: var(--color-text-muted);
}

.confirmation-panel__actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 639px) {
    .confirmation-panel {
        padding: 16px;
        grid-template-columns: 1fr;
    }

    .confirmation-panel__actions {
        display: grid;
    }

    .confirmation-panel__actions .button,
    .confirmation-panel__actions button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .confirmation-panel {
        scroll-margin-top: 210px;
    }
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    width: 100%;

    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;

    background: var(--color-surface);
}

th,
td {
    padding: 13px 15px;

    border-bottom:
        1px solid var(--color-border);

    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--color-text-muted);

    background:
        var(--color-surface-muted);

    font-size: 12px;
    font-weight: 750;

    text-transform: uppercase;
    letter-spacing: 0.045em;
}

td {
    font-size: 14px;
}

tbody tr:hover {
    background: var(--color-surface-muted);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-primary {
    color: var(--color-text);

    font-weight: 700;
}

.table-secondary {
    margin-top: 3px;

    color: var(--color-text-muted);

    font-size: 12px;
}


/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.badge--success {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.badge--warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.badge--danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.badge--info {
    color: var(--color-info);
    background: var(--color-info-soft);
}

.badge--neutral {
    color: var(--color-neutral);
    background: var(--color-neutral-soft);
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

button,
input[type="submit"] {
    min-height: 44px;

    padding: 8px 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border:
        1px solid transparent;

    border-radius: var(--radius-sm);

    background: var(--color-primary);
    color: var(--theme-on-primary);

    cursor: pointer;

    font-weight: 700;
    font-size: 14px;

    line-height: 1.2;
}

button:hover,
input[type="submit"]:hover {
    background-color:
        var(--color-primary-hover);

    color: var(--theme-on-primary);

    text-decoration: none;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}


/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

form {
    margin: 0;

    min-width: 0;
}

fieldset,
.form-field {
    min-width: 0;
}

label {
    display: inline-block;

    margin-bottom: 6px;

    color: var(--color-text);

    font-size: 14px;
    font-weight: 650;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-width: 0;
    max-width: 640px;

    min-height: 44px;

    padding: 9px 11px;

    border:
        1px solid var(--color-border-strong);

    border-radius: var(--radius-sm);

    outline: none;

    background: var(--color-surface);
    color: var(--color-text);
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    display: block;

    min-width: 0;
    max-width: 100%;
}

.localized-temporal {
    position: relative;
    isolation: isolate;

    display: block;

    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.localized-temporal.is-open {
    z-index: 40;
}

.localized-temporal .localized-temporal__display {
    width: 100%;
    max-width: none;
    padding-right: 52px;

    font-variant-numeric: tabular-nums;
}

.localized-temporal__picker {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;

    width: 44px;
    height: 100%;
    min-height: 44px;
    padding: 0;

    border: 0;
    border-left: 1px solid var(--color-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;

    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;

    cursor: pointer;
}

.localized-temporal--date .localized-temporal__picker,
.localized-temporal--datetime-local .localized-temporal__picker {
    background-image: url("../vendor/lucide/calendar-days.svg");
}

.localized-temporal--time .localized-temporal__picker {
    background-image: url("../vendor/lucide/clock.svg");
}

.localized-temporal__picker:hover {
    background-color: var(--color-surface-muted);
}

.localized-temporal__picker:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -3px;
}

.localized-temporal__picker:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.localized-temporal > .localized-temporal__native {
    display: none !important;
}

.localized-temporal__popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;

    width: 352px;
    max-width: calc(100vw - 32px);
    padding: 16px;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);

    background: var(--color-surface);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
    color: var(--color-text);
}

.localized-temporal--time .localized-temporal__popover {
    width: 264px;
}

.localized-temporal__popover[hidden] {
    display: none;
}

.localized-temporal__calendar-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;

    margin-bottom: 8px;
}

.localized-temporal__calendar-header strong {
    text-align: center;
    text-transform: capitalize;
}

.localized-temporal__month-action {
    width: 44px;
    height: 44px;
    padding: 0;

    border: 0;
    border-radius: var(--radius-sm);

    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
}

.localized-temporal__month-action--previous {
    background-image: url("../vendor/lucide/chevron-left.svg");
}

.localized-temporal__month-action--next {
    background-image: url("../vendor/lucide/chevron-right.svg");
}

.localized-temporal__month-action:hover,
.localized-temporal__month-action:focus-visible {
    background-color: var(--color-surface-muted);
}

.localized-temporal__month-action:focus-visible,
.localized-temporal__day:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
}

.localized-temporal__weekdays,
.localized-temporal__days {
    display: grid;
    grid-template-columns: repeat(7, 44px);
    justify-content: center;
    gap: 2px;
}

.localized-temporal__weekdays {
    margin-bottom: 4px;
}

.localized-temporal__weekdays span {
    display: grid;
    place-items: center;

    height: 28px;

    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.localized-temporal__day {
    width: 44px;
    height: 44px;
    padding: 0;

    border: 0;
    border-radius: var(--radius-sm);

    background: transparent;
    color: var(--color-text);

    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.localized-temporal__day:hover {
    background: var(--color-surface-muted);
}

.localized-temporal__day.is-today {
    box-shadow: inset 0 0 0 1px var(--color-border-strong);
}

.localized-temporal__day.is-selected {
    background: var(--color-primary);
    box-shadow: none;
    color: #ffffff;
}

.localized-temporal__time-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.localized-temporal--datetime-local .localized-temporal__time-controls {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--color-border);
}

.localized-temporal__time-controls label {
    display: grid;
    gap: 6px;

    margin: 0;
}

.localized-temporal__time-controls select {
    width: 100%;
    max-width: none;
}

.localized-temporal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 16px;
}

@media (max-width: 389px) {
    .localized-temporal__popover {
        padding: 12px;
    }

    .localized-temporal__weekdays,
    .localized-temporal__days {
        grid-template-columns: repeat(7, minmax(36px, 44px));
    }
}

textarea {
    min-height: 110px;

    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);

    box-shadow:
        0 0 0 3px
        rgba(0, 0, 0, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;

    accent-color:
        var(--color-primary);
}

/* Shared non-visual label for controls whose visible heading already names them. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.form-group {
    margin-bottom: 18px;
}

.form-help {
    margin-top: 5px;

    color: var(--color-text-muted);

    font-size: 12px;
}


/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.alert {
    margin-bottom: 20px;

    padding: 14px 16px;

    border-radius: var(--radius-md);

    font-size: 14px;
}

.alert--success {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.alert--warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.alert--danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.alert--info {
    color: var(--color-info);
    background: var(--color-info-soft);
}


/* --------------------------------------------------------------------------
   Generic legacy helpers
   -------------------------------------------------------------------------- */

hr {
    margin: 28px 0;

    border: 0;
    border-top:
        1px solid var(--color-border);
}

main > table {
    margin: 18px 0 26px;

    border:
        1px solid var(--color-border);

    border-radius: var(--radius-md);
}

small {
    color: var(--color-text-muted);
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/*
|--------------------------------------------------------------------------
| Kompakter Desktop / Hochkant-Monitore
|--------------------------------------------------------------------------
|
| Wenn für Brand, Navigation und Account nicht genug Platz
| in einer Zeile vorhanden ist, bekommt die Navigation eine eigene Zeile.
|
| Der Vereinswechsel liegt bei allen Bildschirmbreiten im Kontomenü.
|
*/

@media (max-width: 1200px) and (min-width: 701px) {

    .app-header__inner {
        min-height: auto;

        padding: 10px 0 0;

        display: grid;

        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;

        grid-template-rows:
            auto
            auto;

        align-items: center;

        gap: 8px 28px;
    }

    .app-brand {
        grid-column: 1;
        grid-row: 1;
    }

    .app-header__account {
        grid-column: 3;
        grid-row: 1;

        justify-self: end;
    }

    .app-nav {
        grid-column: 1 / -1;
        grid-row: 2;

        width: 100%;

        padding: 7px 0 10px;

        display: flex;
        align-items: center;

        gap: 5px;

        overflow-x: auto;
        overflow-y: hidden;

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }

    .app-nav::-webkit-scrollbar {
        display: none;
    }

    .app-nav__link {
        flex: 0 0 auto;

        white-space: nowrap;
    }

}


@media (max-width: 980px) {

    .app-header__inner {
        min-height: auto;

        padding: 12px 0;

        flex-wrap: wrap;
        gap: 10px 18px;
    }

    .app-brand {
        flex: 1;
    }

    .app-nav {
        order: 3;

        width: 100%;

        overflow-x: auto;
    }

    .app-nav__link {
        white-space: nowrap;
    }

    .app-header__user {
        display: none;
    }

}


@media (max-width: 700px) {

    .app-header__inner,
    .event-nav__inner,
    .app-main {
        width:
            calc(100% - 24px);
    }

    .app-main {
        padding-top: 26px;
    }

    .app-brand__mark {
        width: 34px;
        height: 34px;
    }

    .app-nav {
        margin: 0 -4px;
    }

    .app-nav__link {
        padding:
            8px 9px;
    }

    .event-nav__inner {
        min-height: 48px;
    }

    .event-nav__title {
        display: none;
    }

    .card {
        padding: 18px;
    }

    th,
    td {
        padding:
            11px 12px;
    }

    .desktop-only {
        display: none;
    }
}


@media print {

    .app-header,
    .event-nav,
    .app-footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .app-main {
        width: 100%;

        padding: 0;
    }

    .card {
        border: 0;

        box-shadow: none;
    }
}

/* ==========================================================================
   Global Form Control Sizing
   ========================================================================== */

/*
|--------------------------------------------------------------------------
| Einheitliche Formularfelder
|--------------------------------------------------------------------------
|
| Normale Eingabefelder und Dropdowns sollen in der gesamten Anwendung
| dieselbe Höhe und Schriftgröße haben.
|
| Checkboxen, Radiobuttons und Textareas sind bewusst ausgenommen.
|
*/

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
    width: 100%;
    min-height: 48px;

    padding: 0 12px;

    font-size: 16px;
    line-height: 1.3;
}


/*
|--------------------------------------------------------------------------
| Selects
|--------------------------------------------------------------------------
|
| Einheitliche Darstellung unabhängig von Safari/macOS/iOS.
|
*/

select {
    height: 48px;

    padding-right: 40px;

    -webkit-appearance: none;
    appearance: none;

    background-image: url("/assets/vendor/lucide/chevron-down.svg");

    background-position: calc(100% - 13px) center;

    background-size: 17px 17px;

    background-repeat: no-repeat;
}

/* ==========================================================================
   Mobile Header Layout
   ========================================================================== */

@media (max-width: 700px) {

    /*
    |--------------------------------------------------------------------------
    | Header als echtes zweizeiliges Mobile-Layout
    |--------------------------------------------------------------------------
    */

    .app-header__inner {
        width: 100%;

        min-height: auto;

        padding: 0;

        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        align-items: center;

        gap: 0;
    }


    /*
    |--------------------------------------------------------------------------
    | Branding
    |--------------------------------------------------------------------------
    */

    .app-brand {
        min-width: 0;

        padding: 12px 16px;

        display: inline-flex;
        align-items: center;

        gap: 10px;

        font-size: 18px;
    }

    .app-brand__mark {
        width: 36px;
        height: 36px;

        flex: 0 0 36px;

        font-size: 19px;
    }


    /*
    |--------------------------------------------------------------------------
    | Account rechts oben
    |--------------------------------------------------------------------------
    */

    .app-header__account {
        padding: 10px 16px 10px 6px;

        justify-self: end;

        gap: 0;
    }

    .app-header__user {
        display: none;
    }

    .app-header__account .button {
        min-height: 44px;

        padding: 6px 11px;

        font-size: 13px;
    }


    /*
    |--------------------------------------------------------------------------
    | Hauptnavigation als eigene zweite Zeile
    |--------------------------------------------------------------------------
    */

    .app-nav {
        grid-column: 1 / -1;

        order: initial;

        width: 100%;

        margin: 0;

        padding: 7px 12px 9px;

        display: flex;
        align-items: center;

        gap: 5px;

        overflow-x: auto;
        overflow-y: hidden;

        border-top:
            1px solid var(--color-border);

        background: #fff;

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }

    .app-nav::-webkit-scrollbar {
        display: none;
    }

    .app-nav__link {
        flex: 0 0 auto;

        padding: 8px 11px;

        border-radius: 8px;

        white-space: nowrap;

        font-size: 13px;
    }


    /*
    |--------------------------------------------------------------------------
    | Aktiver Menüpunkt etwas klarer
    |--------------------------------------------------------------------------
    */

    .app-nav__link--active {
        background:
            var(--color-primary-soft);

        color:
            var(--color-primary);

        font-weight: 750;
    }


    /*
    |--------------------------------------------------------------------------
    | Event-Untermenü
    |--------------------------------------------------------------------------
    |
    | Liegt unterhalb des normalen Headers und bleibt ebenfalls scrollbar.
    |
    */

    .event-nav__inner {
        width: 100%;

        min-height: auto;

        padding: 7px 12px;

        gap: 5px;
    }

    .event-nav__link {
        flex: 0 0 auto;

        padding: 7px 10px;

        font-size: 12px;
    }

}

/* ==========================================================================
   Mobile Header – final alignment
   ========================================================================== */

@media (max-width: 700px) {

    /*
    |--------------------------------------------------------------------------
    | Erste Zeile: Brand links, Profil rechts
    |--------------------------------------------------------------------------
    */

    .app-brand {
        grid-column: 1;
        grid-row: 1;
    }

    .app-header__account {
        grid-column: 2;
        grid-row: 1;

        align-self: center;
        justify-self: end;

        padding: 10px 16px 10px 6px;
    }

    /*
    |--------------------------------------------------------------------------
    | Zweite Zeile: Navigation
    |--------------------------------------------------------------------------
    */

    .app-nav {
        grid-column: 1 / -1;
        grid-row: 2;
    }

}

/* ==========================================================================
   Squadaroa Branding
   ========================================================================== */

.app-brand__mark {
    width: 42px;
    height: 38px;

    padding: 0;

    background: transparent;
    color: inherit;

    border-radius: 0;
}

.app-brand__logo {
    display: block;

    width: 42px;
    height: 38px;

    object-fit: contain;
}

@media (max-width: 700px) {

    .app-brand__mark {
        width: 38px;
        height: 34px;

        flex: 0 0 38px;
    }

    .app-brand__logo {
        width: 38px;
        height: 34px;
    }

}


/* ==========================================================================
   Mobile Main Navigation
   ========================================================================== */

.mobile-main-nav {
    display: none;
}

@media (max-width: 700px) {

    /*
    |--------------------------------------------------------------------------
    | Alte horizontale Hauptnavigation ausblenden
    |--------------------------------------------------------------------------
    */

    .app-nav--desktop {
        display: none;
    }


    /*
    |--------------------------------------------------------------------------
    | Header-Reihenfolge
    |--------------------------------------------------------------------------
    |
    | Zeile 1: Brand + Profil
    | Zeile 2: Mobile Navigation
    |
    */

    .mobile-main-nav {
        grid-column: 1 / -1;
        grid-row: 2;

        display: block;

        width: 100%;

        border-top:
            1px solid var(--color-border);

        background: #fff;
    }


    /*
    |--------------------------------------------------------------------------
    | Geschlossene Navigation
    |--------------------------------------------------------------------------
    */

    .mobile-main-nav__summary {
        min-height: 48px;

        padding: 8px 16px;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;

        list-style: none;

        color: var(--color-primary);

        font-size: 14px;
        font-weight: 750;

        cursor: pointer;

        user-select: none;
    }

    .mobile-main-nav__summary::-webkit-details-marker {
        display: none;
    }

    .mobile-main-nav__summary::marker {
        display: none;
        content: "";
    }

    .mobile-main-nav__icon {
        width: 36px;
        height: 32px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        flex: 0 0 auto;

        border:
            1px solid var(--color-border);

        border-radius: 8px;

        color: var(--color-text);

        background:
            var(--color-surface-muted);
    }


    /*
    |--------------------------------------------------------------------------
    | Aufgeklapptes Menü
    |--------------------------------------------------------------------------
    */

    .mobile-main-nav__menu {
        padding:
            0 12px
            10px;

        display: grid;
        gap: 3px;

        border-top:
            1px solid var(--color-border);
    }

    .mobile-main-nav__link {
        min-height: 44px;

        padding: 9px 12px;

        display: flex;
        align-items: center;

        border-radius: 8px;

        color: var(--color-text);

        font-size: 14px;
        font-weight: 650;
    }

    .mobile-main-nav__link:hover {
        text-decoration: none;

        color:
            var(--color-primary);

        background:
            var(--color-primary-soft);
    }

    .mobile-main-nav__link.app-nav__link--active {
        color:
            var(--color-primary);

        background:
            var(--color-primary-soft);

        font-weight: 750;
    }


    /*
    |--------------------------------------------------------------------------
    | Bestehendes Mobile-Grid korrigieren
    |--------------------------------------------------------------------------
    */

    .app-nav {
        grid-row: auto;
    }

}

/* ===========================================================================
   Visual Identity v1 foundation
   ========================================================================== */

:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.ui-icon {
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    flex: 0 0 auto;
    stroke-width: 2;
    vertical-align: -0.16em;
}

/* Shared appointment identity: monochrome, independent of response/club colors. */
.ui-icon.appointment-kind-icon { width: 16px; height: 16px; flex: 0 0 16px; vertical-align: -.15em; margin-inline-end: 5px; }


.app-header {
    color: #ffffff;
    background: #000000;
    border-bottom-color: #242424;
    box-shadow: none;
    backdrop-filter: none;
}

.app-header__inner {
    width: min(calc(100% - 64px), var(--content-width));
    min-height: 64px;
    position: relative;
    gap: 24px;
}

.app-pwa-back[hidden] {
    display: none;
}

.app-pwa-back {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 9px;
    background: #151515;
    cursor: pointer;
}

.app-pwa-back:hover {
    color: #ffffff;
    border-color: #686868;
    background: #242424;
}

.app-pwa-back:focus-visible {
    outline-color: #ffffff;
}

.app-pwa-back .ui-icon {
    width: 20px;
    height: 20px;
}

.app-pwa-back:not([hidden]) + .app-brand {
    margin-left: 52px;
}

@media (min-width: 701px) and (max-width: 1200px) {
    .app-pwa-back {
        top: 32px;
    }
}

.app-brand,
.app-brand:hover,
.app-header__user {
    color: #ffffff;
}

.app-brand__mark,
.app-brand__logo {
    width: 34px;
    height: 34px;
}

.app-nav__link {
    position: relative;
    min-height: 44px;
    color: #cfcfcf;
    border-radius: 0;
}

.app-nav__link:hover,
.app-nav__link--active {
    color: #ffffff;
    background: transparent;
    text-decoration: none;
}

.app-nav__link--active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 3px;
    left: 12px;
    height: 3px;
    border-radius: 999px;
    background: var(--color-accent);
}

.event-nav__inner,
.app-main {
    width: min(calc(100% - 64px), var(--content-width));
}

.event-nav__link {
    position: relative;
    border-radius: 0;
}

.event-nav__link:hover,
.event-nav__link--active {
    color: var(--color-text);
    background: var(--color-primary-soft);
    text-decoration: none;
}

.event-nav__link--active::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: -10px;
    left: 10px;
    height: 3px;
    background: #000000;
}

.app-main {
    padding-top: 32px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.page-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 4vw, 2.5rem);
}

.eyebrow,
.page-header__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.eyebrow::before,
.page-header__eyebrow::before {
    content: "";
    width: 18px;
    height: 3px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--color-accent);
}

/* Shared appointment status pills, including every detail header. */
.game-badge {
    min-height: 28px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.game-badge--DRAFT,
.game-badge--POSTPONED {
    border-color: var(--color-warning-border);
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.game-badge--CANCELLED,
.game-badge--ABANDONED {
    border-color: var(--color-danger-border);
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.game-badge--PLANNED,
.game-badge--ACTIVE,
.game-badge--IN_PROGRESS,
.game-badge--COMPLETED {
    border-color: var(--color-info-border);
    color: var(--color-info);
    background: var(--color-info-soft);
}

.game-badge--archived {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.page-subtitle,
.page-header__subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 16px;
}

.page-actions,
.form-actions,
.section-header,
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.card,
.table-card {
    min-width: 0;
    max-width: 100%;

    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    box-shadow: none;
}

/* Equal-rank sections in a single-column detail workspace share its full grid. */
.detail-section-card {
    width: 100%;
    max-width: none;
}

.table-card {
    overflow: hidden;
}

.table-responsive,
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    min-width: 720px;
}

th {
    color: var(--color-neutral);
    background: var(--color-surface-muted);
}

tbody tr:hover {
    background: var(--color-surface-muted);
}

.button,
button,
input[type="submit"] {
    min-height: 44px;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    color: var(--theme-on-primary);
    background-color: var(--color-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    color: var(--theme-on-primary);
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    text-decoration: none;
}

.button-secondary {
    color: var(--color-text);
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}

.button-secondary:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
}

.button-danger-outline {
    color: var(--color-danger);
    background: var(--color-surface);
    border-color: var(--color-danger);
    white-space: nowrap;
}

.button-danger-outline:hover {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: var(--color-danger);
}

.button:disabled,
button:disabled,
input[type="submit"]:disabled,
.button[aria-disabled="true"] {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    cursor: not-allowed;
    opacity: 1;
}

.button[aria-disabled="true"] {
    pointer-events: none;
}

.button-small {
    min-height: 36px;
    padding: 6px 11px;
    font-size: 13px;
    position: relative;
}

.button-small::after {
    content: "";
    position: absolute;
    inset: -4px 0;
}

/* Shared table action column: heading and row actions share one center line. */
.table-actions-column {
    text-align: center;
}

/* Shared filter rows: labeled controls and their apply action share one baseline. */
.filter-bar {
    align-items: end;
}

.filter-bar__field {
    margin-bottom: 0;
}

.filter-bar__actions {
    min-width: 0;
    min-height: 44px;
    margin-bottom: 0;
    align-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar__submit {
    white-space: nowrap;
}

/* Shared active/archive state switch for one compact management list. */
.list-view-switch {
    width: fit-content;
    max-width: 100%;
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-view-switch__label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 700;
}

.list-view-switch__options {
    min-width: 0;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-muted);
}

.list-view-switch__options > a {
    min-height: 44px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 7px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.list-view-switch__options > a:hover {
    color: var(--color-text);
    background: var(--color-surface);
    text-decoration: none;
}

.list-view-switch__options > a[aria-current="page"] {
    color: #ffffff;
    background: var(--color-primary);
}

.list-view-switch__options > a span {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: inherit;
    background: rgba(127, 127, 127, 0.16);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.list-view-switch__options > a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Shared overflow action for repeated table/list rows. */
.row-action-menu {
    width: 100%;
    min-width: 44px;
}

.row-action-menu > summary,
.row-action-trigger {
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin-inline: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    background: var(--color-surface);
    cursor: pointer;
    list-style: none;
}

.row-action-menu > summary::-webkit-details-marker {
    display: none;
}

.row-action-menu > summary::marker {
    display: none;
    content: "";
}

.row-action-menu > summary:hover,
.row-action-menu[open] > summary,
.row-action-trigger:hover,
.row-action-trigger[aria-expanded="true"] {
    border-color: var(--color-text);
    background: var(--color-surface-muted);
}

.row-action-menu > summary:focus-visible,
.row-action-trigger:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

.row-action-menu > summary .ui-icon,
.row-action-trigger .ui-icon {
    width: 20px;
    height: 20px;
}

.row-action-menu__menu {
    margin-top: 8px;
    display: grid;
    gap: 7px;
}

.row-action-menu__menu .button,
.row-action-menu__menu .inline-form,
.row-action-menu__menu button {
    width: 100%;
}

.row-action-menu__menu .button,
.row-action-menu__menu button {
    justify-content: flex-start;
    white-space: nowrap;
}

@media (max-width: 820px) {
    .row-action-menu__menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .list-view-switch {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .list-view-switch__options {
        width: 100%;
    }

    .list-view-switch__options > a {
        min-width: 0;
        flex: 1 1 0;
    }

    .row-action-menu__menu {
        grid-template-columns: 1fr;
    }
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
    min-height: 44px;
    height: 44px;
    border-color: var(--color-border-strong);
}

textarea {
    border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--theme-primary);
}

.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--color-danger-border);
    border-radius: 8px;
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.empty-state {
    padding: 40px 24px;
    color: var(--color-text-muted);
    text-align: center;
}

@media (min-width: 701px) and (max-width: 959px) {
    .app-header__inner {
        width: 100%;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0 16px;
        padding: 0 24px;
    }

    .app-header__account {
        padding-block: 8px;
    }

    .app-nav--desktop {
        display: none;
    }

    .mobile-main-nav {
        grid-column: 1 / -1;
        display: block;
        border-top: 1px solid #2f2f2f;
        background: #000000;
    }

    .mobile-main-nav__summary {
        min-height: 48px;
        padding: 7px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        list-style: none;
        color: #ffffff;
        cursor: pointer;
    }

    .mobile-main-nav__menu {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 8px 0 12px;
        border-top: 1px solid #2f2f2f;
    }

    .mobile-main-nav__link {
        min-height: 44px;
        padding: 9px 12px;
        color: #d6d6d6;
        border-radius: 8px;
    }

    .mobile-main-nav__link:hover,
    .mobile-main-nav__link.app-nav__link--active {
        color: #ffffff;
        background: #242424;
        text-decoration: none;
    }
}

@media (max-width: 700px) {
    .app-header__inner,
    .event-nav__inner,
    .app-main {
        width: 100%;
    }

    .app-header__inner {
        min-height: 56px;
    }

    .app-pwa-back {
        left: 8px;
        top: 32px;
    }

    .app-brand {
        min-height: 56px;
        color: #ffffff;
    }

    .app-brand__mark,
    .app-brand__logo {
        width: 32px;
        height: 32px;
    }

    .mobile-main-nav {
        border-top-color: #2f2f2f;
        background: #000000;
    }

    .mobile-main-nav__summary {
        color: #ffffff;
    }

    .mobile-main-nav__icon {
        color: #ffffff;
        background: #151515;
        border-color: #4a4a4a;
    }

    .mobile-main-nav__menu {
        border-top-color: #2f2f2f;
    }

    .mobile-main-nav__link {
        color: #d6d6d6;
    }

    .mobile-main-nav__link:hover,
    .mobile-main-nav__link.app-nav__link--active {
        color: #ffffff;
        background: #242424;
    }

    .app-main {
        padding: 24px 16px 48px;
    }

    .event-nav__inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .page-header {
        display: grid;
        gap: 18px;
        margin-bottom: 24px;
    }

    .page-actions {
        width: 100%;
    }
}

@media (max-width: 389px) {
    .app-pwa-back:not([hidden]) + .app-brand > span:last-child {
        display: none;
    }
}

/* ===========================================================================
   Shared account menu
   ========================================================================== */

.app-account-menu {
    position: relative;
}

.app-header-search {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 9px;
    background: #000000;
}

.app-header-search:hover,
.app-header-search--active {
    color: #ffffff;
    border-color: #777777;
    background: #242424;
    text-decoration: none;
}

.app-header-search:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.app-header-search .ui-icon {
    width: 19px;
    height: 19px;
}

.app-account-menu__summary {
    min-height: 44px;
    padding: 4px 6px 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 9px;
    background: #000000;
    cursor: pointer;
    user-select: none;
}

.app-account-menu__summary::-webkit-details-marker {
    display: none;
}

.app-account-menu__summary::marker {
    display: none;
    content: "";
}

.app-account-menu__summary:hover,
.app-account-menu[open] .app-account-menu__summary,
.app-account-menu--active .app-account-menu__summary {
    color: #ffffff;
    background: #242424;
    border-color: #777777;
}

.app-account-menu__summary:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.app-account-menu__avatar,
.app-account-menu__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.app-account-menu__avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #151515;
}

.app-account-menu__avatar .ui-icon {
    width: 18px;
    height: 18px;
}

/* Shared private person image. Sizes follow Visual Identity section 12.2. */
.person-avatar-frame.person-avatar--32,
.person-avatar-frame.person-avatar--40,
.person-avatar-frame.person-avatar--64,
.person-avatar-frame.person-avatar--96 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-grow: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    line-height: 1;
}

.person-avatar-frame.person-avatar--32 { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
.person-avatar-frame.person-avatar--40 { width: 40px; height: 40px; flex-basis: 40px; font-size: 13px; }
.person-avatar-frame.person-avatar--64 { width: 64px; height: 64px; flex-basis: 64px; font-size: 20px; }
.person-avatar-frame.person-avatar--96 { width: 96px; height: 96px; flex-basis: 96px; font-size: 28px; }

.person-avatar-frame.person-avatar--image > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

/* Shared private club identities: complete logos, never circular or stretched. */
.entity-logo-frame { display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.entity-logo-frame img { display: block; width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.entity-logo-frame--list { width: 44px; height: 44px; }
.entity-logo-frame--heading { width: 64px; height: 64px; border-radius: var(--radius-md); }
.entity-logo-frame--game { width: 48px; height: 48px; }
.entity-team-photo { display: block; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface-muted); }
.entity-team-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.entity-team-photo--hero { width: min(100%,560px); aspect-ratio: 16 / 9; }

.app-account-menu__chevron .ui-icon {
    width: 15px;
    height: 15px;
    transition: transform 180ms ease;
}

.app-account-menu[open] .app-account-menu__chevron .ui-icon {
    transform: rotate(180deg);
}

.app-account-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    width: 240px;
    max-height: calc(100vh - 84px);
    padding: 6px;
    display: grid;
    gap: 2px;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
}

.app-account-menu__group + .app-account-menu__group {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding-top: 4px;
}

.app-account-menu__group-label {
    margin: 0;
    padding: 6px 10px 4px;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.app-account-menu__item {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    border: 0;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.app-account-menu__item:hover,
.app-account-menu__item--active {
    color: var(--color-text);
    background: var(--color-surface-muted);
    text-decoration: none;
}

.app-account-menu__item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.app-account-menu__item .ui-icon {
    width: 18px;
    height: 18px;
}

.app-account-menu__footer {
    min-width: 0;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid var(--color-border);
}

.app-account-menu__form {
    margin: 0;
}

.app-organization {
    min-width: 0;
    padding: 8px 10px;
}

.app-organization__form {
    display: grid;
    gap: 8px;
    margin: 0;
}

.app-organization__label {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.app-organization__select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    font-size: 14px;
    cursor: pointer;
}

.app-account-menu__logout {
    appearance: none;
}

/* Shared standalone-PWA refresh feedback; never shifts page content. */
.app-account-menu__item[data-pwa-refresh][hidden],
.pwa-refresh[hidden] {
    display: none;
}

.pwa-refresh {
    position: fixed;
    z-index: 110;
    top: calc(env(safe-area-inset-top, 0px) + 72px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 32px);
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    pointer-events: none;
}

.pwa-refresh .ui-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

@media (prefers-reduced-motion: no-preference) {
    .pwa-refresh--loading .ui-icon {
        animation: pwa-refresh-spin 1s linear infinite;
    }
}

@keyframes pwa-refresh-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .app-account-menu__summary {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 9px;
    }

    .app-account-menu__chevron {
        display: none;
    }

    .app-account-menu__avatar {
        width: 100%;
        height: 100%;
        background: transparent;
    }
}

@media (max-width: 700px) {
    .app-account-menu__panel {
        position: fixed;
        top: 62px;
        right: 12px;
        width: min(280px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Shared optional form sections across games, tournaments and trainings. */
.form-disclosure {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}
.form-disclosure[open] > summary {
    margin-bottom: 12px;
}
.form-disclosure > summary .ui-icon {
    width: 17px;
    height: 17px;
}
.form-disclosure > summary:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Shared read-only links on object detail pages. */
.object-links__list { list-style: none; padding: 0; margin: 0; }
.object-links__list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.object-links__list a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; min-width: 0; max-width: 100%; }
.object-links__list a span { overflow-wrap: anywhere; min-width: 0; }
.object-links__list a > svg { flex-shrink: 0; }

/* Object-local views sit inside the identity card, below the global navigation. */
.detail-navigation { display: flex; flex-wrap: wrap; flex: 1 0 100%; gap: 4px 20px; min-width: 0; border-top: 1px solid var(--color-border); padding-top: 8px; }
.detail-navigation a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; border-bottom: 3px solid transparent; color: var(--color-text-muted); font-weight: 600; text-decoration: none; }
.detail-navigation a:hover { color: var(--color-text); }
.detail-navigation a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-text); }
.tournament-identity:has(> .detail-navigation), .event-hero:has(> .detail-navigation) { flex-wrap: wrap; }
.detail-context-heading { margin-bottom: 20px; }
.detail-context-heading__title { margin-bottom: 16px; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }

/* Shared location details for appointment pages and weekly rules. */
.location-details { display: grid; gap: 8px; min-width: 0; margin-top: 16px; }
.location-details .location-details__label {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.location-details__name, .location-details__address { overflow-wrap: anywhere; }
.location-details .location-details__address { margin: 0; color: var(--color-text-muted); line-height: 1.5; }
.location-details .location-map-link { justify-self: start; margin-top: 4px; }
.location-map-link { max-width: 100%; }
@media print { .location-map-link { display: none !important; } }
