/* =====================================================================
   Тэмцээний систем — загвар. Үндсэн өнгө логоны ногоон #00947D.
   Bootstrap 5.3 дээрх нэмэлт: хувьсагч, бүрэлдэхүүн, sidebar, bracket, хэвлэх.
   ===================================================================== */
/* =====================================================================
   Фонт: Inter (variable, 100–900) — монгол кирилл (Ө, Ү) бүрэн; серверээс (CSP font-src 'self'). OFL — fonts/OFL.txt
   ===================================================================== */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-cyrillic-ext.woff2") format("woff2-variations"), url("/fonts/inter-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-cyrillic.woff2") format("woff2-variations"), url("/fonts/inter-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-latin-ext.woff2") format("woff2-variations"), url("/fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
        U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-latin.woff2") format("woff2-variations"), url("/fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --brand: #00947d;
    --brand-600: #007f6b;
    --brand-700: #006a59;
    --brand-800: #04493e;
    --brand-50: #e9f6f3;
    --brand-100: #cfece5;
    --brand-rgb: 0, 148, 125;
    --ink: #17302b;
    --muted: #6a7c78;
    --line: #e2eae8;
    --bg: #f3f7f6;
    --surface: #ffffff;
    --gold: #d4a017;
    --silver: #8f9a9c;
    --bronze: #b0703c;
    --sidebar-width: 264px;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 48, 42, .05), 0 6px 20px rgba(16, 48, 42, .05);

    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 0, 127, 107;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 4, 73, 62;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--line);
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .8rem;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.55;
    --bs-primary-bg-subtle: var(--brand-50);
    --bs-primary-text-emphasis: var(--brand-700);
    --bs-primary-border-subtle: var(--brand-100);
}

/* Бүх хэмжээ (rem) нэг дор арай жижиг: 16px → 15px */
html {
    font-size: 15px;
}

body {
    font-feature-settings: "cv11", "ss03";
    letter-spacing: -.003em;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
    color: var(--ink);
    letter-spacing: -.01em;
}

a {
    text-decoration: none;
}

/* ---------------------------------------------------------------- Bootstrap бүрэлдэхүүнийг брэндийн өнгөөр */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: .65rem;
    --bs-btn-padding-x: 1rem;
}

.btn-sm {
    --bs-btn-border-radius: .5rem;
    --bs-btn-padding-x: .65rem;
}

.btn-lg {
    --bs-btn-border-radius: .8rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), .22);
}

.btn-success {
    --bs-btn-bg: #0f8a5f;
    --bs-btn-border-color: #0f8a5f;
    --bs-btn-hover-bg: #0c744f;
    --bs-btn-hover-border-color: #0c744f;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-border-color: var(--brand-100);
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}

.btn-outline-secondary {
    --bs-btn-color: #44514e;
    --bs-btn-border-color: var(--line);
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-bg: #eef3f2;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: #cfdad7;
    --bs-btn-active-bg: #e4ecea;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-border-color: #cfdad7;
}

.btn-soft {
    --bs-btn-color: var(--brand-700);
    --bs-btn-bg: var(--brand-50);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--brand-100);
    --bs-btn-hover-color: var(--brand-800);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-color: var(--brand-800);
}

.form-control, .form-select {
    border-color: #d6e0dd;
    border-radius: .6rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .16);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .16);
}

.form-label {
    font-weight: 600;
    font-size: .875rem;
    color: #34433f;
}

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

.progress {
    --bs-progress-bar-bg: var(--brand);
    --bs-progress-bg: #e5ecea;
    border-radius: 99px;
}

.list-group-item.active {
    background-color: var(--brand);
    border-color: var(--brand);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--brand);
}

.text-primary {
    color: var(--brand) !important;
}

/* Зөөлөн (subtle) badge — бүх text-bg-* төлвийн тэмдэгт */
.badge {
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: 99px;
    padding: .38em .7em;
}

