:root {
    --bg: #07090d;
    --panel: rgba(12, 14, 17, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f4f5;
    --muted: #8f9298;
    --gold: #d4a24c;
    --gold-hover: #e2b35e;
    --font-display: "Bebas Neue", Impact, sans-serif;
    --font-body: "Manrope", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body,
#app {
    position: relative;
    width: 100%;
    height: 100%;
}

html,
body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

.screen {
    position: absolute;
    inset: 0;
    display: none;
}

.screen.is-active {
    display: flex;
}

.screen--home,
.screen--loading {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
}

.screen--home {
    z-index: 4;
    overflow: hidden;
    padding: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(212, 162, 76, 0.18), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 80%, rgba(212, 162, 76, 0.06), transparent 50%),
        linear-gradient(180deg, #0b1018 0%, var(--bg) 48%, #05070a 100%);
}

.screen--home::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.45;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
    animation: home-grid 18s linear infinite;
}

.screen--home::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(7, 9, 13, 0.55), transparent 18%, transparent 82%, rgba(7, 9, 13, 0.55)),
        linear-gradient(180deg, transparent 70%, rgba(7, 9, 13, 0.85));
}

.home {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    padding: 72px 0 96px;
}

.home__nav {
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: home-rise 0.7s ease both;
}

.home__mark {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.home__mark-uf {
    font-family: var(--font-display);
    font-size: 28px;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--gold);
}

.home__mark-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #c8c8cc;
}

.home__nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.home__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.home__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8a6f3a;
}

.home__status[data-state="boot"]::before {
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 162, 76, 0.15);
    animation: pulse 1.2s ease-in-out infinite;
}

.home__status[data-state="ready"] {
    color: #c8d0b8;
}

.home__status[data-state="ready"]::before {
    background: #7d9a5a;
}

.home__status[data-state="error"] {
    color: #c98787;
}

.home__status[data-state="error"]::before {
    background: #c45c5c;
}

.home__back {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home__back:hover {
    color: var(--gold);
}

.home__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    position: relative;
    flex: 0 0 auto;
}

.home__brand {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -58%);
    font-family: var(--font-display);
    font-size: clamp(96px, 22vw, 220px);
    line-height: 0.8;
    letter-spacing: 0.04em;
    color: rgba(212, 162, 76, 0.07);
    -webkit-text-stroke: 1px rgba(212, 162, 76, 0.22);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    animation: home-brand 1.1s ease both;
}

.home__kicker {
    position: relative;
    margin: 0 0 10px;
    color: var(--gold);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    animation: home-rise 0.75s 0.08s ease both;
}

.home__title {
    position: relative;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(64px, 12vw, 120px);
    line-height: 0.88;
    font-weight: 400;
    letter-spacing: 0.04em;
    animation: home-rise 0.8s 0.12s ease both;
}

.home__lead {
    position: relative;
    max-width: 420px;
    margin: 18px 0 0;
    color: #b7bac0;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 500;
    animation: home-rise 0.85s 0.18s ease both;
}

.home__lead code {
    color: var(--gold);
    font-family: inherit;
    font-weight: 700;
}

.drop {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    margin-top: 34px;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 24px;
    border: 1px solid rgba(212, 162, 76, 0.55);
    background:
        linear-gradient(180deg, rgba(212, 162, 76, 0.2), rgba(212, 162, 76, 0.06));
    cursor: pointer;
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    animation: home-rise 0.9s 0.24s ease both;
}

.drop__ring {
    position: absolute;
    inset: -10px;
    border: 1px solid rgba(212, 162, 76, 0.12);
    pointer-events: none;
    animation: drop-ring 2.8s ease-in-out infinite;
}

