@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --ink: #182720;
    --muted: #758079;
    --line: #e8ece7;
    --paper: #f5f7f3;
    --card: #ffffff;
    --green: #1a573d;
    --green-dark: #143f2e;
    --lime: #d7f273;
    --orange: #d88052;
    --shadow: 0 18px 55px rgba(28, 50, 37, .055);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { max-width: 1440px; margin: 0 auto; padding: 54px 6vw 32px; }
.site-top-menu { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; min-height: 58px; margin: -54px -6vw 30px; padding: 8px 6vw; border-bottom: 1px solid #e5ebe4; background: rgba(245, 247, 243, .96); box-shadow: 0 5px 20px rgba(28, 50, 37, .04); backdrop-filter: blur(14px); }
.site-menu-link { display: inline-flex; min-height: 38px; align-items: center; padding: 0 14px; border-radius: 10px; color: #718077; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-menu-link:hover { background: rgba(255, 255, 255, .7); color: var(--green); }
.site-menu-link[aria-current="page"] { background: white; color: var(--green); box-shadow: 0 2px 8px rgba(28, 50, 37, .08); }
.site-menu-account { display: grid; flex: 0 0 auto; justify-items: end; gap: 3px; min-width: 0; margin-left: auto; padding: 0 12px; border-left: 1px solid #e5ebe4; line-height: 1.2; white-space: nowrap; }
.site-menu-account strong { max-width: 170px; overflow: hidden; color: #3f5d45; font-size: 11px; font-weight: 700; text-overflow: ellipsis; }
.site-menu-account span { max-width: 210px; overflow: hidden; color: #829084; font-size: 10px; text-overflow: ellipsis; }
.site-menu-logout-form { flex: 0 0 auto; margin: 0; }
.site-menu-logout-button { gap: 6px; border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.site-menu-logout-button span { font-size: 15px; line-height: 1; }
.back-button { gap: 7px; }
.back-arrow { font-size: 16px; line-height: 1; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.eyebrow, .step-label, .court-label, .page-footer { font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; letter-spacing: .1em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #65736a; font-size: 10px; font-weight: 500; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #8bb650; box-shadow: 0 0 0 4px rgba(139, 182, 80, .14); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 15px 0 8px; font-size: clamp(32px, 4vw, 49px); letter-spacing: -.055em; line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; }
.event-name-editor { position: relative; z-index: 4; display: inline-block; margin-top: 12px; }
.event-name-editor summary { min-height: 36px; padding: 8px 12px; cursor: pointer; font-size: 11px; list-style: none; }
.event-name-editor summary::-webkit-details-marker { display: none; }
.event-name-edit-form { position: absolute; top: calc(100% + 8px); left: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: min(360px, calc(100vw - 40px)); padding: 14px; border: 1px solid #e4eae2; border-radius: 12px; background: white; box-shadow: 0 14px 35px rgba(28, 50, 37, .14); }
.event-name-edit-form label { grid-column: 1 / -1; color: #56645a; font-size: 11px; font-weight: 600; }
.event-name-edit-form input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 8px; background: #fbfcfa; outline: none; }
.event-name-edit-form .button { min-height: 40px; padding: 0 12px; font-size: 11px; }
.reset-form { flex: 0 0 auto; }
.delete-tournament-form { flex: 0 0 auto; }
.event-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.event-actions form { margin: 0; }
.account-bar { display: flex; align-items: center; gap: 13px; }
.account-bar form { margin: 0; }
.account-identity { display: grid; justify-items: end; gap: 3px; color: #829084; font-size: 10px; }
.account-identity strong { color: #3f5d45; font-size: 11px; font-weight: 700; }
.auth-shell { width: min(100% - 40px, 440px); margin: 0 auto; padding: 72px 0 30px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0 0 24px; color: #1d2c23; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 38px; font-weight: 800; letter-spacing: -1.8px; line-height: 1; }
.auth-brand-ball { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 2px; }
.auth-brand-ball svg { display: block; width: 36px; height: 36px; }
.auth-brand-ball circle { fill: #d7f273; stroke: #86a94d; stroke-width: 1.3; }
.auth-brand-ball path { fill: none; stroke: #86a94d; stroke-linecap: round; stroke-width: 1.3; }
.auth-brand-plus { color: #8eaf43; font-size: 47px; }
.auth-panel { margin-top: 0; padding: 29px; }
.auth-panel h1 { margin: 9px 0 7px; font-size: 34px; }
.auth-intro { margin: 0 0 22px; color: #89958c; font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 5px; color: #56645a; font-size: 11px; font-weight: 600; }
.auth-form input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; outline: none; }
.auth-form .button { min-height: 45px; margin-top: 8px; }
.auth-hint { margin: -3px 0 3px; color: #9aa49c; font-size: 10px; line-height: 1.5; }
.auth-switch { margin: 20px 0 0; color: #89958c; font-size: 11px; text-align: center; }
.auth-switch a { color: var(--green); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.event-shell { max-width: 1180px; }
.event-hero { align-items: center; margin-bottom: 37px; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid #e2e9df; border-radius: 999px; background: rgba(255,255,255,.56); color: #718071; font-size: 11px; }
.local-badge span { width: 7px; height: 7px; border-radius: 50%; background: #83a85c; }
.create-event-launch-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 20px; }
.create-event-trigger { min-height: 44px; white-space: nowrap; }
.create-event-trigger:disabled { cursor: not-allowed; opacity: .48; }
.create-event-launch-hint { color: #89958c; font-size: 11px; }
.create-event-form { display: flex; gap: 9px; }
.create-event-form input, .create-event-form select { min-width: 0; flex: 1; height: 46px; padding: 0 13px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; outline: none; }
.create-event-form input::placeholder { color: #abb4ad; }
.create-event-form select:focus, .club-create-form input:focus, .club-admin-assign-form select:focus { border-color: #9ab69e; outline: none; box-shadow: 0 0 0 3px rgba(65, 117, 82, .1); }
.create-event-form .button { min-height: 46px; padding: 0 17px; }
.club-management-panel { max-width: 760px; margin-bottom: 16px; }
.player-library-page .club-management-panel, .player-library-page .club-management-list { max-width: none; }
.club-create-form { display: flex; gap: 9px; }
.club-create-form input { min-width: 0; flex: 1; height: 46px; padding: 0 14px; border: 1px solid #dce5dc; border-radius: 9px; background: #fff; color: #405046; font: inherit; font-size: 13px; outline: none; }
.club-create-form .button { min-height: 44px; padding: 0 17px; white-space: nowrap; }
.club-create-form .button:focus-visible { outline: 3px solid #cde29d; outline-offset: 3px; }
.club-admin-assign-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 9px; }
.club-admin-assign-form select { min-width: 0; height: 44px; padding: 0 11px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; }
.club-admin-assign-form .button { padding: 0 14px; }
.club-management-list, .club-invitation-list { display: grid; max-width: 760px; gap: 9px; }
.club-management-row { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid #e8ede7; border-radius: 13px; background: var(--card); }
.club-management-row strong { color: #405346; font-size: 13px; }
.club-admin-empty { min-height: 72px; }
.invite-generate-button { min-height: 44px; padding: 0 17px; }
.player-library-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; max-width: 580px; }
.player-library-form > label { align-self: end; color: #526057; font-size: 11px; font-weight: 600; }
.player-library-form > input, .player-library-form > select, .match-edit-team select { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 12px; }
.player-library-actions { display: flex; grid-column: 1 / -1; gap: 8px; }
.player-library-actions .button { min-height: 42px; }
.player-library-add-trigger { display: inline-flex; width: 50px; height: 50px; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: #f1f6e7; color: #6d9143; font-size: 27px; line-height: 1; }
.player-library-add-trigger:hover { background: #e9f1d9; }
.player-library-dialog { width: min(460px, calc(100vw - 32px)); max-width: none; max-height: min(90vh, 720px); padding: 0; overflow: auto; border: 1px solid #e1e8e0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(17, 33, 22, .24); }
.player-library-dialog::backdrop { background: rgba(20, 33, 25, .46); backdrop-filter: blur(3px); }
.player-library-dialog-content { padding: 22px; }
.player-library-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.player-library-dialog-header .step-label { margin-bottom: 5px; }
.player-library-dialog-header h2 { margin: 0; color: #203329; font-size: 21px; }
.player-library-dialog .player-library-form { grid-template-columns: minmax(0, 1fr); gap: 7px; max-width: none; }
.player-library-dialog .player-library-form > label { grid-column: 1; margin-top: 5px; }
.player-library-dialog .player-library-form > input:not([type="hidden"]), .player-library-dialog .player-library-form > select { grid-column: 1; width: 100%; }
.player-library-dialog .player-library-actions { grid-column: 1; justify-content: flex-end; margin-top: 9px; }
.player-library-row { justify-content: flex-start; }
.player-library-name { display: grid; min-width: 0; flex: 1; gap: 3px; }
.player-library-name strong { color: #405346; font-size: 13px; }
.player-library-name > span { color: #8b978e; font-size: 10px; }
.player-library-row-actions { display: flex; align-items: center; gap: 6px; }
.player-library-row-actions form { margin: 0; }
.player-library-row-actions .button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.player-library-club-filter { justify-content: flex-start; margin: 0; }
.player-library-filter { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(120px, .8fr) minmax(120px, .8fr) auto auto; align-items: end; gap: 9px; margin: 0 0 16px; padding: 14px; border: 1px solid #e8ede7; border-radius: 12px; background: #fbfcfa; }
.player-library-filter > label { display: grid; min-width: 0; gap: 5px; color: #657268; font-size: 10px; font-weight: 600; }
.player-library-filter input, .player-library-filter select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 8px; background: white; color: #405046; font: inherit; font-size: 11px; }
.player-library-filter > .button { min-height: 40px; padding: 0 12px; font-size: 10px; }
.player-library-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 2px 0; border-top: 1px solid #e8ede7; }
.player-library-pagination-summary { color: #87938a; font-size: 11px; }
.player-library-pagination-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.player-library-pagination-controls .button { min-height: 36px; padding: 0 11px; font-size: 11px; }
.player-library-pagination-controls .button.is-current { border-color: #1b5c43; background: #1b5c43; color: #fff; }
.player-picker-open { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 17px; padding: 0 13px; }
.player-picker-open-count { color: #89958c; font-size: 10px; font-weight: 500; white-space: nowrap; }
.player-picker-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(85vh, 720px); padding: 0; overflow: hidden; border: 1px solid #e1e8e0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(17, 33, 22, .24); }
.player-picker-dialog::backdrop { background: rgba(20, 33, 25, .46); backdrop-filter: blur(3px); }
.player-picker-form { display: flex; max-height: min(85vh, 720px); flex-direction: column; padding: 20px; }
.player-picker-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.player-picker-header .step-label { margin-bottom: 5px; }
.player-picker-header h3 { margin: 0; color: #203329; font-size: 20px; }
.player-picker-intro, .player-picker-gender-hint { margin: 0 0 10px; color: #829087; font-size: 11px; line-height: 1.6; }
.player-picker-gender-hint a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.player-picker-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.player-picker-tools > div { display: flex; gap: 6px; }
.player-picker-tools .button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.player-picker-tools > span { color: #829087; font-size: 11px; white-space: nowrap; }
.player-picker-tools strong { color: var(--green); font-size: 13px; }
.player-picker-list { display: grid; min-height: 120px; gap: 6px; overflow-y: auto; padding: 1px 3px 1px 0; }
.player-picker-option { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 7px 10px; border: 1px solid #e9eee8; border-radius: 10px; background: #fbfcfa; cursor: pointer; }
.player-picker-option:has(input:checked) { border-color: #b6c9b5; background: #f1f7ed; }
.player-picker-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.player-picker-option-name { overflow: hidden; color: #405346; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.player-picker-option-meta { color: #859188; font-size: 10px; white-space: nowrap; }
.player-picker-option-note { grid-column: 2 / -1; color: #a27b44; font-size: 9px; }
.player-picker-option.is-disabled { background: #f7f8f6; cursor: not-allowed; opacity: .65; }
.player-picker-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #edf0ec; }
.player-picker-footer .button { min-height: 42px; padding: 0 15px; }
.player-picker-footer [disabled] { cursor: not-allowed; opacity: .5; }
.player-library-empty-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin: 10px 0 17px; color: #89958c; font-size: 11px; }
.player-library-empty-hint p { margin: 0; }
.player-library-empty-hint a { color: #1b5c43; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.generated-invitation { display: grid; gap: 8px; margin-top: 17px; padding: 15px; border: 1px solid #dfe9d2; border-radius: 11px; background: #f2f8e9; color: #446236; font-size: 11px; }
.generated-invitation strong { color: #203c2a; font-family: "Manrope", monospace; font-size: 21px; letter-spacing: .08em; overflow-wrap: anywhere; }
.club-invitation-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #e8ede7; border-radius: 12px; background: var(--card); color: #929d94; font-size: 10px; }
.club-invitation-row > div { display: grid; gap: 5px; }
.club-invitation-row strong { color: #4e6454; font-size: 12px; }
.event-list-section { margin-top: 43px; }
.club-filter { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 18px; color: #76847a; font-size: 11px; }
.club-filter select { min-width: 170px; height: 38px; padding: 0 11px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fff; color: #405046; font: inherit; }
.club-filter select:focus { border-color: #9ab69e; outline: none; box-shadow: 0 0 0 3px rgba(65, 117, 82, .1); }
.clear-filter-link { color: var(--green); font-size: 11px; text-decoration: none; }
.clear-filter-link:hover { text-decoration: underline; }
.tournament-list { display: grid; gap: 11px; }
.tournament-card { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; align-items: center; gap: 22px; padding: 17px 19px; border: 1px solid #e8ede7; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.tournament-card:hover { transform: translateY(-1px); border-color: #cbd8c8; box-shadow: 0 15px 36px rgba(28, 50, 37, .08); }
.tournament-card-main { display: flex; min-width: 0; align-items: center; gap: 13px; }
.tournament-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #eff5e6; color: #658142; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 700; }
.tournament-icon-tennis svg { display: block; width: 25px; height: 25px; overflow: visible; }
.tournament-icon-tennis circle { fill: #d7f273; stroke: #86a94d; stroke-width: 1.3; }
.tournament-icon-tennis path { fill: none; stroke: #86a94d; stroke-linecap: round; stroke-width: 1.3; }
.tournament-title-block { min-width: 0; }
.tournament-title-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.tournament-title-block h3 { overflow: hidden; margin: 0 0 5px; color: #29392e; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.tournament-title-row h3 { min-width: 0; flex: 1; }
.tournament-club-chip { flex: 0 0 auto; max-width: 40%; overflow: hidden; padding: 3px 7px; border-radius: 999px; background: #f1f5eb; color: #6d825d; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.tournament-title-block p { margin: 0; color: #939e95; font-size: 10px; }
.tournament-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 17px; color: #929d94; font-size: 10px; }
.tournament-stats strong { color: #4e6454; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 13px; font-weight: 600; }
.tournament-arrow { color: #99a89a; font-size: 20px; text-align: right; }
.club-group { margin-bottom: 22px; }
.club-group-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 0 2px 9px; }
.club-group-heading .step-label { margin-bottom: 4px; }
.club-group-heading h3 { margin: 0; color: #405346; font-size: 14px; }
.club-group-heading > span { color: #9aa49c; font-size: 10px; }
.event-empty-board { max-width: 760px; }
.event-empty-board .court-lines { width: 104px; height: 60px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 700; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-quiet { padding: 11px 15px; border: 1px solid #dce3dc; background: rgba(255,255,255,.58); color: #56635a; }
.button-quiet:hover { background: white; }
.button-danger { padding: 11px 14px; border: 1px solid #f0dbd5; background: #fff8f6; color: #a44c3b; }
.button-danger:hover { background: #fff0ec; }
.button-primary { padding: 0 17px; background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-draw { width: 100%; min-height: 51px; margin-top: 21px; padding: 0 18px; background: var(--lime); color: #21331e; }
.button-draw:hover:not(:disabled) { background: #c9e763; box-shadow: 0 8px 18px rgba(140, 174, 66, .2); }
.button-draw:disabled { cursor: not-allowed; opacity: .48; }
.button-arrow { font-size: 19px; font-weight: 400; }
.event-start-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -6px 0 18px; padding: 15px 17px; border: 1px solid #e3eadc; border-radius: 13px; background: #fbfdf8; }
.event-start-panel p { margin: 4px 0 0; color: #768277; font-size: 11px; line-height: 1.55; }
.event-start-panel form { flex: 0 0 auto; margin: 0; }
.button-start { min-height: 44px; padding: 0 19px; background: var(--green); color: #fff; white-space: nowrap; }
.button-start:hover:not(:disabled) { background: var(--green-dark); }
.button-start:disabled { cursor: not-allowed; opacity: .48; }
.event-started-banner { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; padding: 12px 15px; border: 1px solid #e3eadc; border-radius: 12px; background: #fbfdf8; color: #637261; font-size: 11px; }
.event-started-banner .started-badge { margin: 0; }
.match-score-locked { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef1ed; color: #9aa49c; font-size: 10px; }
.button-score { min-height: 39px; padding: 0 13px; background: #eaf1e7; color: var(--green); white-space: nowrap; }
.button-score:hover { background: #dce9d8; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 12px 15px; border: 1px solid #dfe9d2; border-radius: 11px; background: #f2f8e9; color: #446236; font-size: 13px; }
.notice[hidden] { display: none; }
.notice-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #dcebc4; font-size: 11px; font-weight: 700; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 18px; }
.panel, .round-card { border: 1px solid #e8ede7; border-radius: 17px; background: var(--card); box-shadow: var(--shadow); }
.panel { padding: 24px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.step-label { margin-bottom: 7px; color: #9ba59d; font-size: 9px; font-weight: 500; }
h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.04em; }
.count-pill { display: flex; align-items: baseline; gap: 6px; padding: 8px 11px; border-radius: 9px; background: #f1f5ee; color: #5c6c5f; font-size: 11px; }
.count-pill strong { color: var(--green); font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 18px; }
.number-input-wrap, .score-form input { border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; }
input:focus { border-color: #9ab69e !important; box-shadow: 0 0 0 3px rgba(65, 117, 82, .1); }
.roster-empty { display: flex; align-items: center; gap: 12px; min-height: 85px; color: #89958c; font-size: 12px; }
.roster-empty p { margin: 0; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px dashed #bbc7bc; border-radius: 9px; color: #8fa08f; font-size: 17px; }
.player-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; max-height: 252px; overflow: auto; margin-top: 17px; }
.player-row { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 8px 9px; border: 1px solid #edf0ec; border-radius: 9px; background: #fcfdfb; }
.player-index { color: #a5aea7; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 10px; }
.player-name { flex: 1; overflow: hidden; color: #34443a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-row form { margin: 0; }
.icon-button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: #99a49b; font-size: 19px; line-height: 1; }
.icon-button:hover { background: #f7e9e5; color: #aa6048; }
.panel-footnote { margin: 15px 0 0; color: #a0aaa2; font-size: 10px; }
.draw-mark { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: #f1f6e4; color: #64813b; font-size: 21px; }
.scoring-rule-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 19px; }
.scoring-rule-form label { grid-column: 1 / -1; color: #526057; font-size: 12px; }
.scoring-rule-form select { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 11px; }
.scoring-rule-form .button { min-height: 42px; padding: 0 12px; }
.scoring-rule-form .panel-footnote { grid-column: 1 / -1; margin: 0; line-height: 1.5; }
.draw-form { display: grid; gap: 14px; }
.started-settings { display: grid; gap: 5px; }
.started-settings p { margin: 0; color: #657268; font-size: 11px; line-height: 1.55; }
.started-settings p strong { color: #405046; font-weight: 600; }
.started-settings .panel-footnote { margin-top: 7px; }
.started-badge { width: fit-content; margin-bottom: 4px; padding: 5px 8px; border-radius: 999px; background: #eef4e9; color: #557447; font-size: 9px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #526057; font-size: 13px; }
.number-input-wrap { display: flex; align-items: center; width: 112px; height: 40px; padding: 0 11px; }
.number-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #26372c; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 15px; font-variant-numeric: tabular-nums; }
.number-input-wrap span { color: #97a198; font-size: 11px; }
.draw-summary { display: flex; gap: 10px; align-items: flex-start; margin-top: 1px; padding: 12px 13px; border-radius: 10px; background: #f7f9f2; }
.draw-summary p { margin: 0; color: #6f7d70; font-size: 11px; line-height: 1.65; }
.summary-icon { color: #92ae50; font-size: 13px; }
.match-target-suggestion { display: grid; gap: 7px; padding: 11px 12px; border: 1px solid #e4ebdd; border-radius: 10px; background: #f7faf2; }
.match-target-suggestion > p { margin: 0; color: #607062; font-size: 11px; line-height: 1.55; }
.match-target-suggestion > p strong { color: var(--green); font-size: 13px; }
.results-section { margin-top: 0; }
.mobile-tournament-tabs { position: sticky; top: 62px; z-index: 12; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: min(100%, 620px); margin: 0 0 18px; padding: 5px; border: 1px solid #e5ebe4; border-radius: 14px; background: rgba(245, 247, 243, .94); box-shadow: 0 8px 24px rgba(28, 50, 37, .08); backdrop-filter: blur(12px); }
.mobile-tournament-tab { min-width: 0; min-height: 42px; padding: 0 7px; border: 0; border-radius: 10px; background: transparent; color: #748078; font-size: 12px; font-weight: 600; white-space: nowrap; }
.mobile-tournament-tab[aria-pressed="true"] { background: white; color: var(--green); box-shadow: 0 2px 8px rgba(28, 50, 37, .08); }
.tournament-page[data-mobile-tab="setup"] .results-section,
.tournament-page[data-mobile-tab="setup"] .share-panel,
.tournament-page[data-mobile-tab="matches"] #mobile-panel-setup,
.tournament-page[data-mobile-tab="matches"] .share-panel,
.tournament-page[data-mobile-tab="standings"] #mobile-panel-setup,
.tournament-page[data-mobile-tab="standings"] .share-panel,
.tournament-page[data-mobile-tab="share"] #mobile-panel-setup,
.tournament-page[data-mobile-tab="share"] .results-section { display: none; }
.tournament-page[data-mobile-tab="matches"] .results-section,
.tournament-page[data-mobile-tab="standings"] .results-section { display: block; }
.tournament-page[data-mobile-tab="share"] .share-panel { display: block; margin-top: 0; }
.tournament-page[data-mobile-tab="matches"] .competition-grid,
.tournament-page[data-mobile-tab="standings"] .competition-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.tournament-page[data-mobile-tab="matches"] .rounds-column { display: grid; }
.tournament-page[data-mobile-tab="matches"] .leaderboard-panel { display: none; }
.tournament-page[data-mobile-tab="standings"] .results-section .section-heading,
.tournament-page[data-mobile-tab="standings"] .event-start-panel,
.tournament-page[data-mobile-tab="standings"] .event-started-banner,
.tournament-page[data-mobile-tab="standings"] .rounds-column { display: none; }
.tournament-page[data-mobile-tab="standings"] .leaderboard-panel { display: block; position: static; padding: 24px; }
.tournament-page[data-mobile-tab="matches"] .results-section,
.tournament-page[data-mobile-tab="standings"] .results-section { scroll-margin-top: 120px; }
.tournament-page .match-card[id^="match-"] { scroll-margin-top: 130px; }

.share-panel { margin-top: 18px; }
.share-panel > .panel-footnote { max-width: 720px; line-height: 1.6; }
.share-create-form { display: grid; gap: 8px; max-width: 520px; margin-top: 18px; }
.share-create-form > label { color: #526057; font-size: 12px; font-weight: 600; }
.share-controls { display: flex; align-items: center; gap: 9px; }
.share-controls .number-input-wrap { width: 135px; height: 44px; }
.share-controls .button { min-height: 44px; }
.share-status { margin-top: 17px; color: #557447; font-size: 11px; font-weight: 700; }
.share-link-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.share-link-input { min-width: 0; flex: 1; height: 42px; padding: 0 11px; border: 1px solid #dfe8d8; border-radius: 9px; background: #f7faf3; color: #48613e; font: inherit; font-size: 11px; }
.share-revoke-form { margin-top: 11px; }
.share-revoke-form .button { padding: 9px 12px; font-size: 11px; }
.tournament-create-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tournament-create-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid #e1e8e0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(17, 33, 22, .24); }
.tournament-create-dialog::backdrop { background: rgba(20, 33, 25, .46); backdrop-filter: blur(3px); }
.tournament-create-dialog-content { padding: 22px; }
.tournament-create-dialog .player-library-dialog-header { margin-bottom: 18px; }
.tournament-create-dialog .tournament-create-form { gap: 13px 11px; }
.tournament-create-field { display: grid; min-width: 0; gap: 6px; color: #526057; font-size: 11px; font-weight: 600; }
.tournament-create-field select, .tournament-create-field input { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 12px; font-weight: 400; }
.tournament-create-name { grid-column: 1 / -1; }
.tournament-create-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.tournament-create-actions .button { min-height: 44px; }
.tournament-create-actions .button:disabled { cursor: not-allowed; opacity: .48; }
.tournament-create-dialog .panel-footnote { margin-top: 16px; line-height: 1.6; }
.tournament-settings-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 17px; }
.tournament-settings-form > label { grid-column: 1 / -1; color: #526057; font-size: 12px; }
.tournament-settings-form > select { grid-column: 1 / -1; width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 11px; }
.tournament-settings-form > .button { grid-column: 1 / -1; min-height: 42px; }
.tournament-settings-form > .panel-footnote { grid-column: 1 / -1; margin: 0; line-height: 1.5; }
.player-list { grid-template-columns: minmax(0, 1fr); }
.player-gender-form { display: flex; align-items: center; gap: 5px; }
.player-gender-form select { width: 72px; height: 32px; padding: 0 5px; border: 1px solid #e1e7e0; border-radius: 7px; background: #fbfcfa; color: #536259; font: inherit; font-size: 10px; }
.player-gender-form .button { min-height: 32px; padding: 0 7px; font-size: 10px; }
.player-gender-badge { min-width: 34px; color: #839087; font-size: 10px; text-align: center; }

@media (max-width: 500px) {
    .player-library-dialog { width: calc(100vw - 24px); max-height: 90vh; border-radius: 16px; }
    .player-library-dialog-content { padding: 16px; }
    .player-library-dialog-header h2 { font-size: 19px; }
    .share-panel { margin-top: 14px; padding: 18px; }
    .share-controls { align-items: stretch; flex-direction: column; }
    .share-controls .number-input-wrap { width: 100%; }
    .share-controls .button { min-height: 46px; }
    .share-link-row { align-items: stretch; flex-direction: column; }
    .share-link-row .button { min-height: 42px; }
    .share-link-input { width: 100%; }
    .tournament-create-form { grid-template-columns: minmax(0, 1fr); }
    .tournament-create-dialog { width: calc(100vw - 24px); max-height: 90vh; border-radius: 16px; }
    .tournament-create-dialog-content { padding: 16px; }
    .tournament-create-name { grid-column: 1; }
    .tournament-create-actions { grid-column: 1; }
    .player-picker-dialog { width: calc(100vw - 24px); max-height: 90vh; border-radius: 16px; }
    .player-picker-form { max-height: 90vh; padding: 15px; }
    .player-picker-option { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; padding: 7px 8px; }
    .player-picker-option-meta { font-size: 9px; }
    .player-library-form { grid-template-columns: minmax(0, 1fr); }
    .player-library-form > label, .player-library-actions { grid-column: 1; }
    .player-library-form > input, .player-library-form > select { width: 100%; }
    .player-library-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 11px; }
    .player-library-filter > label:first-of-type { grid-column: 1 / -1; }
    .player-library-filter > .button { min-height: 42px; }
    .player-library-pagination { align-items: stretch; flex-direction: column; }
    .player-library-pagination-controls { justify-content: flex-start; }
    .player-library-pagination-controls .button { flex: 1 0 auto; padding: 0 9px; }
    .player-library-row { flex-wrap: nowrap; gap: 8px; padding: 10px; }
    .player-library-name strong, .player-library-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .player-library-row-actions { flex: 0 0 auto; gap: 4px; }
    .player-library-row-actions .button { min-height: 36px; padding: 0 8px; }
}
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-heading h2 { font-size: 25px; }
.round-count { color: #89948c; font-size: 11px; }
.empty-board { display: flex; align-items: center; gap: 21px; min-height: 190px; padding: 30px; overflow: hidden; border: 1px solid #e6ece5; border-radius: 17px; background: #fbfcfa; }
.empty-board h3 { margin-bottom: 6px; font-size: 16px; }
.empty-board p { margin: 0; color: #919b93; font-size: 12px; }
.court-lines { position: relative; width: 112px; height: 64px; flex: 0 0 auto; overflow: hidden; border: 1px solid #bfd2c1; border-radius: 7px; background: #e8f0e6; }
.court-lines::before { position: absolute; z-index: 1; inset: 10% 6%; border: 1px solid #a9c3ac; content: ""; }
.court-lines::after { position: absolute; z-index: 3; top: 10%; bottom: 10%; left: 50%; width: 1px; background: #f8fbf5; box-shadow: -1px 0 #a9c3ac, 1px 0 #a9c3ac; content: ""; }
.court-lines span { position: absolute; z-index: 2; top: 23%; right: 6%; bottom: 23%; left: 6%; border-top: 1px solid #a9c3ac; border-bottom: 1px solid #a9c3ac; }
.court-lines i { position: absolute; z-index: 1; top: 23%; right: 6%; bottom: 23%; left: 6%; background: linear-gradient(to right, transparent 24.5%, #a9c3ac 24.5% 25.5%, transparent 25.5% 74.5%, #a9c3ac 74.5% 75.5%, transparent 75.5%); }
.court-lines i::after { position: absolute; top: 50%; right: 25%; left: 25%; height: 1px; background: #a9c3ac; content: ""; transform: translateY(-50%); }
.competition-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); align-items: start; gap: 18px; }
.competition-grid.no-rounds { grid-template-columns: minmax(0, 1fr); }
.rounds-column { display: grid; gap: 13px; }
.round-card { padding: 17px; }
.round-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 1px 1px 13px; }
.round-title { display: flex; align-items: center; gap: 10px; }
.round-title h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.round-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--green); color: white; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.match-count { color: #9aa49c; font-size: 10px; }
.matches-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.match-card { min-width: 0; padding: 12px; border: 1px solid #edf0ed; border-radius: 11px; background: #fcfdfb; }
.round-edit-form { display: none; }
.match-edit-grid { display: grid; gap: 10px; }
.match-edit-team { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 7px; }
.match-edit-team > strong { display: grid; place-items: center; width: 28px; height: 24px; border-radius: 6px; font-size: 9px; }
.match-edit-team > label { display: grid; min-width: 0; gap: 4px; color: #8a968d; font-size: 9px; }
.match-edit-team select { width: 100%; height: 36px; padding: 0 6px; font-size: 10px; }
.round-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.round-edit-actions .button { min-height: 38px; padding: 0 12px; font-size: 10px; }
.round-edit-actions > span { color: #9aa49c; font-size: 9px; line-height: 1.5; }
.match-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.court-label { color: #9ba69d; font-size: 8px; }
.saved-label { display: flex; align-items: center; gap: 5px; color: #56824a; font-size: 9px; }
.saved-label i { width: 5px; height: 5px; border-radius: 50%; background: #78a85e; }
.match-teams { display: grid; gap: 7px; }
.team-line { display: grid; grid-template-columns: 18px minmax(0, 1fr) 20px; align-items: center; gap: 7px; }
.team-tag { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 8px; }
.team-a-tag { background: #eaf1e8; color: #42704b; }
.team-b-tag { background: #f6ece5; color: #a86b4d; }
.team-names { overflow: hidden; color: #405046; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.team-names b { padding: 0 4px; color: #a6b0a7; font-size: 9px; font-weight: 400; }
.team-score { color: #26382c; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.score-form { display: flex; align-items: flex-end; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef1ed; }
.score-form label { display: grid; flex: 1; min-width: 0; gap: 4px; color: #97a199; font-size: 8px; }
.score-form input, .score-form select { width: 100%; height: 33px; padding: 0 8px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #33453a; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 13px; font-variant-numeric: tabular-nums; outline: none; }
.score-form .deciding-point-field { flex: 1.15; }
.score-form .deciding-point-field select { padding: 0 5px; font-size: 10px; }
.match-deciding-note { margin-top: 8px; color: #8b7442; font-size: 9px; }
.score-separator { padding-bottom: 8px; color: #b5beb7; font-size: 11px; }
.score-form .button-score { min-height: 33px; padding: 0 9px; border-radius: 8px; font-size: 10px; }
.bye-note { display: flex; gap: 9px; align-items: baseline; margin-top: 11px; padding: 9px 10px; border-radius: 8px; background: #f7f8f5; color: #8d988f; font-size: 10px; }
.bye-note p { margin: 0; color: #657268; }
.round-empty { margin: 0; color: #929d94; font-size: 11px; }
.leaderboard-panel { position: sticky; top: 18px; padding: 20px; }
.leaderboard-heading { margin-bottom: 8px; }
.leaderboard-heading h2 { font-size: 18px; }
.trophy { color: #90a850; font-size: 22px; }
.ranking-rule { margin: 0 0 17px; color: #929d94; font-size: 10px; line-height: 1.6; }
.gender-standings-group { margin-top: 14px; }
.gender-standings-group h3 { margin: 0 0 4px; color: #526057; font-size: 12px; font-weight: 700; }
.leaderboard-table { width: 100%; border-collapse: collapse; text-align: left; }
.leaderboard-table th { padding: 9px 5px; border-bottom: 1px solid #e9eee8; color: #a0aaa2; font-size: 9px; font-weight: 500; }
.leaderboard-table td { padding: 10px 5px; border-bottom: 1px solid #f0f2ef; color: #66736a; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.leaderboard-table tr:last-child td { border-bottom: 0; }
.rank-number { color: #a0aaa2; }
.rank-player { display: flex; align-items: center; min-width: 0; gap: 5px; }
.gender-tag { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 19px; height: 17px; padding: 0 4px; border-radius: 999px; font-size: 9px; line-height: 1; }
.gender-male { background: #eef5fa; color: #527b96; }
.gender-female { background: #fbf0f4; color: #a45f78; }
.gender-unspecified { background: #f1f3f0; color: #829087; }
.rank-name { display: block; flex: 1 1 auto; min-width: 0; max-width: 130px; overflow: hidden; color: #46564b !important; font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif !important; text-overflow: ellipsis; white-space: nowrap; }
.rank-games { color: #315b3c !important; font-size: 13px !important; font-weight: 700; }
.top-rank .rank-number { color: #a27f30; font-weight: 700; }
.top-rank .rank-name { color: #203c2a !important; font-weight: 700; }
.ranking-footnote { margin: 13px 0 0; color: #a2aca4; font-size: 9px; line-height: 1.5; }
.ranking-empty { display: grid; min-height: 140px; place-content: center; justify-items: center; border: 1px dashed #e1e8df; border-radius: 11px; color: #a7b0a8; text-align: center; }
.ranking-empty span { margin-bottom: 7px; font-size: 24px; }
.ranking-empty p { max-width: 160px; margin: 0; font-size: 10px; line-height: 1.55; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 42px; padding-top: 17px; border-top: 1px solid #e5ebe4; color: #9aa49c; font-size: 8px; }
.club-record-manager-list { max-width: none; }
.club-record-manager-name { display: grid; min-width: 0; flex: 1; gap: 4px; }
.club-record-manager-name strong { color: #405346; font-size: 12px; }
.club-record-manager-name span { color: #89958c; font-size: 10px; }
.club-record-manager-form { flex: 0 0 auto; margin: 0; }
.club-record-manager-form .button { min-height: 38px; padding: 0 12px; font-size: 10px; }
.competition-period-panel { margin-bottom: 14px; }
.competition-period-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.competition-period-heading h2 { color: #263a2d; }
.competition-period-filter { display: flex; align-items: center; gap: 8px; margin: 0; }
.competition-period-filter > label:not(.sr-only) { color: #6e7c71; font-size: 11px; }
.competition-period-filter select { min-width: 115px; height: 40px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 11px; }
.competition-period-filter .button { min-height: 40px; padding: 0 13px; font-size: 11px; }
.competition-club-filter { justify-content: flex-end; margin: -13px 0 18px; }
.competition-club-filter select { min-width: min(280px, 55vw); }
.competition-points-explainer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; color: #7c8980; font-size: 11px; }
.competition-points-explainer span { color: #405b46; font-weight: 700; }
.competition-points-explainer i { width: 3px; height: 3px; margin: 0 5px; border-radius: 50%; background: #aab4aa; }
.competition-tabs { display: flex; width: fit-content; gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid #e4eae2; border-radius: 12px; background: #edf1eb; }
.competition-tab { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 0 17px; border: 0; border-radius: 9px; background: transparent; color: #77847a; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.competition-tab[aria-selected="true"] { background: white; color: #1a573d; box-shadow: 0 2px 7px rgba(28, 50, 37, .08); }
.competition-tab:focus-visible { outline: 2px solid #91b15d; outline-offset: 2px; }
.competition-tab-count { min-width: 19px; padding: 2px 5px; border-radius: 999px; background: #eff4e8; color: #71884f; font-size: 9px; line-height: 1.2; }
.competition-tab-panel[hidden] { display: none !important; }
.competition-standing-panel { margin-bottom: 15px; }
.competition-standing-panel .section-heading { margin-bottom: 14px; }
.competition-record-list-section { margin-top: 0; }
.competition-standing-table-wrap { overflow-x: auto; border: 1px solid #edf0ec; border-radius: 12px; }
.competition-standing-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; white-space: nowrap; }
.competition-standing-table th, .competition-standing-table td { padding: 11px 14px; border-bottom: 1px solid #edf0ec; color: #78847a; }
.competition-standing-table th { background: #fbfcfa; color: #909b91; font-size: 10px; font-weight: 600; }
.competition-standing-table tbody tr:last-child td { border-bottom: 0; }
.competition-standing-player { color: #405346 !important; font-weight: 700; }
.competition-rank { display: inline-flex; width: 23px; height: 23px; align-items: center; justify-content: center; border-radius: 8px; background: #f1f5eb; color: #718d4b; font-size: 10px; font-weight: 700; }
.competition-total-points { color: #245a3e; font-size: 14px; }
.competition-standing-empty { min-height: 95px; }
.competition-record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0 0 28px; }
.competition-record-actions .button { min-height: 42px; padding: 0 14px; font-size: 11px; }
.competition-record-list-section { margin-top: 25px; }
.competition-record-list { display: grid; gap: 10px; }
.competition-record-card { padding: 17px; border: 1px solid #e8ede7; border-radius: 14px; background: white; box-shadow: var(--shadow); }
.competition-record-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.competition-record-card-heading > div { min-width: 0; }
.competition-record-card-heading h3 { margin: 8px 0 4px; color: #33483a; font-size: 15px; }
.competition-record-card-heading p { margin: 0; color: #929d94; font-size: 10px; }
.competition-record-card-heading form { flex: 0 0 auto; margin: 0; }
.competition-record-card-heading .button { min-height: 34px; padding: 0 11px; font-size: 10px; }
.competition-record-type { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.competition-record-type.is-training { background: #f0f5e8; color: #648047; }
.competition-record-type.is-external { background: #eef4f7; color: #5a798a; }
.competition-record-participants { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px; margin-top: 13px; }
.competition-record-participant { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid #edf0ec; border-radius: 9px; background: #fbfcfa; font-size: 10px; }
.competition-record-participant strong { min-width: 0; overflow: hidden; color: #405346; text-overflow: ellipsis; white-space: nowrap; }
.competition-record-participant span { color: #8a958c; white-space: nowrap; }
.competition-record-participant b { margin-left: auto; color: #42653e; white-space: nowrap; }
.competition-record-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 780px); }
.competition-record-dialog .player-library-dialog-content { display: flex; max-height: min(88vh, 780px); flex-direction: column; }
.competition-dialog-hint { margin: -5px 0 12px; color: #849087; font-size: 11px; line-height: 1.55; }
.competition-record-form { display: grid; gap: 7px; min-height: 0; }
.competition-record-form > label { margin-top: 5px; color: #526057; font-size: 11px; font-weight: 600; }
.competition-record-form > input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #e1e7e0; border-radius: 9px; background: #fbfcfa; color: #405046; font: inherit; font-size: 12px; }
.competition-player-selection { display: grid; max-height: 270px; gap: 6px; overflow-y: auto; margin-top: 5px; padding-right: 2px; }
.competition-player-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 43px; padding: 6px 9px; border: 1px solid #e9eee8; border-radius: 9px; background: #fbfcfa; }
.competition-player-check { display: flex; min-width: 0; align-items: center; gap: 8px; cursor: pointer; }
.competition-player-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.competition-player-check span { overflow: hidden; color: #405346; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.competition-player-score, .competition-player-placement { display: flex; align-items: center; gap: 6px; color: #8a958c; font-size: 10px; white-space: nowrap; }
.competition-player-score input { width: 64px; height: 32px; padding: 0 7px; border: 1px solid #e1e7e0; border-radius: 7px; background: white; color: #405046; font: inherit; font-size: 11px; }
.competition-player-placement select { width: 104px; height: 32px; padding: 0 6px; border: 1px solid #e1e7e0; border-radius: 7px; background: white; color: #405046; font: inherit; font-size: 10px; }
.competition-record-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; padding-top: 11px; border-top: 1px solid #edf0ec; }
.competition-record-form-actions .button { min-height: 40px; padding: 0 13px; font-size: 11px; }
.competition-records-empty { max-width: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
    .competition-grid { grid-template-columns: 1fr; }
    .leaderboard-panel { position: static; }
}

@media (max-width: 760px) {
    .page-shell { padding: 34px 20px 24px; }
    .site-top-menu { margin: -34px -20px 24px; padding: 6px 20px; overflow-x: auto; scrollbar-width: none; }
    .site-top-menu::-webkit-scrollbar { display: none; }
    .site-menu-link { padding: 0 10px; }
    .setup-grid { grid-template-columns: 1fr; }
    .hero { align-items: flex-start; }
    .hero p { max-width: 480px; font-size: 12px; line-height: 1.65; }
    .matches-list { grid-template-columns: 1fr; }
    .tournament-card { grid-template-columns: minmax(0, 1fr) 28px; gap: 12px; }
    .tournament-stats { grid-column: 1; justify-content: flex-start; padding-left: 53px; }
    .tournament-arrow { grid-column: 2; grid-row: 1 / span 2; }
    .account-bar { align-self: flex-end; }
}

@media (max-width: 500px) {
    .hero { display: block; }
    .reset-form { margin-top: 16px; }
    .event-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); align-items: stretch; gap: 8px; margin-top: 16px; }
    .event-actions > a.button, .event-actions > form { min-width: 0; }
    .event-actions > form { display: flex; }
    .event-actions .button { width: 100%; min-height: 42px; padding: 9px 6px; font-size: 11px; white-space: nowrap; }
    .event-actions > .reset-form { margin: 0; }
    .account-bar { align-items: stretch; flex-wrap: wrap; margin-top: 16px; }
    .account-bar .account-identity { flex: 1 0 100%; justify-items: start; }
    .account-bar > a.button, .account-bar > form { flex: 1 1 0; }
    .account-bar > form { display: flex; }
    .account-bar > form .button { width: 100%; }
    .create-event-form { flex-direction: column; }
    .create-event-form .button { min-height: 44px; }
    .panel { padding: 18px; }
    .player-list { grid-template-columns: 1fr; max-height: 220px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .club-filter { align-items: stretch; flex-wrap: wrap; justify-content: flex-start; }
    .club-filter select { flex: 1; }
    .empty-board { min-height: 160px; padding: 20px; }
    .court-lines, .event-empty-board .court-lines { width: 88px; height: 50px; }
    .page-footer { flex-direction: column; }
    .tournament-card { padding: 14px; }
    .tournament-stats { gap: 10px; padding-left: 0; }
    .club-create-form, .club-admin-assign-form { grid-template-columns: 1fr; }
    .club-create-form { flex-direction: column; }
    .club-create-form input { width: 100%; flex: none; height: 46px; }
    .club-create-form .button { width: 100%; min-height: 46px; }
    .club-admin-assign-form .button { min-height: 44px; }
    .club-record-manager-row { flex-wrap: wrap; }
    .club-record-manager-form { margin-left: auto; }
    .competition-period-heading { align-items: stretch; flex-direction: column; }
    .competition-period-filter { align-items: stretch; flex-wrap: wrap; }
    .competition-period-filter select { flex: 1 1 110px; }
    .competition-tabs { width: 100%; }
    .competition-tab { flex: 1 1 0; padding: 0 9px; }
    .competition-club-filter { justify-content: flex-start; margin-top: -5px; }
    .competition-club-filter select { flex: 1; }
    .competition-record-actions { display: grid; grid-template-columns: 1fr; }
    .competition-record-actions .button { width: 100%; min-height: 44px; }
    .competition-record-card { padding: 14px; }
    .competition-record-participants { grid-template-columns: 1fr; }
    .competition-record-dialog .player-library-dialog-content { padding: 17px; }
    .competition-player-entry { gap: 6px; padding: 6px; }
    .competition-record-form-actions { position: sticky; bottom: -17px; padding: 10px 0 0; background: white; }
    .match-edit-team { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr); gap: 5px; }
    .round-edit-actions { align-items: stretch; flex-direction: column; }
    .round-edit-actions .button { min-height: 44px; }
    .icon-button { width: 36px; height: 36px; }
    .score-form input { height: 40px; }
    .score-form .button-score { min-height: 40px; padding: 0 10px; }
    .event-start-panel { align-items: stretch; flex-direction: column; gap: 12px; margin: 0 0 14px; padding: 14px; }
    .event-start-panel .button-start { width: 100%; min-height: 46px; }
    .event-started-banner { align-items: flex-start; flex-direction: column; gap: 7px; }
    .club-invitation-row { align-items: flex-start; flex-direction: column; }
    .auth-shell { width: min(100% - 32px, 440px); padding-top: 42px; }
    .auth-panel { padding: 22px; }
}

@media (max-width: 360px) {
    .page-shell { padding: 28px 16px 20px; }
    .event-actions { gap: 6px; }
    .event-actions .button { padding: 8px 4px; font-size: 10px; }
    .panel { padding: 16px; }
    .round-card { padding: 13px; }
    .match-card { padding: 10px; }
}