.badge.text-bg-primary { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.badge.text-bg-success { background: #e2f5ec !important; color: #0b6b4a !important; }
.badge.text-bg-warning { background: #fff3d6 !important; color: #8a5a00 !important; }
.badge.text-bg-secondary { background: #edf1f0 !important; color: #52605d !important; }
.badge.text-bg-dark { background: #e6e8ea !important; color: #343a40 !important; }
.badge.text-bg-info { background: #e3f2fb !important; color: #0b5d86 !important; }
.badge.text-bg-danger { background: #fde8e8 !important; color: #a12626 !important; }
.badge.text-bg-light { background: #f4f6f6 !important; color: #3e4b48 !important; border: 1px solid var(--line); }

.alert {
    border-radius: var(--radius);
}

.alert-success { --bs-alert-bg: #eaf7f2; --bs-alert-border-color: #cdeadf; --bs-alert-color: #0b5a40; }
.alert-warning { --bs-alert-bg: #fff8e6; --bs-alert-border-color: #f6e2ae; --bs-alert-color: #6b4a00; }
.alert-info { --bs-alert-bg: var(--brand-50); --bs-alert-border-color: var(--brand-100); --bs-alert-color: var(--brand-800); }

/* ---------------------------------------------------------------- Карт, хүснэгт */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    --bs-card-cap-bg: transparent;
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
}

.card-header {
    background: transparent;
    font-weight: 700;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--line);
}

.card-header .bi {
    color: var(--brand);
}

.card-body {
    padding: 1.15rem;
}

.table {
    --bs-table-hover-bg: #f6faf9;
    margin-bottom: 0;
}

.table > thead th, .table thead.table-light th {
    background: #f7faf9;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: .65rem .8rem;
    border-bottom-color: #edf2f1;
}

.table-sm > :not(caption) > * > * {
    padding: .5rem .65rem;
}

/* ---------------------------------------------------------------- Зүүн талын цэс (sidebar) */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 60px;
    padding: 0 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.app-topbar .menu-btn {
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1;
    padding: 0;
    border: 0;
    background: none;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--ink);
    min-width: 0;
}

.app-brand:hover {
    color: var(--ink);
}

.app-brand img {
    height: 34px;
    width: auto;
    flex: none;
}

.app-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.app-brand .brand-title {
    font-weight: 800;
    font-size: 1.02rem;
    white-space: nowrap;
}

.app-brand .brand-sub {
    font-size: .7rem;
    color: var(--brand-600);
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.app-sidebar {
    --bs-offcanvas-width: var(--sidebar-width);
    --bs-offcanvas-bg: var(--surface);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.app-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.1rem 1rem;
}

.app-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: .25rem .8rem 1rem;
}

.app-sidebar-label {
    margin: 1.1rem .65rem .4rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #9aaba7;
}

.app-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    margin-bottom: 2px;
    border-radius: .6rem;
    color: #45524f;
    font-weight: 500;
    white-space: nowrap;
}

.app-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    color: #8a9a96;
}

.app-sidebar .nav-link:hover {
    background: #f2f7f5;
    color: var(--ink);
}

.app-sidebar .nav-link.active {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 700;
}

.app-sidebar .nav-link.active i {
    color: var(--brand);
}

.app-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: -.8rem;
    top: 20%;
    bottom: 20%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--brand);
}

.app-sidebar-foot {
    margin: .75rem;
    padding: .8rem;
    border-radius: .8rem;
    background: #f5f8f7;
    display: grid;
    gap: .6rem;
}

.app-user {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    color: var(--ink);
    font-weight: 600;
    font-size: .9rem;
}

.app-user:hover {
    color: var(--brand-700);
}

.app-user .avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
}

.app-user .role {
    display: block;
    font-size: .7rem;
    color: var(--muted);
    font-weight: 600;
}

/* Том дэлгэц: цэс зүүн талд тогтмол; body-д зай үлдээж агуулга дэлгэцэнд багтана */
@media (min-width: 992px) {
    .app-sidebar.offcanvas-lg {
        background-color: var(--surface) !important;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--sidebar-width);
        z-index: 1030;
    }

    body:has(> .app-nav-root) {
        padding-left: var(--sidebar-width);
    }
}

/* ---------------------------------------------------------------- Хуудасны толгой */
.page {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2rem;
}

.page.narrow {
    max-width: 980px;
}

@media (max-width: 575.98px) {
    .page {
        padding: 1.1rem .85rem 1.5rem;
    }
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.page-title {
    font-weight: 800;
    font-size: 1.6rem;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    margin: .3rem 0 0;
    max-width: 760px;
}

.eyebrow {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--brand-600);
}

/* Тэмцээний толгой ба үе шатны таб */
.tournament-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.tournament-head .head-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.4rem 1.5rem 0;
}

.tournament-head .t-title {
    font-weight: 800;
    font-size: 1.45rem;
    margin: 0;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: #4d5c58;
    background: #f2f6f5;
    border-radius: 99px;
    padding: .25rem .65rem;
}

.stage-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: .25rem;
    margin-top: 1rem;
    border: 0;
}

.stage-tabs .nav-link {
    white-space: nowrap;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #5c6b67;
    font-weight: 600;
    padding: .65rem .9rem;
}

.stage-tabs .nav-link:hover {
    color: var(--ink);
    border-bottom-color: #d5e1de;
}

.stage-tabs .nav-link.active {
    color: var(--brand-700);
    background: transparent;
    border-bottom-color: var(--brand);
}

/* ---------------------------------------------------------------- Статистик */
.stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: var(--brand-50);
    color: var(--brand);
}

.stat-icon.amber { background: #fff3d6; color: #b07a00; }
.stat-icon.blue { background: #e5f1fb; color: #1f6fb2; }
.stat-icon.slate { background: #eef2f1; color: #5d6c68; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.05;
}

.stat-label {
    color: var(--muted);
    font-size: .85rem;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--brand-700), var(--brand) 60%, #19b394);
    color: #fff;
    padding: 1.6rem 1.75rem;
    box-shadow: 0 10px 30px rgba(var(--brand-rgb), .25);
}

.hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}

