:root {
    --ed: #f6a63b;
    --ed-soft: rgba(246, 166, 59, 0.18);
    --sc: #5ad5ff;
    --sc-soft: rgba(90, 213, 255, 0.18);
    --ink: #02060d;
    --panel: rgba(4, 11, 22, 0.74);
    --line: rgba(185, 222, 255, 0.18);
    --text: #eef8ff;
    --muted: #7990a6;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--ink);
    color: var(--text);
    font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
}

.hidden {
    display: none !important;
}

#viewLobby {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: 112px 58px 1fr 46px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 52%, rgba(197, 91, 16, 0.13), transparent 31%),
        radial-gradient(circle at 82% 47%, rgba(15, 141, 202, 0.15), transparent 34%),
        linear-gradient(115deg, #030713 0%, #050a14 45%, #030711 100%);
}

#viewLobby::before,
#viewLobby::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

#viewLobby::before {
    opacity: 0.5;
    background:
        linear-gradient(90deg, transparent 49.95%, rgba(157, 209, 255, 0.14) 50%, transparent 50.05%),
        linear-gradient(rgba(125, 179, 220, 0.025) 1px, transparent 1px);
    background-size: 100% 100%, 100% 5px;
}

#viewLobby::after {
    opacity: 0.22;
    background: linear-gradient(105deg, transparent 0 47%, rgba(113, 190, 255, 0.12) 50%, transparent 53% 100%);
    transform: translateX(-100%);
    animation: sector-scan 11s linear infinite;
}

.space-field,
.space-field::before,
.space-field::after {
    position: absolute;
    inset: -10%;
    z-index: -3;
    content: "";
    pointer-events: none;
}

.space-field {
    opacity: 1;
    animation: stars-drift 90s linear infinite;
}

.space-field::before {
    inset: 0;
    opacity: 0.18;
    background:
        radial-gradient(ellipse at 12% 28%, rgba(130, 186, 224, 0.18), transparent 25%),
        radial-gradient(ellipse at 91% 74%, rgba(255, 168, 92, 0.1), transparent 23%);
    filter: blur(34px);
}

.space-field::after {
    inset: 0;
    opacity: 0.35;
    background:
        radial-gradient(ellipse at 22% 60%, rgba(255, 116, 28, 0.18), transparent 35%),
        radial-gradient(ellipse at 78% 55%, rgba(50, 178, 255, 0.18), transparent 38%);
    filter: blur(28px);
    animation: nebula-breathe 9s ease-in-out infinite alternate;
}

.space-star {
    position: absolute;
    left: var(--star-x);
    top: var(--star-y);
    display: block;
    width: var(--star-size);
    height: var(--star-size);
    border-radius: 50%;
    background: var(--star-color);
    box-shadow: 0 0 var(--star-glow) var(--star-color);
    opacity: var(--star-alpha);
    animation: star-twinkle var(--star-duration) ease-in-out var(--star-delay) infinite alternate;
}

.tactical-grid {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -43%;
    height: 74%;
    z-index: -2;
    opacity: 0.18;
    transform: perspective(520px) rotateX(62deg);
    transform-origin: bottom;
    background-image:
        linear-gradient(rgba(104, 181, 231, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(104, 181, 231, 0.25) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to top, black, transparent 84%);
}

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 62px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(2, 6, 14, 0.95), rgba(3, 9, 18, 0.55));
}

.brand-block {
    position: relative;
    padding-left: 18px;
}

.brand-block::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: linear-gradient(var(--ed), var(--sc));
    box-shadow: 0 0 18px rgba(106, 206, 255, 0.55);
}

.brand-kicker,
.faction-code,
.lobby-footer,
.status-node,
.lb-title {
    font-family: Consolas, "Lucida Console", monospace;
    letter-spacing: 0.2em;
}

.brand-kicker {
    display: block;
    margin-bottom: 4px;
    color: #6f879c;
    font-size: 11px;
}

h1 {
    margin: 0;
    color: #f4fbff;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
    text-shadow: 0 0 22px rgba(162, 222, 255, 0.18);
}

h1 span {
    color: #67849b;
    font-size: 0.48em;
    font-weight: 400;
    vertical-align: 0.22em;
}

