/* Functional layouts, isolated below the current design system. */
@layer legacy {
:root {
    --connect4-size: min(68vh, 680px, 62vw);
    --disc-red: #f34b6d;
    --disc-red-light: #ff9aad;
    --disc-yellow: #f4bd35;
    --disc-yellow-light: #fff09a;
    --board-blue: #6e55e8;
}

.connect4-brand-mark {
    display: grid;
    grid-template-columns: repeat(4, 7px);
    gap: 3px;
    align-items: end;
    width: 40px;
    height: 35px;
    padding: 5px;
    border: 1px solid rgba(177,159,255,.25);
    border-radius: 10px;
    background: rgba(128,101,245,.10);
}
.connect4-brand-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 9px rgba(243,75,109,.5); }
.connect4-brand-mark i:nth-child(2), .connect4-brand-mark i:nth-child(4) { background: var(--disc-yellow); box-shadow: 0 0 9px rgba(244,189,53,.42); }

.connect4-mode-icon {
    display: grid;
    grid-template-columns: repeat(4, 11px);
    align-content: center;
    justify-content: center;
    gap: 4px;
}
.connect4-mode-icon i { width: 11px; height: 11px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 12px rgba(243,75,109,.45); }
.connect4-mode-icon i:last-child { background: var(--disc-yellow); box-shadow: 0 0 12px rgba(244,189,53,.42); }

.connect4-game-layout {
    grid-template-columns: minmax(0, var(--connect4-size)) 350px;
    align-items: center;
}
.connect4-game-layout .player-strip { grid-template-columns: 43px minmax(0,1fr) auto; }
.connect4-board-stage {
    position: relative;
    width: var(--connect4-size);
    max-width: 100%;
    margin: 8px auto;
    padding-top: calc(var(--connect4-size) * .095);
    filter: drop-shadow(0 34px 45px rgba(0,0,0,.34));
}
.connect4-board-stage::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 7%;
    right: 7%;
    bottom: -4%;
    height: 9%;
    border-radius: 50%;
    background: rgba(50,30,130,.46);
    filter: blur(18px);
}
.connect4-board {
    position: relative;
    z-index: 2;
    display: grid;
    width: 100%;
    aspect-ratio: 7 / 6;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: clamp(4px, .8vw, 10px);
    padding: clamp(9px, 1.45vw, 17px);
    overflow: hidden;
    border: 1px solid rgba(193,180,255,.42);
    border-radius: clamp(18px, 2.2vw, 28px);
    background:
        linear-gradient(145deg, rgba(255,255,255,.16), transparent 30%),
        linear-gradient(145deg, #765ff0, #5037c7 75%, #3a2897);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.24),
        inset 0 -14px 30px rgba(30,17,100,.28),
        0 20px 50px rgba(60,35,165,.27);
}
.connect4-cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 44%, #09090d 0 58%, #2e2080 60% 66%, rgba(255,255,255,.12) 68% 72%, #4b36ba 74%);
    box-shadow: inset 0 5px 10px rgba(0,0,0,.52), 0 1px 0 rgba(255,255,255,.14);
    cursor: pointer;
}
.connect4-cell::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    opacity: 0;
    transform: scale(.86);
    transition: transform .2s ease, opacity .2s ease, filter .2s ease;
}
.connect4-cell.is-red::after {
    opacity: 1;
    transform: scale(1);
    background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 46%, #bd2447 100%);
    box-shadow: inset 0 2px 2px rgba(255,255,255,.38), inset 0 -7px 13px rgba(123,18,45,.25), 0 4px 9px rgba(38,5,17,.38);
}
.connect4-cell.is-yellow::after {
    opacity: 1;
    transform: scale(1);
    background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 48%, #c18116 100%);
    box-shadow: inset 0 2px 2px rgba(255,255,255,.46), inset 0 -7px 13px rgba(122,72,3,.2), 0 4px 9px rgba(35,23,2,.36);
}
.connect4-cell.is-new::after { animation: connect4-drop .52s cubic-bezier(.22,.82,.28,1.12) both; }
.connect4-cell.is-winning::after { animation: connect4-win 1s ease-in-out infinite; }
.connect4-cell.is-playable:hover { filter: brightness(1.13); }
.connect4-cell:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.connect4-cell.is-disabled { cursor: default; }

.column-preview {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    width: calc(100% / 7);
    aspect-ratio: 1;
    padding: 1.2%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(var(--preview-column, 0) * 100%));
    transition: transform .16s cubic-bezier(.2,.8,.2,1), opacity .16s ease;
}
.column-preview::after {
    content: "";
    display: block;
    width: 76%;
    height: 76%;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 46%, #bd2447 100%);
    box-shadow: 0 8px 24px rgba(243,75,109,.34), inset 0 2px 2px rgba(255,255,255,.38);
}
.column-preview.is-yellow::after { background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 48%, #c18116 100%); box-shadow: 0 8px 24px rgba(244,189,53,.3); }
.column-preview.is-visible { opacity: .88; }

.connect4-color-chip { width: 28px; height: 28px; border-radius: 50%; }
.connect4-color-chip--red { background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 50%, #bd2447); box-shadow: 0 0 20px rgba(243,75,109,.3); }
.connect4-color-chip--yellow { background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 50%, #c18116); box-shadow: 0 0 20px rgba(244,189,53,.28); }

.connect4-history-disc { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; }
.connect4-history-disc.is-red { background: var(--disc-red); box-shadow: 0 0 8px rgba(243,75,109,.25); }
.connect4-history-disc.is-yellow { background: var(--disc-yellow); box-shadow: 0 0 8px rgba(244,189,53,.22); }
.move-row { grid-template-columns: 15px minmax(0,1fr) auto; }
.connect4-panel-actions { display: grid; }

.connect4-result-symbol {
    display: grid;
    grid-template-columns: repeat(4, 15px);
    place-content: center;
    gap: 3px;
    background: linear-gradient(145deg, rgba(111,83,231,.32), rgba(56,36,146,.48));
}
.connect4-result-symbol i { width: 15px; height: 15px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 11px rgba(243,75,109,.48); }
.connect4-result-symbol.is-loss i { background: var(--disc-yellow); box-shadow: 0 0 11px rgba(244,189,53,.4); }
.connect4-result-symbol.is-draw i:nth-child(even) { background: var(--disc-yellow); }

/* =========================================================
   PRISM PUISSANCE 4 10.8 · Tournois, bracket et spectateurs
   ========================================================= */

.mode-card--tournament {
    grid-column: 1 / -1;
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
    align-items: center;
    gap: clamp(30px, 6vw, 90px);
    border-color: rgba(244, 189, 53, .13);
    background:
        radial-gradient(circle at 9% 50%, rgba(244, 189, 53, .08), transparent 30%),
        linear-gradient(135deg, rgba(26, 24, 30, .94), rgba(13, 13, 17, .88));
}
.mode-card--tournament .mode-card__halo {
    top: -170px;
    right: 12%;
    background: rgba(244, 189, 53, .12);
}
.tournament-card-copy {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 27px;
}
.tournament-card-copy .mode-icon { margin: 0; }
.tournament-card-copy h2 {
    margin-top: 8px;
    font-size: clamp(31px, 4vw, 48px);
}
.tournament-card-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}
.tournament-card-action {
    display: grid;
    gap: 13px;
    padding: 20px;
    border: 1px solid rgba(244, 189, 53, .1);
    border-radius: 21px;
    background: rgba(0, 0, 0, .15);
}
.tournament-card-action .mode-note { margin: 0; }
.tournament-mode-icon {
    position: relative;
    overflow: hidden;
    color: #ffe7a2;
}
.tournament-mode-icon i {
    position: absolute;
    width: 18px;
    height: 1px;
    background: rgba(244, 189, 53, .58);
    box-shadow: 0 0 8px rgba(244, 189, 53, .35);
}
.tournament-mode-icon i:nth-child(1) { left: 11px; top: 22px; }
.tournament-mode-icon i:nth-child(2) { left: 11px; bottom: 22px; }
.tournament-mode-icon i:nth-child(3) { right: 11px; top: 22px; }
.tournament-mode-icon i:nth-child(4) { right: 11px; bottom: 22px; }
.tournament-mode-icon i:nth-child(1),
.tournament-mode-icon i:nth-child(2) { transform-origin: right; transform: rotate(26deg); }
.tournament-mode-icon i:nth-child(3),
.tournament-mode-icon i:nth-child(4) { transform-origin: left; transform: rotate(-26deg); }
.tournament-mode-icon span {
    position: relative;
    z-index: 2;
    font-size: 23px;
    text-shadow: 0 0 18px rgba(244, 189, 53, .55);
}
.tournament-size-control {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}
.tournament-size-control button {
    min-height: 43px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}
.tournament-size-control button:hover {
    transform: translateY(-1px);
    color: var(--text);
    background: rgba(255, 255, 255, .055);
}
.tournament-size-control button.is-active {
    border-color: rgba(244, 189, 53, .28);
    background: rgba(244, 189, 53, .1);
    color: #ffe5a0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.tournament-watch-section {
    margin-top: 22px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid rgba(72, 213, 221, .13);
    border-radius: 24px;
    background:
        radial-gradient(circle at 90% 0, rgba(72, 213, 221, .07), transparent 34%),
        rgba(14, 15, 20, .82);
}
.tournament-watch-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}
.tournament-watch-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 580;
    letter-spacing: -.035em;
}
.tournament-watch-heading .text-button { margin: 0; }
.tournament-watch-list { display: grid; gap: 10px; }
.tournament-watch-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 94px;
    padding: 17px 19px;
    border: 1px solid rgba(72, 213, 221, .1);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(14, 28, 35, .78), rgba(11, 13, 19, .92));
    transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.tournament-watch-card:hover {
    border-color: rgba(72, 213, 221, .28);
    background: linear-gradient(135deg, rgba(16, 35, 42, .86), rgba(11, 13, 19, .95));
    transform: translateY(-1px);
}
.tournament-watch-card__copy { min-width: 0; }
.tournament-watch-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}
.tournament-watch-card__title strong {
    color: #e9ffff;
    font-size: 14px;
    letter-spacing: .04em;
}
.tournament-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7ff4ed;
    font-size: 7px;
    font-weight: 850;
    letter-spacing: .11em;
}
.tournament-live-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #58e4dc;
    box-shadow: 0 0 11px rgba(88, 228, 220, .7);
    animation: spectator-live 1.45s ease-in-out infinite;
}
.tournament-watch-card p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tournament-watch-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8fe9e5;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    text-align: right;
    transition: color .2s ease, transform .2s ease;
}
.tournament-watch-link::before { content: "→ "; }
.tournament-watch-link:hover {
    color: #d8ffff;
    transform: translateX(2px);
}
.tournament-watch-link:focus-visible {
    outline: 2px solid #8fe9e5;
    outline-offset: 5px;
    border-radius: 3px;
}
.tournament-watch-empty {
    margin: 0;
    padding: 20px;
    border: 1px dashed rgba(255, 255, 255, .08);
    border-radius: 14px;
    color: var(--muted-2);
    font-size: 10px;
    text-align: center;
}
.tournament-watch-empty.is-error { color: #ee9aad; }

.tournament-queue-modal { width: min(470px, 100%); }
.tournament-queue-emblem {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    margin: 0 auto 25px;
    border: 1px solid rgba(244, 189, 53, .2);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(244, 189, 53, .16), transparent 66%),
        rgba(255, 255, 255, .02);
    color: #ffe8a9;
    font-size: 26px;
    box-shadow: 0 0 50px rgba(244, 189, 53, .1);
    animation: tournament-emblem 2.4s ease-in-out infinite;
}
.tournament-queue-count {
    display: grid;
    gap: 5px;
    margin: 25px 0 12px;
}
.tournament-queue-count strong {
    color: #fff0c0;
    font-size: 28px;
    font-weight: 620;
    letter-spacing: -.04em;
}
.tournament-queue-count span {
    color: var(--muted-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .14em;
}
.tournament-queue-track {
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, .065);
}
.tournament-queue-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8d73ff, #f4bd35);
    box-shadow: 0 0 17px rgba(244, 189, 53, .38);
    transition: width .65s cubic-bezier(.2, .8, .2, 1);
}
.tournament-queue-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 12px;
    margin: 16px 0 12px;
}
.tournament-queue-dots i {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .035);
}
.tournament-queue-dots i.is-filled {
    border-color: rgba(244, 189, 53, .28);
    background: #f4bd35;
    box-shadow: 0 0 9px rgba(244, 189, 53, .5);
    animation: queue-dot-in .38s cubic-bezier(.2, .8, .2, 1) both;
}

