/* ReactKing — live matches, results, rematches, and match chat. */

.versus-chip {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.versus-chip > span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.match-player-details {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.versus-chip > span:first-child .match-player-details {
    align-items: flex-end;
}

.versus-chip > span:last-child .match-player-details {
    align-items: flex-start;
}

.match-player-name {
    overflow-wrap: anywhere;
}

.match-player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
    align-items: baseline;
    font-size: 0.6rem;
}

.versus-chip > span:first-child .match-player-stats {
    justify-content: flex-end;
}

.match-player-stats strong {
    color: var(--color-ghost-white);
    font-weight: 700;
}

.match-player-stats small {
    color: var(--color-kippo-pink);
    font-size: inherit;
    font-weight: 700;
}

.ranked-form {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--mono);
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-transform: uppercase;
}

.ranked-form-label { margin-right: 0.2rem; }

.ranked-form-result {
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 0.15rem;
    font-weight: 700;
    text-decoration: none;
}

.ranked-form-win { color: var(--color-kippo-pink); }
.ranked-form-loss { color: rgba(255, 255, 255, 0.55); }
.ranked-form-draw { color: var(--color-ghost-white); }
.versus-chip .ranked-form { gap: 0.2rem; font-size: 0.55rem; }
.versus-chip .ranked-form-result { width: 1rem; height: 1rem; }
.play-stage > .ranked-form { justify-content: center; margin-top: 1rem; }

.match-podium-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
}

.match-podium-badge .podium-rank,
.match-podium-badge .podium-rank img {
    width: 1.65rem;
    height: 1.65rem;
}

.match-win-streak {
    position: relative;
    display: inline-grid;
    width: 1.15rem;
    height: 1.5rem;
    flex: none;
    place-items: center;
    background: url("../win-streak-flame.svg") center / contain no-repeat;
    color: #000;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
}

.match-win-streak > span {
    position: relative;
    top: 0.28rem;
    text-shadow: 0 0 2px #fad15c;
}