.hero h1, .hero h2 {
    color: #fff;
}

.hero p {
    color: rgba(255, 255, 255, .86);
}

.hero .btn-light {
    color: var(--brand-700);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: var(--brand-50);
    color: var(--brand);
}

/* Явцын алхам */
.steps {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps li {
    flex: 1 1 150px;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem .85rem;
    border-radius: .8rem;
    background: var(--surface);
    border: 1px solid var(--line);
    color: #6a7976;
    font-size: .875rem;
    font-weight: 600;
}

.steps li .step-no {
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eef2f1;
    font-size: .8rem;
    font-weight: 800;
}

.steps li.done {
    color: var(--brand-700);
    border-color: var(--brand-100);
    background: var(--brand-50);
}

.steps li.done .step-no {
    background: var(--brand);
    color: #fff;
}

.steps li.current {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 6px 18px rgba(var(--brand-rgb), .3);
}

.steps li.current .step-no {
    background: #fff;
    color: var(--brand-700);
}

/* ---------------------------------------------------------------- Хэсгийн хүснэгт, тоглолт */
.table-standings td, .table-standings th {
    text-align: center;
    vertical-align: middle;
}

.table-standings td.team, .table-standings th.team {
    text-align: left;
}

.table-standings tr.qualify td:first-child {
    box-shadow: inset 4px 0 0 var(--brand);
    font-weight: 700;
    color: var(--brand-700);
}

.table-standings tr.tie td {
    background: #fff8e6;
}

.score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.winner-name {
    font-weight: 700;
    color: var(--brand-700);
}

.group-card .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    border-color: #edf2f1;
}

.group-card .card-header {
    background: linear-gradient(90deg, var(--brand-50), transparent);
}

.group-badge {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    margin-right: .5rem;
}

.medal {
    display: inline-block;
    width: 1.7rem;
    height: 1.7rem;
    line-height: 1.7rem;
    border-radius: 50%;
    text-align: center;
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
}

.medal-gold { background: var(--gold); }
.medal-silver { background: var(--silver); }
.medal-bronze { background: var(--bronze); }

.medal-icon {
    font-size: 1.15rem;
    margin-right: 1px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.medal-icon.gold { color: var(--gold); }
.medal-icon.silver { color: var(--silver); }
.medal-icon.bronze { color: var(--bronze); }

.overall-table tr.overall-top td {
    background: #fbfdfc;
}

.champion-banner {
    background: linear-gradient(120deg, #fff6d8, #ffe599);
    border: 1px solid #f2d36b;
    border-radius: var(--radius);
}

.champion-banner .trophy {
    font-size: 2.6rem;
    color: var(--gold);
}

.match-score-board {
    background: linear-gradient(180deg, var(--brand-50), #fff);
}

/* ---------------------------------------------------------------- Тэмцээн үүсгэх: спорт, баг сонгох */
.sport-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .6rem;
}

.sport-option {
    position: relative;
}

.sport-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sport-option label {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .75rem;
    border: 1.5px solid var(--line);
    border-radius: .8rem;
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    transition: border-color .15s, background .15s;
}

.sport-option label:hover {
    border-color: var(--brand-100);
}

.sport-option .sport-initial {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #eef3f2;
    color: var(--brand-700);
    font-weight: 800;
}

.sport-option input:checked ~ label {
    border-color: var(--brand);
    background: var(--brand-50);
    color: var(--brand-800);
}

.sport-option input:checked ~ label .sport-initial {
    background: var(--brand);
    color: #fff;
}

.sport-option input:focus-visible ~ label {
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25);
}

.format-picker {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.format-picker label {
    align-items: flex-start;
}

.team-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .5rem;
    max-height: 340px;
    overflow-y: auto;
    padding: .15rem;
}

.team-option {
    position: relative;
}

.team-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.team-option label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: .65rem;
    cursor: pointer;
    background: var(--surface);
    font-size: .9rem;
    min-width: 0;
}

.team-option label .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Спорт, цехийн сонголт: нэрийг бүтэн (шаардлагатай бол хэд хэдэн мөрөнд) харуулна */
.team-picker.full-names .team-option label {
    height: 100%;
    line-height: 1.3;
}

.team-picker.full-names .team-option label .name {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.team-option label .tick {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 5px;
    border: 1.5px solid #c4d1ce;
    display: grid;
    place-items: center;
    color: transparent;
    font-size: .75rem;
}

.team-option input:checked ~ label {
    border-color: var(--brand);
    background: var(--brand-50);
    font-weight: 600;
}

.team-option input:checked ~ label .tick {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.team-option input:focus-visible ~ label {
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25);
}

.summary-card {
    position: sticky;
    top: 1.25rem;
}

.summary-count {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--brand);
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: .9rem;
}

.summary-list li:last-child {
    border-bottom: 0;
}

.summary-list li span:first-child {
    color: var(--muted);
}

/* ---------------------------------------------------------------- Нэвтрэх хуудас */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--surface);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, var(--brand-800), var(--brand) 70%, #1fb99a);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

