/* ============================================================
   forms.css — management-screen surfaces
   Loaded after app.css, so it wins ties against the global
   .form-control / .btn rules it deliberately opts out of.

   Contents
     1. Sheet (shared bottom-sheet / dialog)
     2. Create-form shell + title bar
     3. Settings summary row + settings sheet controls
     4. Panels (Players)
     5. Player rows
     6. Action bar
     7. Tournament list (segmented filter, search)
   ============================================================ */

/* ------------------------------------------------------------
   1. SHEET
   ------------------------------------------------------------ */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1060;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* fadeOnly, not fadeIn — the latter animates transform, which would offset
       this fixed-position overlay for the duration of the animation. */
    animation: fadeOnly 0.18s ease-out;
    /* Landscape on a notched phone puts the cutout beside the sheet, not above it. */
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

.sheet {
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-sheet);
    animation: sheetIn 0.28s var(--ease-out);
    padding-bottom: var(--safe-bottom);
    /* Sheet.razor writes an inline transform while a dismiss drag is in flight and
       clears it on release; this is what springs the sheet back when the drag did
       not pass the threshold. Inline `transition: none` suppresses it mid-drag so
       the sheet tracks the finger exactly. */
    transition: transform 0.24s var(--ease-out);
}

/* Grabber + header. touch-action:none hands the gesture to us outright — pan-y
   would let the browser keep scroll-panning and the drag would never arrive.
   Safe here precisely because this region has nothing scrollable in it. */
.sheet-drag-area {
    flex: none;
    touch-action: none;
    cursor: grab;
}

@media (min-width: 641px) {
    /* Desktop is a centred dialog, not a draggable sheet. */
    .sheet-drag-area {
        touch-action: auto;
        cursor: default;
    }
}

@keyframes sheetIn {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.sheet-grabber {
    flex: none;
    width: 40px;
    height: 4px;
    margin: 0.625rem auto 0.125rem;
    border-radius: var(--radius-pill);
    background: var(--color-muted-stroke);
}

.sheet-header {
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-muted-stroke);
}

.sheet-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.sheet-title i {
    color: var(--color-outline);
    font-size: 1.1rem;
}

.sheet-close {
    flex: none;
}

.sheet-body {
    padding: var(--space-2) var(--space-4) var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Stop scroll chaining: hitting the end of a long sheet must not start
       scrolling the page behind the backdrop. */
    overscroll-behavior: contain;
}

.sheet-footer {
    flex: none;
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-muted-stroke);
}

.sheet-footer > * {
    flex: 1;
}

@media (min-width: 641px) {
    .sheet-overlay {
        align-items: center;
        padding: var(--space-4);
    }

    .sheet {
        max-width: 460px;
        max-height: 85vh;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-3);
        padding-bottom: 0;
    }

    .sheet-wide {
        max-width: 620px;
    }

    .sheet-grabber {
        display: none;
    }
}

html[data-theme='dark'] .sheet-close,
[data-bs-theme='dark'] .sheet-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ------------------------------------------------------------
   2. CREATE-FORM SHELL + TITLE BAR
   ------------------------------------------------------------ */
.create-form {
    max-width: 660px;
    margin: 0 auto;
    /* Clears the fixed action bar on phones. The tab bar's own footprint is
       already reserved by main's padding-bottom, so only the bar itself is
       counted here. */
    padding-bottom: 6.5rem;
}

@media (min-width: 641px) {
    .create-form {
        padding-bottom: var(--space-6);
    }
}

.form-titlebar {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    animation: fadeInUp 0.4s ease-out backwards;
}

.form-type-chip {
    flex: none;
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    font-size: 1.35rem;
    color: #fff;
    box-shadow: var(--shadow-2);
}

