.wo-bracket-page {
    --grid-ink: #f1e9dd;
    --grid-muted: #c0b1a0;
    --grid-accent: #d1a477;
    --grid-edge: #80664e;
    --grid-surface: linear-gradient(155deg, #312820, #1d1916 72%);
    --grid-cut: 16px;
    max-width: 1440px;
    color: var(--grid-ink);
}

.wo-bracket-title {
    margin: clamp(18px, 3vw, 38px) 0 18px;
}

.wo-bracket-title h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 56px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.wo-bracket-title p {
    margin: 5px 0 0;
    color: var(--grid-muted);
    font-size: clamp(13px, 1.35vw, 17px);
}

.wo-grid-board {
    --round-gap: clamp(36px, 5.5vw, 80px);
    min-width: 0;
}

.wo-grid-board__tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.wo-grid-board__tools p {
    margin: 0;
    color: var(--grid-muted);
    font-size: 12px;
}

.wo-grid-board__tools button {
    margin-inline-start: auto;
    flex-shrink: 0;
}

.wo-grid-board__scroll {
    overflow: auto;
    padding: 3px 2px 12px;
    scrollbar-color: #966f4c #211c18;
    scrollbar-width: thin;
}

.wo-grid-rounds {
    --round-width: max(260px, calc((100% - (var(--round-columns) - 1) * var(--round-gap)) / var(--round-columns)));
    position: relative;
    display: flex;
    align-items: stretch;
    gap: var(--round-gap);
}

.wo-grid-round {
    display: flex;
    flex: 0 0 var(--round-width);
    flex-direction: column;
    min-width: 0;
    max-width: 550px;
}

.wo-grid-round h2,
.wo-grid-bronze h2 {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #584737;
    color: var(--grid-ink);
    font-size: clamp(17px, 1.8vw, 24px);
    line-height: 1.2;
    font-weight: 800;
}

.wo-grid-round__bouts {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-around;
    gap: 14px;
    padding-top: 12px;
}

.is-circular .wo-grid-round__bouts {
    flex: none;
    justify-content: flex-start;
}

.is-circular .wo-grid-round h2 {
    border-color: #9c7555;
}

.wo-grid-round__rest {
    margin: 12px 0 0;
    text-align: center;
    font-size: 15px;
}

.wo-grid-round__rest span {
    display: block;
    color: var(--grid-muted);
    font-size: 13px;
    font-style: italic;
}

.wo-grid-bronze {
    width: min(100%, 420px);
    margin-top: 28px;
}

.wo-grid-bronze h2 {
    margin-bottom: 18px;
}

.wo-grid-board.is-expanded {
    position: fixed;
    z-index: 100;
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    padding: clamp(8px, 2vw, 26px);
    border: 1px solid #584737;
    background: #131211;
    box-shadow: 0 0 0 24px #0a0909eb;
}

.wo-grid-board.is-expanded .wo-grid-board__scroll {
    flex: 1;
}

.wo-grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wo-grid-lines path {
    fill: none;
    stroke: #a9825e;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.wo-grid-lines circle {
    fill: var(--grid-accent);
}

.wo-grid-match {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--grid-ink);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.wo-grid-match:hover,
.wo-grid-match:focus-visible {
    --grid-edge: #e1b789;
    color: var(--grid-ink);
}

.wo-grid-match:focus-visible,
.wo-grid-board__scroll:focus-visible {
    outline: 2px solid #e1b789;
    outline-offset: -2px;
}

.wo-grid-match__frame,
.wo-grid-podium__row,
.wo-grid-score,
.wo-grid-medal {
    --grid-shape: polygon(0 0, calc(100% - var(--grid-cut)) 0, 100% var(--grid-cut),
        100% 100%, var(--grid-cut) 100%, 0 calc(100% - var(--grid-cut)));
    clip-path: var(--grid-shape);
}

.wo-grid-match__frame,
.wo-grid-podium__row {
    position: relative;
    isolation: isolate;
    background: var(--grid-edge);
}

.wo-grid-match__frame::before,
.wo-grid-podium__row::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 1px;
    clip-path: var(--grid-shape);
    background: var(--grid-surface);
}

.wo-grid-match__frame {
    display: block;
    padding: 5px 11px;
}