.auth-brand::before, .auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.auth-brand::before {
    width: 420px;
    height: 420px;
    right: -140px;
    top: -120px;
}

.auth-brand::after {
    width: 300px;
    height: 300px;
    left: -100px;
    bottom: -120px;
}

.auth-logo {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    width: fit-content;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
}

.auth-logo img {
    height: 110px;
    width: auto;
    display: block;
}

.auth-brand h1 {
    color: #fff;
    font-weight: 800;
    font-size: 2.1rem;
    position: relative;
    z-index: 1;
}

.auth-brand p, .auth-brand li {
    color: rgba(255, 255, 255, .88);
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-form .inner {
    width: 100%;
    max-width: 400px;
}

@media (max-width: 991.98px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 1.5rem;
        gap: 1rem;
    }

    .auth-brand h1 {
        font-size: 1.5rem;
    }

    .auth-brand .auth-points {
        display: none;
    }

    .auth-logo img {
        height: 64px;
    }
}

/* ---------------------------------------------------------------- Bracket */
.bracket-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .75rem;
}

.bracket {
    display: flex;
    gap: 28px;
    min-width: max-content;
    align-items: stretch;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    width: 236px;
    flex: 0 0 236px;
}

.bracket-round .round-title {
    text-align: center;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--brand-700);
    font-weight: 800;
    margin-bottom: .6rem;
    padding: .3rem;
    border-radius: 99px;
    background: var(--brand-50);
}

.round-matches {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bracket-match-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    padding: 7px 0;
}

.bracket-round:not(:last-child) .bracket-match-wrap:nth-child(odd)::after,
.bracket-round:not(:last-child) .bracket-match-wrap:nth-child(even)::after {
    content: "";
    position: absolute;
    right: -14px;
    width: 14px;
    border-right: 2px solid #c7d6d2;
}

.bracket-round:not(:last-child) .bracket-match-wrap:nth-child(odd)::after {
    top: 50%;
    height: 50%;
    border-top: 2px solid #c7d6d2;
    border-top-right-radius: 6px;
}

.bracket-round:not(:last-child) .bracket-match-wrap:nth-child(even)::after {
    top: 0;
    height: 50%;
    border-bottom: 2px solid #c7d6d2;
    border-bottom-right-radius: 6px;
}

.bracket-round.single-match .bracket-match-wrap::after {
    display: none;
}

.bracket-round.has-prev .bracket-match-wrap::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 14px;
    border-top: 2px solid #c7d6d2;
}

.bracket-match {
    display: block;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .75rem;
    overflow: hidden;
    color: inherit;
    box-shadow: var(--shadow);
    font-size: .875rem;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}

a.bracket-match:hover {
    color: inherit;
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(var(--brand-rgb), .16);
}

.bracket-match .bm-head {
    display: flex;
    justify-content: space-between;
    padding: .3rem .65rem;
    background: #f6f9f8;
    font-size: .7rem;
    color: var(--muted);
    font-weight: 600;
}

.bracket-match .bm-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .4rem .65rem;
    border-top: 1px solid #eef3f1;
}

.bracket-match .bm-team .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bracket-match .bm-team.win {
    font-weight: 800;
    color: var(--brand-800);
    background: var(--brand-50);
    box-shadow: inset 3px 0 0 var(--brand);
}

.bracket-match .bm-team.lose {
    color: #94a29f;
}

.bracket-match .bm-team.pending .name {
    color: #94a29f;
    font-style: italic;
}

.bracket-match.bye {
    border-style: dashed;
    box-shadow: none;
    opacity: .85;
}

.bracket-match.status-IN_PROGRESS {
    border-color: #f0c14b;
}

.champion-col {
    justify-content: center;
}