.status-node {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 290px;
    padding: 12px 18px;
    color: #8aa0b3;
    border: 1px solid rgba(146, 194, 225, 0.18);
    background: rgba(7, 16, 28, 0.72);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    font-size: 11px;
}

.status-light {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #50606d;
    box-shadow: 0 0 10px currentColor;
}

.status-node.lobby {
    color: #7dffc1;
    border-color: rgba(89, 255, 184, 0.28);
}

.status-node.lobby .status-light {
    background: #64ffc0;
    animation: status-pulse 1.6s ease-in-out infinite;
}

.status-node.active {
    color: #ffcd70;
}

#leaderboard {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 0 62px;
    overflow: hidden;
    border-bottom: 1px solid rgba(123, 180, 219, 0.12);
    background: rgba(5, 13, 25, 0.72);
}

#leaderboard::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--ed), transparent 36%, transparent 64%, var(--sc));
    opacity: 0.5;
}

.lb-title {
    flex: 0 0 auto;
    color: #9cafbf;
    font-size: 11px;
}

#lb-entries {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.lb-entry {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 5px 12px;
    color: #dcebf5;
    border-left: 1px solid rgba(133, 188, 224, 0.2);
    font-size: 13px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.lb-rank {
    color: #6e8ba1;
    font-family: Consolas, monospace;
    font-size: 10px;
}

.lb-score {
    color: #72c9ef;
    font-family: Consolas, monospace;
    font-size: 10px;
}

.teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
    min-height: 0;
    padding: 34px 52px 22px;
}

body[data-edition="vsear"] .teams {
    grid-template-columns: minmax(0, 1fr);
    padding-right: clamp(90px, 22vw, 430px);
    padding-left: clamp(90px, 22vw, 430px);
}

body[data-edition="vsear"] .versus-core {
    display: none;
}

body[data-edition="vsear"] .team-sc {
    border-left: 1px solid rgba(90, 213, 255, 0.2);
}

.team {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 0 26px;
}

.team-ed {
    border-left: 1px solid rgba(246, 166, 59, 0.2);
}

.team-sc {
    border-right: 1px solid rgba(90, 213, 255, 0.2);
}

.faction-heading {
    position: relative;
    height: 82px;
    text-align: center;
}

.faction-code {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
}

.team-ed .faction-code {
    color: var(--ed);
}

.team-sc .faction-code {
    color: var(--sc);
}

.faction-heading h2 {
    margin: 0;
    color: #eaf6ff;
    font-size: clamp(22px, 2vw, 34px);
    font-weight: 700;
    letter-spacing: 0.15em;
}

.faction-rule {
    display: block;
    width: 76%;
    height: 1px;
    margin: 14px auto 0;
}

.team-ed .faction-rule {
    background: linear-gradient(90deg, transparent, var(--ed), transparent);
}

.team-sc .faction-rule {
    background: linear-gradient(90deg, transparent, var(--sc), transparent);
}

.pilot-roster {
    display: grid;
    grid-auto-rows: 62px;
    flex: 1 1 auto;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scrollbar-color: rgba(126, 187, 225, 0.38) transparent;
    scrollbar-width: thin;
    list-style: none;
}

body:not(.admin-page) .pilot-roster {
    scrollbar-width: none;
}

body:not(.admin-page) .pilot-roster::-webkit-scrollbar {
    width: 0;
}

.admin-page .pilot-roster::-webkit-scrollbar {
    width: 5px;
}

.admin-page .pilot-roster::-webkit-scrollbar-thumb {
    background: rgba(126, 187, 225, 0.38);
}

.pilot-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 6px 16px;
    overflow: hidden;
    border: 1px solid rgba(170, 213, 240, 0.13);
    background: linear-gradient(90deg, rgba(12, 24, 38, 0.9), rgba(5, 12, 23, 0.55));
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    animation-duration: 720ms;
    animation-timing-function: cubic-bezier(0.16, 0.84, 0.24, 1.08);
    animation-fill-mode: both;
    animation-delay: var(--delay, 0ms);
}

.team-ed .pilot-card {
    border-left: 2px solid var(--ed);
    box-shadow: inset 26px 0 44px rgba(246, 166, 59, 0.05);
    animation-name: pilot-in-left;
}