.form-type-chip-primary { background: linear-gradient(135deg, #1e293b 0%, #334155 100%); }
.form-type-chip-success { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.form-type-chip-warning { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.form-type-chip-danger  { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }
.form-type-chip-info    { background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); }

.form-titlebar-main {
    flex: 1;
    min-width: 0;
}

/* Deliberately NOT .form-control — the name is the page title, not a field. */
.form-name-input {
    width: 100%;
    min-height: var(--tap);
    padding: 0.25rem 0;
    font-family: 'Orbitron', 'Nunito', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: border-color 0.2s ease;
}

.form-name-input::placeholder {
    opacity: 0.3;
    font-weight: 600;
}

.form-name-input:focus {
    outline: none;
    box-shadow: none;
    transform: none;
    background: transparent;
    border-bottom-color: var(--color-outline);
}

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    min-height: 32px;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--color-text);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

button.type-pill {
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

button.type-pill:hover {
    border-color: var(--color-outline);
}

.type-pill i {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ------------------------------------------------------------
   3. SETTINGS SUMMARY ROW + SHEET CONTROLS
   ------------------------------------------------------------ */
.settings-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--tap);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    text-align: left;
    background: var(--color-surface);
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-md);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.4s ease-out 0.06s backwards;
}

.settings-row:hover:not(:disabled) {
    border-color: var(--color-outline);
    box-shadow: var(--shadow-1);
}

.settings-row:disabled {
    cursor: default;
    opacity: 0.75;
}

.settings-row .settings-icon {
    flex: none;
    color: var(--color-outline);
    font-size: 1.1rem;
}

.settings-summary {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-row .settings-chevron {
    flex: none;
    opacity: 0.4;
}

/* --- individual settings inside the sheet --- */
.setting {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-muted-stroke);
}

.setting:last-child {
    border-bottom: none;
}

.setting.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: 0.9375rem;
    font-weight: 700;
}

.setting-hint {
    margin: var(--space-2) 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    opacity: 0.6;
}

.setting-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 0.8125rem;
    line-height: 1.4;
    opacity: 0.85;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chip {
    min-height: var(--tap);
    min-width: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.chip:hover:not(.chip-active) {
    border-color: var(--color-outline);
}

.chip-active {
    background: var(--navbar-bg);
    color: var(--navbar-text);
    border-color: transparent;
    box-shadow: var(--shadow-1);
}

.stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg);
}

.stepper button {
    width: var(--tap);
    height: var(--tap);
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.stepper button:hover:not(:disabled) {
    background: var(--surface-2);
}

.stepper button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stepper-value {
    min-width: 5rem;
    height: var(--tap);
    display: grid;
    place-items: center;
    padding: 0 var(--space-2);
    border-left: 1px solid var(--color-muted-stroke);
    border-right: 1px solid var(--color-muted-stroke);
    font-size: 0.9375rem;
    font-weight: 800;
    white-space: nowrap;
}

.setting-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--tap);
}

.setting-switch .setting-label {
    margin-bottom: 0;
}

.setting-switch .form-check {
    flex: none;
    min-height: auto;
    margin: 0;
    padding: 0;
}

.setting-switch .form-check-input {
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    cursor: pointer;
}

/* ------------------------------------------------------------
   4. PANELS
   ------------------------------------------------------------ */
.form-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    animation: fadeInUp 0.4s ease-out 0.12s backwards;
}

.form-panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-3);
}

.form-panel-header .panel-icon {
    color: var(--color-outline);
    font-size: 1.05rem;
}

.form-panel-header h2 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    opacity: 0.7;
}

.form-panel-body {
    padding: 0 var(--space-4) var(--space-4);
}

.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 1.75rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: 0.8125rem;
    font-weight: 800;
}

.sitout-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: var(--radius-pill);
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

html[data-theme='dark'] .sitout-pill,
[data-bs-theme='dark'] .sitout-pill {
    background: rgba(251, 146, 60, 0.16);
    border-color: rgba(251, 146, 60, 0.35);
    color: #fdba74;
}

.panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    opacity: 0.55;
}

.panel-empty i {
    font-size: 2rem;
}

.panel-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* ------------------------------------------------------------
   5. PLAYERS
   ------------------------------------------------------------ */
.player-add {
    display: flex;
    gap: var(--space-2);
}