.champion-box {
    text-align: center;
    background: linear-gradient(150deg, #fff6d8, #ffe08a);
    border: 1px solid #f0c94a;
    border-radius: var(--radius);
    padding: 1.25rem .75rem;
    box-shadow: 0 10px 24px rgba(212, 160, 23, .2);
}

.champion-box .trophy {
    font-size: 2.2rem;
    color: var(--gold);
}

.round-picker {
    flex-wrap: nowrap;
    overflow-x: auto;
}

.round-picker .btn {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .sport-picker:not(.format-picker) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bracket-round {
        width: 204px;
        flex-basis: 204px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .page-title {
        font-size: 1.35rem;
    }
}

/* ---------------------------------------------------------------- Тамирчид */
.athlete-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.athlete-card {
    overflow: hidden;
}

.athlete-card .athlete-photo {
    width: 100%;
    height: 200px;
    border-radius: 0;
}

.athlete-photo {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    border-radius: 14px;
}

.athlete-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.athlete-photo-lg {
    width: 180px;
    height: 220px;
}

.athlete-photo-sm {
    width: 40px;
    height: 48px;
    border-radius: 8px;
}

.athlete-initials {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand);
}

.athlete-photo-sm .athlete-initials {
    font-size: 1rem;
}

.team-option input:disabled ~ label {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------- Олон нийтийн тоглолтын самбар */
.public-page {
    background: var(--bg);
}

.public-inner {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: .65rem 0;
}

/* Олон нийтийн самбар: таб (Тоглолтууд | Нэгдсэн оноо) */
.public-tabs {
    display: flex;
    gap: .25rem;
    padding: .2rem;
    background: #eef3f1;
    border-radius: 99px;
}

.public-tabs a {
    flex: 1;
    text-align: center;
    padding: .4rem .75rem;
    border-radius: 99px;
    color: #44514e;
    font-weight: 600;
    font-size: .9rem;
}

.public-tabs a.active {
    background: var(--surface);
    color: var(--brand-700);
    box-shadow: 0 1px 3px rgba(16, 40, 34, .12);
}

/* Нэгдсэн оноо — байрын карт */
.ps-list {
    display: grid;
    /* minmax(0, 1fr): урт нэр grid баганыг (тэгээд хуудсыг) дэлгэцнээс өргөн болгохгүй */
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
}

.ps-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.ps-card.ps-top {
    border-color: #f0dc9a;
}

.ps-card summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    cursor: pointer;
    list-style: none;
}

.ps-card summary::-webkit-details-marker {
    display: none;
}

.ps-rank {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    font-weight: 800;
    color: var(--muted);
}

.ps-card .medal {
    flex: none;
    margin-right: 0;
}

.ps-team {
    flex: 1;
    min-width: 0;
}

/* Хэд хэдэн цехийн нийлсэн урт нэрийг бүтэн (хэд хэдэн мөрөнд) */
.ps-name {
    display: block;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ps-medals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .45rem;
    font-size: .78rem;
}

.ps-total {
    flex: none;
    text-align: right;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ps-total small {
    display: block;
    font-size: .65rem;
    font-weight: 600;
    color: var(--muted);
}

.ps-detail {
    margin: 0;
    padding: .25rem .9rem .7rem 3.65rem;
    list-style: none;
    border-top: 1px dashed var(--line);
    font-size: .88rem;
}

/* Хэвлэхэд хүснэгт үргэлж (A4 өргөн нь lg-ээс бага) */
@media print {
    .print-block {
        display: block !important;
    }
}

/* Олон тэмцээнтэй үед «Тооцох тэмцээнүүд» жагсаалт гүйлгэдэг */
.overall-filter-list {
    max-height: 220px;
    overflow-y: auto;
}

.ps-detail li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .3rem 0;
}

.day-switch {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .6rem;
    box-shadow: var(--shadow);
}

.day-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-700);
}

.state-filter {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.state-filter .chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid var(--line);
    background: var(--surface);
    color: #45524f;
    border-radius: 99px;
    padding: .4rem .85rem;
    font-weight: 600;
    font-size: .875rem;
}

.state-filter .chip b {
    font-weight: 800;
    color: var(--muted);
}

.state-filter .chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.state-filter .chip.active b {
    color: rgba(255, 255, 255, .85);
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e8590c;
    animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.75); }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot {
        animation: none;
    }
}

.pm-list {
    display: grid;
    gap: .6rem;
}

.pm-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .7rem .85rem .8rem;
}

.pm-card.pm-live {
    border-color: #f3c46b;
    box-shadow: 0 0 0 3px rgba(243, 196, 107, .25), var(--shadow);
}

.pm-card.pm-cancelled {
    opacity: .6;
}

.pm-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: .45rem;
}

.pm-time {
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pm-stage {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .6rem;
}

.pm-team {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.pm-home {
    text-align: right;
}

.pm-team.pm-win {
    color: var(--brand-700);
    font-weight: 800;
}

.pm-score {
    min-width: 76px;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--brand-50);
    color: var(--brand-800);
    border-radius: .65rem;
    padding: .2rem .55rem;
}

.pm-live .pm-score {
    background: #fff3d6;
    color: #8a5a00;
}

.pm-sep {
    margin: 0 .2rem;
    opacity: .6;
}

.pm-vs {
    font-size: .9rem;
    font-weight: 700;
    color: var(--muted);
}

.pm-sub {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem .9rem;
    margin-top: .45rem;
    font-size: .78rem;
    color: var(--muted);
}

@media (max-width: 400px) {
    .pm-team {
        font-size: .92rem;
    }

    .pm-score {
        min-width: 64px;
        font-size: 1.25rem;
    }
}

/* ---------------------------------------------------------------- Хэвлэх */
.print-only {
    display: none;
}

/* ---------------------------------------------------------------- Зөөлөн шилжилт, ачааллын төлөв */
/* Хуудас хооронд зөөлөн шилжилт (Chromium, Safari 18.2+; дэмжихгүй хөтөчид энгийнээр ачаална) */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: .16s;
}

/* Хажуугийн цэс шилжилтийн үед хөдлөхгүй */
.app-sidebar {
    view-transition-name: app-sidebar;
}

::view-transition-group(app-sidebar) {
    animation: none;
}