body.has-tournament-arena { overflow: hidden; }
.tournament-arena {
    position: fixed;
    z-index: 1450;
    inset: 0;
    overflow: hidden;
    background: #070a11;
    color: var(--text);
    isolation: isolate;
    animation: tournament-arena-in .75s cubic-bezier(.16, .85, .26, 1) both;
}
.tournament-arena__backdrop {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(rgba(79, 223, 230, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 223, 230, .025) 1px, transparent 1px),
        radial-gradient(circle at 50% 44%, rgba(50, 220, 224, .075), transparent 37%),
        radial-gradient(circle at 50% 82%, rgba(244, 189, 53, .055), transparent 30%),
        linear-gradient(145deg, #090d17, #050810 62%, #090b12);
    background-size: 54px 54px, 54px 54px, auto, auto, auto;
}
.tournament-arena__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .055;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url("/game/connect4/assets/css/%23n")'/%3E%3C/svg%3E");
}
.tournament-arena__header {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    min-height: 108px;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 32px 18px;
    text-align: center;
    pointer-events: none;
    background: linear-gradient(#070a11 0, rgba(7, 10, 17, .88) 65%, transparent);
}
.tournament-arena__header h1 {
    margin: 5px 0 0;
    color: #f7ecd3;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 650;
    letter-spacing: .04em;
    text-shadow: 0 0 32px rgba(244, 189, 53, .14);
}
.tournament-arena__reward {
    position: absolute;
    right: 30px;
    top: 28px;
    display: grid;
    justify-items: end;
    gap: 3px;
}
.tournament-arena__reward span {
    color: var(--muted-2);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .15em;
}
.tournament-arena__reward strong { color: #ffe29a; font-size: 14px; }

.tournament-viewport {
    position: absolute;
    z-index: 2;
    inset: 90px 0 62px;
    overflow: hidden;
}
.tournament-camera {
    position: absolute;
    left: 0;
    top: 0;
    width: 1800px;
    height: 1100px;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 1.5s cubic-bezier(.16, .8, .18, 1);
}
.tournament-lines,
.tournament-nodes {
    position: absolute;
    inset: 0;
    width: 1800px;
    height: 1100px;
}
.tournament-line {
    fill: none;
    stroke: rgba(72, 213, 221, .3);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(72, 213, 221, .17));
    transition: stroke .45s ease, opacity .45s ease;
}
.tournament-line.is-complete { stroke: rgba(72, 231, 226, .7); }
.tournament-line.is-viewer {
    stroke: #f5c95b;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(245, 201, 91, .5));
}
.tournament-line.is-animated {
    stroke-dasharray: 12 9;
    animation: tournament-route 1.1s linear infinite;
}
.tournament-loss-line {
    fill: none;
    stroke: #ba4c67;
    stroke-width: 3;
    stroke-dasharray: 11 9;
    filter: drop-shadow(0 0 8px rgba(186, 76, 103, .45));
    animation: tournament-route 1.1s linear infinite;
}
.bracket-match {
    position: absolute;
    display: grid;
    width: 218px;
    min-height: 68px;
    grid-template-rows: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(66, 217, 224, .22);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(11, 27, 36, .93), rgba(7, 15, 24, .96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 9px 25px rgba(0, 0, 0, .22);
    transform: translate(-50%, -50%);
    transition: border-color .4s ease, box-shadow .4s ease, opacity .4s ease, transform .4s ease;
}
.bracket-match.is-pending { opacity: .48; }
.bracket-match.is-current {
    z-index: 4;
    border-color: rgba(245, 201, 91, .82);
    box-shadow: 0 0 0 2px rgba(245, 201, 91, .08), 0 0 34px rgba(245, 201, 91, .18);
    transform: translate(-50%, -50%) scale(1.05);
}
.bracket-match.is-viewer:not(.is-current) { border-color: rgba(245, 201, 91, .38); }
.bracket-match.is-finished { border-color: rgba(72, 213, 221, .42); }
.bracket-match.is-watchable {
    cursor: pointer;
    border-color: rgba(72, 231, 226, .58);
    box-shadow: 0 0 0 1px rgba(72, 231, 226, .06), 0 0 28px rgba(72, 231, 226, .11);
}
.bracket-match.is-watchable:hover,
.bracket-match.is-watchable:focus-visible {
    z-index: 5;
    border-color: rgba(126, 255, 248, .92);
    outline: none;
    box-shadow: 0 0 0 2px rgba(126, 255, 248, .1), 0 0 42px rgba(72, 231, 226, .24);
    transform: translate(-50%, -50%) scale(1.07);
}
.bracket-match.is-watched {
    border-color: rgba(245, 201, 91, .86);
    box-shadow: 0 0 0 2px rgba(245, 201, 91, .1), 0 0 38px rgba(245, 201, 91, .2);
}
.bracket-match.is-final {
    width: 250px;
    min-height: 78px;
    border-color: rgba(245, 201, 91, .42);
    background:
        radial-gradient(circle at 50% 50%, rgba(245, 201, 91, .09), transparent 70%),
        linear-gradient(145deg, rgba(17, 29, 34, .96), rgba(8, 14, 21, .98));
}
.bracket-player {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 9px;
    color: #9aa7ad;
    font-size: 10px;
}
.bracket-player + .bracket-player { border-top: 1px solid rgba(66, 217, 224, .1); }
.bracket-player.is-winner {
    background: rgba(72, 213, 221, .07);
    color: #d8ffff;
}
.bracket-player.is-viewer {
    background: rgba(245, 201, 91, .08);
    color: #fff0be;
}
.bracket-player__avatar {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: #25333a;
    color: #e9faff;
    font-size: 8px;
    font-weight: 800;
}
.bracket-player__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bracket-player strong {
    overflow: hidden;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bracket-player small {
    color: rgba(255, 255, 255, .28);
    font-size: 7px;
    font-weight: 800;
}
.bracket-player.is-winner small { color: #62e7df; }
.bracket-trophy {
    position: absolute;
    left: 900px;
    top: 28px;
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border: 1px solid rgba(245, 201, 91, .26);
    border-radius: 50%;
    background: rgba(245, 201, 91, .07);
    color: #ffe39b;
    font-size: 23px;
    transform: translateX(-50%);
    box-shadow: 0 0 35px rgba(245, 201, 91, .12);
}
.bracket-round-label {
    position: absolute;
    color: rgba(134, 213, 217, .52);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
    text-align: center;
    transform: translateX(-50%);
}

.loser-dock {
    position: absolute;
    left: 540px;
    top: 870px;
    display: grid;
    width: 720px;
    min-height: 168px;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    padding: 21px;
    border: 1px solid rgba(186, 76, 103, .24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 50%, rgba(186, 76, 103, .11), transparent 45%),
        rgba(8, 13, 20, .95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.loser-dock.is-viewer-destination {
    border-color: rgba(230, 101, 127, .68);
    box-shadow: 0 0 45px rgba(186, 76, 103, .16);
}
.loser-dock__title {
    display: grid;
    align-content: center;
    gap: 4px;
    padding-right: 18px;
    border-right: 1px solid rgba(186, 76, 103, .14);
}
.loser-dock__title span {
    color: #8e5663;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .18em;
}
.loser-dock__title strong {
    color: #d7a4af;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.05;
}
.loser-dock__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 7px;
    max-height: 124px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-color: rgba(186, 76, 103, .34) transparent;
    scrollbar-width: thin;
}
.loser-entry {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
    color: #8e939a;
}
.loser-entry.is-viewer {
    border-color: rgba(230, 101, 127, .4);
    background: rgba(186, 76, 103, .09);
    color: #f4bac6;
}
.loser-entry i {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background: #2b2229;
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
}
.loser-entry i img { width: 100%; height: 100%; object-fit: cover; }
.loser-entry span { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.loser-entry small { color: #754b56; font-size: 6px; font-weight: 800; }
.loser-empty {
    grid-column: 1 / -1;
    align-self: center;
    color: rgba(255, 255, 255, .22);
    font-size: 9px;
    text-align: center;
}

.tournament-faceoff,
.tournament-outcome {
    position: absolute;
    z-index: 30;
    top: 50%;
    left: 50%;
    width: min(680px, calc(100% - 32px));
    padding: clamp(25px, 4vw, 42px);
    border: 1px solid rgba(245, 201, 91, .2);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 0, rgba(245, 201, 91, .09), transparent 44%),
        rgba(7, 11, 18, .93);
    box-shadow: 0 45px 130px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .04);
    text-align: center;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(22px);
    animation: faceoff-in .72s cubic-bezier(.16, .85, .26, 1) both;
}
.tournament-faceoff::before,
.tournament-outcome::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: -100vh -100vw;
    background: rgba(3, 6, 10, .48);
    backdrop-filter: blur(5px);
}
.faceoff-versus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 26px 0 22px;
}
.faceoff-player {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
}
.faceoff-player strong {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(16px, 3vw, 23px);
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.faceoff-player > span {
    color: var(--muted-2);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .15em;
}
.faceoff-avatar {
    display: grid;
    width: clamp(72px, 12vw, 108px);
    height: clamp(72px, 12vw, 108px);
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 27px;
    background: linear-gradient(145deg, #d8d2df, #8d8a95);
    color: #15121b;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .3);
}
.faceoff-player--opponent .faceoff-avatar {
    border-color: rgba(72, 213, 221, .2);
    background: linear-gradient(145deg, #b8dde0, #557379);
}
.faceoff-avatar img { width: 100%; height: 100%; object-fit: cover; }
.faceoff-vs {
    position: relative;
    display: grid;
    height: 90px;
    place-items: center;
}
.faceoff-vs span {
    position: relative;
    z-index: 2;
    color: #ffe39b;
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 0 24px rgba(245, 201, 91, .45);
}
.faceoff-vs i {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(transparent, rgba(245, 201, 91, .5), transparent);
    transform: rotate(20deg);
}
.tournament-faceoff h2,
.tournament-outcome h2 {
    margin: 8px 0 8px;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 580;
    letter-spacing: -.045em;
}
.tournament-faceoff p,
.tournament-outcome p {
    margin: 0 auto 25px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}
.tournament-faceoff .button,
.tournament-outcome .button { min-height: 48px; }
.tournament-outcome { width: min(520px, calc(100% - 32px)); }
.tournament-outcome__symbol {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    margin: 0 auto 23px;
    border: 1px solid rgba(245, 201, 91, .22);
    border-radius: 50%;
    background: rgba(245, 201, 91, .08);
    color: #ffe39b;
    font-size: 26px;
    box-shadow: 0 0 42px rgba(245, 201, 91, .12);
}
.tournament-outcome.is-loss {
    border-color: rgba(210, 84, 111, .28);
    background:
        radial-gradient(circle at 50% 0, rgba(186, 76, 103, .11), transparent 44%),
        rgba(9, 10, 17, .95);
}
.tournament-outcome.is-loss .tournament-outcome__symbol {
    border-color: rgba(210, 84, 111, .28);
    background: rgba(186, 76, 103, .09);
    color: #f1a5b5;
}
.tournament-outcome.is-champion .tournament-outcome__symbol {
    animation: champion-symbol 1.7s ease-in-out infinite;
}
.tournament-outcome .xp-award { margin: 0 0 23px; }
.tournament-outcome > .text-button { margin-top: 14px; }

.tournament-arena__footer {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    min-height: 67px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 28px max(13px, env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(7, 10, 17, .94) 44%, #070a11);
}
.tournament-arena__footer p { margin: 0; color: var(--muted); font-size: 9px; }
.tournament-arena__footer > div { display: flex; gap: 17px; }
.tournament-arena__footer .text-button { margin: 0; }

@keyframes tournament-emblem {
    0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(244, 189, 53, .1); }
    50% { transform: scale(1.045); box-shadow: 0 0 65px rgba(244, 189, 53, .2); }
}
@keyframes queue-dot-in {
    from { opacity: 0; transform: scale(.3); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes tournament-arena-in {
    from { opacity: 0; filter: blur(8px); }
    to { opacity: 1; filter: blur(0); }
}
@keyframes faceoff-in {
    from { opacity: 0; transform: translate(-50%, -44%) scale(.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes tournament-route {
    to { stroke-dashoffset: -42; }
}
@keyframes champion-symbol {
    0%, 100% { transform: scale(1); box-shadow: 0 0 42px rgba(245, 201, 91, .12); }
    50% { transform: scale(1.08); box-shadow: 0 0 65px rgba(245, 201, 91, .3); }
}
@keyframes spectator-live {
    0%, 100% { opacity: .55; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes connect4-drop {
    0% { transform: translateY(calc(-700% - 55px)) scale(.92); }
    68% { transform: translateY(7%) scale(1.02,.96); }
    84% { transform: translateY(-3%) scale(.98,1.02); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes connect4-win {
    0%,100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(.82); filter: brightness(1.45); }
}

@media (max-width: 1100px) {
    :root { --connect4-size: min(66vh, 650px, 61vw); }
    .connect4-game-layout { grid-template-columns: minmax(0,var(--connect4-size)) 325px; }
}
@media (max-width: 860px) {
    :root { --connect4-size: min(calc(100vw - 38px), 680px); }
    .connect4-game-layout { grid-template-columns: 1fr; }
    .mode-card--tournament {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
@media (max-width: 420px) {
    :root { --connect4-size: calc(100vw - 20px); }
    .connect4-board { gap: 3px; padding: 7px; border-radius: 17px; }
    .connect4-board-stage { padding-top: calc(var(--connect4-size) * .11); }
}
@media (max-width: 620px) {
    .connect4-game-layout .player-strip { grid-template-columns: 39px minmax(0,1fr) 26px; }
    .connect4-color-chip { width: 24px; height: 24px; }
    .tournament-card-copy {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tournament-card-copy .mode-icon { width: 66px; height: 66px; border-radius: 19px; }
    .tournament-card-action { padding: 15px; }
    .tournament-watch-heading { align-items: center; }
    .tournament-watch-card {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .tournament-watch-card__title { align-items: flex-start; flex-direction: column; }
    .tournament-watch-card p { white-space: normal; }
    .tournament-watch-link { text-align: left; }
    .tournament-arena__header {
        min-height: 94px;
        padding-inline: 14px;
    }
    .tournament-arena__header h1 { font-size: 22px; }
    .tournament-arena__reward {
        position: static;
        display: none;
    }
    .tournament-viewport { inset: 79px 0 80px; }
    .tournament-arena__footer {
        min-height: 82px;
        align-items: flex-start;
        padding-inline: 15px;
    }
    .tournament-arena__footer p { max-width: 52%; line-height: 1.45; }
    .tournament-arena__footer > div { display: grid; justify-items: end; gap: 5px; }
    .faceoff-versus { grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr); gap: 6px; }
    .faceoff-vs span { font-size: 19px; }
    .tournament-faceoff,
    .tournament-outcome { padding: 25px 18px; border-radius: 22px; }
    .tournament-faceoff h2,
    .tournament-outcome h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .connect4-cell.is-new::after,
    .connect4-cell.is-winning::after,
    .tournament-line,
    .tournament-loss-line,
    .tournament-queue-emblem,
    .tournament-outcome__symbol { animation: none; }
    .tournament-live-badge::before { animation: none; }
    .tournament-camera { transition-duration: .01ms; }
}

:root {
    --bg: #08080a;
    --surface: rgba(19, 19, 23, 0.78);
    --surface-solid: #121216;
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.085);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f7f7f8;
    --muted: #8f8f9b;
    --muted-2: #656570;
    --accent: #b9a7ff;
    --accent-2: #7e66ff;
    --accent-soft: rgba(151, 123, 255, 0.16);
    --danger: #ff6f7d;
    --light-square: #dedce2;
    --dark-square: #74717a;
    --board-radius: 18px;
    --shadow: 0 42px 90px rgba(0, 0, 0, 0.48);
    --board-size: min(70vh, 720px, 64vw);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgba(107, 80, 226, 0.11), transparent 34%),
        radial-gradient(circle at 86% 82%, rgba(169, 77, 190, 0.07), transparent 30%),
        linear-gradient(135deg, #09090b 0%, #070709 55%, #0b0a0f 100%);
    color: var(--text);
    font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.ambient {
    position: fixed;
    z-index: -3;
    width: 42vw;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    animation: ambient-drift 18s ease-in-out infinite alternate;
}

.ambient--one {
    top: -18vw;
    left: -12vw;
    background: #6c4dff;
}

.ambient--two {
    right: -20vw;
    bottom: -20vw;
    background: #9d4db4;
    animation-delay: -7s;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url("/game/chess/assets/css/%23n")' opacity='.8'/%3E%3C/svg%3E");
}

.app-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 26px 0 36px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    align-items: end;
    gap: 3px;
    width: 20px;
    height: 25px;
    transform: skewX(-10deg);
}

.brand-mark span {
    display: block;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #d5caff, #846cff);
    box-shadow: 0 0 18px rgba(147, 119, 255, 0.35);
}

.brand-mark span:nth-child(1) { height: 54%; }
.brand-mark span:nth-child(2) { height: 100%; }
.brand-mark span:nth-child(3) { height: 76%; }

.brand-copy {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.brand-copy strong {
    font-family: "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    letter-spacing: 0.22em;
}

.brand-copy small {
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button,
.button,
.segmented button,
.text-button,
.promotion-button {
    border: 0;
    cursor: pointer;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    transition: border-color 220ms ease, background 220ms ease, color 220ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}

.icon-button:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.065);
    color: var(--text);
    transform: translateY(-1px);
}

.icon-button svg {
    width: 18px;
    fill: currentColor;
}

.icon-button .sound-off { display: none; }
.icon-button[aria-pressed="false"] .sound-on { display: none; }
.icon-button[aria-pressed="false"] .sound-off { display: block; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease, background 220ms ease, color 220ms ease, opacity 220ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.button:disabled { cursor: not-allowed; opacity: 0.35; }
.button svg { width: 17px; fill: currentColor; }

.button--ghost {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
}

.button--ghost:hover { background: rgba(255, 255, 255, 0.07); }

.button--secondary {
    flex: 1;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.button--secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }

.button--danger {
    border: 1px solid rgba(255, 111, 125, 0.15);
    background: rgba(255, 111, 125, 0.06);
    color: #ff9da6;
}

.button--danger:hover { background: rgba(255, 111, 125, 0.11); }

.button--primary {
    width: 100%;
    background: linear-gradient(135deg, #b9a7ff, #8269ff);
    color: #0b0912;
    box-shadow: 0 12px 32px rgba(126, 102, 255, 0.24);
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--board-size)) 360px;
    justify-content: center;
    gap: clamp(34px, 5vw, 82px);
    align-items: center;
}

.board-stage {
    width: 100%;
    animation: stage-in 780ms cubic-bezier(.16,.85,.26,1) both;
}

.player-strip {
    display: grid;
    grid-template-columns: 43px minmax(0, auto) 1fr;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.player-strip--opponent { margin-bottom: 12px; }
.player-strip--self { margin-top: 12px; }

.avatar {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.avatar--player {
    color: #17131f;
    background: linear-gradient(145deg, #ece8f3, #aaa6b2);
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    font-weight: 800;
}

.avatar--ai {
    position: relative;
    background: radial-gradient(circle at 50% 35%, rgba(151, 123, 255, 0.24), rgba(255,255,255,0.025) 62%);
}

.avatar--ai::before,
.avatar--ai::after,
.avatar-core {
    position: absolute;
    border-radius: 50%;
}

.avatar--ai::before {
    content: "";
    width: 23px;
    height: 23px;
    border: 1px solid rgba(185, 167, 255, 0.48);
    animation: ai-orbit 7s linear infinite;
}

.avatar--ai::after {
    content: "";
    width: 17px;
    height: 17px;
    border: 1px dashed rgba(185, 167, 255, 0.35);
    animation: ai-orbit 4s linear infinite reverse;
}

.avatar-core {
    width: 6px;
    height: 6px;
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent);
}

.player-meta { min-width: 0; }

.player-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.player-name-line strong {
    font-family: "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.player-subline {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 200ms ease;
}

.badge {
    padding: 4px 6px;
    border: 1px solid rgba(185, 167, 255, 0.15);
    border-radius: 6px;
    background: var(--accent-soft);
    color: #cfc4ff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.turn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(185, 167, 255, 0.85);
    animation: turn-pulse 1.8s ease-in-out infinite;
    transition: opacity 220ms ease;
}

.turn-dot.is-inactive { opacity: 0.12; animation: none; }

.captured {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    padding-right: 2px;
    color: var(--muted-2);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(13px, 1.5vw, 19px);
    letter-spacing: -0.2em;
    white-space: nowrap;
}

.board-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: calc(var(--board-radius) + 8px);
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    isolation: isolate;
}

.board-glow {
    position: absolute;
    inset: 12%;
    z-index: -1;
    border-radius: 50%;
    background: rgba(135, 105, 255, 0.2);
    filter: blur(55px);
    opacity: 0.45;
    transition: opacity 500ms ease;
}

.board-frame.is-thinking .board-glow {
    opacity: 0.85;
    animation: thinking-glow 1.6s ease-in-out infinite alternate;
}

.board {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    overflow: hidden;
    border-radius: var(--board-radius);
    background: var(--dark-square);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
    user-select: none;
    touch-action: none;
}

.square {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.square.light { background: var(--light-square); }
.square.dark { background: var(--dark-square); }

.square::before,
.square::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.square::before {
    inset: 0;
    background: rgba(171, 149, 255, 0);
    transition: background 180ms ease;
}

.square.is-last::before { background: rgba(170, 145, 255, 0.2); }
.square.is-selected::before { background: rgba(150, 121, 255, 0.36); }
.square.is-check::before {
    background: radial-gradient(circle, rgba(255, 90, 106, 0.62), rgba(255, 68, 89, 0.18) 54%, transparent 72%);
    animation: check-pulse 1.2s ease-in-out infinite alternate;
}

.square.is-legal::after {
    z-index: 2;
    width: 16%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(30, 27, 35, 0.3);
    transform: scale(0);
    animation: legal-dot 240ms cubic-bezier(.2,.8,.2,1) forwards;
}

.square.is-capture::after {
    z-index: 2;
    inset: 8%;
    width: auto;
    aspect-ratio: auto;
    border: clamp(2px, .45vw, 5px) solid rgba(49, 43, 58, 0.25);
    border-radius: 50%;
    background: transparent;
    transform: scale(0.82);
    animation: legal-ring 240ms cubic-bezier(.2,.8,.2,1) forwards;
}

.coordinate {
    position: absolute;
    z-index: 4;
    color: rgba(22, 20, 26, 0.45);
    font-size: clamp(7px, .72vw, 10px);
    font-weight: 700;
    pointer-events: none;
}

.coordinate--file { right: 6px; bottom: 4px; }
.coordinate--rank { top: 5px; left: 6px; }
.square.dark .coordinate { color: rgba(245, 243, 248, 0.48); }

.piece {
    position: relative;
    z-index: 3;
    display: grid;
    width: 88%;
    height: 88%;
    place-items: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: grab;
    font-family: Georgia, "Times New Roman", "DejaVu Serif", serif;
    font-size: clamp(31px, calc(var(--board-size) / 10.2), 70px);
    line-height: 1;
    transform: translateZ(0) scale(1);
    transform-origin: center;
    transition: transform 160ms cubic-bezier(.2,.8,.2,1), filter 160ms ease, opacity 120ms ease;
    will-change: transform;
}

.piece:active { cursor: grabbing; }
.square:hover .piece { transform: translateZ(0) scale(1.045); }
.square.is-selected .piece { transform: translateZ(0) scale(1.07); }

.piece--white {
    color: #fbfafc;
    filter: drop-shadow(0 2px 0 rgba(58, 54, 64, .32)) drop-shadow(0 8px 8px rgba(20, 18, 23, .24));
    text-shadow: 0 0 1px #59545f;
}

.piece--black {
    color: #202026;
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .14)) drop-shadow(0 8px 8px rgba(16, 14, 18, .25));
    text-shadow: 0 0 1px rgba(255, 255, 255, .25);
}

.piece.is-dragging {
    opacity: 0;
}

.drag-piece,
.move-ghost {
    position: fixed;
    z-index: 999;
    display: grid;
    place-items: center;
    pointer-events: none;
    font-family: Georgia, "Times New Roman", "DejaVu Serif", serif;
    line-height: 1;
    will-change: transform;
}

.drag-piece {
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .35));
    transform: translate(-50%, -50%) scale(1.08);
}

.move-ghost {
    margin: 0;
}

.thinking-overlay {
    position: absolute;
    inset: 8px;
    z-index: 10;
    display: grid;
    place-items: center;
    border-radius: var(--board-radius);
    background: rgba(10, 9, 13, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease, background 250ms ease;
}

.board-frame.is-thinking .thinking-overlay {
    background: rgba(10, 9, 13, 0.06);
    opacity: 1;
}

.thinking-orbit {
    position: relative;
    width: 44px;
    height: 44px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 220ms ease, transform 320ms cubic-bezier(.2,.8,.2,1);
}

.board-frame.is-thinking .thinking-orbit {
    opacity: 1;
    transform: scale(1);
}

.thinking-orbit span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(185, 167, 255, 0.32);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ai-orbit 1.2s linear infinite;
}

.thinking-orbit span:nth-child(2) {
    inset: 7px;
    animation-duration: 1.8s;
    animation-direction: reverse;
}

.thinking-orbit span:nth-child(3) {
    inset: 15px;
    border-style: dashed;
    animation-duration: .85s;
}

.game-panel {
    display: flex;
    min-height: 580px;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255,255,255,.035);
    backdrop-filter: blur(22px);
    animation: panel-in 880ms 90ms cubic-bezier(.16,.85,.26,1) both;
}


.eyebrow,
.section-heading {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.status-card {
    padding-bottom: 25px;
}

.status-card h1 {
    margin: 11px 0 8px;
    font-family: "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(23px, 2vw, 30px);
    font-weight: 600;
    letter-spacing: -0.035em;
}

.status-card p {
    min-height: 35px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.status-line {
    height: 1px;
    margin-top: 23px;
    overflow: hidden;
    background: var(--border);
}

.status-line span {
    display: block;
    width: 38%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: translateX(-100%);
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.status-card.is-updated .status-line span {
    animation: status-scan 780ms ease;
}

.panel-section {
    padding: 21px 0;
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

.section-heading span:last-child { color: #5f5f69; }

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(0,0,0,.16);
}

.segmented button {
    min-height: 36px;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    transition: color 200ms ease, background 220ms ease, box-shadow 220ms ease, transform 200ms ease;
}

.segmented button:hover { color: var(--text); }
.segmented button:active { transform: scale(.98); }
.segmented button.is-active {
    background: rgba(255,255,255,.075);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 12px rgba(0,0,0,.12);
}

.microcopy {
    margin: 9px 2px 0;
    color: var(--muted-2);
    font-size: 9px;
}

.panel-section--moves {
    display: flex;
    min-height: 210px;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.move-list {
    display: grid;
    max-height: 250px;
    gap: 2px;
    overflow-y: auto;
    padding-right: 5px;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255,255,255,.12) transparent;
    scrollbar-width: thin;
}

.move-list::-webkit-scrollbar { width: 4px; }
.move-list::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(255,255,255,.12); }

.empty-history {
    display: grid;
    min-height: 130px;
    place-items: center;
    color: var(--muted-2);
    font-size: 10px;
}

.move-row {
    display: grid;
    grid-template-columns: 28px 1fr 1fr;
    align-items: center;
    min-height: 36px;
    padding: 0 9px;
    border-radius: 9px;
    color: #b8b8c0;
    font-size: 11px;
    animation: move-row-in 360ms cubic-bezier(.2,.8,.2,1) both;
}

.move-row:hover { background: rgba(255,255,255,.035); }
.move-number { color: #55555f; font-size: 9px; }
.move-san { font-weight: 600; }
.move-san.is-current { color: #d7ceff; }

.panel-actions {
    display: flex;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 5, 7, .68);
    backdrop-filter: blur(14px);
    animation: backdrop-in 260ms ease both;
}

.modal-backdrop[hidden] { display: none; }

.modal {
    width: min(390px, 100%);
    padding: 34px;
    border: 1px solid var(--border-strong);
    border-radius: 25px;
    background: linear-gradient(160deg, rgba(28, 27, 34, .98), rgba(13, 13, 17, .98));
    box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
    text-align: center;
    animation: modal-in 420ms cubic-bezier(.16,.85,.26,1) both;
}

.modal-symbol {
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    margin: 0 auto 25px;
    border: 1px solid rgba(185, 167, 255, .18);
    border-radius: 23px;
    background: radial-gradient(circle, rgba(167, 142, 255, .18), rgba(255,255,255,.025));
    color: #e3ddff;
    font-family: Georgia, serif;
    font-size: 41px;
    box-shadow: 0 0 45px rgba(126,102,255,.12);
}

.modal h2 {
    margin: 10px 0 9px;
    font-family: "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 28px;
    letter-spacing: -.035em;
}

.modal p {
    margin: 0 0 25px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.text-button {
    margin-top: 15px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.text-button:hover { color: var(--text); }

.modal--promotion { width: min(430px, 100%); }

.promotion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 25px;
}

.promotion-button {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 47px;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 220ms ease, border-color 220ms ease;
}

.promotion-button:hover {
    border-color: rgba(185,167,255,.28);
    background: var(--accent-soft);
    transform: translateY(-3px) scale(1.02);
}

@keyframes stage-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes panel-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }

@keyframes ambient-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(7vw, 4vh, 0) scale(1.12); }
}

@keyframes ai-orbit { to { transform: rotate(360deg); } }
@keyframes turn-pulse { 50% { opacity: .45; transform: scale(.75); } }
@keyframes thinking-glow { to { transform: scale(1.12); filter: blur(70px); } }
@keyframes check-pulse { to { opacity: .7; } }
@keyframes legal-dot { to { transform: scale(1); } }
@keyframes legal-ring { to { transform: scale(1); } }
@keyframes status-scan { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@keyframes move-row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1100px) {
    :root { --board-size: min(64vh, 620px, 61vw); }
    .game-layout { grid-template-columns: minmax(0, var(--board-size)) 320px; gap: 34px; }
    .game-panel { padding: 22px; }
}

@media (max-width: 860px) {
    :root { --board-size: min(calc(100vw - 36px), 690px); }

    .app-shell {
        width: min(690px, calc(100% - 28px));
        padding-top: 14px;
    }

    .topbar { margin-bottom: 20px; }
    .game-layout { grid-template-columns: 1fr; gap: 30px; }
    .game-panel { min-height: 0; }
    .panel-section--moves { min-height: 180px; }
    .move-list { max-height: 210px; }
    .piece { font-size: clamp(30px, calc(var(--board-size) / 10.4), 65px); }
}

@media (max-width: 520px) {
    .app-shell { width: calc(100% - 20px); }
    .brand-copy small { display: none; }
    .topbar-actions .button--ghost { min-width: 42px; width: 42px; padding: 0; font-size: 0; }
    .topbar-actions .button--ghost::before { content: "+"; font-size: 22px; font-weight: 400; }
    .player-strip { grid-template-columns: 39px minmax(0, 1fr); }
    .avatar { width: 39px; height: 39px; border-radius: 12px; }
    .captured { grid-column: 2; justify-content: flex-start; min-height: 12px; padding: 0; font-size: 14px; }
    .player-strip { gap: 9px; }
    .player-strip--opponent { margin-bottom: 8px; }
    .player-strip--self { margin-top: 8px; }
    .board-frame { padding: 5px; border-radius: 18px; }
    .board { border-radius: 13px; }
    .piece { width: 94%; height: 94%; font-size: clamp(28px, 11.7vw, 58px); }
    .game-panel { padding: 20px; border-radius: 20px; }
    .status-card h1 { font-size: 25px; }
    .panel-actions { flex-direction: column; }
    .button--secondary, .button--danger { width: 100%; }
    .promotion-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto ;
        animation-duration: 0.01ms ;
        animation-iteration-count: 1 ;
        transition-duration: 0.01ms ;
    }
}

/* =========================================================
   PRISM ÉCHECS 2.0 · hub membre, XP et multijoueur
   ========================================================= */
[hidden] { display: none ; }

.member-pill {
    display: inline-grid;
    grid-template-columns: 34px auto;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 4px 12px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    color: var(--text);
    text-decoration: none;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 220ms ease, border-color 220ms ease;
}
.member-pill:hover { transform: translateY(-1px); background: rgba(255,255,255,.065); border-color: var(--border-strong); }
.member-pill__avatar {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, #ece8f3, #aaa6b2);
    color: #17131f;
    font-size: 11px;
    font-weight: 800;
}
.member-pill__avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-pill > span:last-child { display: grid; gap: 1px; }
.member-pill strong { max-width: 130px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-pill small { color: var(--muted-2); font-size: 8px; font-weight: 700; letter-spacing: .04em; }

.boot-view {
    display: grid;
    min-height: calc(100vh - 150px);
    place-items: center;
    align-content: center;
    gap: 24px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .04em;
}
.boot-orbit, .waiting-orbit { position: relative; width: 64px; height: 64px; }
.boot-orbit span, .waiting-orbit span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(185,167,255,.22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ai-orbit 1.8s linear infinite;
}
.boot-orbit span:nth-child(2), .waiting-orbit span:nth-child(2) { inset: 9px; animation-duration: 2.5s; animation-direction: reverse; }
.boot-orbit span:nth-child(3), .waiting-orbit span:nth-child(3) { inset: 21px; border-style: dashed; animation-duration: 1.1s; }

.menu-view { width: min(1160px, 100%); margin: 0 auto; animation: stage-in 700ms cubic-bezier(.16,.85,.26,1) both; }
.menu-hero { max-width: 720px; margin: 8vh auto 42px; text-align: center; }
.menu-hero h1 {
    margin: 14px 0 14px;
    font-family: "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(45px, 7vw, 88px);
    font-weight: 560;
    letter-spacing: -.065em;
    line-height: .95;
}
.menu-hero h1 span { color: #b9a7ff; text-shadow: 0 0 48px rgba(126,102,255,.22); }
.menu-hero p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.65; }

.player-progress-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 14px 24px;
    align-items: center;
    width: min(750px, 100%);
    margin: 0 auto 28px;
    padding: 17px 19px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255,255,255,.028);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
    backdrop-filter: blur(16px);
}
.progress-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress-avatar { flex: 0 0 auto; }
.progress-identity > div:last-child { display: grid; gap: 3px; min-width: 0; }
.progress-identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.progress-identity span, .progress-copy span { color: var(--muted); font-size: 9px; }
.progress-copy { display: grid; justify-items: end; gap: 3px; }
.progress-copy strong { font-size: 12px; }
.xp-track { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.xp-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#8169ff,#c4b5ff); box-shadow: 0 0 15px rgba(185,167,255,.45); transition: width 800ms cubic-bezier(.2,.8,.2,1); }

.mode-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding-bottom: 42px; }
.mode-card {
    position: relative;
    min-height: 515px;
    overflow: hidden;
    padding: clamp(28px,4vw,44px);
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient(150deg, rgba(23,23,29,.86), rgba(13,13,17,.84));
    box-shadow: 0 30px 80px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
    backdrop-filter: blur(24px);
    isolation: isolate;
    transition: transform 350ms cubic-bezier(.2,.8,.2,1), border-color 300ms ease;
}
.mode-card:hover { transform: translateY(-4px); border-color: rgba(185,167,255,.16); }
.mode-card__halo { position: absolute; z-index: -1; width: 300px; height: 300px; right: -130px; top: -150px; border-radius: 50%; background: rgba(126,102,255,.16); filter: blur(70px); transition: transform 700ms ease; }
.mode-card--multi .mode-card__halo { background: rgba(172,87,190,.12); }
.mode-card:hover .mode-card__halo { transform: scale(1.2) translate(-10px,15px); }
.mode-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    margin-bottom: 32px;
    border: 1px solid rgba(185,167,255,.16);
    border-radius: 23px;
    background: radial-gradient(circle,rgba(167,142,255,.15),rgba(255,255,255,.02));
    color: #eeeaff;
    font-family: Georgia, serif;
    font-size: 43px;
    box-shadow: 0 0 45px rgba(126,102,255,.08);
}
.mode-card h2 { margin: 10px 0 11px; font-size: clamp(30px,4vw,45px); font-weight: 560; letter-spacing: -.05em; }
.mode-card > p:not(.mode-note) { min-height: 62px; margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.mode-action { min-height: 48px; margin-top: 19px; }
.mode-note { margin: 14px 0 0; color: var(--muted-2); font-size: 9px; text-align: center; }
.mode-note strong { color: #cfc5ff; }

.difficulty-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.difficulty-cards button {
    display: grid;
    min-height: 75px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255,255,255,.025);
    color: var(--muted);
    cursor: pointer;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease, background 220ms ease, color 220ms ease;
}
.difficulty-cards button:hover { transform: translateY(-2px); color: var(--text); background: rgba(255,255,255,.05); }
.difficulty-cards button.is-active { border-color: rgba(185,167,255,.27); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.difficulty-cards span { font-size: 10px; font-weight: 700; }
.difficulty-cards strong { color: #cfc5ff; font-size: 8px; letter-spacing: .04em; }

.mode-icon--network { position: relative; font-family: inherit; }
.mode-icon--network i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #c7b9ff; box-shadow: 0 0 15px rgba(185,167,255,.55); }
.mode-icon--network i:nth-child(1) { top: 22px; left: 20px; }
.mode-icon--network i:nth-child(2) { top: 23px; right: 19px; }
.mode-icon--network i:nth-child(3) { bottom: 19px; left: 34px; }
.mode-icon--network::before, .mode-icon--network::after { content:""; position:absolute; width: 28px; height: 1px; background: rgba(185,167,255,.45); transform-origin: left center; }
.mode-icon--network::before { left: 26px; top: 27px; transform: rotate(1deg); }
.mode-icon--network::after { left: 25px; top: 30px; transform: rotate(50deg); }
.mode-icon--network i:nth-child(2)::after { content:""; position:absolute; width: 29px; height:1px; background:rgba(185,167,255,.45); transform:rotate(127deg); transform-origin:left center; }
.join-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.join-divider::before,.join-divider::after { content:""; flex:1; height:1px; background:var(--border); }
.join-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-form input {
    min-width: 0;
    height: 46px;
    padding: 0 17px;
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: 0;
    background: rgba(0,0,0,.18);
    color: var(--text);
    font: 700 17px/1 "Segoe UI Variable Display",Inter,sans-serif;
    letter-spacing: .25em;
    text-align: center;
    text-transform: uppercase;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}
.join-form input::placeholder { color: #4e4e58; }
.join-form input:focus { border-color: rgba(185,167,255,.35); box-shadow: 0 0 0 4px rgba(126,102,255,.08); }

.game-view { animation: stage-in 600ms cubic-bezier(.16,.85,.26,1) both; }
.game-meta-section { display: grid; gap: 10px; }
.game-meta-section .section-heading { margin-bottom: 3px; }
.game-meta-row { display: flex; align-items: center; justify-content: space-between; min-height: 25px; color: var(--muted); font-size: 10px; }
.game-meta-row strong { color: #c9c9d0; font-size: 10px; }
.avatar--member { color: #17131f; background: linear-gradient(145deg,#ece8f3,#aaa6b2); font-size: 14px; font-weight: 800; }

.waiting-modal { width: min(440px,100%); }
.waiting-orbit { margin: 0 auto 27px; }
.waiting-orbit i { position:absolute; inset:27px; border-radius:50%; background:var(--accent); box-shadow:0 0 20px var(--accent); animation: turn-pulse 1.5s ease-in-out infinite; }
.party-code {
    display: grid;
    width: 100%;
    min-height: 94px;
    place-items: center;
    gap: 3px;
    margin-top: 5px;
    border: 1px solid rgba(185,167,255,.18);
    border-radius: 19px;
    background: rgba(126,102,255,.08);
    color: var(--text);
    cursor: pointer;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 220ms ease, border-color 220ms ease;
}
.party-code:hover { transform: translateY(-2px); background: rgba(126,102,255,.14); border-color: rgba(185,167,255,.3); }
.party-code span { font-size: 35px; font-weight: 650; letter-spacing: .22em; text-indent: .22em; }
.party-code small { color: var(--muted-2); font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.xp-award { display: grid; gap: 6px; margin: -7px 0 24px; padding: 15px; border: 1px solid rgba(185,167,255,.16); border-radius: 15px; background: var(--accent-soft); }
.xp-award span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.xp-award strong { color: #ddd5ff; font-size: 18px; }

.toast {
    position: fixed;
    z-index: 1600;
    left: 50%;
    bottom: max(24px,env(safe-area-inset-bottom));
    max-width: min(420px,calc(100% - 32px));
    padding: 12px 17px;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: rgba(25,24,30,.96);
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    color: var(--text);
    font-size: 10px;
    transform: translateX(-50%);
    animation: toast-in 320ms cubic-bezier(.16,.85,.26,1) both;
}
.toast.is-error { border-color: rgba(255,111,125,.25); color:#ffb0b8; }
@keyframes toast-in { from { opacity:0; transform:translate(-50%,12px) scale(.97); } to { opacity:1; transform:translate(-50%,0) scale(1); } }

@media (max-width: 860px) {
    .menu-hero { margin-top: 5vh; }
    .mode-grid { grid-template-columns: 1fr; }
    .mode-card { min-height: 0; }
    .mode-card > p:not(.mode-note) { min-height: 0; }
    .game-view .game-layout { align-items: start; }
}

@media (max-width: 620px) {
    .topbar { align-items: flex-start; }
    .member-pill { max-width: 145px; padding-right: 7px; }
    .member-pill strong { max-width: 76px; }
    .menu-hero { margin-bottom: 28px; }
    .menu-hero h1 { font-size: clamp(43px,15vw,66px); }
    .player-progress-card { grid-template-columns: 1fr; gap: 12px; }
    .progress-copy { justify-items: start; }
    .xp-track { grid-column: 1; }
    .mode-card { padding: 27px 21px; border-radius: 23px; }
    .difficulty-cards { gap: 5px; }
    .difficulty-cards button { min-height: 70px; }
    .join-form { grid-template-columns: 1fr; }
    .join-form .button { width: 100%; }
    .party-code span { font-size: 30px; }
}

@media (max-width: 520px) {
    .topbar-actions .button--ghost { min-width: auto; width: auto; padding: 0 13px; font-size: 11px; }
    .topbar-actions .button--ghost::before { content: none; }
    .member-pill { display: none ; }
    .menu-hero h1 { letter-spacing: -.055em; }
}


/* PRISM GAMES ZERO GAP START */
/* Site 27.4.7 / Webservices 11.1.27
   Aucun espace vertical artificiel : les panneaux suivent leur contenu. */

/* =========================================================
   Catalogue /game/
   ========================================================= */
body.p8-games .games-page{
  margin-top:8px ;
  margin-bottom:18px ;
  padding-top:0 ;
}
body.p8-games .games-section{
  margin-top:8px ;
}
body.p8-games .games-section::before{
  margin:0 auto 2px ;
}
body.p8-games .games-section__head{
  margin:0 0 6px ;
  padding:0 ;
}
body.p8-games .games-section__head .games-kicker{
  margin:0 0 2px ;
}
body.p8-games .games-section__head h2{
  margin:0 ;
  font-size:clamp(2.6rem,4.6vw,4.4rem) ;
  line-height:.92 ;
}
body.p8-games .games-grid{
  display:grid ;
  grid-template-columns:repeat(2,minmax(0,1fr)) ;
  grid-auto-rows:auto ;
  align-items:start ;
  align-content:start ;
  gap:10px ;
}
body.p8-games .game-card,
body.p8-games .game-card:nth-child(5),
body.p8-games .game-card--werewolf{
  display:flex ;
  flex-direction:column ;
  justify-content:flex-start ;
  align-items:stretch ;
  align-content:flex-start ;
  align-self:start ;
  block-size:auto ;
  height:auto ;
  min-height:0 ;
  max-height:none ;
  padding:12px 14px ;
  gap:5px ;
  overflow:hidden ;
}
body.p8-games .game-card__glow{
  position:absolute ;
  inset:auto ;
  right:-100px ;
  top:-110px ;
  width:180px ;
  height:180px ;
}
body.p8-games .game-card__topline{
  order:1 ;
  display:flex ;
  flex:0 0 auto ;
  align-items:center ;
  justify-content:space-between ;
  min-height:0 ;
  height:auto ;
  margin:0 ;
  padding:0 ;
  gap:8px ;
}
body.p8-games .chess-mark{
  width:27px ;
  height:29px ;
  padding:2px ;
  grid-template-columns:repeat(3,4px) ;
  gap:3px ;
}
body.p8-games .chess-mark span{width:4px }
body.p8-games :is(.checkers-mark,.go-mark,.connect4-mark,.werewolf-mark){
  width:29px ;
  height:29px ;
  flex:0 0 29px ;
}
body.p8-games .availability-badge{
  padding:4px 7px ;
  gap:5px ;
  font-size:.61rem ;
}
body.p8-games .game-card__body{
  order:2 ;
  display:block ;
  flex:0 0 auto ;
  align-self:stretch ;
  width:100% ;
  min-height:0 ;
  height:auto ;
  margin:0 ;
  padding:0 ;
}
body.p8-games .game-card__eyebrow{
  margin:0 0 2px ;
  font-size:.6rem ;
  line-height:1.15 ;
}
body.p8-games .game-card__body h3{
  margin:0 0 3px ;
  font-size:clamp(2.05rem,3vw,2.85rem) ;
  line-height:.95 ;
}
body.p8-games .game-card__body > p:last-child{
  min-height:0 ;
  height:auto ;
  margin:0 ;
  padding:0 ;
  font-size:.82rem ;
  line-height:1.35 ;
}
body.p8-games .game-card__tags{
  order:3 ;
  display:flex ;
  flex:0 0 auto ;
  align-self:flex-start ;
  min-height:0 ;
  height:auto ;
  margin:1px 0 0 ;
  padding:0 ;
  gap:4px ;
}
body.p8-games .game-card__tags span{
  padding:4px 7px ;
  border-radius:6px ;
  font-size:.61rem ;
  line-height:1.15 ;
}
body.p8-games .game-card__footer{
  order:4 ;
  display:flex ;
  flex:0 0 auto ;
  align-self:stretch ;
  min-height:0 ;
  height:auto ;
  margin:1px 0 0 ;
  padding:6px 0 0 ;
  gap:8px ;
  align-items:center ;
  border-top:1px solid rgba(240,213,138,.10) ;
}
body.p8-games .game-card__reward{
  display:flex ;
  flex-direction:column ;
  gap:0 ;
  margin:0 ;
}
body.p8-games .game-card__reward small{font-size:.54rem ;line-height:1.1 }
body.p8-games .game-card__reward strong{font-size:.72rem ;line-height:1.2 }
body.p8-games .play-button{
  min-height:34px ;
  height:34px ;
  padding:0 12px ;
  gap:7px ;
  border-radius:8px ;
  font-size:.7rem ;
}
body.p8-games .play-button svg{width:14px }
body.p8-games .game-card--werewolf{
  grid-column:1/-1 ;
}
body.p8-games .game-card--werewolf::after{
  width:130px ;
  height:130px ;
}

/* Profil joueur catalogue : compacte également les respirations inutiles. */
body.p8-games .player-banner{
  min-height:0 ;
  padding:12px 16px ;
  gap:14px ;
}
body.p8-games .player-banner__identity{gap:12px }
body.p8-games .player-avatar{width:58px ;height:58px ;flex-basis:58px }
body.p8-games .player-banner__name .games-kicker{margin-bottom:2px }
body.p8-games .player-banner__name h1{margin:0 ;line-height:.95 }
body.p8-games .player-banner__name > a{margin-top:5px }
body.p8-games .player-banner__progress{gap:8px }
body.p8-games .player-level{min-height:0 ;padding:9px 12px }
body.p8-games .player-xp{padding:9px 12px }

/* =========================================================
   Échecs / Dames / Go / Puissance 4 : écrans de choix
   ========================================================= */
body > main.app-shell{
  padding-top:0 ;
  padding-bottom:12px ;
}
body > main.app-shell .topbar{
  margin-bottom:6px ;
}
body > main.app-shell .menu-view{
  padding-top:0 ;
  padding-bottom:8px ;
}
body > main.app-shell .menu-hero{
  min-height:0 ;
  height:auto ;
  max-width:720px ;
  margin:0 auto 6px ;
  padding:0 ;
}
body > main.app-shell .menu-hero h1{
  margin:0 0 3px ;
  font-size:clamp(2.45rem,4.6vw,3.9rem) ;
  line-height:.9 ;
}
body > main.app-shell .menu-hero p{
  margin:0 auto ;
  line-height:1.3 ;
}
body > main.app-shell .player-progress-card{
  min-height:0 ;
  height:auto ;
  margin:0 auto 6px ;
  padding:7px 10px ;
  gap:6px 10px ;
}
body > main.app-shell .mode-grid{
  display:grid ;
  grid-template-columns:repeat(2,minmax(0,1fr)) ;
  grid-auto-rows:auto ;
  align-items:start ;
  align-content:start ;
  gap:8px ;
  padding:0 0 8px ;
}
body > main.app-shell .mode-card,
body > main.app-shell .mode-card--tournament{
  display:flex ;
  flex-direction:column ;
  justify-content:flex-start ;
  align-items:stretch ;
  align-content:flex-start ;
  align-self:start ;
  block-size:auto ;
  height:auto ;
  min-height:0 ;
  max-height:none ;
  padding:12px 14px ;
  gap:4px ;
}
body > main.app-shell .mode-card__halo{
  position:absolute ;
  width:160px ;
  height:160px ;
  right:-80px ;
  top:-90px ;
}
body > main.app-shell .mode-icon{
  flex:0 0 auto ;
  width:38px ;
  height:38px ;
  min-height:0 ;
  margin:0 0 3px ;
  border-radius:11px ;
  font-size:23px ;
}
body > main.app-shell .mode-card .eyebrow,
body > main.app-shell .mode-card .mode-eyebrow{
  margin:0 ;
}
body > main.app-shell .mode-card h2{
  margin:0 0 3px ;
  font-size:clamp(1.65rem,2.8vw,2.25rem) ;
  line-height:.96 ;
}
body > main.app-shell .mode-card > p:not(.mode-note){
  min-height:0 ;
  height:auto ;
  margin:0 0 4px ;
  font-size:.82rem ;
  line-height:1.34 ;
}
body > main.app-shell .difficulty-cards{
  gap:4px ;
  margin:0 ;
}
body > main.app-shell .difficulty-cards button{
  min-height:40px ;
  height:auto ;
  padding:5px ;
  gap:2px ;
}
body > main.app-shell .mode-action{
  min-height:34px ;
  height:auto ;
  margin-top:4px ;
}
body > main.app-shell .mode-note{
  margin:3px 0 0 ;
}
body > main.app-shell .join-divider{
  margin:4px 0 ;
}

/* =========================================================
   Loup-Garou Royal : uniquement le menu / accueil
   ========================================================= */
body[data-world] .menu-view{
  padding-top:4px ;
  padding-bottom:10px ;
}
body[data-world] .menu-hero{
  min-height:0 ;
  height:auto ;
  margin:0 0 6px ;
  grid-template-columns:minmax(0,1.4fr) minmax(180px,.6fr) ;
}
body[data-world] .menu-hero__copy{
  justify-content:flex-start ;
  padding:14px 16px ;
}
body[data-world] .menu-hero h1{
  margin:2px 0 4px ;
  font-size:clamp(2.35rem,4vw,3.7rem) ;
  line-height:.92 ;
}
body[data-world] .menu-hero__copy > p{
  margin:0 ;
  line-height:1.35 ;
}
body[data-world] .hero-actions{margin-top:6px }
body[data-world] .reward-note{margin-top:5px }
body[data-world] .menu-hero__emblem{
  min-height:140px ;
  height:auto ;
}
body[data-world] .menu-dashboard{
  gap:8px ;
  margin-top:6px ;
}
body[data-world] .profile-card,
body[data-world] .join-card,
body[data-world] .role-teaser{
  min-height:0 ;
  height:auto ;
  padding:12px 14px ;
}
body[data-world] .role-teaser{margin-top:6px }

@media(max-width:860px){
  body.p8-games .games-grid,
  body > main.app-shell .mode-grid{grid-template-columns:1fr }
  body.p8-games .game-card,
  body.p8-games .game-card:nth-child(5),
  body.p8-games .game-card--werewolf,
  body > main.app-shell .mode-card,
  body > main.app-shell .mode-card--tournament{padding:11px 12px }
  body[data-world] .menu-hero{grid-template-columns:1fr }
  body[data-world] .menu-hero__emblem{min-height:110px }
}

@media(max-width:560px){
  body.p8-games .games-page{margin-top:4px }
  body.p8-games .player-banner{padding:10px 12px }
  body.p8-games .game-card,
  body.p8-games .game-card:nth-child(5),
  body.p8-games .game-card--werewolf,
  body > main.app-shell .mode-card,
  body > main.app-shell .mode-card--tournament{padding:10px }
  body > main.app-shell .menu-hero{margin-bottom:4px }
  body[data-world] .menu-hero__copy{padding:12px }
  body[data-world] .menu-hero__emblem{min-height:90px }
}
/* PRISM GAMES ZERO GAP END */

:root {
    --connect4-size: min(68vh, 680px, 62vw);
    --disc-red: #f34b6d;
    --disc-red-light: #ff9aad;
    --disc-yellow: #f4bd35;
    --disc-yellow-light: #fff09a;
    --board-blue: #6e55e8;
}

.connect4-brand-mark {
    display: grid;
    grid-template-columns: repeat(4, 7px);
    gap: 3px;
    align-items: end;
    width: 40px;
    height: 35px;
    padding: 5px;
    border: 1px solid rgba(177,159,255,.25);
    border-radius: 10px;
    background: rgba(128,101,245,.10);
}
.connect4-brand-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 9px rgba(243,75,109,.5); }
.connect4-brand-mark i:nth-child(2), .connect4-brand-mark i:nth-child(4) { background: var(--disc-yellow); box-shadow: 0 0 9px rgba(244,189,53,.42); }

.connect4-mode-icon {
    display: grid;
    grid-template-columns: repeat(4, 11px);
    align-content: center;
    justify-content: center;
    gap: 4px;
}
.connect4-mode-icon i { width: 11px; height: 11px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 12px rgba(243,75,109,.45); }
.connect4-mode-icon i:last-child { background: var(--disc-yellow); box-shadow: 0 0 12px rgba(244,189,53,.42); }

.connect4-game-layout {
    grid-template-columns: minmax(0, var(--connect4-size)) 350px;
    align-items: center;
}
.connect4-game-layout .player-strip { grid-template-columns: 43px minmax(0,1fr) auto; }
.connect4-board-stage {
    position: relative;
    width: var(--connect4-size);
    max-width: 100%;
    margin: 8px auto;
    padding-top: calc(var(--connect4-size) * .095);
    filter: drop-shadow(0 34px 45px rgba(0,0,0,.34));
}
.connect4-board-stage::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 7%;
    right: 7%;
    bottom: -4%;
    height: 9%;
    border-radius: 50%;
    background: rgba(50,30,130,.46);
    filter: blur(18px);
}
.connect4-board {
    position: relative;
    z-index: 2;
    display: grid;
    width: 100%;
    aspect-ratio: 7 / 6;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: clamp(4px, .8vw, 10px);
    padding: clamp(9px, 1.45vw, 17px);
    overflow: hidden;
    border: 1px solid rgba(193,180,255,.42);
    border-radius: clamp(18px, 2.2vw, 28px);
    background:
        linear-gradient(145deg, rgba(255,255,255,.16), transparent 30%),
        linear-gradient(145deg, #765ff0, #5037c7 75%, #3a2897);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.24),
        inset 0 -14px 30px rgba(30,17,100,.28),
        0 20px 50px rgba(60,35,165,.27);
}
.connect4-cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 44%, #09090d 0 58%, #2e2080 60% 66%, rgba(255,255,255,.12) 68% 72%, #4b36ba 74%);
    box-shadow: inset 0 5px 10px rgba(0,0,0,.52), 0 1px 0 rgba(255,255,255,.14);
    cursor: pointer;
}
.connect4-cell::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    opacity: 0;
    transform: scale(.86);
    transition: transform .2s ease, opacity .2s ease, filter .2s ease;
}
.connect4-cell.is-red::after {
    opacity: 1;
    transform: scale(1);
    background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 46%, #bd2447 100%);
    box-shadow: inset 0 2px 2px rgba(255,255,255,.38), inset 0 -7px 13px rgba(123,18,45,.25), 0 4px 9px rgba(38,5,17,.38);
}
.connect4-cell.is-yellow::after {
    opacity: 1;
    transform: scale(1);
    background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 48%, #c18116 100%);
    box-shadow: inset 0 2px 2px rgba(255,255,255,.46), inset 0 -7px 13px rgba(122,72,3,.2), 0 4px 9px rgba(35,23,2,.36);
}
.connect4-cell.is-new::after { animation: connect4-drop .52s cubic-bezier(.22,.82,.28,1.12) both; }
.connect4-cell.is-winning::after { animation: connect4-win 1s ease-in-out infinite; }
.connect4-cell.is-playable:hover { filter: brightness(1.13); }
.connect4-cell:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.connect4-cell.is-disabled { cursor: default; }

.column-preview {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    width: calc(100% / 7);
    aspect-ratio: 1;
    padding: 1.2%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(var(--preview-column, 0) * 100%));
    transition: transform .16s cubic-bezier(.2,.8,.2,1), opacity .16s ease;
}
.column-preview::after {
    content: "";
    display: block;
    width: 76%;
    height: 76%;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 46%, #bd2447 100%);
    box-shadow: 0 8px 24px rgba(243,75,109,.34), inset 0 2px 2px rgba(255,255,255,.38);
}
.column-preview.is-yellow::after { background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 48%, #c18116 100%); box-shadow: 0 8px 24px rgba(244,189,53,.3); }
.column-preview.is-visible { opacity: .88; }

.connect4-color-chip { width: 28px; height: 28px; border-radius: 50%; }
.connect4-color-chip--red { background: radial-gradient(circle at 34% 27%, var(--disc-red-light), var(--disc-red) 50%, #bd2447); box-shadow: 0 0 20px rgba(243,75,109,.3); }
.connect4-color-chip--yellow { background: radial-gradient(circle at 34% 27%, var(--disc-yellow-light), var(--disc-yellow) 50%, #c18116); box-shadow: 0 0 20px rgba(244,189,53,.28); }

.connect4-history-disc { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; }
.connect4-history-disc.is-red { background: var(--disc-red); box-shadow: 0 0 8px rgba(243,75,109,.25); }
.connect4-history-disc.is-yellow { background: var(--disc-yellow); box-shadow: 0 0 8px rgba(244,189,53,.22); }
.move-row { grid-template-columns: 15px minmax(0,1fr) auto; }
.connect4-panel-actions { display: grid; }

.connect4-result-symbol {
    display: grid;
    grid-template-columns: repeat(4, 15px);
    place-content: center;
    gap: 3px;
    background: linear-gradient(145deg, rgba(111,83,231,.32), rgba(56,36,146,.48));
}
.connect4-result-symbol i { width: 15px; height: 15px; border-radius: 50%; background: var(--disc-red); box-shadow: 0 0 11px rgba(243,75,109,.48); }
.connect4-result-symbol.is-loss i { background: var(--disc-yellow); box-shadow: 0 0 11px rgba(244,189,53,.4); }
.connect4-result-symbol.is-draw i:nth-child(even) { background: var(--disc-yellow); }

/* =========================================================
   PRISM PUISSANCE 4 10.8 · Tournois, bracket et spectateurs
   ========================================================= */

.mode-card--tournament {
    grid-column: 1 / -1;
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
    align-items: center;
    gap: clamp(30px, 6vw, 90px);
    border-color: rgba(244, 189, 53, .13);
    background:
        radial-gradient(circle at 9% 50%, rgba(244, 189, 53, .08), transparent 30%),
        linear-gradient(135deg, rgba(26, 24, 30, .94), rgba(13, 13, 17, .88));
}
.mode-card--tournament .mode-card__halo {
    top: -170px;
    right: 12%;
    background: rgba(244, 189, 53, .12);
}
.tournament-card-copy {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 27px;
}
.tournament-card-copy .mode-icon { margin: 0; }
.tournament-card-copy h2 {
    margin-top: 8px;
    font-size: clamp(31px, 4vw, 48px);
}
.tournament-card-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}
.tournament-card-action {
    display: grid;
    gap: 13px;
    padding: 20px;
    border: 1px solid rgba(244, 189, 53, .1);
    border-radius: 21px;
    background: rgba(0, 0, 0, .15);
}
.tournament-card-action .mode-note { margin: 0; }
.tournament-mode-icon {
    position: relative;
    overflow: hidden;
    color: #ffe7a2;
}
.tournament-mode-icon i {
    position: absolute;
    width: 18px;
    height: 1px;
    background: rgba(244, 189, 53, .58);
    box-shadow: 0 0 8px rgba(244, 189, 53, .35);
}
.tournament-mode-icon i:nth-child(1) { left: 11px; top: 22px; }
.tournament-mode-icon i:nth-child(2) { left: 11px; bottom: 22px; }
.tournament-mode-icon i:nth-child(3) { right: 11px; top: 22px; }
.tournament-mode-icon i:nth-child(4) { right: 11px; bottom: 22px; }
.tournament-mode-icon i:nth-child(1),
.tournament-mode-icon i:nth-child(2) { transform-origin: right; transform: rotate(26deg); }
.tournament-mode-icon i:nth-child(3),
.tournament-mode-icon i:nth-child(4) { transform-origin: left; transform: rotate(-26deg); }
.tournament-mode-icon span {
    position: relative;
    z-index: 2;
    font-size: 23px;
    text-shadow: 0 0 18px rgba(244, 189, 53, .55);
}
.tournament-size-control {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}
.tournament-size-control button {
    min-height: 43px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}
.tournament-size-control button:hover {
    transform: translateY(-1px);
    color: var(--text);
    background: rgba(255, 255, 255, .055);
}
.tournament-size-control button.is-active {
    border-color: rgba(244, 189, 53, .28);
    background: rgba(244, 189, 53, .1);
    color: #ffe5a0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.tournament-watch-section {
    margin-top: 22px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid rgba(72, 213, 221, .13);
    border-radius: 24px;
    background:
        radial-gradient(circle at 90% 0, rgba(72, 213, 221, .07), transparent 34%),
        rgba(14, 15, 20, .82);
}
.tournament-watch-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}
.tournament-watch-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 580;
    letter-spacing: -.035em;
}
.tournament-watch-heading .text-button { margin: 0; }
.tournament-watch-list { display: grid; gap: 10px; }
.tournament-watch-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 94px;
    padding: 17px 19px;
    border: 1px solid rgba(72, 213, 221, .1);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(14, 28, 35, .78), rgba(11, 13, 19, .92));
    transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.tournament-watch-card:hover {
    border-color: rgba(72, 213, 221, .28);
    background: linear-gradient(135deg, rgba(16, 35, 42, .86), rgba(11, 13, 19, .95));
    transform: translateY(-1px);
}
.tournament-watch-card__copy { min-width: 0; }
.tournament-watch-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}
.tournament-watch-card__title strong {
    color: #e9ffff;
    font-size: 14px;
    letter-spacing: .04em;
}
.tournament-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7ff4ed;
    font-size: 7px;
    font-weight: 850;
    letter-spacing: .11em;
}
.tournament-live-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #58e4dc;
    box-shadow: 0 0 11px rgba(88, 228, 220, .7);
    animation: spectator-live 1.45s ease-in-out infinite;
}
.tournament-watch-card p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tournament-watch-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8fe9e5;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    text-align: right;
    transition: color .2s ease, transform .2s ease;
}
.tournament-watch-link::before { content: "→ "; }
.tournament-watch-link:hover {
    color: #d8ffff;
    transform: translateX(2px);
}
.tournament-watch-link:focus-visible {
    outline: 2px solid #8fe9e5;
    outline-offset: 5px;
    border-radius: 3px;
}
.tournament-watch-empty {
    margin: 0;
    padding: 20px;
    border: 1px dashed rgba(255, 255, 255, .08);
    border-radius: 14px;
    color: var(--muted-2);
    font-size: 10px;
    text-align: center;
}
.tournament-watch-empty.is-error { color: #ee9aad; }

.tournament-queue-modal { width: min(470px, 100%); }
.tournament-queue-emblem {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    margin: 0 auto 25px;
    border: 1px solid rgba(244, 189, 53, .2);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(244, 189, 53, .16), transparent 66%),
        rgba(255, 255, 255, .02);
    color: #ffe8a9;
    font-size: 26px;
    box-shadow: 0 0 50px rgba(244, 189, 53, .1);
    animation: tournament-emblem 2.4s ease-in-out infinite;
}
.tournament-queue-count {
    display: grid;
    gap: 5px;
    margin: 25px 0 12px;
}
.tournament-queue-count strong {
    color: #fff0c0;
    font-size: 28px;
    font-weight: 620;
    letter-spacing: -.04em;
}
.tournament-queue-count span {
    color: var(--muted-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .14em;
}
.tournament-queue-track {
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, .065);
}
.tournament-queue-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8d73ff, #f4bd35);
    box-shadow: 0 0 17px rgba(244, 189, 53, .38);
    transition: width .65s cubic-bezier(.2, .8, .2, 1);
}
.tournament-queue-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 12px;
    margin: 16px 0 12px;
}
.tournament-queue-dots i {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .035);
}
.tournament-queue-dots i.is-filled {
    border-color: rgba(244, 189, 53, .28);
    background: #f4bd35;
    box-shadow: 0 0 9px rgba(244, 189, 53, .5);
    animation: queue-dot-in .38s cubic-bezier(.2, .8, .2, 1) both;
}

body.has-tournament-arena { overflow: hidden; }
.tournament-arena {
    position: fixed;
    z-index: 1450;
    inset: 0;
    overflow: hidden;
    background: #070a11;
    color: var(--text);
    isolation: isolate;
    animation: tournament-arena-in .75s cubic-bezier(.16, .85, .26, 1) both;
}
.tournament-arena__backdrop {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(rgba(79, 223, 230, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 223, 230, .025) 1px, transparent 1px),
        radial-gradient(circle at 50% 44%, rgba(50, 220, 224, .075), transparent 37%),
        radial-gradient(circle at 50% 82%, rgba(244, 189, 53, .055), transparent 30%),
        linear-gradient(145deg, #090d17, #050810 62%, #090b12);
    background-size: 54px 54px, 54px 54px, auto, auto, auto;
}
.tournament-arena__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .055;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url("/game/connect4/assets/css/%23n")'/%3E%3C/svg%3E");
}
.tournament-arena__header {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    min-height: 108px;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 32px 18px;
    text-align: center;
    pointer-events: none;
    background: linear-gradient(#070a11 0, rgba(7, 10, 17, .88) 65%, transparent);
}
.tournament-arena__header h1 {
    margin: 5px 0 0;
    color: #f7ecd3;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 650;
    letter-spacing: .04em;
    text-shadow: 0 0 32px rgba(244, 189, 53, .14);
}
.tournament-arena__reward {
    position: absolute;
    right: 30px;
    top: 28px;
    display: grid;
    justify-items: end;
    gap: 3px;
}
.tournament-arena__reward span {
    color: var(--muted-2);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .15em;
}
.tournament-arena__reward strong { color: #ffe29a; font-size: 14px; }

.tournament-viewport {
    position: absolute;
    z-index: 2;
    inset: 90px 0 62px;
    overflow: hidden;
}
.tournament-camera {
    position: absolute;
    left: 0;
    top: 0;
    width: 1800px;
    height: 1100px;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 1.5s cubic-bezier(.16, .8, .18, 1);
}
.tournament-lines,
.tournament-nodes {
    position: absolute;
    inset: 0;
    width: 1800px;
    height: 1100px;
}
.tournament-line {
    fill: none;
    stroke: rgba(72, 213, 221, .3);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(72, 213, 221, .17));
    transition: stroke .45s ease, opacity .45s ease;
}
.tournament-line.is-complete { stroke: rgba(72, 231, 226, .7); }
.tournament-line.is-viewer {
    stroke: #f5c95b;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(245, 201, 91, .5));
}
.tournament-line.is-animated {
    stroke-dasharray: 12 9;
    animation: tournament-route 1.1s linear infinite;
}
.tournament-loss-line {
    fill: none;
    stroke: #ba4c67;
    stroke-width: 3;
    stroke-dasharray: 11 9;
    filter: drop-shadow(0 0 8px rgba(186, 76, 103, .45));
    animation: tournament-route 1.1s linear infinite;
}
.bracket-match {
    position: absolute;
    display: grid;
    width: 218px;
    min-height: 68px;
    grid-template-rows: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(66, 217, 224, .22);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(11, 27, 36, .93), rgba(7, 15, 24, .96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 9px 25px rgba(0, 0, 0, .22);
    transform: translate(-50%, -50%);
    transition: border-color .4s ease, box-shadow .4s ease, opacity .4s ease, transform .4s ease;
}
.bracket-match.is-pending { opacity: .48; }
.bracket-match.is-current {
    z-index: 4;
    border-color: rgba(245, 201, 91, .82);
    box-shadow: 0 0 0 2px rgba(245, 201, 91, .08), 0 0 34px rgba(245, 201, 91, .18);
    transform: translate(-50%, -50%) scale(1.05);
}
.bracket-match.is-viewer:not(.is-current) { border-color: rgba(245, 201, 91, .38); }
.bracket-match.is-finished { border-color: rgba(72, 213, 221, .42); }
.bracket-match.is-watchable {
    cursor: pointer;
    border-color: rgba(72, 231, 226, .58);
    box-shadow: 0 0 0 1px rgba(72, 231, 226, .06), 0 0 28px rgba(72, 231, 226, .11);
}
.bracket-match.is-watchable:hover,
.bracket-match.is-watchable:focus-visible {
    z-index: 5;
    border-color: rgba(126, 255, 248, .92);
    outline: none;
    box-shadow: 0 0 0 2px rgba(126, 255, 248, .1), 0 0 42px rgba(72, 231, 226, .24);
    transform: translate(-50%, -50%) scale(1.07);
}
.bracket-match.is-watched {
    border-color: rgba(245, 201, 91, .86);
    box-shadow: 0 0 0 2px rgba(245, 201, 91, .1), 0 0 38px rgba(245, 201, 91, .2);
}
.bracket-match.is-final {
    width: 250px;
    min-height: 78px;
    border-color: rgba(245, 201, 91, .42);
    background:
        radial-gradient(circle at 50% 50%, rgba(245, 201, 91, .09), transparent 70%),
        linear-gradient(145deg, rgba(17, 29, 34, .96), rgba(8, 14, 21, .98));
}
.bracket-player {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 9px;
    color: #9aa7ad;
    font-size: 10px;
}
.bracket-player + .bracket-player { border-top: 1px solid rgba(66, 217, 224, .1); }
.bracket-player.is-winner {
    background: rgba(72, 213, 221, .07);
    color: #d8ffff;
}
.bracket-player.is-viewer {
    background: rgba(245, 201, 91, .08);
    color: #fff0be;
}
.bracket-player__avatar {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: #25333a;
    color: #e9faff;
    font-size: 8px;
    font-weight: 800;
}
.bracket-player__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bracket-player strong {
    overflow: hidden;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bracket-player small {
    color: rgba(255, 255, 255, .28);
    font-size: 7px;
    font-weight: 800;
}
.bracket-player.is-winner small { color: #62e7df; }
.bracket-trophy {
    position: absolute;
    left: 900px;
    top: 28px;
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border: 1px solid rgba(245, 201, 91, .26);
    border-radius: 50%;
    background: rgba(245, 201, 91, .07);
    color: #ffe39b;
    font-size: 23px;
    transform: translateX(-50%);
    box-shadow: 0 0 35px rgba(245, 201, 91, .12);
}
.bracket-round-label {
    position: absolute;
    color: rgba(134, 213, 217, .52);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
    text-align: center;
    transform: translateX(-50%);
}

.loser-dock {
    position: absolute;
    left: 540px;
    top: 870px;
    display: grid;
    width: 720px;
    min-height: 168px;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    padding: 21px;
    border: 1px solid rgba(186, 76, 103, .24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 50%, rgba(186, 76, 103, .11), transparent 45%),
        rgba(8, 13, 20, .95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.loser-dock.is-viewer-destination {
    border-color: rgba(230, 101, 127, .68);
    box-shadow: 0 0 45px rgba(186, 76, 103, .16);
}
.loser-dock__title {
    display: grid;
    align-content: center;
    gap: 4px;
    padding-right: 18px;
    border-right: 1px solid rgba(186, 76, 103, .14);
}
.loser-dock__title span {
    color: #8e5663;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .18em;
}
.loser-dock__title strong {
    color: #d7a4af;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.05;
}
.loser-dock__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 7px;
    max-height: 124px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-color: rgba(186, 76, 103, .34) transparent;
    scrollbar-width: thin;
}
.loser-entry {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
    color: #8e939a;
}
.loser-entry.is-viewer {
    border-color: rgba(230, 101, 127, .4);
    background: rgba(186, 76, 103, .09);
    color: #f4bac6;
}
.loser-entry i {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background: #2b2229;
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
}
.loser-entry i img { width: 100%; height: 100%; object-fit: cover; }
.loser-entry span { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.loser-entry small { color: #754b56; font-size: 6px; font-weight: 800; }
.loser-empty {
    grid-column: 1 / -1;
    align-self: center;
    color: rgba(255, 255, 255, .22);
    font-size: 9px;
    text-align: center;
}

.tournament-faceoff,
.tournament-outcome {
    position: absolute;
    z-index: 30;
    top: 50%;
    left: 50%;
    width: min(680px, calc(100% - 32px));
    padding: clamp(25px, 4vw, 42px);
    border: 1px solid rgba(245, 201, 91, .2);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 0, rgba(245, 201, 91, .09), transparent 44%),
        rgba(7, 11, 18, .93);
    box-shadow: 0 45px 130px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .04);
    text-align: center;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(22px);
    animation: faceoff-in .72s cubic-bezier(.16, .85, .26, 1) both;
}
.tournament-faceoff::before,
.tournament-outcome::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: -100vh -100vw;
    background: rgba(3, 6, 10, .48);
    backdrop-filter: blur(5px);
}
.faceoff-versus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 26px 0 22px;
}
.faceoff-player {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
}
.faceoff-player strong {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(16px, 3vw, 23px);
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.faceoff-player > span {
    color: var(--muted-2);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .15em;
}
.faceoff-avatar {
    display: grid;
    width: clamp(72px, 12vw, 108px);
    height: clamp(72px, 12vw, 108px);
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 27px;
    background: linear-gradient(145deg, #d8d2df, #8d8a95);
    color: #15121b;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .3);
}
.faceoff-player--opponent .faceoff-avatar {
    border-color: rgba(72, 213, 221, .2);
    background: linear-gradient(145deg, #b8dde0, #557379);
}
.faceoff-avatar img { width: 100%; height: 100%; object-fit: cover; }
.faceoff-vs {
    position: relative;
    display: grid;
    height: 90px;
    place-items: center;
}
.faceoff-vs span {
    position: relative;
    z-index: 2;
    color: #ffe39b;
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 0 24px rgba(245, 201, 91, .45);
}
.faceoff-vs i {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(transparent, rgba(245, 201, 91, .5), transparent);
    transform: rotate(20deg);
}
.tournament-faceoff h2,
.tournament-outcome h2 {
    margin: 8px 0 8px;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 580;
    letter-spacing: -.045em;
}
.tournament-faceoff p,
.tournament-outcome p {
    margin: 0 auto 25px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}
.tournament-faceoff .button,
.tournament-outcome .button { min-height: 48px; }
.tournament-outcome { width: min(520px, calc(100% - 32px)); }
.tournament-outcome__symbol {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    margin: 0 auto 23px;
    border: 1px solid rgba(245, 201, 91, .22);
    border-radius: 50%;
    background: rgba(245, 201, 91, .08);
    color: #ffe39b;
    font-size: 26px;
    box-shadow: 0 0 42px rgba(245, 201, 91, .12);
}
.tournament-outcome.is-loss {
    border-color: rgba(210, 84, 111, .28);
    background:
        radial-gradient(circle at 50% 0, rgba(186, 76, 103, .11), transparent 44%),
        rgba(9, 10, 17, .95);
}
.tournament-outcome.is-loss .tournament-outcome__symbol {
    border-color: rgba(210, 84, 111, .28);
    background: rgba(186, 76, 103, .09);
    color: #f1a5b5;
}
.tournament-outcome.is-champion .tournament-outcome__symbol {
    animation: champion-symbol 1.7s ease-in-out infinite;
}
.tournament-outcome .xp-award { margin: 0 0 23px; }
.tournament-outcome > .text-button { margin-top: 14px; }

.tournament-arena__footer {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    min-height: 67px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 28px max(13px, env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(7, 10, 17, .94) 44%, #070a11);
}
.tournament-arena__footer p { margin: 0; color: var(--muted); font-size: 9px; }
.tournament-arena__footer > div { display: flex; gap: 17px; }
.tournament-arena__footer .text-button { margin: 0; }

@keyframes tournament-emblem {
    0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(244, 189, 53, .1); }
    50% { transform: scale(1.045); box-shadow: 0 0 65px rgba(244, 189, 53, .2); }
}
@keyframes queue-dot-in {
    from { opacity: 0; transform: scale(.3); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes tournament-arena-in {
    from { opacity: 0; filter: blur(8px); }
    to { opacity: 1; filter: blur(0); }
}
@keyframes faceoff-in {
    from { opacity: 0; transform: translate(-50%, -44%) scale(.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes tournament-route {
    to { stroke-dashoffset: -42; }
}
@keyframes champion-symbol {
    0%, 100% { transform: scale(1); box-shadow: 0 0 42px rgba(245, 201, 91, .12); }
    50% { transform: scale(1.08); box-shadow: 0 0 65px rgba(245, 201, 91, .3); }
}
@keyframes spectator-live {
    0%, 100% { opacity: .55; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes connect4-drop {
    0% { transform: translateY(calc(-700% - 55px)) scale(.92); }
    68% { transform: translateY(7%) scale(1.02,.96); }
    84% { transform: translateY(-3%) scale(.98,1.02); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes connect4-win {
    0%,100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(.82); filter: brightness(1.45); }
}

@media (max-width: 1100px) {
    :root { --connect4-size: min(66vh, 650px, 61vw); }
    .connect4-game-layout { grid-template-columns: minmax(0,var(--connect4-size)) 325px; }
}
@media (max-width: 860px) {
    :root { --connect4-size: min(calc(100vw - 38px), 680px); }
    .connect4-game-layout { grid-template-columns: 1fr; }
    .mode-card--tournament {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
@media (max-width: 420px) {
    :root { --connect4-size: calc(100vw - 20px); }
    .connect4-board { gap: 3px; padding: 7px; border-radius: 17px; }
    .connect4-board-stage { padding-top: calc(var(--connect4-size) * .11); }
}
@media (max-width: 620px) {
    .connect4-game-layout .player-strip { grid-template-columns: 39px minmax(0,1fr) 26px; }
    .connect4-color-chip { width: 24px; height: 24px; }
    .tournament-card-copy {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tournament-card-copy .mode-icon { width: 66px; height: 66px; border-radius: 19px; }
    .tournament-card-action { padding: 15px; }
    .tournament-watch-heading { align-items: center; }
    .tournament-watch-card {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .tournament-watch-card__title { align-items: flex-start; flex-direction: column; }
    .tournament-watch-card p { white-space: normal; }
    .tournament-watch-link { text-align: left; }
    .tournament-arena__header {
        min-height: 94px;
        padding-inline: 14px;
    }
    .tournament-arena__header h1 { font-size: 22px; }
    .tournament-arena__reward {
        position: static;
        display: none;
    }
    .tournament-viewport { inset: 79px 0 80px; }
    .tournament-arena__footer {
        min-height: 82px;
        align-items: flex-start;
        padding-inline: 15px;
    }
    .tournament-arena__footer p { max-width: 52%; line-height: 1.45; }
    .tournament-arena__footer > div { display: grid; justify-items: end; gap: 5px; }
    .faceoff-versus { grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr); gap: 6px; }
    .faceoff-vs span { font-size: 19px; }
    .tournament-faceoff,
    .tournament-outcome { padding: 25px 18px; border-radius: 22px; }
    .tournament-faceoff h2,
    .tournament-outcome h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .connect4-cell.is-new::after,
    .connect4-cell.is-winning::after,
    .tournament-line,
    .tournament-loss-line,
    .tournament-queue-emblem,
    .tournament-outcome__symbol { animation: none; }
    .tournament-live-badge::before { animation: none; }
    .tournament-camera { transition-duration: .01ms; }
}

}