.drop.is-over {
    border-color: var(--gold-hover);
    background: rgba(212, 162, 76, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.drop input {
    display: none;
}

.drop__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.drop strong {
    font-family: var(--font-display);
    font-size: 34px;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #fff;
}

.drop > span:not([class]) {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
}

.home__foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    padding-top: 0;
    border-top: 0;
    animation: home-rise 1s 0.32s ease both;
}

.home__maps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home__maps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

.home__maps-head b {
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 0.04em;
}

.home__maps-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px 10px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(90deg, #000 55%, transparent);
}

.home-map {
    color: #8f9298;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-map:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.18);
}

.hint {
    min-height: 0;
    margin: 16px 0 0;
    color: #c98787;
    font-size: 13px;
}

.screen--loading {
    z-index: 5;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 60% 45% at 50% 40%, rgba(212, 162, 76, 0.1), transparent 60%),
        var(--bg);
}

@keyframes pulse {
    50% { opacity: 0.45; }
}

@keyframes home-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes home-brand {
    from {
        opacity: 0;
        transform: translate(-50%, -52%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -58%) scale(1);
    }
}

@keyframes home-grid {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 72px, 72px 0; }
}

@keyframes drop-ring {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.015); }
}

.loading {
    text-align: center;
}

.loading__mark {
    font-family: var(--font-display);
    font-size: 56px;
    letter-spacing: 0.06em;
    line-height: 1;
}

.loading__mark span {
    color: var(--gold);
}

.loading p {
    margin: 14px 0 0;
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 12px;
}

.replay-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    cursor: grab;
}

#app[data-screen="player"] .replay-canvas {
    opacity: 1;
    pointer-events: auto;
}

#app[data-screen="player"] .replay-canvas.is-dragging {
    cursor: grabbing;
}

.screen--player.is-active {
    display: block;
    z-index: 2;
    pointer-events: none;
}

.hud {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.hud__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud__meta span {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 12px;
}

.intel,
.killfeed {
    pointer-events: auto;
    position: absolute;
    z-index: 3;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.intel {
    top: 88px;
    left: 16px;
    width: min(280px, calc(100% - 32px));
    max-height: calc(100% - 170px);
    overflow: auto;
    padding: 12px;
}

.intel__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.intel__stat {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.intel__stat b {
    display: block;
    color: var(--gold);
    font-size: 16px;
}

.intel__stat span,
.intel__label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.intel__factions,
.intel__players,
.intel__classes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.intel__label {
    margin: 10px 0 4px;
}

.intel__row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.intel__row em {
    color: var(--muted);
    font-style: normal;
}

.killfeed {
    top: 88px;
    right: 16px;
    width: min(340px, calc(100% - 32px));
    max-height: calc(100% - 170px);
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.killfeed__item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.killfeed__item:hover {
    background: rgba(212, 162, 76, 0.1);
}

.killfeed__time,
.killfeed__reason {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}

.killfeed__text {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.killfeed__empty {
    color: var(--muted);
    font-size: 12px;
    padding: 8px;
}

.hud__ghost,
.player button {
    pointer-events: auto;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    min-height: 34px;
    padding: 0 12px;
    cursor: pointer;
}

.hud__ghost:hover,
.player button:hover {
    border-color: rgba(212, 162, 76, 0.4);
    color: var(--gold-hover);
}

.player {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: auto;
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.player__timeline {
    display: block;
    width: 100%;
    height: 8px;
    margin: 0;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.player__timeline::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
}

.player__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 0 16px;
}

.player__group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
}

.player__group:last-child {
    justify-content: flex-end;
}

.player__time,
.player__speed {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .home {
        width: min(920px, calc(100% - 28px));
        padding-top: 16px;
    }

    .home__brand {
        font-size: clamp(84px, 28vw, 160px);
    }

    .home__title {
        font-size: clamp(52px, 16vw, 88px);
    }

    .drop {
        min-height: 132px;
        margin-top: 28px;
    }

    .drop strong {
        font-size: 28px;
    }
}

@media (max-width: 860px) {
    .intel,
    .killfeed {
        width: calc(100% - 32px);
        max-height: 26vh;
    }

    .killfeed {
        top: auto;
        bottom: 92px;
    }
}

@media (max-width: 720px) {
    .home__nav {
        flex-wrap: wrap;
    }

    .home__mark-name {
        display: none;
    }

    .home__maps-list {
        max-height: 40px;
    }

    .player__bar {
        flex-wrap: wrap;
        padding: 10px 12px 12px;
    }

    .player__group {
        min-width: 0;
    }
}