/* Дээд талын ачааллын зураас */
.nav-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 2000;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}

.nav-progress.active {
    opacity: 1;
}

.nav-progress::before {
    content: "";
    display: block;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    animation: nav-progress 1s ease-in-out infinite;
}

@keyframes nav-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}

/* Илгээж буй товч */
.btn.is-busy {
    position: relative;
    pointer-events: none;
    opacity: .75;
}

.btn.is-busy::after {
    content: "";
    display: inline-block;
    width: .85em;
    height: .85em;
    margin-left: .45em;
    vertical-align: -.1em;
    border: .15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
}

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

/* Үр дүн бүртгэсний дараа буцсан тоглолтын мөрийг тодруулна */
tr[id^="m-"], .bracket-match[id^="m-"] {
    scroll-margin-top: 90px;
}

tr:target > td, .bracket-match:target {
    animation: target-flash 2.4s ease-out;
}

@keyframes target-flash {
    0%, 35% { background-color: rgba(var(--brand-rgb), .18); }
    100% { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }

    .nav-progress::before, .btn.is-busy::after, tr:target > td, .bracket-match:target {
        animation: none;
    }
}

/* ---------------------------------------------------------------- Хуваарийн цонх (footer дотор байрладаг тул өвлөлтийг цуцална) */
#scheduleModal {
    font-size: 1rem;
    text-align: left;
    color: var(--ink);
}

/* ---------------------------------------------------------------- Тайлангийн гарын үсэг */
.signatures {
    margin-top: 2.5rem;
    break-inside: avoid;
}

.signature-line {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 1.2fr) auto;
    gap: .75rem;
    align-items: end;
    padding: .9rem 0 .2rem;
}

.signature-title {
    font-weight: 600;
}

.signature-blank {
    border-bottom: 1px solid #333;
    height: 1.4rem;
}

.signature-name {
    white-space: nowrap;
}

/* ---------------------------------------------------------------- Тайлангийн график (CSS баганан) */
:root {
    --chart-blue: #3b82c4;
    --chart-amber: #e0a526;
    --chart-red: #d9534f;
    --chart-gray: #a9b4b2;
}

.chart {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    break-inside: avoid;
}

.chart-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .25rem .75rem;
    margin-bottom: .5rem;
}

.chart-title {
    font-weight: 700;
    font-size: .9rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .78rem;
    color: var(--muted);
}

.chart-dot {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    margin-right: .3rem;
    border-radius: 3px;
    vertical-align: -1px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(90px, 32%) 1fr auto;
    gap: .6rem;
    align-items: center;
    padding: .18rem 0;
    font-size: .82rem;
}

.chart-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chart-tracks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-track {
    display: flex;
    height: 14px;
    overflow: hidden;
    background: var(--brand-50);
    border-radius: 4px;
}

.chart-track.thin {
    height: 7px;
}

.chart-seg {
    display: block;
    height: 100%;
}

.chart-value {
    min-width: 3.2rem;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.chart-note {
    margin-top: .35rem;
    font-size: .75rem;
    color: var(--muted);
}

.tone-brand { background: var(--brand); }
.tone-blue { background: var(--chart-blue); }
.tone-amber { background: var(--chart-amber); }
.tone-red { background: var(--chart-red); }
.tone-gray { background: var(--chart-gray); }
.tone-gold { background: var(--gold); }
.tone-silver { background: var(--silver); }
.tone-bronze { background: var(--bronze); }

.chart-donut {
    position: relative;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    flex: none;
    border-radius: 50%;
}

.chart-donut::before {
    content: "";
    position: absolute;
    inset: 18px;
    background: var(--surface);
    border-radius: 50%;
}

.chart-donut span {
    position: relative;
    font-size: 1.2rem;
    font-weight: 800;
}

/* ---------------------------------------------------------------- Хасагдах шатны гар зоолт */
.seeding-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto 1fr;
    gap: .5rem;
    align-items: center;
    padding: .45rem 0;
    border-bottom: 1px dashed var(--line);
}

.seeding-no {
    font-weight: 700;
    color: var(--muted);
}

.seeding-vs {
    font-weight: 700;
    color: var(--muted);
}

@media (max-width: 575.98px) {
    .seeding-row {
        grid-template-columns: 2.5rem 1fr;
    }

    .seeding-vs {
        display: none;
    }

    .seeding-row select:last-of-type {
        grid-column: 2;
    }
}

/* ---------------------------------------------------------------- Тамирчны мандат (90×128 мм, A4-т 4) */
.badge-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, 90mm);
    gap: 6mm;
    justify-content: center;
}

.acc-card {
    width: 90mm;
    height: 128mm;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4mm;
    box-shadow: var(--shadow);
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.acc-head {
    position: relative;
    padding: 4mm 4mm 3mm 18mm;
    min-height: 19mm;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-800));
}

.acc-logo {
    position: absolute;
    left: 3.5mm;
    top: 50%;
    width: 12mm;
    height: 12mm;
    padding: 1.2mm;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    transform: translateY(-50%);
}

