body {
    background:
        radial-gradient(circle at 90% 0%, rgba(225, 6, 0, .14), transparent 30%),
        #030303;
}

.replay-page {
    width: min(1180px, 92%);
    margin: 0 auto;
    padding: 34px 0 100px;
}

.replay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
    padding: 4px 2px;
}

.replay-header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.replay-header-signal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--red-bright);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.replay-header-signal i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.replay-back {
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--red);
    padding-bottom: 4px;
}

.replay-player-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 5vw, 58px);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)),
        radial-gradient(circle at top, rgba(225, 6, 0, .12), transparent 42%),
        linear-gradient(145deg, #121212, #070707 60%);
    box-shadow: var(--shadow-soft);
}

.replay-player-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 7%;
    width: 42%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.replay-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: end;
    gap: 30px;
}

.replay-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--red-bright);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.replay-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.replay-status[data-state="ready"] { color: var(--green); }
.replay-status[data-state="error"] { color: #ff8f8b; }

.replay-player-panel h1 {
    margin-top: 10px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: .9;
    letter-spacing: -5px;
    font-weight: 950;
}

.replay-description {
    min-height: 24px;
    margin: 14px 0 24px;
    color: var(--muted);
    line-height: 1.6;
}

.replay-performance-note {
    max-width: 620px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 190, 80, .24);
    border-radius: 10px;
    color: #c9b99c;
    background: rgba(255, 190, 80, .06);
    font-size: 12px;
    line-height: 1.55;
}

.replay-performance-note strong {
    color: #ffd27b;
}

.replay-telemetry {
    display: grid;
    gap: 9px;
    padding: 18px;
    border-left: 1px solid rgba(225, 6, 0, .5);
    background: rgba(225, 6, 0, .06);
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1.2px;
}

.replay-telemetry strong {
    color: #fff;
    font-size: 25px;
    letter-spacing: -1px;
}

.replay-telemetry strong span { color: var(--red); }
.replay-telemetry small { color: var(--red-bright); font-size: 8px; }

.replay-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 38px;
}

.replay-race {
    position: relative;
    display: flex;
    min-height: 190px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 23px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(225, 6, 0, .08), transparent 45%), #0b0b0b;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.replay-race:hover {
    transform: translateY(-3px);
    border-color: rgba(225, 6, 0, .55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .3);
}

.replay-race-header { width: 100%; }

.replay-race h2 {
    margin: 10px 0 8px;
    font-size: clamp(23px, 3vw, 31px);
    line-height: .98;
    letter-spacing: -1.5px;
}

.replay-race p {
    color: var(--muted);
    font-size: 12px;
}

.replay-race-meta {
    display: flex;
    align-items: center;
    gap: 9px;
}

.replay-race-round {
    color: #858585;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.replay-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
}

.replay-option {
    display: flex;
    min-height: 92px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
}

.replay-option.is-cancelled {
    border-color: rgba(225, 6, 0, .5);
    background: rgba(225, 6, 0, .08);
}

.replay-option-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.replay-option-title strong {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.replay-race-type {
    padding: 5px 8px;
    border: 1px solid rgba(225, 6, 0, .45);
    border-radius: 999px;
    color: var(--red-bright);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.replay-open-button {
    flex: 0 0 auto;
    border: 1px solid var(--red);
    border-radius: 999px;
    padding: 11px 17px;
    color: #fff;
    background: var(--red);
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    transition: transform .2s ease, background .2s ease;
}

.replay-open-button:hover {
    transform: translateY(-2px);
    background: var(--red-bright);
}

.replay-unavailable {
    color: #626262;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.cancelled-race-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border: 1px solid rgba(225, 6, 0, .3);
    border-radius: 8px;
}

.replay-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 280px;
    overflow: hidden;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: #000;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.replay-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 700px) {
    .replay-header-right { gap: 12px; }
    .replay-header-signal { display: none; }
    .replay-hero-grid { grid-template-columns: 1fr; }
    .replay-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .replay-options { grid-template-columns: 1fr; }
    .replay-race { min-height: 170px; }
}