.team-sc .pilot-card {
    flex-direction: row-reverse;
    border-right: 2px solid var(--sc);
    background: linear-gradient(270deg, rgba(12, 24, 38, 0.9), rgba(5, 12, 23, 0.55));
    box-shadow: inset -26px 0 44px rgba(90, 213, 255, 0.05);
    animation-name: pilot-in-right;
}

.pilot-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.11), transparent);
    animation: card-sweep 800ms ease-out calc(var(--delay, 0ms) + 350ms) 1;
}

.pilot-ship {
    width: 88px;
    height: 46px;
    flex: 0 0 88px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.12));
}

.team-ed .pilot-ship {
    filter: drop-shadow(0 0 8px rgba(246,166,59,0.25));
}

.team-sc .pilot-ship {
    filter: drop-shadow(0 0 8px rgba(90,213,255,0.28));
}

.pilot-data {
    min-width: 0;
    flex: 1;
}

.team-sc .pilot-data {
    text-align: right;
}

.pilot-name {
    display: block;
    overflow: hidden;
    color: #eff9ff;
    font-size: clamp(15px, 1.35vw, 22px);
    font-weight: 650;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.pilot-model {
    display: block;
    margin-top: 3px;
    color: #6d8599;
    font-family: Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.roster-empty {
    display: none;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: #496276;
    font-family: Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
}

.pilot-roster:empty + .roster-empty {
    display: flex;
}

.versus-core {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 58px;
}

.core-line {
    width: 1px;
    height: 86px;
    background: linear-gradient(transparent, rgba(138, 200, 239, 0.34), transparent);
}

.core-mark {
    position: absolute;
    top: 4px;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    color: #7f99ad;
    border: 1px solid rgba(146, 205, 241, 0.24);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: rgba(7, 17, 29, 0.72);
    font-family: Consolas, monospace;
    font-size: 36px;
    transform: translateX(-50%);
    text-shadow: 0 0 18px rgba(138, 200, 239, 0.45);
}

.lobby-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: #50677a;
    border-top: 1px solid rgba(132, 186, 220, 0.14);
    background: rgba(2, 7, 14, 0.88);
    font-size: 9px;
}

.lobby-footer strong {
    color: #b8d5e7;
    font-size: 11px;
    font-weight: 500;
}

.lobby-footer i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #5d8198;
}

.admin-toolbar {
    position: fixed;
    left: 50%;
    top: 18px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    width: min(720px, 42vw);
    transform: translateX(-50%) scale(var(--ui-scale, 1));
    transform-origin: top center;
    text-align: center;
}

.admin-toolbar-title {
    color: #70899d;
    font-family: Consolas, "Lucida Console", monospace;
    font-size: 9px;
    letter-spacing: 0.24em;
}

.admin-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.admin-buttons button {
    min-height: 34px;
    padding: 7px 13px;
    color: #c9dce9;
    border: 1px solid rgba(126, 187, 225, 0.28);
    background: rgba(7, 18, 31, 0.9);
    font-family: Consolas, "Lucida Console", monospace;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-align: center;
    cursor: pointer;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.admin-buttons button:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(90, 213, 255, 0.7);
    box-shadow: 0 0 14px rgba(90, 213, 255, 0.12);
}

.admin-buttons button:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 9999;
    display: none;
    padding: 10px 14px;
    color: #fff;
    border: 1px solid rgba(126, 187, 225, 0.3);
    background: #07121f;
    transform: translateX(-50%);
    text-align: center;
}

#matchWrapper {
    position: relative;
    display: none;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#matchCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    will-change: transform;
}

#matchHud {
    position: absolute;
    top: 22px;
    right: 28px;
    z-index: 10;
    min-width: 238px;
    padding: 13px 18px 12px;
    color: #eaf7ff;
    border: 1px solid rgba(90, 213, 255, 0.28);
    background: linear-gradient(110deg, rgba(3, 10, 19, 0.9), rgba(7, 26, 42, 0.78));
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    font-family: Consolas, "Lucida Console", monospace;
    text-align: right;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    transform: scale(var(--ui-scale, 1));
    transform-origin: top right;
}

.hud-label {
    display: block;
    margin-bottom: 2px;
    color: #609abb;
    font-size: 8px;
    letter-spacing: 0.2em;
}

#matchTimer {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

#matchHint {
    margin-top: 3px;
    color: #8eb3c9;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#killFeed {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: min(720px, 70vw);
    pointer-events: none;
    transform: translateX(-50%) scale(var(--ui-scale, 1));
    transform-origin: bottom center;
}

