/* =================================================================
   Replay Page — standalone public page for viewing saved extractions.
   Inherits nothing from the admin extraction CSS; self-contained.
   ================================================================= */

:root {
    --rp-bg: #080d19;
    --rp-surface: #0f1729;
    --rp-gold: #FFD700;
    --rp-gold-dark: #B8860B;
    --rp-text: #e2e8f0;
    --rp-text-muted: #94a3b8;
    --rp-radius: 12px;
    --rp-transition: 0.3s ease;
}

/* ── Page wrapper ─────────────────────────────────────────────── */

.replay-page {
    background: var(--rp-bg);
    min-height: 100vh;
    color: var(--rp-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 3rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Header ───────────────────────────────────────────────────── */

.replay-header {
    width: 100%;
    background: var(--rp-surface);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding: 1rem 1.5rem;
}

.replay-header__inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.replay-header__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.replay-header__icon {
    color: var(--rp-gold);
    font-size: 1.5rem;
}

.replay-header__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.replay-header__subtitle {
    font-size: 0.85rem;
    color: var(--rp-text-muted);
    margin: 0;
}

.replay-header__right {
    display: flex;
    gap: 1rem;
}

.replay-stat {
    font-size: 0.8rem;
    color: var(--rp-text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
}

.replay-stat i {
    color: var(--rp-gold);
    margin-right: 0.3rem;
}

/* ── Test mode banner ─────────────────────────────────────────── */

.replay-test-banner {
    width: 100%;
    max-width: 900px;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-radius: 8px;
    color: #ffc107;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.replay-test-banner i {
    margin-right: 0.4rem;
}

/* ── Live ticker ──────────────────────────────────────────────── */

.replay-ticker {
    margin-top: 1.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--rp-surface);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--rp-text-muted);
    text-align: center;
    transition: all var(--rp-transition);
    min-height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.replay-ticker.spinning {
    color: var(--rp-gold);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
    animation: rp-ticker-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes rp-ticker-pulse {
    from { opacity: 0.85; }
    to   { opacity: 1; }
}

/* ── Wheel stage ──────────────────────────────────────────────── */

.replay-stage {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 560px;
}

.replay-stage canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Controls ─────────────────────────────────────────────────── */

.replay-controls {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rp-transition);
    font-family: inherit;
}

.replay-btn--play {
    background: linear-gradient(135deg, var(--rp-gold), var(--rp-gold-dark));
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.replay-btn--play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.replay-btn--again {
    background: transparent;
    color: var(--rp-gold);
    border: 2px dashed rgba(255, 215, 0, 0.4);
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
}

.replay-btn--again:hover {
    border-color: var(--rp-gold);
    background: rgba(255, 215, 0, 0.05);
}

.replay-status {
    font-size: 0.85rem;
    color: var(--rp-text-muted);
}

/* ── Winner card ──────────────────────────────────────────────── */

.replay-winner {
    margin-top: 2rem;
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.replay-winner.reveal {
    opacity: 1;
    transform: translateY(0);
}

.replay-winner__card {
    background: var(--rp-surface);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: var(--rp-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.replay-winner__icon {
    font-size: 2.5rem;
    color: var(--rp-gold);
    margin-bottom: 0.5rem;
    animation: rp-crown-bounce 0.6s ease;
}

@keyframes rp-crown-bounce {
    0%   { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.replay-winner__heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rp-text-muted);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.replay-winner__name {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.replay-winner__ticket {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.1rem;
    color: var(--rp-gold);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.replay-winner__date {
    font-size: 0.8rem;
    color: var(--rp-text-muted);
    margin: 0;
}

/* ── Replay again ─────────────────────────────────────────────── */

.replay-again {
    margin-top: 1.5rem;
    text-align: center;
}

/* ── Back link ────────────────────────────────────────────────── */

.replay-back {
    margin-top: 2rem;
    text-align: center;
}

.replay-back__link {
    color: var(--rp-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--rp-transition);
}

.replay-back__link:hover {
    color: var(--rp-gold);
}

.replay-back__link i {
    margin-right: 0.3rem;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 640px) {
    .replay-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .replay-header__right {
        flex-wrap: wrap;
    }
    .replay-stage {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    .replay-winner__name {
        font-size: 1.3rem;
    }
}
