/* Game Replay Popup Styles */

.game-replay-popup {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid rgba(251, 146, 60, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.game-replay-popup .popup-header {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    padding: 16px 20px;
    border-bottom: 2px solid rgba(251, 146, 60, 0.5);
}

.game-replay-popup .popup-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
}

/* Replay Info Bar */
.replay-info-bar {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(15, 20, 25, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.replay-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.replay-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.replay-value {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 600;
    font-family: ui-monospace, monospace;
}

.replay-value.crash-value {
    color: #ef4444;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Replay Canvas Container */
#replay-canvas-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(180deg, #0a0e1a 0%, #1a1f2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 16px 0;
    overflow: hidden;
}

#replay-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#replay-multiplier-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(251, 146, 60, 0.8),
                 0 0 40px rgba(251, 146, 60, 0.4);
    pointer-events: none;
    font-family: 'Orbitron', monospace, sans-serif;
    letter-spacing: 2px;
}

body.variant-rockit #replay-multiplier-display {
    font-family: 'RockItMultiplier', 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-style: italic;
    background: linear-gradient(180deg, #ffec49 0%, #fbcf3d 55%, #fe8b22 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 0 transparent;
    text-shadow: none;
    letter-spacing: 0.5px;
}

#replay-status-text {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    pointer-events: none;
}

body.variant-rockit #replay-status-text {
    font-family: 'RockItPhase', 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-style: italic;
    font-weight: 700;
    color: #ffffff;
}

/* Playback Controls */
.replay-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(15, 20, 25, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.replay-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.replay-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.5);
}

.replay-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.4);
}

.replay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #4a5568;
}

.replay-btn span {
    font-size: 1.1rem;
}

.replay-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.replay-speed-control label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

#replay-speed-select {
    padding: 6px 12px;
    background: rgba(30, 40, 60, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

#replay-speed-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Progress Timeline */
.replay-timeline {
    padding: 16px 20px;
}

.timeline-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(30, 40, 60, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 2px solid #f97316;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
    transition: left 0.1s linear;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: ui-monospace, monospace;
}

/* Event Log (optional) */
.replay-events {
    padding: 16px 20px;
    background: rgba(15, 20, 25, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.replay-events h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 40, 60, 0.6);
    border-radius: 4px;
    font-size: 0.85rem;
}

.event-time {
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
}

.event-description {
    color: #e2e8f0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .game-replay-popup {
        width: 95%;
        max-height: 95vh;
    }
    
    #replay-canvas-container {
        height: 300px;
    }
    
    #replay-multiplier-display {
        font-size: 3rem;
    }
    
    .replay-info-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .replay-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .replay-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .replay-speed-control {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        justify-content: center;
    }
}