.kill-entry {
    position: relative;
    max-width: 100%;
    padding: 9px 22px 9px 25px;
    overflow: hidden;
    color: #dcecf6;
    border: 1px solid rgba(147, 198, 230, 0.18);
    background: linear-gradient(90deg, transparent, rgba(3, 12, 22, 0.88) 12%, rgba(3, 12, 22, 0.88) 88%, transparent);
    font-family: Consolas, "Lucida Console", monospace;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    animation: kill-feed-entry 10s ease both;
}

.kill-entry::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 5px;
    height: 5px;
    background: #afcce0;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 0 0 10px currentColor;
}

.kill-entry.faction-ed::before {
    color: var(--ed);
    background: var(--ed);
}

.kill-entry.faction-sc::before {
    color: var(--sc);
    background: var(--sc);
}

.kill-pilot {
    font: inherit;
    font-weight: 700;
    text-shadow: 0 0 10px currentColor;
}

.kill-pilot.faction-ed {
    color: var(--ed);
}

.kill-pilot.faction-sc {
    color: var(--sc);
}

#viewVictory {
    --victory-color: #b9d6e8;
    --victory-soft: rgba(158, 199, 224, 0.2);
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(1, 7, 14, 0.68), rgba(0, 0, 0, 0.86)),
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,0.018) 4px 5px);
}

#viewVictory.victory-ed {
    --victory-color: var(--ed);
    --victory-soft: rgba(246, 166, 59, 0.23);
}

#viewVictory.victory-sc {
    --victory-color: var(--sc);
    --victory-soft: rgba(90, 213, 255, 0.23);
}

.showing-victory #matchHud,
.showing-victory #killFeed {
    display: none;
}

.victory-scan,
.victory-radiance {
    position: absolute;
    pointer-events: none;
}

.victory-radiance {
    left: 50%;
    top: 50%;
    width: 860px;
    height: 860px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--victory-soft), transparent 66%);
    filter: blur(6px);
    transform: translate(-50%, -50%);
    animation: victory-radiance 3.2s ease-in-out infinite alternate;
}

.victory-scan {
    inset: 0;
    opacity: 0.35;
    background: linear-gradient(105deg, transparent 43%, var(--victory-soft) 49%, transparent 55%);
    transform: translateX(-100%);
    animation: victory-scan 4.8s ease-in-out infinite;
}

.victoryBox {
    position: relative;
    width: 880px;
    padding: 38px 70px 42px;
    color: #edf8ff;
    border-top: 1px solid color-mix(in srgb, var(--victory-color) 72%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--victory-color) 45%, transparent);
    background: linear-gradient(90deg, transparent, rgba(2, 9, 17, 0.9) 15%, rgba(2, 9, 17, 0.9) 85%, transparent);
    box-shadow: 0 0 90px var(--victory-soft);
    text-align: center;
    transform: scale(var(--ui-scale, 1));
    animation: victory-panel-in 900ms cubic-bezier(0.12, 0.78, 0.2, 1) both;
}

.victoryBox::before,
.victoryBox::after {
    content: "";
    position: absolute;
    top: -7px;
    width: 72px;
    height: 13px;
    border-top: 2px solid var(--victory-color);
}

.victoryBox::before { left: 0; border-left: 2px solid var(--victory-color); }
.victoryBox::after { right: 0; border-right: 2px solid var(--victory-color); }

.victory-eyebrow,
.victoryTitle,
.victorySub {
    font-family: Consolas, "Lucida Console", monospace;
}

.victory-eyebrow {
    color: var(--victory-color);
    font-size: 10px;
    letter-spacing: 0.34em;
    animation: victory-copy-in 700ms 450ms ease both;
}

.victory-emblem {
    position: relative;
    display: grid;
    place-items: center;
    width: 134px;
    height: 134px;
    margin: 20px auto 14px;
}

.victory-orbit {
    position: absolute;
    border: 1px solid var(--victory-color);
    border-radius: 50%;
}

.orbit-one {
    inset: 10px;
    opacity: 0.55;
    border-right-color: transparent;
    animation: victory-orbit 8s linear infinite;
}

.orbit-two {
    inset: 25px;
    opacity: 0.35;
    border-top-color: transparent;
    animation: victory-orbit 5s linear infinite reverse;
}

