@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

:root {
    --primary: #bb86fc;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --dark: #121212;
    --dark-card: #1E1E1E;
    --dark-accent: #2D2D2D;
    --light: #e0e0e0;
}

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

body.dark-theme {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Game Page Header */
.game-page-header {
    background-color: #1f1f1f;
    padding: 0.8rem 0;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--light);
}

/* Main Game Content Area */
.game-content {
    padding: 2rem 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(187, 134, 252, 0.3);
    background: linear-gradient(45deg, #bb86fc, #c39dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 8s ease infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* The Game Container */
#game-container {
    width: 100%;
    max-width: 800px;
    min-height: 500px;
    background-color: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    margin: 0 auto 2rem auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

/* Game Instructions Area */
.game-instructions {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    max-width: 700px;
    width: 90%;
    margin: 0 auto;
    text-align: center;
}

.game-instructions h2 {
    font-size: 1.3rem;
    color: var(--light);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.game-instructions p {
    font-size: 0.95rem;
    color: #a0a0a0;
    line-height: 1.7;
}

/* Footer Styles */
.site-footer {
    background-color: #1f1f1f;
    color: #a0a0a0;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.site-footer p {
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.8rem;
    }
    #game-container {
        min-height: 400px;
    }
    .game-instructions {
        width: 95%;
        padding: 0.8rem 1rem;
    }
    .game-instructions h2 {
        font-size: 1.2rem;
    }
    .game-instructions p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.6rem;
    }
    #game-container {
        min-height: 300px;
        border-width: 1px;
    }
    .back-link {
        font-size: 0.9rem;
    }
}

/* ================= Game-specific styles below ================= */

.game-info {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    font-size: 1.2rem;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

.score-container, .time-container, .target-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

#score, #time {
    font-size: 1.5rem;
    font-weight: bold;
}

.color-display {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f1c40f;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 255, 255, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
}

#game-area {
    position: relative;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    width: 100%;
}

.color-ball {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transform: scale(0);
    animation: appear 0.3s forwards;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

@keyframes appear {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.color-ball.pop {
    animation: pop 0.3s forwards;
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.color-ball.wrong {
    animation: wrong 0.3s forwards;
}

@keyframes wrong {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); background-color: var(--secondary-color) !important; }
    100% { transform: scale(0); opacity: 0; }
}

.streak-effect {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: float-up 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes float-up {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100px); opacity: 0; }
}

.score-popup {
    position: absolute;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    animation: score-pop 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes score-pop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

button {
    background: linear-gradient(45deg, var(--accent-color), var(--primary));
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, var(--primary), var(--accent-color));
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

h2 {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .game-info {
        flex-direction: column;
        align-items: center;
    }
    
    #game-area {
        height: 350px;
    }
} 