:root {
    --bg: #080a0c;
    --panel: rgba(12, 14, 17, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f4f5;
    --muted: #7c8088;
    --gold: #d4a24c;
    --gold-hover: #e2b35e;
}

* {
    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: Inter, Arial, sans-serif;
}

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

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

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

.screen--home {
    z-index: 4;
    overflow: auto;
    padding: 0;
    background:
        radial-gradient(ellipse 80% 55% at 78% 18%, rgba(212, 162, 76, 0.12), transparent 52%),
        radial-gradient(ellipse 50% 40% at 8% 92%, rgba(212, 162, 76, 0.05), transparent 55%),
        var(--bg);
}

.screen--home::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 60% 40%, #000 18%, transparent 78%);
}

.home {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 40px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    min-height: 100%;
}

.home__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home__logo {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

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

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

.home__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 12px;
}

.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: 13px;
}

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

.home__main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    grid-template-areas:
        "copy drop"
        "features drop";
    gap: 28px 48px;
    align-items: center;
}

.home__copy {
    grid-area: copy;
}

.drop {
    grid-area: drop;
}

.home__features {
    grid-area: features;
}

.home__kicker {
    margin: 0 0 14px;
    color: var(--gold);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
}

.home__title {
    margin: 0;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 0.96;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.home__title em {
    color: var(--gold);
    font-style: normal;
}

.home__lead {
    max-width: 520px;
    margin: 18px 0 0;
    color: #b7bac0;
    font-size: 16px;
    line-height: 1.55;
}

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

.home__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home__feature {
    padding: 14px 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(8, 10, 12, 0.55);
}

.home__feature b {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.home__feature span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.drop {
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 28px;
    border: 1px dashed rgba(212, 162, 76, 0.38);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 30%, rgba(212, 162, 76, 0.08), transparent 46%),
        rgba(255, 255, 255, 0.02);
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.drop.is-over {
    border-color: var(--gold);
    background: rgba(212, 162, 76, 0.1);
    transform: translateY(-2px);
}

.drop input {
    display: none;
}

.drop__badge {
    position: absolute;
    top: 22px;
    right: 22px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(212, 162, 76, 0.35);
    color: var(--gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.drop__icon {
    width: 64px;
    height: 64px;
    color: var(--gold);
    margin-bottom: 8px;
}

.drop__icon svg {
    width: 100%;
    height: 100%;
}

.drop strong {
    font-size: 22px;
    letter-spacing: -0.03em;
}

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

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

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

.home__maps-head b {
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.home__maps-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-map {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: #c5c8ce;
    font-size: 12px;
}

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

.screen--loading {
    z-index: 5;
    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; }
}

.loading {
    text-align: center;
}

.loading__mark {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;
}

.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(1180px, calc(100% - 32px));
        padding-top: 20px;
        gap: 28px;
    }

    .home__main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "drop"
            "features";
        gap: 22px;
    }

    .home__features {
        grid-template-columns: 1fr;
    }

    .drop {
        min-height: 280px;
    }
}

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

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

@media (max-width: 720px) {
    .player__bar {
        flex-wrap: wrap;
        padding: 10px 12px 12px;
    }

    .player__group {
        min-width: 0;
    }
}
