* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28102, 126, 234, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.logo-lightning {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    position: relative;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: electric 1.5s infinite alternate;
    border: 2px solid #FFD700;
}

.logo-lightning::before {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes electric {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
    }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: #667eea !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #764ba2 !important;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Game Section */
.game-section {
    margin-bottom: 3rem;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.game-description {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Game Controls */
.game-controls {
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    margin-bottom: 2rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    background: #5a6268;
}

.score-display,
.timer-display,
.accuracy-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 600;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Reaction Area */
.reaction-container {
    margin-bottom: 2rem;
}

.reaction-area {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #ddd;
    background: #f8f9fa;
}

.reaction-area.waiting {
    background: linear-gradient(45deg, #dc3545, #c82333);
    border-color: #dc3545;
    animation: pulse-red 2s infinite;
}

.reaction-area.ready {
    background: linear-gradient(45deg, #28a745, #20c997);
    border-color: #28a745;
    animation: pulse-green 0.5s infinite;
}

.reaction-area.too-early {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
    border-color: #ffc107;
    animation: shake 0.5s;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.reaction-content h2 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.reaction-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Stats */
.game-stats {
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info Section */
.info-section {
    margin-bottom: 3rem;
}

.info-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.instruction-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.instruction-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
    background: rgba(102, 126, 234, 0.1);
}

.instruction-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-item h4 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.instruction-item p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-bottom: 3rem;
}

.leaderboard-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 2fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 2fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    align-items: center;
}

.leaderboard-entry:hover {
    background: rgba(102, 126, 234, 0.05);
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.rank-col {
    font-weight: 700;
    color: #667eea;
}

.score-col {
    font-weight: 600;
    color: #333;
}

.accuracy-col {
    color: #666;
}

.date-col {
    color: #999;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
}

.modal-title {
    font-weight: 700;
}

.btn-close {
    filter: brightness(0) invert(1);
}

.result-content {
    padding: 2rem 1rem;
}

.time-display {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

.performance-rating h4 {
    color: #667eea;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.performance-rating p {
    color: #666;
    font-size: 1.1rem;
}

.comparison-item {
    background: rgba(102, 126, 234, 0.05);
    padding: 1rem;
    border-radius: 10px;
    margin: 0.5rem 0;
}

.comparison-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.comparison-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reaction-area {
        height: 300px;
        max-width: 100%;
    }

    .reaction-content h2 {
        font-size: 1.5rem;
    }

    .reaction-content p {
        font-size: 1rem;
    }

    .game-controls {
        flex-direction: column;
        text-align: center;
    }

    .game-controls>* {
        margin-bottom: 0.5rem;
    }

    .leaderboard-header,
    .leaderboard-entry {
        grid-template-columns: 0.8fr 1.5fr 1.5fr 1.2fr;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    .time-display {
        font-size: 3rem;
    }

    .instruction-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem 0;
    }

    .game-container,
    .info-container,
    .leaderboard-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .game-header h1 {
        font-size: 2.5rem;
    }

    .reaction-area {
        height: 250px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .time-display {
        font-size: 2.5rem;
    }
}