.victory-core {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    color: var(--victory-color);
    border: 1px solid var(--victory-color);
    background: rgba(2, 10, 18, 0.88);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    font: 800 28px "Segoe UI", sans-serif;
    text-shadow: 0 0 18px currentColor;
    animation: victory-core-pulse 1.8s ease-in-out infinite alternate;
}

.victoryTitle {
    color: #7892a5;
    font-size: 11px;
    letter-spacing: 0.3em;
    animation: victory-copy-in 700ms 550ms ease both;
}

.victoryWinner {
    margin-top: 8px;
    color: #f3fbff;
    font: 900 74px "Arial Narrow", "Roboto Condensed", sans-serif;
    letter-spacing: 0.17em;
    line-height: 1;
    text-indent: 0.17em;
    text-shadow: 0 0 28px var(--victory-soft);
    animation: victory-title-in 850ms 600ms cubic-bezier(0.14, 0.82, 0.22, 1) both;
}

.victoryFaction {
    margin-top: 10px;
    color: var(--victory-color);
    font: 700 26px "Arial Narrow", "Roboto Condensed", sans-serif;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-shadow: 0 0 16px var(--victory-soft);
    animation: victory-copy-in 700ms 900ms ease both;
}

.victory-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 25px auto 17px;
    animation: victory-copy-in 700ms 1050ms ease both;
}

.victory-divider i {
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--victory-color));
}

.victory-divider i:last-child {
    background: linear-gradient(90deg, var(--victory-color), transparent);
}

.victory-divider span {
    width: 7px;
    height: 7px;
    border: 1px solid var(--victory-color);
    transform: rotate(45deg);
}

.victorySub {
    color: #8ca5b7;
    font-size: 11px;
    letter-spacing: 0.17em;
    animation: victory-copy-in 700ms 1150ms ease both;
}

@keyframes pilot-in-left {
    from { opacity: 0; transform: translateX(-120px); }
    72% { opacity: 1; transform: translateX(7px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pilot-in-right {
    from { opacity: 0; transform: translateX(120px); }
    72% { opacity: 1; transform: translateX(-7px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes card-sweep {
    from { left: -35%; opacity: 0; }
    35% { opacity: 1; }
    to { left: 110%; opacity: 0; }
}

@keyframes status-pulse {
    50% { opacity: 0.38; box-shadow: 0 0 3px currentColor; }
}

@keyframes sector-scan {
    to { transform: translateX(100%); }
}

@keyframes stars-drift {
    to { transform: translate3d(90px, 45px, 0); }
}

@keyframes star-twinkle {
    from {
        opacity: var(--star-min-alpha);
        filter: brightness(0.82);
        transform: scale(0.78);
    }
    to {
        opacity: var(--star-alpha);
        filter: brightness(1.18);
        transform: scale(1.08);
    }
}

@keyframes nebula-breathe {
    to { opacity: 0.58; transform: scale(1.08); }
}

@keyframes kill-feed-entry {
    0% { opacity: 0; transform: translateY(16px); }
    8%, 82% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes victory-panel-in {
    from { opacity: 0; transform: scale(var(--ui-scale, 1)) translateY(26px); }
    to { opacity: 1; transform: scale(var(--ui-scale, 1)) translateY(0); }
}

@keyframes victory-copy-in {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes victory-title-in {
    from { opacity: 0; letter-spacing: 0.42em; filter: blur(7px); }
    to { opacity: 1; letter-spacing: 0.17em; filter: blur(0); }
}

@keyframes victory-orbit {
    to { transform: rotate(360deg); }
}

@keyframes victory-core-pulse {
    to { filter: brightness(1.35); transform: scale(1.06); }
}

@keyframes victory-radiance {
    to { opacity: 0.62; transform: translate(-50%, -50%) scale(1.13); }
}

@keyframes victory-scan {
    45%, 100% { transform: translateX(100%); }
}

@media (max-width: 1100px) {
    .lobby-header,
    #leaderboard {
        padding-right: 28px;
        padding-left: 28px;
    }

    .teams {
        padding-right: 18px;
        padding-left: 18px;
    }

    .team {
        padding-right: 14px;
        padding-left: 14px;
    }

    .pilot-ship {
        width: 62px;
        flex-basis: 62px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
    }
}