.wo-grid-match__number {
    position: absolute;
    inset: -10px auto auto 50%;
    transform: translateX(-50%);
    min-width: 58px;
    padding: 2px 10px;
    border: 1px solid var(--grid-edge);
    border-radius: 3px 3px 8px 3px;
    background: #33271d;
    color: #f2ddc4;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wo-grid-match__side {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: clamp(58px, 5.2vw, 76px);
    padding: 7px 12px 7px 3px;
}

.wo-grid-match__side + .wo-grid-match__side {
    border-top: 1px solid #4b3e31;
}

.wo-grid-match__side.is-winner {
    background: linear-gradient(90deg, #c5996529, #c599650c 72%, transparent);
}

.wo-grid-match__side.is-winner::before {
    content: '';
    position: absolute;
    inset: 17% auto 17% -7px;
    width: 3px;
    border-radius: 3px;
    background: #dcac75;
    box-shadow: 0 0 10px #dca76b70;
}

.wo-grid-match__side.is-empty strong {
    color: var(--grid-muted);
    font-weight: 500;
}

.wo-grid-match__arrow {
    position: absolute;
    inset: 50% 5px auto auto;
    display: grid;
    transform: translateY(-50%);
    color: var(--grid-accent);
}

.wo-grid-match__arrow .wo-icon {
    width: 14px;
    height: 14px;
}

.wo-grid-athlete {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wo-grid-athlete__portrait {
    --portrait: clamp(36px, 3.65vw, 52px);
    position: relative;
    flex: 0 0 var(--portrait);
}

.wo-grid-athlete__portrait .wo-public-avatar {
    width: var(--portrait);
    height: var(--portrait);
    border-radius: 0;
    clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 20% 100%, 0 80%);
    background: #392f27;
    color: #e8c49f;
}

.wo-grid-athlete__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wo-grid-athlete__identity {
    min-width: 0;
}

.wo-grid-athlete__identity strong,
.wo-grid-athlete__identity small span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wo-grid-athlete__identity strong {
    font-size: clamp(14px, 1.28vw, 19px);
    font-weight: 800;
    line-height: 1.25;
}

.wo-grid-athlete__identity small {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    color: var(--grid-muted);
    font-size: clamp(10px, 1vw, 13px);
}

.wo-grid-athlete__identity .wo-flag {
    width: 20px;
    height: 14px;
    flex: 0 0 20px;
    border-radius: 0;
}

.wo-grid-score,
.wo-grid-medal {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
}

.wo-grid-score {
    --grid-cut: 8px;
    min-width: 35px;
    padding: 6px 8px;
    background: #3b342e;
    color: #f1e9dd;
    font-size: 12px;
}

.wo-grid-score.is-leading {
    background: #d6a775;
    color: #22170f;
}

/* «Неявка» — тёмная плашка с мелкой подписью, как на макете 20. */
.wo-grid-score.is-note {
    min-width: 0;
    padding: 7px 9px;
    background: #3b342e;
    color: #e9ded1;
    font-size: 11px;
    letter-spacing: .01em;
}

/* Сабмишн у победителя — золотая плашка, как ведущий счёт. */
.wo-grid-score.is-note.is-leading {
    background: #d6a775;
    color: #22170f;
}

.wo-grid-score.is-points {
    font-size: clamp(17px, 1.75vw, 23px);
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
}

.wo-grid-podium {
    max-width: 560px;
    margin-top: 28px;
}

.wo-grid-podium h2 {
    margin: 0 0 12px;
    font-size: clamp(23px, 2.65vw, 35px);
    line-height: 1.15;
}

.wo-grid-podium ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wo-grid-podium__row {
    --grid-cut: 13px;
    --grid-edge: #4e4840;
    --grid-surface: linear-gradient(#2b2825, #1b1917);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 53px;
    padding: 7px 13px;
}

.wo-grid-podium__row--1 {
    --grid-edge: #80664e;
    --grid-surface: linear-gradient(155deg, #352a20, #201a16);
}

.wo-grid-podium__row .wo-grid-athlete {
    flex: 1;
}

.wo-grid-podium__row .wo-grid-athlete__portrait {
    --portrait: 35px;
}

.wo-grid-podium__wins {
    flex-shrink: 0;
    font-size: clamp(12px, 1.4vw, 18px);
}

.wo-grid-medal {
    --grid-cut: 8px;
    width: 27px;
    height: 27px;
    background: #e4b76b;
    color: #21170e;
    font-size: 15px;
}

.wo-grid-medal--2 { background: #d7dce0; }
.wo-grid-medal--3 { background: #d29b7c; }
/* Круговая на четверых (макет 24): 4-е место и ниже — серый значок. */
.wo-grid-medal--4 { background: #6f7377; color: #e9ecef; }
.wo-grid-podium__row--4 { --grid-edge: #3c3833; }

/* Без фото значок места закрывал вторую букву инициалов («AS» → «A2»):
   инициалы сдвигаем в верхний левый угол, значок остаётся в нижнем правом. */
.wo-grid-athlete__portrait:has(.wo-grid-medal) .wo-public-avatar:has(.wo-initials) {
    place-items: start;
    padding: 4px 0 0 5px;
    font-size: .82em;
}

.wo-grid-athlete__portrait .wo-grid-medal {
    position: absolute;
    inset: auto -5px -3px auto;
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.wo-grid-details {
    position: fixed;
    inset: 0;
    width: min(520px, calc(100% - 24px));
    max-height: calc(100% - 28px);
    margin: auto;
    padding: clamp(14px, 3vw, 25px);
    overflow: auto;
    border: 1px solid var(--grid-edge);
    border-radius: 12px;
    background: #201b17;
    color: var(--grid-ink);
}

.wo-grid-details::backdrop { background: #0b0908b8; }

.wo-grid-details__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.wo-grid-details__heading h2 {
    margin: 0;
    font-size: clamp(22px, 4vw, 30px);
}

.wo-grid-details__meta {
    color: var(--grid-muted);
    font-size: 13px;
}

.wo-grid-details__method,
.wo-grid-details__winner {
    color: #e9bd8d;
    font-weight: 700;
}

.wo-grid-details__winner {
    font-size: 11px;
}

.wo-grid-details__sides {
    margin-bottom: 12px;
    padding-inline: 10px;
    background: #2b221b;
}

.wo-grid-details__score div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-block: 6px;
    border-bottom: 1px solid #544234;
}

.wo-grid-details__score dd { margin: 0; }
.wo-grid-details__link { margin-top: 8px; }

@media (min-width: 1000px) {
    .wo-bracket-page .wo-event-tabs {
        gap: 6px;
    }
    .wo-bracket-page .wo-event-tabs > a,
    .wo-bracket-page .wo-event-tabs > button,
    .wo-bracket-page .wo-grid-menu > summary {
        flex-direction: row;
        min-height: 42px;
        gap: 6px;
        padding: 6px 12px;
    }
    .wo-bracket-page .wo-event-tabs .wo-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
    .wo-bracket-page .wo-grid-controls {
        display: flex;
        align-items: center;
        gap: 16px;
    }
    .wo-bracket-page .wo-grid-selector {
        flex: 0 1 620px;
        min-width: 0;
        margin: 0;
        padding: 6px 10px;
    }
    .wo-bracket-page .wo-grid-toolbar {
        flex: 1;
        gap: 16px;
        margin: 0;
    }
    .wo-bracket-page .wo-grid-toolbar .wo-segmented {
        min-width: 0;
        width: auto;
    }
    .wo-bracket-page .wo-grid-toolbar .wo-segmented a {
        min-width: 0;
        padding-inline: 14px;
    }
}

@media (max-width: 700px) {
    .wo-grid-board {
        --round-gap: 24px;
    }
    .wo-grid-rounds {
        --round-width: calc(100% - var(--round-gap) - 19px);
    }
    .wo-grid-round:only-of-type { flex-basis: 100%; }
    .wo-grid-match__frame { padding-inline: 9px; }
    .wo-grid-athlete { gap: 7px; }
}

/* ---------------------------------------------------------------
   Заказчик, 21.11.2026: кнопка-квадрат «некрасивая»; в развёрнутой
   сетке её нужно уменьшать и увеличивать пальцами — большую сетку
   не крутить вправо-влево; на телефоне сетка слишком крупная.
   --------------------------------------------------------------- */
.wo-grid-expand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    margin-inline-start: auto;
    padding: 0 14px 0 12px;
    border: 1px solid #6a543f;
    border-radius: 999px;
    background: #211b16;
    color: var(--grid-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.wo-grid-expand .wo-icon {
    width: 16px;
    height: 16px;
    color: var(--grid-accent);
}

.wo-grid-expand:hover,
.wo-grid-expand:focus-visible {
    border-color: #e1b789;
    color: #fff;
    outline: none;
}

.wo-grid-zoom {
    display: none;
}

.wo-grid-board.is-expanded .wo-grid-board__tools {
    display: none;
}

.wo-grid-board.is-expanded .wo-grid-zoom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 10px;
}

.wo-grid-zoom strong {
    overflow: hidden;
    font-size: 16px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wo-grid-zoom__controls {
    display: flex;
    align-items: center;
    padding: 3px;
    border: 1px solid #584737;
    border-radius: 999px;
    background: #1d1814;
}

.wo-grid-zoom button {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--grid-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.wo-grid-zoom button:hover,
.wo-grid-zoom button:focus-visible {
    background: #33281f;
    outline: none;
}

.wo-grid-zoom button .wo-icon {
    width: 16px;
    height: 16px;
}

.wo-grid-zoom output {
    min-width: 44px;
    color: var(--grid-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.wo-grid-zoom .wo-grid-zoom__fit {
    color: var(--grid-accent);
}

.wo-grid-zoom .wo-grid-zoom__close {
    width: 38px;
    height: 38px;
    border: 1px solid #584737;
    background: #1d1814;
}

.wo-grid-zoom__hint {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--grid-muted);
    font-size: 11px;
}

@media (hover: hover) and (pointer: fine) {
    .wo-grid-zoom__hint { display: none; }
}

/* В развёрнутом виде колонки фиксированной ширины: размер сетки не
   зависит от экрана, и её можно масштабировать целиком. */
.wo-grid-board.is-expanded .wo-grid-rounds {
    --round-width: 300px;
}

.wo-grid-board.is-expanded .wo-grid-board__scroll {
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
}

.wo-grid-board.is-expanded .wo-grid-stage {
    position: relative;
}

.wo-grid-board.is-expanded .wo-grid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    transform-origin: 0 0;
}

@media (max-width: 700px) {
    .wo-grid-board {
        --round-gap: 22px;
    }
    .wo-grid-rounds {
        --round-width: min(282px, calc(100% - var(--round-gap) - 42px));
    }
    .wo-grid-round h2,
    .wo-grid-bronze h2 {
        margin-bottom: 8px;
        padding-bottom: 6px;
        font-size: 16px;
    }
    .wo-grid-round__bouts {
        gap: 12px;
    }
    .wo-grid-match__frame {
        padding: 3px 8px;
    }
    .wo-grid-match__side {
        min-height: 46px;
        gap: 6px;
        padding: 5px 9px 5px 2px;
    }
    .wo-grid-match__number {
        min-width: 44px;
        padding: 1px 8px;
        font-size: 11px;
    }
    .wo-grid-athlete {
        gap: 7px;
    }
    .wo-grid-athlete__portrait {
        --portrait: 30px;
    }
    .wo-grid-athlete__identity strong {
        font-size: 13px;
    }
    .wo-grid-athlete__identity small {
        margin-top: 1px;
        font-size: 10px;
    }
    .wo-grid-athlete__identity .wo-flag {
        width: 16px;
        height: 11px;
        flex-basis: 16px;
    }
    .wo-grid-score {
        min-width: 28px;
        padding: 4px 6px;
    }
    .wo-grid-score.is-points {
        font-size: 15px;
    }
    .wo-grid-score.is-note {
        padding: 5px 7px;
        font-size: 10px;
    }
    .wo-grid-athlete__portrait .wo-grid-medal {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    .wo-grid-board__tools p {
        font-size: 11px;
        line-height: 1.35;
    }
    .wo-grid-expand {
        min-height: 34px;
        padding: 0 12px 0 10px;
        font-size: 12px;
    }
    .wo-grid-board.is-expanded {
        inset: 0;
        padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
        border: 0;
        box-shadow: none;
    }
    .wo-grid-zoom strong {
        font-size: 15px;
    }
}

@media (max-width: 420px) {
    .wo-grid-board.is-expanded .wo-grid-zoom strong { display: none; }
    .wo-grid-board.is-expanded .wo-grid-zoom { grid-template-columns: minmax(0, 1fr) auto; }
    .wo-grid-zoom__controls { justify-self: start; }
}
