/* Padelverse brand layer for the staff screens (app, Matches, Slides, sign-in).
   Loaded last so it restyles without touching layout or behaviour. It takes the
   look of the Own The Verse site: condensed uppercase headlines in silver and blue,
   navy gradient panels with hairline edges, blue pill controls and one gold action. */
@font-face {
    font-family: 'Saira Extra Condensed';
    src: url('/fonts/SairaExtraCondensed-Black.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
    size-adjust: 92%;
}

:root {
    --brand-bg: #030b1f;
    --brand-panel: #081737;
    --brand-panel-2: #0b1d44;
    --brand-line: rgba(110, 152, 215, .2);
    --brand-line-2: rgba(110, 152, 215, .34);
    --brand-ink: #eef4fc;
    --brand-ink-2: #a9bfdc;
    --brand-ink-3: #6f86ad;
    --brand-blue: #3385ff;
    --brand-blue-lt: #7cb5ff;
    --brand-gold-ink: #2e2108;
    --brand-up: #6fe0a5;
    --brand-display: 'Saira Extra Condensed', Impact, 'Arial Narrow', sans-serif;
    --brand-white-grad: linear-gradient(180deg, #ffffff 30%, #c7d9f0 100%);
    --brand-blue-grad: linear-gradient(180deg, #e6f1ff 8%, #93c2ff 50%, #3d85f0 100%);
    --brand-panel-fill: radial-gradient(90% 60% at 50% 0%, rgba(51, 133, 255, .07), transparent 70%), linear-gradient(160deg, var(--brand-panel-2), var(--brand-panel) 70%);
    --brand-pill-active: linear-gradient(180deg, #1b6de8, #0a56c8);
    --brand-ease: cubic-bezier(.16, 1, .3, 1);
}

html { background: var(--brand-bg); }
body {
    background: radial-gradient(60% 40% at 85% -6%, rgba(41, 127, 255, .2), transparent 70%) no-repeat, var(--brand-bg) !important;
    background-attachment: scroll !important;
    color: var(--brand-ink);
}
body::before { opacity: 0 !important; }

/* ---------- headlines ---------- */
.section-header h1,
.panel-heading h1,
.remote-heading h1,
.auth-card h1,
.settings-hero h1,
#display-settings-title,
.tournament-overview-card h2 {
    font-family: var(--brand-display) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .005em !important;
    line-height: .9 !important;
    padding-top: .06em;
    background: var(--brand-white-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
.section-header h1,
.panel-heading h1 { font-size: clamp(3rem, 6vw, 4.6rem) !important; }
.remote-heading h1 { font-size: clamp(3rem, 7vw, 4.8rem) !important; }
.auth-card h1 { font-size: clamp(2.4rem, 5vw, 3rem) !important; }
.tournament-overview-card h2 { font-size: clamp(2.2rem, 4.4vw, 3.3rem) !important; }
#display-settings-title { font-size: clamp(2rem, 3.4vw, 2.8rem) !important; }

.section-header .subtitle,
.remote-kicker {
    color: var(--brand-blue-lt) !important;
    font-size: .8rem !important;
    font-weight: 700 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase;
}
.section-header > p,
.panel-heading p,
.remote-heading .help { color: var(--brand-ink-2) !important; }

/* Section and card titles in the same condensed face, smaller. */
.t-create-heading h3,
.mb-round-title,
.draw-round > summary h3,
.led-screens h2,
.settings-panel header h2,
.public-list-heading h2,
.tournament-list-card h3 {
    font-family: var(--brand-display) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .01em !important;
    line-height: 1 !important;
    background: var(--brand-white-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
.t-create-heading h3 { font-size: 2.1rem !important; }
.mb-round-title,
.draw-round > summary h3 { font-size: 1.55rem !important; padding-top: .05em; }
.mb-round.is-done .mb-round-title,
.draw-round.is-done > summary h3 { opacity: .55; }
.led-screens h2,
.settings-panel header h2 { font-size: 1.9rem !important; }
.tournament-list-card h3 { font-size: 1.7rem !important; }

/* ---------- panels ---------- */
.glass-card,
.create-section-card,
.mb-round,
.draw-round,
.remote-panel,
.settings-panel,
.connection,
.standings-picker,
.result-row,
.standing-group,
.form-section,
.team-card,
.finalization-block,
.tournament-create-card {
    border: 0 !important;
    border-radius: 1.4rem !important;
    background: var(--brand-panel-fill) !important;
    box-shadow: inset 0 0 0 1px var(--brand-line), 0 .6rem 1.4rem rgba(1, 5, 16, .28) !important;
}
.create-section-card,
.mb-round,
.draw-round { box-shadow: inset 0 0 0 1px var(--brand-line) !important; }
.tournament-create-card .create-section-card { background: rgba(3, 11, 31, .45) !important; }
.mb-round-matches,
.mb-match + .mb-match { border-color: var(--brand-line) !important; }
.mb-round.is-live,
.draw-round.is-live { box-shadow: inset 0 0 0 1px rgba(111, 224, 165, .35) !important; }
.draw-round .draw-fixture { background: rgba(3, 11, 31, .5) !important; border-color: var(--brand-line) !important; }
.tournament-list-card { transition: transform .25s var(--brand-ease), box-shadow .25s; }
.tournament-list-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--brand-line-2), 0 1.6rem 3.2rem rgba(1, 5, 16, .4) !important; }

/* ---------- tabs and segmented controls ---------- */
.mode-tabs,
.mb-switch,
.led-mode,
#t-format-selection {
    gap: .25rem !important;
    padding: .3rem !important;
    border: 0 !important;
    border-radius: 1rem !important;
    background: rgba(3, 11, 31, .6) !important;
    box-shadow: inset 0 0 0 1px var(--brand-line) !important;
}
.mode-tab,
.mb-switch button,
.led-mode button,
#t-format-selection .format-btn {
    border: 0 !important;
    border-radius: .75rem !important;
    background: transparent !important;
    color: var(--brand-ink-2) !important;
    box-shadow: none !important;
}
.mode-tab.active,
.mb-switch button[aria-selected="true"],
.led-mode button[aria-checked="true"],
#t-format-selection .format-btn.selected {
    background: var(--brand-pill-active) !important;
    color: #fff !important;
    box-shadow: 0 .4rem 1rem rgba(8, 91, 215, .3) !important;
}
.mb-switch button[aria-selected="true"] small,
.led-mode button[aria-checked="true"] small { color: rgba(255, 255, 255, .8) !important; }

/* Tournament page tabs: one rounded control, the chosen tab marked like the selected filter pills. */
.t-tabs {
    display: flex;
    gap: .25rem;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 1.5rem;
    padding: .3rem;
    overflow-x: auto;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    background: var(--brand-panel);
    scrollbar-width: none;
}
.t-tabs::-webkit-scrollbar { display: none; }
.t-nav-tab {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: .45rem 1.15rem !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--brand-ink-2) !important;
    font-size: .875rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
}
.t-nav-tab:hover { color: #fff !important; }
.t-nav-tab.active {
    border-color: var(--brand-blue) !important;
    background: rgba(51, 133, 255, .18) !important;
    color: #fff !important;
}
.t-tab-count {
    min-width: 1.4rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: rgba(124, 181, 255, .14);
    color: var(--brand-ink-2);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}
.t-nav-tab.active .t-tab-count { background: rgba(124, 181, 255, .26); color: #fff; }
@media (max-width: 560px) {
    .t-tabs { width: 100%; }
    .t-nav-tab { flex: 1 0 auto; }
}

.format-btn:not(#t-format-selection .format-btn) { border-radius: 999px !important; }
.format-btn.selected:not(#t-format-selection .format-btn) {
    border-color: var(--brand-blue) !important;
    background: rgba(51, 133, 255, .18) !important;
    color: #fff !important;
}

/* ---------- buttons ---------- */
.btn,
.primary,
.secondary-action,
.refresh-button,
.pv-dialog-button,
.mb-edit,
.led-open,
.remote-buttons button { border-radius: 999px !important; }
.remote-buttons button { border-radius: 1.2rem !important; }
.btn-primary,
.primary,
.pv-dialog-button.is-primary {
    border: 0 !important;
    background: var(--brand-blue) !important;
    color: #fff !important;
    box-shadow: 0 .5rem 1.4rem rgba(51, 133, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
    transition: transform .2s var(--brand-ease), background-color .2s;
}
.btn-primary:hover,
.primary:hover,
.pv-dialog-button.is-primary:hover { background: #4a92ff !important; }
.btn:active,
.primary:active,
.pv-dialog-button:active { transform: scale(.97); }
/* The one main action on a screen is gold, as on the Own The Verse site. */
#admin-new-tournament,
#t-create-btn {
    border: 0 !important;
    background: linear-gradient(170deg, #f8dfa6, #d9b155) !important;
    color: var(--brand-gold-ink) !important;
    box-shadow: 0 .6rem 1.6rem rgba(240, 209, 138, .2), inset 0 1px 0 rgba(255, 255, 255, .5) !important;
}
#admin-new-tournament:hover,
#t-create-btn:hover { background: linear-gradient(170deg, #ffeab8, #e2bd65) !important; }
.btn-secondary,
.secondary-action,
.refresh-button,
.pv-dialog-button.is-secondary {
    border: 0 !important;
    background: rgba(3, 11, 31, .35) !important;
    color: var(--brand-ink) !important;
    box-shadow: inset 0 0 0 1.5px var(--brand-line-2) !important;
}
.btn-secondary:hover,
.secondary-action:hover,
.refresh-button:hover { box-shadow: inset 0 0 0 1.5px var(--brand-blue-lt) !important; }

/* ---------- fields ---------- */
.player-input,
.pv-dialog-field input,
.mb-search input,
.remote-panel select,
.standings-picker select {
    border: 0 !important;
    border-radius: .85rem !important;
    background: rgba(3, 11, 31, .6) !important;
    color: var(--brand-ink) !important;
    box-shadow: inset 0 0 0 1px var(--brand-line-2) !important;
}
.player-input:focus,
.mb-search input:focus { outline: 2px solid var(--brand-blue-lt) !important; outline-offset: 2px; }

/* ---------- numbers ---------- */
.stat-value,
.mb-result b,
.draw-fixture-score,
.points-box,
.pv-score-box,
.result-score,
#result-score-a,
#result-score-b {
    font-family: var(--brand-display) !important;
    font-weight: 700 !important;
    letter-spacing: .01em;
}
.stat-value { font-size: clamp(2rem, 4.6vw, 2.8rem) !important; line-height: 1; }
.mb-result b { font-size: 1.6rem !important; line-height: 1; }
.points-box,
.pv-score-box { font-size: 1.45rem !important; }
.stat-label { color: var(--brand-blue-lt) !important; letter-spacing: .14em !important; }

/* ---------- live and status colours ---------- */
.mb-state.is-live,
.mb-round.is-live .mb-round-meta,
.draw-round.is-live .draw-round-meta { color: var(--brand-up) !important; }
.mb-state.is-ready,
.court-cta { color: var(--brand-blue-lt) !important; }

/* ---------- header and bottom navigation ---------- */
.workspace-header {
    background: rgba(3, 11, 31, .96) !important;
    border-bottom: 1px solid var(--brand-line) !important;
}
.workspace-account summary {
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(3, 11, 31, .35) !important;
    box-shadow: inset 0 0 0 1.5px var(--brand-line-2) !important;
}
.app-tabs {
    background: rgba(3, 11, 31, .97) !important;
    border-top: 1px solid var(--brand-line) !important;
}
.app-tabs [aria-current="page"],
.app-tabs .active,
.app-tabs [aria-selected="true"] { color: #fff !important; }
.app-tabs [aria-current="page"] svg,
.app-tabs .active svg,
.app-tabs [aria-selected="true"] svg { background: var(--brand-pill-active) !important; color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .tournament-list-card, .btn-primary, .primary { transition: none; }
    .tournament-list-card:hover { transform: none; }
}

/* ---------- match actions on the Matches board: Live score in blue, the rest outlined ---------- */
.mb-court-cards .scoreable-court {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.mb-court-cards .scoreable-court > .court {
    flex: 1 1 12rem;
    min-height: 3.2rem !important;
    padding: .55rem 3rem .55rem 1.2rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--brand-blue) !important;
    box-shadow: 0 .5rem 1.4rem rgba(51, 133, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
}
.mb-court-cards .scoreable-court > .court:hover { background: #4a92ff !important; }
.mb-court-cards .scoreable-court > .court .court-cta { color: #fff !important; }
.mb-court-cards .scoreable-court > .court .chevron {
    right: .45rem !important;
    width: 2.3rem !important;
    height: 2.3rem !important;
    border: 0 !important;
    background: rgba(255, 255, 255, .18) !important;
}
.mb-court-cards .scoreable-court > .court[data-state="switch"],
.mb-court-cards .scoreable-court > .court[data-state="busy"] {
    border-radius: 1.1rem !important;
    background: rgba(3, 11, 31, .5) !important;
    box-shadow: inset 0 0 0 1.5px var(--brand-line-2) !important;
}
.mb-court-cards .scoreable-court > .court[data-state="switch"] .court-cta { color: var(--brand-blue-lt) !important; }
.mb-court-cards .scoreable-actions {
    position: static !important;
    flex: 1 1 12rem;
    height: auto !important;
    min-height: 3.2rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    overflow: hidden;
    background: rgba(3, 11, 31, .35) !important;
    box-shadow: inset 0 0 0 1.5px var(--brand-line-2) !important;
}
.mb-court-cards .scoreable-actions > button {
    border: 0 !important;
    background: transparent !important;
    color: var(--brand-ink) !important;
}
.mb-court-cards .scoreable-actions > button + button { box-shadow: inset 1.5px 0 0 var(--brand-line-2); }
.mb-court-cards .scoreable-actions > button:hover { background: rgba(51, 133, 255, .14) !important; }
.mb-court-cards .scoreable-actions .direct-result span { color: var(--brand-ink) !important; font-weight: 800; }
.mb-court-cards .scoreable-actions .direct-result small { color: var(--brand-ink-3) !important; }

/* ---------- category headings and the phone tab bar in the app ---------- */
.draw-category > h2 {
    font-family: var(--brand-display) !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
    text-transform: uppercase;
    line-height: 1;
    background: var(--brand-blue-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
#mobile-bottom-nav {
    background: rgba(3, 11, 31, .97) !important;
    border-top: 1px solid var(--brand-line) !important;
}
.mobile-nav-btn.active { color: #fff !important; }
.mobile-nav-btn.active svg { background: var(--brand-pill-active) !important; color: #fff; }
.mb-court-cards .scoreable-actions .direct-result small { display: none !important; }

/* ---------- sign-in ---------- */
#staff-story-title,
#staff-login-title {
    font-family: var(--brand-display) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .005em !important;
    line-height: .88 !important;
    padding-top: .06em;
    background: var(--brand-white-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
#staff-story-title { font-size: clamp(3.4rem, 7vw, 6rem) !important; }
#staff-login-title { font-size: clamp(2.6rem, 4vw, 3.4rem) !important; }
.staff-login-action {
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--brand-blue) !important;
    color: #fff !important;
    box-shadow: 0 .5rem 1.4rem rgba(51, 133, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
}
.staff-login-action:hover { background: #4a92ff !important; }

/* ---------- app feel: screen titles instead of page heroes, pinned controls, touch feedback ---------- */
html, body { overscroll-behavior-y: none; }
button, a, summary, label, select, [role="tab"], [role="radio"] { -webkit-tap-highlight-color: transparent; }
button, summary, [role="tab"], .mode-tab, .app-tabs, #mobile-bottom-nav, .t-nav-tab, .mb-round > summary, .draw-round > summary {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* A screen title, sized like a native large title. The explanatory line under it is dropped;
   every control on the screen stays where it was. */
body.is-app-workspace .section-header:not(.public-tournament-hero) h1,
body[data-app-screen] .panel-heading h1,
.remote-heading h1 {
    font-size: clamp(2.3rem, 5vw, 3rem) !important;
}
body.is-app-workspace .section-header:not(.public-tournament-hero) > .subtitle,
body.is-app-workspace .section-header:not(.public-tournament-hero) > p,
body[data-app-screen] .panel-heading p,
.remote-heading .remote-kicker,
.remote-heading .help { display: none !important; }
body.is-app-workspace .section-header:not(.public-tournament-hero) { margin-bottom: 1rem !important; padding-top: .25rem !important; }
body[data-app-screen] .panel-heading { margin-bottom: .9rem !important; align-items: center !important; }
.remote-heading { margin-bottom: 1rem !important; }
.tournament-overview-card h2 { font-size: clamp(2rem, 4vw, 2.6rem) !important; }

/* The scorer tabs stay pinned under the header while the list scrolls. */
body[data-app-screen="score"] .mode-tabs {
    position: sticky;
    top: calc(var(--workspace-header-height, 4rem) + .5rem);
    z-index: 30;
    background: rgba(3, 11, 31, .97) !important;
}
body.is-embedded[data-app-screen="score"] .mode-tabs { top: .5rem; }

/* Press feedback replaces hover lift. */
.tournament-list-card:hover { transform: none !important; }
.tournament-list-card:active,
.mb-round > summary:active,
.draw-round > summary:active,
.mode-tab:active,
.mb-switch button:active,
.t-nav-tab:active { transform: scale(.985); }
.tournament-list-card,
.mb-round > summary,
.draw-round > summary { transition: transform .15s var(--brand-ease); }

/* Phones: tighter gutters and panels, the way a native list sits on screen. */
@media (max-width: 620px) {
    body[data-app-screen] .shell,
    body.is-app-workspace #app-content { padding-left: 1rem !important; padding-right: 1rem !important; }
    .glass-card, .mb-round, .draw-round, .remote-panel, .settings-panel, .standing-group, .result-row { border-radius: 1.1rem !important; }
    .mb-match { padding: .75rem .85rem !important; }
    .mb-round > summary { min-height: 3.2rem !important; padding: .6rem .85rem !important; }
    body.is-app-workspace .section-header:not(.public-tournament-hero) h1,
    body[data-app-screen] .panel-heading h1,
    .remote-heading h1 { font-size: 2.3rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    .tournament-list-card, .mb-round > summary, .draw-round > summary { transition: none; }
    .tournament-list-card:active, .mb-round > summary:active, .draw-round > summary:active, .mode-tab:active, .mb-switch button:active, .t-nav-tab:active { transform: none; }
}

/* ---------- performance: no live blur behind panels that are painted solid anyway ----------
   Background blur is recomputed on every scroll frame and is the main cost on phones and in
   the Android app. Dialog backdrops keep theirs; they are only on screen briefly. */
#app-header,
#main-nav,
#mobile-bottom-nav,
.workspace-header,
.app-tabs,
.glass-card,
.settings-panel,
.control-card,
.tournament-create-card,
.create-section-card,
.player-dropdown,
.t-automatic-stage-note,
.manual-draft-status,
.settings-toolbar,
.remote-panel,
.mb-round,
.draw-round {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
#t-create-actions {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(3, 11, 31, .97) !important;
}
#app-header { background: rgba(3, 11, 31, .97) !important; }

/* ---------- finish: one radius scale, breathing room between cards, a calmer tab bar ----------
   Cards 1.1-1.4rem, controls .85rem, chips and buttons fully round. */
#admin-tournament-list-container[style*="display: block"] { display: grid !important; gap: .75rem; }

/* The active tab carries a soft pill behind its icon instead of a solid block. */
.mobile-nav-btn svg,
.app-tabs svg { box-sizing: content-box; padding: .3rem 1rem; border-radius: 999px; transition: background-color .2s var(--brand-ease); }
.mobile-nav-btn.active svg,
.app-tabs [aria-current="page"] svg,
.app-tabs .active svg,
.app-tabs [aria-selected="true"] svg { background: rgba(51, 133, 255, .24) !important; color: #fff; }
.mobile-nav-btn:not(.active) { color: var(--brand-ink-3) !important; }

/* Match cards in a draw: rounded, with compact actions so a card is not a stack of buttons. */
.draw-fixture { border-radius: 1rem !important; }
.draw-fixture footer .btn {
    flex: 1 1 auto;
    min-height: 2.6rem;
    padding: .45rem .95rem !important;
    font-size: .88rem !important;
}
.draw-fixture footer .t-draw-score-link { flex-basis: 100%; }
.draw-fixture-teams > small { font-size: .7rem; }

/* Secondary menus take the same round shape as every other control. */
.t-danger-menu > summary {
    border: 0 !important;
    border-radius: 999px !important;
    padding: .6rem 1.1rem !important;
    box-shadow: inset 0 0 0 1.5px var(--brand-line-2);
}

@media (max-width: 620px) {
    .draw-round > .draw-fixture-grid { padding: 0 .6rem .6rem !important; }
    .draw-fixture { padding: .85rem .9rem !important; gap: .65rem !important; }
}

/* Entry tools (paste a list, names only, emails) wrap as chips instead of squeezing. */
.t-entry-tools { flex-wrap: wrap; }
.t-entry-tool,
.t-entry-switch { border-radius: 999px !important; white-space: nowrap; }
.t-entry-switch { padding: 0 .95rem !important; }
/* A switch that is on reads like a chosen pill. */
.t-entry-switch:has(input:checked) {
    border-color: var(--brand-blue) !important;
    background: rgba(51, 133, 255, .18);
    color: #fff;
}

/* On a phone the create form's outer card steps back so its sections get the width. */
@media (max-width: 620px) {
    .tournament-create-card { padding: .55rem !important; }
    .tournament-create-card .create-section-card { padding: 1rem .9rem !important; }
}