.player-add-input {
    flex: 1;
    min-width: 0;
    min-height: var(--tap);
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.player-add-input:focus {
    outline: none;
    transform: none;
    border-color: var(--color-outline);
    box-shadow: var(--focus-ring);
}

/* These are Bootstrap .btn (inline-block), so they need explicit centring
   before a min-height is safe to apply. */
.player-add .btn {
    flex: none;
    min-width: var(--tap);
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.suggest-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: var(--space-3);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.5;
}

.suggest-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2) 0 var(--space-1);
}

.suggest-chip {
    flex: none;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.3rem 0.5rem 0.3rem 0.55rem;
    border: 1px dashed var(--color-muted-stroke);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
}

.suggest-chip:hover {
    border-style: solid;
    border-color: var(--color-outline);
    background: var(--surface-2);
}

.suggest-chip > i {
    font-size: 0.85rem;
    opacity: 0.55;
}

.suggest-chip .play-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: 0.6875rem;
    font-weight: 800;
    opacity: 0.8;
}

/* Expand/collapse is an affordance, not a player. A solid border and the accent
   colour keep it from reading as one more name in the dashed row beside it. */
.suggest-more {
    border-style: solid;
    border-color: var(--color-outline);
    color: var(--color-outline);
    font-weight: 800;
}

.suggest-more > i {
    font-size: 0.75rem;
    opacity: 0.9;
}

.player-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-3);
    border-top: 1px solid var(--color-muted-stroke);
}

.player-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: 0.125rem 0;
    border-bottom: 1px solid var(--color-muted-stroke);
    animation: rowIn 0.22s ease-out backwards;
}

@keyframes rowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: none; }
}

.player-avatar {
    flex: none;
    position: relative;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--color-text);
    font-size: 0.8125rem;
    font-weight: 800;
    transition: transform 0.15s ease;
}

button.player-avatar {
    cursor: pointer;
}

/* Grow the hit area to 44px without growing the visual dot. */
button.player-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
}

button.player-avatar:hover {
    transform: scale(1.08);
}

.player-avatar-linked {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: #10b981;
    color: #fff;
}

.player-avatar[data-group="1"] { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); border-color: #6366f1; color: #fff; }
.player-avatar[data-group="2"] { background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%); border-color: #ec4899; color: #fff; }
.player-avatar[data-group="3"] { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); border-color: #f59e0b; color: #fff; }
.player-avatar[data-group="4"] { background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%); border-color: #14b8a6; color: #fff; }
.player-avatar[data-group="5"] { background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%); border-color: #8b5cf6; color: #fff; }
.player-avatar[data-group="6"] { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); border-color: #3b82f6; color: #fff; }

.player-avatar[data-group]:not([data-group="1"]):not([data-group="2"]):not([data-group="3"]):not([data-group="4"]):not([data-group="5"]):not([data-group="6"]) {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border-color: #64748b;
    color: #fff;
}

.player-name-input {
    flex: 1;
    min-width: 0;
    min-height: var(--tap);
    padding: 0.25rem 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: border-color 0.15s ease;
}

.player-name-input:focus {
    outline: none;
    box-shadow: none;
    transform: none;
    background: transparent;
    border-bottom-color: var(--color-outline);
}

.player-name-input:disabled {
    opacity: 0.75;
}

.player-remove {
    flex: none;
    width: var(--tap);
    height: var(--tap);
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    font-size: 1.05rem;
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.18s ease;
}

.player-remove:hover {
    opacity: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ------------------------------------------------------------
   6. ACTION BAR
   ------------------------------------------------------------ */
.form-inline-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-3);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    font-size: 0.875rem;
    font-weight: 600;
    animation: fadeIn 0.2s ease-out;
}

.form-inline-error ul {
    margin: 0;
    padding-left: 1.1rem;
}

