/**
 * Retro-Arcade High-Score Scoreboard Styling
 * Authentic 80s/90s arcade aesthetics with modern responsiveness
 */

/* Import retro fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Audiowide&display=swap');

/* High Score Notification Popup */
.high-score-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10000;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 400% 400%;
    animation: rainbow-bg 2s ease-in-out infinite;
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        0 0 30px rgba(255, 0, 255, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.high-score-notification.show {
    transform: translate(-50%, -50%) scale(1);
    animation: 
        rainbow-bg 2s ease-in-out infinite,
        pulse-glow 1s ease-in-out infinite alternate;
}

.high-score-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.high-score-icon {
    font-size: 3rem;
    animation: bounce 0.6s ease-in-out infinite alternate;
}

.high-score-text {
    text-align: left;
}

.high-score-title {
    font-family: 'Audiowide', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.high-score-game {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 3px;
}

.high-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffff00;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8);
}

/* Scoreboard Overlay */
.scoreboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.scoreboard-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Scoreboard Modal */
.scoreboard-modal {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    border: 3px solid #00ffff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.5),
        inset 0 0 50px rgba(0, 255, 255, 0.1);
    animation: modal-glow 3s ease-in-out infinite alternate;
}

/* Scoreboard Header */
.scoreboard-header {
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    padding: 20px;
    position: relative;
    border-bottom: 2px solid #00ffff;
}

.scoreboard-title {
    font-family: 'Audiowide', monospace;
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
    letter-spacing: 4px;
    margin: 0;
    text-transform: uppercase;
}

.scoreboard-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: 2px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scoreboard-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Scoreboard Content */
.scoreboard-content {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* Game Selector */
.game-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 20px;
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    border-bottom: 2px solid #00ffff;
}

.game-tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border: 2px solid #555;
    border-radius: 10px;
    color: #ccc;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-tab:hover {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

.game-tab.active {
    background: linear-gradient(135deg, #00ffff, #0099cc);
    border-color: #fff;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    font-weight: 700;
}

.score-count {
    display: block;
    font-size: 0.7rem;
    margin-top: 2px;
    opacity: 0.8;
}

/* Scoreboard List */
.scoreboard-list {
    padding: 20px;
    background: linear-gradient(180deg, #0a0a0a, #1a1a2e);
}

.scores-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.scores-title {
    font-family: 'Audiowide', monospace;
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scores-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

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

/* Score Entry */
.score-entry {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.score-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.score-entry:hover::before {
    left: 100%;
}

.score-entry:hover {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateX(5px);
}

/* Rank styling */
.score-rank {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 80px;
}

.rank-number {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ccc;
    min-width: 30px;
    text-align: center;
}

.rank-medal {
    font-size: 1.5rem;
}

/* Top 3 special styling */
.score-entry.rank-1 {
    border-color: #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.score-entry.rank-1 .rank-number {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.score-entry.rank-2 {
    border-color: #c0c0c0;
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.05));
}

.score-entry.rank-2 .rank-number {
    color: #c0c0c0;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.6);
}

.score-entry.rank-3 {
    border-color: #cd7f32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), rgba(205, 127, 50, 0.05));
}

.score-entry.rank-3 .rank-number {
    color: #cd7f32;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.6);
}

/* Score Details */
.score-details {
    flex: 1;
    text-align: right;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    margin-bottom: 2px;
}

.score-date {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #999;
    opacity: 0.8;
}

/* No Scores State */
.no-scores {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-scores-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-scores-text {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #999;
}

.no-scores-hint {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Scoreboard Footer */
.scoreboard-footer {
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    padding: 15px;
    text-align: center;
    border-top: 2px solid #00ffff;
}

.arcade-decoration {
    font-family: 'Orbitron', monospace;
    color: #00ffff;
    font-size: 1.2rem;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    animation: decoration-glow 2s ease-in-out infinite alternate;
}

/* Animations */
@keyframes rainbow-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 30px rgba(255, 0, 255, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.2); }
    100% { box-shadow: 0 0 50px rgba(0, 255, 255, 1), inset 0 0 50px rgba(255, 255, 255, 0.4); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

@keyframes modal-glow {
    0% { box-shadow: 0 0 50px rgba(0, 255, 255, 0.5), inset 0 0 50px rgba(0, 255, 255, 0.1); }
    100% { box-shadow: 0 0 80px rgba(0, 255, 255, 0.8), inset 0 0 80px rgba(0, 255, 255, 0.2); }
}

@keyframes decoration-glow {
    0% { text-shadow: 0 0 10px rgba(0, 255, 255, 0.8); }
    100% { text-shadow: 0 0 20px rgba(0, 255, 255, 1), 0 0 30px rgba(0, 255, 255, 0.5); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .scoreboard-modal {
        width: 95%;
        margin: 20px;
    }
    
    .scoreboard-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .game-tab {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .score-entry {
        padding: 12px;
    }
    
    .score-value {
        font-size: 1.1rem;
    }
    
    .high-score-notification {
        width: 90%;
        margin: 0 5%;
    }
    
    .high-score-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .game-selector {
        flex-direction: column;
    }
    
    .game-tab {
        min-width: auto;
        width: 100%;
    }
    
    .score-rank {
        min-width: 60px;
    }
    
    .rank-number {
        font-size: 1rem;
        min-width: 25px;
    }
    
    .rank-medal {
        font-size: 1.2rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .scoreboard-modal {
        border-width: 4px;
    }
    
    .score-entry {
        border-width: 2px;
    }
    
    .game-tab {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .high-score-notification,
    .scoreboard-overlay,
    .score-entry,
    .game-tab {
        transition: none;
    }
    
    .high-score-notification.show {
        animation: none;
    }
    
    .modal-glow,
    .rainbow-bg,
    .pulse-glow,
    .bounce,
    .decoration-glow {
        animation: none;
    }
}