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

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #111;
    color: white;
    overflow: hidden;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background: #333;
    color: white;
    padding: 10px 0;
    font-size: 1.5rem;
    font-weight: 900;
    z-index: 20;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
}

.game-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    padding-top: 50px; /* Offset for top bar */
}

.score-display, .high-score-display {
    position: absolute;
    z-index: 10;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.score-display {
    bottom: 20px;
    right: 20px;
}

.high-score-display {
    bottom: 20px;
    left: 20px;
}

.screen {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.screen:active {
    transform: scale(0.98);
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    z-index: 1;
    transition: filter 0.3s ease;
}

.screen:hover .background-overlay {
    filter: brightness(0.6);
}

.content {
    position: relative;
    z-index: 2;
    padding: 20px;
    pointer-events: none; /* Let clicks pass through to screen */
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

p {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 10px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.stat {
    font-size: 5rem;
    font-weight: 900;
    color: #e10600; /* F1 red */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
    margin: 20px 0;
}

.click-hint {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 20px;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 30px;
    display: inline-block;
    background: rgba(0,0,0,0.5);
}

.vs-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: white;
    color: black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 1.5rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    pointer-events: none;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    border: 3px solid white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-play-again {
    background: #e10600;
    color: white;
}

.btn-share {
    background: #333;
    color: white;
}

.btn:hover {
    background: white;
    color: black;
}

.hidden {
    display: none !important;
}

.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main-menu-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main-menu-screen h2 {
    font-size: 5rem;
    font-weight: 900;
    color: white;
    text-shadow: 4px 4px 10px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    text-align: center;
}

.main-menu-screen p {
    font-size: 2rem;
    margin-bottom: 30px;
}

.main-menu-buttons {
    display: flex;
    gap: 30px;
}

.btn-mode {
    background: #e10600;
    color: white;
    font-size: 1.8rem;
    padding: 20px 40px;
}

.game-over-screen h2 {
    font-size: 5rem;
    font-weight: 900;
    color: #e10600;
}

.game-over-screen p {
    font-size: 2rem;
}

/* Correct/Incorrect animations */
@keyframes flashGreen {
    0% { background-color: rgba(76, 175, 80, 0); }
    50% { background-color: rgba(76, 175, 80, 0.5); }
    100% { background-color: rgba(76, 175, 80, 0); }
}

@keyframes flashRed {
    0% { background-color: rgba(244, 67, 54, 0); }
    50% { background-color: rgba(244, 67, 54, 0.5); }
    100% { background-color: rgba(244, 67, 54, 0); }
}

.correct-guess::after {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    z-index: 5;
    pointer-events: none;
    animation: flashGreen 0.8s ease-out;
}

.incorrect-guess::after {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    z-index: 5;
    pointer-events: none;
    animation: flashRed 0.8s ease-out;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }
    .screen {
        height: 50vh;
    }
    h1 { font-size: 2.5rem; }
    .stat { font-size: 3rem; margin: 10px 0; }
    p { font-size: 1rem; }
    .click-hint { font-size: 1rem; padding: 5px 10px; margin-top: 10px;}
}