.match-player-title {
    color: var(--title-rarity-accent, var(--lime));
    font-family: var(--mono);
    font-size: 0.55rem;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.versus-chip i {
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-style: normal;
    font-size: 0.55rem;
}

.versus-chip > .match-versus-marker {
    display: grid;
    flex: none;
    justify-items: center;
    gap: 0.35rem;
}

.reaction-header-score {
    color: var(--color-action-hover);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
}

.match-id {
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.arena-center {
    position: relative;
    z-index: 2;
    display: grid;
    flex: 1;
    place-content: center;
    padding: 2rem;
    text-align: center;
}

.reaction-series-hud {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    display: block;
    width: min(calc(100% - 3rem), 76rem);
    box-sizing: border-box;
    color: var(--color-ghost-white);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.game-arena[data-phase="ready"] .reaction-series-hud {
    opacity: 1;
}

.ranked-first-round-info {
    display: grid;
    gap: 0.45rem;
}

.ranked-first-round-info strong {
    color: var(--color-ghost-white);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.game-arena:not([data-phase="ready"]) .ranked-first-round-info {
    display: none;
}

.ranked-reaction-board {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-cards);
    background: var(--color-surface-raised);
    color: var(--color-ghost-white);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.ranked-reaction-board-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 0.9rem clamp(1rem, 2vw, 1.5rem);
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-surface-emphasis);
}

.ranked-reaction-board-heading > span {
    color: var(--muted);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ranked-reaction-board-heading > span:last-child {
    text-align: right;
}

.ranked-reaction-current-score {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    text-align: center;
}

.ranked-reaction-current-score > span {
    color: var(--color-text-secondary);
    font-size: 0.56rem;
}

.ranked-reaction-current-score strong {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    color: var(--color-ghost-white);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 0.9;
}

.ranked-reaction-current-score :is(b, i) {
    font-style: normal;
}

.ranked-reaction-current-score b:first-child {
    color: var(--color-action-hover);
    text-shadow: 0 0 0.7rem color-mix(in srgb, var(--color-action-hover) 42%, transparent);
}

.ranked-reaction-current-score b:last-child {
    color: var(--color-text-secondary);
    opacity: 0.62;
}

.ranked-reaction-current-score i {
    color: var(--color-text-tertiary);
    font-size: 0.75em;
    font-weight: 500;
}

.ranked-reaction-board-grid {
    display: grid;
    grid-template-columns: minmax(12rem, 0.8fr) minmax(24rem, 1.6fr) minmax(12rem, 0.8fr);
    min-width: 0;
}

.ranked-reaction-player {
    display: grid;
    grid-template-rows: auto auto auto auto 1fr;
    min-width: 0;
    align-content: start;
    justify-items: center;
    gap: 0.45rem;
    padding: clamp(1rem, 2vw, 1.5rem);
    text-align: center;
}

.ranked-reaction-player.is-you {
    border-right: 1px solid var(--color-border-subtle);
}

.ranked-reaction-player.is-opponent {
    border-left: 1px solid var(--color-border-subtle);
}

.ranked-reaction-player.is-winner {
    box-shadow: inset 0 2px var(--result-accent, var(--color-success));
}

.ranked-reaction-player-role {
    color: var(--muted);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ranked-reaction-player-name {
    max-width: 100%;
    min-height: 1.5rem;
    overflow-wrap: anywhere;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.ranked-reaction-title-slot {
    display: flex;
    min-width: 0;
    min-height: 1.35rem;
    align-items: center;
    justify-content: center;
}

.ranked-reaction-title-slot small {
    max-width: 100%;
    font-size: 0.64rem;
}

.ranked-reaction-player-score {
    display: grid;
    gap: 0.1rem;
    margin: 1rem 0;
}

.ranked-reaction-player-score strong {
    color: var(--color-action-hover);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.ranked-reaction-player-score span {
    color: var(--muted);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ranked-reaction-player-stats {
    display: flex;
    width: auto;
    align-self: end;
    gap: 0.45rem;
    margin: 0;
}

.ranked-reaction-player-stats > div {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.4rem;
    padding-top: 0.25rem;
}

.ranked-reaction-player-stats :is(dt, dd) {
    margin: 0;
}

.ranked-reaction-player-stats dt {
    color: var(--muted);
    font-size: 0.52rem;
    text-transform: uppercase;
}

.ranked-reaction-player-stats dd {
    font-size: 0.65rem;
    font-weight: 700;
}

.ranked-reaction-player-stats em {
    margin-left: 0.2rem;
    font-size: 0.54rem;
    font-style: normal;
}

.ranked-reaction-rounds {
    min-width: 0;
    align-self: center;
    margin: clamp(1rem, 2vw, 1.5rem);
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-buttons);
}

.ranked-reaction-rounds > header,
.ranked-reaction-round {
    display: grid;
    grid-template-columns: minmax(6rem, 1fr) 4.5rem minmax(6rem, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
}

.ranked-reaction-rounds > header {
    background: var(--color-surface-emphasis);
    color: var(--muted);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ranked-reaction-rounds :is(header, .ranked-reaction-round) > :first-child {
    text-align: left;
}

.ranked-reaction-rounds :is(header, .ranked-reaction-round) > :nth-child(2) {
    text-align: center;
}

.ranked-reaction-rounds :is(header, .ranked-reaction-round) > :last-child {
    text-align: right;
}

.ranked-reaction-round + .ranked-reaction-round {
    border-top: 1px solid var(--color-border-subtle);
}

.ranked-reaction-round > span {
    color: var(--color-action-hover);
    font-size: clamp(0.78rem, 1.5vw, 1rem);
    font-weight: 700;
}

.ranked-reaction-round .is-winner {
    color: var(--color-action-hover);
}

.ranked-reaction-round .is-secondary {
    color: color-mix(in srgb, var(--muted) 55%, transparent);
    font-weight: 500;
}

.ranked-reaction-round > strong {
    justify-self: center;
    color: color-mix(in srgb, var(--muted) 70%, transparent);
    font-size: clamp(0.75rem, 1.4vw, 1rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
}

.ranked-reaction-average > strong {
    color: color-mix(in srgb, var(--muted) 52%, transparent);
    font-size: clamp(0.68rem, 1.2vw, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
}

.ranked-reaction-average > span,
.ranked-reaction-average > span.is-winner {
    color: color-mix(in srgb, var(--muted) 58%, transparent);
    font-size: clamp(0.68rem, 1.2vw, 0.84rem);
    font-weight: 500;
    text-shadow: none;
}

.ranked-reaction-outcome {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem clamp(1rem, 2vw, 1.5rem);
    border-top: 1px solid var(--color-border-subtle);
    background: rgba(105, 91, 220, 0.12);
}

.ranked-reaction-outcome strong {
    color: var(--color-action-hover);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-align: center;
}

.ranked-reaction-outcome span {
    color: var(--muted);
    font-size: 0.62rem;
}

.ranked-reaction-outcome span:last-child {
    text-align: right;
}

@media (max-width: 860px) {
    .reaction-series-hud {
        top: 50%;
        left: 50%;
        width: calc(100% - 2rem);
    }

    .ranked-reaction-board-heading {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }

    .ranked-reaction-board-heading .ranked-reaction-current-score {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .ranked-reaction-board-heading > span {
        grid-row: 2;
    }

    .ranked-reaction-board-grid {
        grid-template-areas:
            "rounds rounds"
            "you opponent";
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranked-reaction-player {
        padding: 0.9rem;
    }

    .ranked-reaction-player.is-you {
        grid-area: you;
        border-top: 1px solid var(--color-border-subtle);
        border-right: 1px solid var(--color-border-subtle);
    }

    .ranked-reaction-player.is-opponent {
        grid-area: opponent;
        border-top: 1px solid var(--color-border-subtle);
        border-left: 0;
    }

    .ranked-reaction-player-score {
        margin: 0.4rem 0;
    }

    .ranked-reaction-player-score strong {
        font-size: 2rem;
    }

    .ranked-reaction-rounds {
        grid-area: rounds;
        margin: 0.75rem;
    }

    .ranked-reaction-rounds > header,
    .ranked-reaction-round {
        grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
    }

    .ranked-reaction-outcome {
        gap: 0.5rem;
        padding: 0.7rem 0.9rem;
    }
}

.game-arena[data-phase="countdown"] .arena-message {
    animation: count-pop 1s ease-out infinite;
}

.game-arena[data-phase="press"] .arena-message {
    animation: press-in 140ms ease-out both;
}

.result-header > span:last-child {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reaction-result-page {
    overflow-y: auto;
}

.reaction-result-screen {
    display: flex;
    width: min(calc(100% - 3rem), 86rem);
    min-height: calc(100dvh - 5.2rem);
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0 0 1.5rem;
    flex-direction: column;
}

.reaction-result-accent {
    width: 100%;
    height: 4px;
    flex: none;
    background: var(--color-success, #69dfaa);
}

.reaction-result-page[data-outcome="loss"] .reaction-result-accent {
    background: #ff7485;
}

.reaction-result-heading {
    padding: clamp(1.5rem, 3vw, 2.4rem) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.reaction-result-heading .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.65rem;
}

.reaction-result-heading h1 {
    margin: 0;
    color: var(--color-ghost-white);
    font-family: var(--font-source-code-pro);
    font-size: clamp(2.4rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 0.95;
}

.reaction-result-page[data-outcome="win"] .reaction-result-heading h1 {
    color: #82e6a0;
}

.reaction-result-page[data-outcome="loss"] .reaction-result-heading h1 {
    color: #ff7485;
}

.reaction-result-heading > p:last-child:not(.eyebrow) {
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.reaction-result-content {
    display: grid;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.reaction-result-primary {
    min-width: 0;
}

.reaction-result-primary:not(:has(.ranked-reaction-board)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--color-border-subtle);
}

.reaction-result-primary:not(:has(.ranked-reaction-board)) .post-game-player {
    min-height: 11rem;
    padding: 1.75rem;
}

.reaction-result-primary:not(:has(.ranked-reaction-board)) .post-game-player + .post-game-player {
    border-left: 1px solid var(--color-border-subtle);
}

.reaction-result-primary:not(:has(.ranked-reaction-board)) .post-game-player:has(.post-game-player-detail-slot small) .post-game-player-value {
    color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.reaction-result-more {
    width: min(100%, 56rem);
    justify-self: center;
}

.reaction-result-secondary {
    display: grid;
    grid-template-columns: minmax(0, 36rem);
    align-items: start;
    justify-content: center;
    justify-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem 0 1.5rem;
    text-align: center;
}

.reaction-result-secondary:empty {
    display: none;
}

.reaction-result-secondary .result-rivalry,
.reaction-result-secondary .result-achievement-progress {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
}

.reaction-result-secondary .result-rivalry {
    align-self: center;
}

.reaction-result-secondary .rating-result {
    justify-content: center;
}

.reaction-result-secondary .result-achievement-progress {
    align-self: stretch;
    padding: 0.75rem 0;
    border-block: 0;
}

.reaction-result-more > summary {
    width: fit-content;
    min-height: 36px;
    box-sizing: border-box;
    margin: 0.4rem auto 0;
    padding: 0.6rem 0.75rem;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.65rem;
}

.reaction-result-more[open] > summary {
    margin-bottom: 0.25rem;
}

.reaction-result-chat {
    width: min(100%, 44rem);
    justify-self: center;
    padding-top: 0.25rem;
}

.reaction-result-chat > summary {
    width: fit-content;
    margin: 0 auto;
    padding: 0.5rem;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.72rem;
}

.reaction-result-chat .match-chat {
    width: min(100%, 44rem);
    margin: 0.75rem auto 0;
}

.reaction-result-footer {
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.reaction-result-footer .post-game-next-mode {
    margin: 0;
    color: var(--muted);
    font-size: 0.65rem;
}

.reaction-result-footer .result-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    width: min(100%, 46rem);
    margin: 0;
}

.reaction-result-footer .result-actions > .game-action-button {
    width: 100%;
    min-width: 0;
}

.reaction-result-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.reaction-result-secondary-actions .game-action-button {
    min-height: 36px;
    padding-block: 0.5rem;
    font-size: 0.65rem;
}

.reaction-result-footer :is(.result-share-status, .rematch-status, .match-chat-error) {
    margin: 0;
    text-align: center;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-board {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.reaction-series-hud .ranked-reaction-board.is-intermission {
    border-top: 4px solid #82e6a0;
    background: rgba(17, 26, 41, 0.94);
    padding-inline: clamp(1rem, 3vw, 2rem);
}

.reaction-series-hud .ranked-reaction-board.is-intermission[data-outcome="loss"] {
    border-top-color: #ff7485;
}

.reaction-series-hud .ranked-reaction-board.is-intermission[data-outcome="draw"] {
    border-top-color: var(--muted);
}

.reaction-result-screen .ranked-reaction-board.is-final .ranked-reaction-board-heading {
    display: none;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-board-heading {
    display: block;
    padding: clamp(1.25rem, 2.5vw, 2rem) 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: transparent;
    text-align: left;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-board-heading strong {
    display: block;
    margin-top: 0.6rem;
    color: #82e6a0;
    font-family: var(--font-source-code-pro);
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 0.95;
    text-align: left;
    text-transform: none;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-board-heading > span {
    display: block;
    text-align: left;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-board-heading > span:last-child {
    margin-top: 0.65rem;
    text-align: left;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-board-grid {
    border-bottom: 1px solid var(--color-border-subtle);
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player {
    border: 0;
    min-height: 13rem;
    justify-items: start;
    padding: clamp(1.75rem, 3vw, 2.75rem);
    text-align: left;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player-stats {
    align-self: end;
    padding-top: 0.75rem;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player.is-winner {
    box-shadow: none;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player.is-opponent {
    justify-items: end;
    text-align: right;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-rounds {
    display: grid;
    grid-template-rows: auto;
    grid-auto-rows: 1fr;
    align-self: stretch;
    margin: 0;
    border: 0;
    border-radius: 0;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-rounds > header {
    border: 0;
    background: transparent;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-round {
    min-height: 3rem;
    border: 0;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-round:not(.is-current-round, .ranked-reaction-average) > span {
    color: color-mix(in srgb, var(--color-text-secondary) 62%, transparent);
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-round.is-current-round > span:not(.is-secondary) {
    color: var(--color-action-hover);
    text-shadow: 0 0 0.75rem color-mix(in srgb, var(--color-action-hover) 68%, transparent);
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-player-score strong {
    color: color-mix(in srgb, var(--color-text-secondary) 50%, transparent);
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-outcome strong {
    color: color-mix(in srgb, var(--color-text-secondary) 52%, transparent);
    font-weight: 600;
}

.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-player.is-opponent,
.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-rounds > header > :last-child,
.reaction-series-hud .ranked-reaction-board.is-intermission .ranked-reaction-round > :last-child {
    opacity: 0.55;
}

:is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-outcome {
    border: 0;
    background: transparent;
}

@media (max-width: 860px) {
    .reaction-result-screen {
        width: min(calc(100% - 2rem), 86rem);
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player {
        min-height: 0;
        justify-items: center;
        padding: 0.75rem;
        text-align: center;
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player.is-opponent {
        justify-items: center;
        text-align: center;
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-title-slot {
        min-height: 0;
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player-score {
        margin: 0.2rem 0;
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player-score strong {
        font-size: 1.7rem;
    }

    :is(.reaction-result-screen, .reaction-series-hud) .ranked-reaction-player-stats {
        gap: 0.2rem;
    }
}

@media (max-width: 560px) {
    .reaction-result-page > .result-header {
        display: none;
    }

    .reaction-result-screen {
        min-height: 100dvh;
    }

    .reaction-result-heading {
        padding-block: 1.25rem;
    }

    .reaction-result-secondary {
        grid-template-columns: 1fr;
    }

    .reaction-result-footer .result-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .reaction-result-footer .result-actions > :first-child {
        grid-column: 1 / -1;
    }
}

.reaction-player:last-child {
    text-align: right;
}

.reaction-player .match-player-title {
    margin-top: 0.2rem;
}

.versus {
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.rating-result {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.rating-result > span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.rating-result em {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-style: normal;
}

.result-rivalry {
    display: grid;
    gap: 0.45rem;
    max-width: 25rem;
    margin-top: 1.25rem;
    font-size: 0.76rem;
}

.result-rivalry > span {
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
}

.result-rivalry > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: baseline;
    gap: 0.7rem;
}

.result-rivalry strong {
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.result-rivalry small {
    color: rgba(255, 255, 255, 0.65);
    text-align: right;
}

.result-achievement-progress {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.1rem;
    max-width: 32rem;
    margin-top: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-ash);
    color: var(--color-ghost-white);
    font-size: 0.78rem;
    text-decoration: none;
}

.result-achievement-progress span:last-child { color: var(--color-kippo-pink); }
.result-achievement-progress:hover { text-decoration: underline; }

.result-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.rematch-button:disabled {
    cursor: default;
    opacity: 0.72;
    transform: none;
}

.rematch-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
}

@keyframes rematch-pulse {
    70% { }
    100% { }
}

.match-chat > header div {
    display: flex;
    flex-direction: column;
}

.match-chat > header span {
    font-size: 0.78rem;
    font-weight: 800;
}

.match-chat > header small, .match-chat > header em {
    color: rgba(255, 255, 255, 0.48);
    font-family: var(--mono);
    font-size: 0.52rem;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.match-chat-messages {
    display: flex;
    min-height: 7rem;
    max-height: 16rem;
    overflow-y: auto;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem;
}

.match-chat-messages article {
    max-width: 78%;
    align-self: flex-start;
}

.match-chat-messages article.is-mine {
    align-self: flex-end;
}

.match-chat-messages article > div {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin-bottom: 0.2rem;
}

.match-chat-messages article.is-mine > div {
    justify-content: flex-end;
}

.match-chat-messages strong, .match-chat-messages time {
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--mono);
    font-size: 0.5rem;
    text-transform: uppercase;
}

.match-chat-empty {
    margin: auto;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--mono);
    font-size: 0.62rem;
}

.match-chat-form button:disabled {
    cursor: default;
    opacity: 0.35;
}

.result-share-status {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--mono);
    font-size: 0.65rem;
}

@keyframes count-pop {
    0% { opacity: 0; transform: scale(0.7); }
    20% { opacity: 1; transform: scale(1); }
    85% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.06); }
}

@keyframes press-in {
    from { transform: scale(0.72); }
    to { transform: scale(1); }
}

.tournament-arena-score {
    display: grid;
    min-width: 8rem;
    justify-items: center;
    font-family: var(--mono);
}

.tournament-arena-score span {
    margin-top: 0.2rem;
    font-size: 0.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .tournament-arena-score {
        position: absolute;
        top: 5rem;
        right: 0;
        left: 0;
    }

    .match-id {
        display: none;
    }

    .arena-header {
        align-items: start;
    }

    .versus-chip {
        flex-direction: column;
        align-items: end;
        gap: 0.1rem;
    }

    .versus-chip > span:last-child .match-player-details {
        align-items: flex-end;
    }

    .versus-chip > span:last-child .match-player-stats {
        justify-content: flex-end;
    }

    .versus-chip i {
        display: none;
    }

    .versus-chip > .match-versus-marker {
        align-self: flex-end;
        margin-block: 0.15rem;
    }

    .arena-message {
        font-size: clamp(4.3rem, 23vw, 8rem);
    }

    .arena-footer {
        gap: 1rem;
    }

    .arena-footer span:last-child {
        text-align: right;
    }

.reaction-player strong {
        font-size: 1.3rem;
    }

.result-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.live-dot, .loading-pulse {
    background: var(--color-kippo-pink);
}

.rematch-status span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--color-kippo-pink);
    animation: rematch-pulse 1.6s infinite;
}

.game-arena {
    background: var(--color-void-black);
    color: var(--color-ghost-white);
    cursor: crosshair;
    position: fixed;
    z-index: 10;
    inset: 0;
    display: flex;
    min-width: 320px;
    flex-direction: column;
    overflow: hidden;
    touch-action: manipulation;
    user-select: none;
    transition: background-color 70ms linear;
}

.result-page {
    background: var(--color-void-black);
    color: var(--color-ghost-white);
    cursor: default;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
    position: fixed;
    z-index: 10;
    inset: 0;
    display: flex;
    min-width: 320px;
    flex-direction: column;
    touch-action: manipulation;
    transition: background-color 70ms linear;
}

.game-arena::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 5vw 5vw;
    content: "";
    display: none;
}

.game-arena[data-phase="wait"],
.game-arena[data-phase="false-start"],
.game-arena[data-phase="pressed"],
.game-arena[data-phase="press"] {
    background: var(--color-carbon);
}

.game-arena[data-phase="press"] .arena-message {
    color: var(--color-action-hover);
    text-shadow: 0 0 1rem color-mix(in srgb, var(--color-action-hover) 42%, transparent);
}

.arena-header, .result-header {
    position: relative;
    min-height: 5.2rem;
    padding: 1.35rem clamp(1.25rem, 4vw, 4rem);
    border-color: var(--color-ash);
    color: var(--color-ghost-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.arena-footer {
    position: relative;
    z-index: 1;
    min-height: auto;
    padding: 1.35rem clamp(1.25rem, 4vw, 4rem);
    border-color: var(--color-ash);
    color: var(--color-ghost-white);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.arena-message {
    margin: 0;
    font-family: var(--font-source-code-pro);
    font-size: clamp(3rem, 14vw, 10rem);
    font-weight: 800;
    letter-spacing: 0.1em !important;
    line-height: 0.75;
    font-variant-numeric: tabular-nums;
}

.arena-help {
    max-width: 36rem;
    margin: 1.5rem auto 0;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--mono);
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    line-height: 1.5;
}

.game-arena[data-phase="press"] .arena-help,
.game-arena[data-phase="pressed"] .arena-help,
.game-arena[data-phase="false-start"] .arena-help {
    display: none;
}

.tournament-arena-score strong {
    color: var(--color-kippo-pink);
    font-size: 1.5rem;
    line-height: 1;
}

.result-win::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 0.65rem;
    height: 100%;
    background: var(--color-result-win);
    content: "";
}

.result-loss::after {
    background: var(--color-kippo-pink);
    position: absolute;
    top: 0;
    left: 0;
    width: 0.65rem;
    height: 100%;
    content: "";
}

.result-draw::after {
    background: var(--color-kippo-pink);
    position: absolute;
    top: 0;
    left: 0;
    width: 0.65rem;
    height: 100%;
    content: "";
}

.match-chat > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    border-color: var(--color-ash);
}

.match-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-color: var(--color-ash);
}

.match-chat-messages article p {
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: var(--color-carbon);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-buttons);
    color: var(--color-ghost-white);
}

.match-chat-messages article.is-mine p {
    padding: 0.15rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-ghost-white);
}

.match-chat-form input {
    min-width: 0;
    height: 3rem;
    padding: 0 0.9rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-ghost-white);
    font-size: 0.75rem;
    text-transform: none;
}

.result-page .match-chat-form input:focus-visible {
    outline: none;
}

.match-chat-form:focus-within {
    border-top-color: var(--color-ghost-white);
}

.match-chat-form button {
    min-width: 5rem;
    border: 0;
    background: transparent;
    color: var(--color-ghost-white);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    border-left: 1px solid var(--color-ghost-white);
}

.result-header, .arena-header {
    border-color: var(--color-ash);
}

.match-chat-form input::placeholder {
    color: #77777a;
}

.match-chat {
    width: min(100%, 42rem);
    margin-top: 3rem;
    border: 1px solid var(--color-ghost-white);
    background: var(--color-void-black);
    border-radius: var(--radius-cards);
    color: var(--color-ghost-white);
    animation: none;
}

.result-page::before {
    position: absolute;
    top: 14%;
    right: -10vw;
    width: 52vw;
    height: 52vw;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
    display: none;
}

.match-chat-error {
    border-color: var(--color-ash);
    margin: 0;
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-ghost-white);
    font-family: var(--mono);
    font-size: 0.56rem;
}

.rating-result strong {
    font-family: var(--font-source-code-pro);
    font-size: 2rem;
}