.acc-event {
    font-size: 11pt;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.acc-dates {
    margin-top: .8mm;
    font-size: 8.5pt;
    opacity: .9;
}

.acc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4mm 4mm 2mm;
    text-align: center;
    min-height: 0;
    overflow: hidden; /* багтаах шалгалтад (JS: acc-fit-N) */
}

.acc-photo {
    display: grid;
    place-items: center;
    width: 36mm;
    height: 45mm;
    flex: none;
    overflow: hidden;
    border: .6mm solid var(--brand);
    border-radius: 2.5mm;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
}

.acc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.acc-lastname {
    margin-top: 3mm;
    font-size: 10pt;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.acc-firstname {
    font-size: 17pt;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ink);
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.acc-level {
    margin-top: .8mm;
    padding: .2mm 2.5mm;
    font-size: 8pt;
    font-weight: 700;
    color: #7a5a00;
    background: #fff3c4;
    border-radius: 10mm;
}

.acc-dept {
    margin-top: 2.5mm;
    font-size: 10pt;
    font-weight: 700;
    color: var(--brand-800);
    line-height: 1.2;
}

.acc-label {
    display: inline-block;
    margin-right: 1.2mm;
    padding: .2mm 1.5mm;
    font-size: 7pt;
    color: #fff;
    background: var(--brand-700);
    border-radius: 1mm;
    vertical-align: middle;
}

.acc-team {
    margin-top: .6mm;
    font-size: 8.5pt;
    color: var(--muted);
}

.acc-sports {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2mm;
    margin-top: auto;
    padding-top: 2mm;
}

.acc-sport {
    max-width: 100%;
    padding: .7mm 2.4mm;
    font-size: 8.5pt;
    line-height: 1.25;
    font-weight: 700;
    color: var(--brand-800);
    background: var(--brand-50);
    border: .3mm solid var(--brand-100);
    border-radius: 10mm;
}

/* Мандатад агуулга багтахгүй бол (олон спорт, урт цех/баг) JS шат дараатай acc-fit-1…6 нэмж жижигрүүлнэ */
.acc-card.acc-fit-1 .acc-sport { font-size: 7.5pt; padding: .5mm 2mm; }
.acc-card.acc-fit-1 .acc-sports { gap: 1mm; padding-top: 1.5mm; }
.acc-card.acc-fit-1 .acc-team { font-size: 7.5pt; }

.acc-card.acc-fit-2 .acc-photo { width: 32mm; height: 40mm; }
.acc-card.acc-fit-2 .acc-lastname { margin-top: 2mm; }

.acc-card.acc-fit-3 .acc-sport { font-size: 7pt; padding: .4mm 1.6mm; }
.acc-card.acc-fit-3 .acc-sports { gap: .8mm; padding-top: 1mm; }
.acc-card.acc-fit-3 .acc-dept { font-size: 9pt; margin-top: 1.5mm; }
.acc-card.acc-fit-3 .acc-firstname { font-size: 15pt; }

.acc-card.acc-fit-4 .acc-photo { width: 28mm; height: 35mm; }
.acc-card.acc-fit-4 .acc-sport { font-size: 6.5pt; }
.acc-card.acc-fit-4 .acc-team { font-size: 7pt; }

.acc-card.acc-fit-5 .acc-photo { width: 25mm; height: 31mm; }
.acc-card.acc-fit-5 .acc-sport { font-size: 6pt; padding: .3mm 1.3mm; }
.acc-card.acc-fit-5 .acc-firstname { font-size: 13pt; }
.acc-card.acc-fit-5 .acc-body { padding-top: 3mm; }

.acc-card.acc-fit-6 .acc-photo { width: 22mm; height: 27mm; }
.acc-card.acc-fit-6 .acc-sport { font-size: 5.5pt; }
.acc-card.acc-fit-6 .acc-team, .acc-card.acc-fit-6 .acc-level { font-size: 6.5pt; }
.acc-card.acc-fit-6 .acc-dept { font-size: 8pt; }

.acc-foot {
    padding: 2.2mm;
    font-size: 13pt;
    font-weight: 900;
    letter-spacing: .3em;
    text-align: center;
    color: #fff;
    background: var(--brand);
}

/* ---------------------------------------------------------------- Мэдээлэл: файлын дүрс */
.info-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 1.25rem;
}

/* ---------------------------------------------------------------- Олон нийтийн самбар: санал хүсэлтийн хөвөгч товч */
.feedback-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 3.4rem;
    min-width: 3.4rem;
    padding: 0 1.15rem;
    border-radius: 99px;
    background: var(--brand);
    color: #fff;
    font-weight: 650;
    box-shadow: 0 6px 18px rgba(var(--brand-rgb), .35), 0 2px 6px rgba(16, 40, 34, .15);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.feedback-fab i {
    font-size: 1.35rem;
    line-height: 1;
}

.feedback-fab:hover, .feedback-fab:focus-visible {
    color: #fff;
    background: var(--brand-600);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--brand-rgb), .4), 0 3px 8px rgba(16, 40, 34, .15);
}