html[data-theme='dark'] .form-inline-error,
[data-bs-theme='dark'] .form-inline-error {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.form-actionbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.form-actionbar-summary {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Secondary buttons in the bar (e.g. Cancel) never grow at the CTA's expense. */
.form-actionbar .btn:not(.btn-submit) {
    flex: none;
}

.form-actionbar .btn-submit {
    flex: none;
    min-width: 10rem;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.3px;
}

@media (max-width: 640.98px) {
    .form-actionbar {
        /* position:sticky cannot be used here — MainLayout's
           .page-content sets overflow:hidden, which kills it.
           z-index stays under the 1000 tab bar. */
        position: fixed;
        left: var(--safe-left);
        right: var(--safe-right);
        /* Stacks directly on top of the tab bar rather than fighting it for the
           bottom edge. Both stay reachable, which matters on Create: the tab bar
           is how you abandon the form and the CTA is how you finish it.
           --tabbar-total already includes the home-indicator inset, so the bar no
           longer pays it itself — it is not touching the screen edge any more. */
        bottom: var(--tabbar-total);
        z-index: 900;
        margin: 0;
        padding: var(--space-3) var(--space-4);
        background: var(--color-surface);
        border-top: 1px solid var(--color-muted-stroke);
        box-shadow: var(--shadow-sheet);
    }

    .form-actionbar .btn-submit {
        min-width: 8.5rem;
    }
}

/* ------------------------------------------------------------
   6b. SEASON TOURNAMENT PICKER
   ------------------------------------------------------------ */
.season-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-3);
    border-top: 1px solid var(--color-muted-stroke);
}

.season-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--tap);
    padding: var(--space-3) var(--space-1);
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--color-muted-stroke);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.season-row:hover {
    background: var(--surface-2);
}

.season-row-check {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    font-size: 1.15rem;
    opacity: 0.4;
}

.season-row.is-selected .season-row-check {
    opacity: 1;
    color: var(--color-outline);
}

.season-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.season-row-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.season-row-name {
    font-size: 0.9375rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.season-row-flag {
    flex: none;
    padding: 0.1rem 0.45rem;
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: var(--radius-pill);
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
    font-size: 0.6875rem;
    font-weight: 700;
}

html[data-theme='dark'] .season-row-flag,
[data-bs-theme='dark'] .season-row-flag {
    background: rgba(251, 146, 60, 0.16);
    border-color: rgba(251, 146, 60, 0.35);
    color: #fdba74;
}

.season-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.season-row-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

/* One truncated line, not one pill per player. */
.season-row-players {
    font-size: 0.75rem;
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   7. TOURNAMENT LIST
   ------------------------------------------------------------ */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.list-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

@media (min-width: 641px) {
    .list-header h1 {
        font-size: 1.75rem;
    }
}

/* Cards are capped so a wide desktop shows a real multi-column grid rather
   than two 700px-wide cards. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 420px));
    justify-content: center;
    gap: var(--space-4);
    max-width: 1600px;
    margin: 0 auto;
}

.empty-filter-state {
    grid-column: 1 / -1;
}

.list-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.segmented {
    flex: 1;
    min-width: 0;
    display: flex;
    padding: 3px;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.segmented button {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.4rem;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--color-text);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.18s ease;
}

.segmented button.is-active {
    background: var(--color-surface);
    box-shadow: var(--shadow-1);
}

.segmented .seg-count {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.55;
}

.toolbar-icon-btn {
    flex: none;
    position: relative;
    width: var(--tap);
    height: var(--tap);
    display: grid;
    place-items: center;
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.toolbar-icon-btn:hover {
    border-color: var(--color-outline);
}

.toolbar-icon-btn.is-active {
    background: var(--navbar-bg);
    color: var(--navbar-text);
    border-color: transparent;
}

.list-search {
    position: relative;
    margin-bottom: var(--space-3);
}

.list-search i {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    opacity: 0.45;
    pointer-events: none;
}

.list-search input {
    width: 100%;
    min-height: var(--tap);
    padding: 0.5rem 2.5rem;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-muted-stroke);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
}

.list-search input:focus {
    outline: none;
    transform: none;
    border-color: var(--color-outline);
    box-shadow: var(--focus-ring);
}

.list-search .search-clear {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    opacity: 0.4;
    cursor: pointer;
}

.list-search .search-clear:hover {
    opacity: 1;
}

/* Type-filter rows inside the filter sheet */
.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--tap);
    padding: var(--space-2) var(--space-2);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.filter-option:hover {
    background: var(--surface-2);
}

.filter-option .filter-count {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 700;
    opacity: 0.5;
}

.filter-option .filter-check {
    color: var(--color-outline);
}