/* Гар утсанд зөвхөн дугуй icon */
@media (max-width: 575.98px) {
    .feedback-fab {
        justify-content: center;
        padding: 0;
        width: 3.4rem;
    }

    .feedback-fab span {
        display: none;
    }
}

/* Товч сүүлийн тоглолтыг далдлахгүй */
body:has(> .feedback-fab) main {
    padding-bottom: 5rem;
}

/* =====================================================================
   UI сайжруулалт: Inter-д тохирсон гарчиг, зөөлөн хүрээ/сүүдэр, хүснэгт, цэс, шилжилт
   ===================================================================== */
:root {
    --line: #e4ebe9;
    --shadow: 0 1px 2px rgba(16, 40, 34, .04), 0 4px 14px rgba(16, 40, 34, .04);
    --shadow-hover: 0 2px 4px rgba(16, 40, 34, .05), 0 10px 26px rgba(16, 40, 34, .08);
}

::selection {
    background: rgba(var(--brand-rgb), .18);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: -.025em;
}

.page-subtitle {
    font-size: .95rem;
    line-height: 1.55;
}

.eyebrow, .app-sidebar-label {
    font-weight: 700;
    letter-spacing: .08em;
}

/* Тоо — тэгш өргөнтэй (хүснэгт, оноо, статистик) */
.table, .stat-value, .score, .chart-value, .badge {
    font-variant-numeric: tabular-nums;
}

/* Товч, холбоос, карт — зөөлөн шилжилт */
.btn, .nav-link, .form-control, .form-select, a.card, .team-option label, .sport-option label {
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn {
    --bs-btn-font-size: .95rem;
    letter-spacing: -.005em;
}

.btn-sm {
    --bs-btn-font-size: .85rem;
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(var(--brand-rgb), .25), 0 4px 10px rgba(var(--brand-rgb), .16);
}

.btn-primary:hover {
    box-shadow: 0 2px 4px rgba(var(--brand-rgb), .25), 0 6px 16px rgba(var(--brand-rgb), .2);
}

.btn:focus-visible, .nav-link:focus-visible, a:focus-visible {
    outline: 2px solid rgba(var(--brand-rgb), .55);
    outline-offset: 2px;
    box-shadow: none;
}

/* Маягт */
.form-control, .form-select {
    font-size: .95rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
    background-color: #fff;
}

.form-control::placeholder {
    color: #9aa9a5;
}

.form-control-sm, .form-select-sm {
    font-size: .85rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
}

.form-label {
    font-size: .85rem;
    margin-bottom: .35rem;
}

.form-text {
    font-size: .8rem;
}

/* Карт */
.card-header {
    font-size: .95rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

a.card:hover {
    border-color: var(--brand-100);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

/* Хүснэгт */
.table {
    font-size: .925rem;
}

.table > thead th, .table thead.table-light th {
    font-size: .7rem;
    font-weight: 650;
    color: #7c8c88;
    background: #f8faf9;
}

.table-hover > tbody > tr {
    transition: background-color .12s ease;
}

.table > :not(caption) > * > * {
    border-bottom-color: #eef3f1;
}

.table > tbody > tr:last-child > * {
    border-bottom: 0;
}

/* Badge */
.badge {
    font-size: .74em;
    font-weight: 650;
}

/* Хажуугийн цэс */
.app-sidebar .nav-link {
    font-size: .925rem;
    padding: .5rem .75rem;
}

.app-sidebar .nav-link:hover i {
    color: var(--brand-600);
}

.app-brand .brand-title {
    font-weight: 750;
    letter-spacing: -.02em;
}

/* Статистик карт */
.stat-value {
    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.stat-label {
    font-size: .82rem;
}

/* Hero */
.hero {
    box-shadow: 0 8px 24px rgba(var(--brand-rgb), .2);
}

.hero h1 {
    color: #fff;
    letter-spacing: -.025em;
}

/* Модал */
.modal-content {
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(16, 40, 34, .2);
}

.modal-header, .modal-footer {
    border-color: var(--line);
}

/* Нимгэн гүйлгэх мөр */
* {
    scrollbar-width: thin;
    scrollbar-color: #c8d4d1 transparent;
}

@media print {
    .badge-sheet {
        gap: 5mm;
    }

    .acc-card {
        box-shadow: none;
        border-color: #bbb;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        background: #fff;
        padding-left: 0 !important;
    }

    .no-print, .app-nav-root, .tournament-head .stage-tabs, footer, .alert-dismissible .btn-close {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .page {
        padding: 0;
        max-width: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .bracket-scroll {
        overflow: visible;
    }

    .bracket {
        zoom: .78;
    }

    .bracket-match, .bracket-match .bm-team.win, .medal, .table-standings tr.qualify td:first-child {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .report-section {
        break-inside: avoid-page;
    }

    .page-break {
        break-before: page;
    }

    .print-landscape {
        page: landscape;
    }

    @page landscape {
        size: A4 landscape;
    }
}
