@import url('https://fonts.cdnfonts.com/css/minecraft-4');

body {
    text-align: center;
    font-family: 'Minecraft', Arial, sans-serif;
    background-image: url('https://staticg.sportskeeda.com/editor/2024/03/765aa-17101429607911-1920.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    transition: background-color 0.5s;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

h1 {
    margin: 5px 0;
}

#gameArea {
    position: relative;
    width: 100%;
    height: 50vh;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #654321;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    #gameArea {
        width: calc(100% - 30px);
        height: 40vh;
        min-height: 250px;
    }
    
    .answerButton {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #gameArea {
        width: calc(100% - 20px);
        height: 35vh;
        min-height: 200px;
    }
    
    .answerButton {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

.answerButton {
    position: absolute;
    width: 80px;
    height: 80px;
    font-size: 28px;
    background-image: url('https://i.imgur.com/FWOqzE1.gif');
    background-size: cover;
    background-position: center;
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Minecraft', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.answerButton:hover {
    opacity: 0.8;
    background-color: transparent;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

#overlay p {
    font-size: 24px;
    margin: 10px 0;
    text-align: center;
}

#winnerGif,
#loserGif {
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    background-color: transparent;
}

#restartButton {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    font-family: 'Minecraft', Arial, sans-serif;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

@media (max-height: 600px) {
    h1 {
        font-size: clamp(18px, 4vw, 32px);
    }
    
    p {
        font-size: clamp(12px, 2vw, 14px);
        margin: 3px 0;
    }
    
    #gameArea {
        margin: 5px auto;
    }
}

#nameInput {
    display: block;
    margin: 20px auto;
    padding: 10px;
    font-family: 'Minecraft', Arial, sans-serif;
    font-size: 18px;
    text-align: center;
    width: 200px;
}

#startButton {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 18px;
    font-family: 'Minecraft', Arial, sans-serif;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

body.game-page #welcomeScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#welcomeScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 3px solid #654321;
    border-radius: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#welcomeScreen input,
#welcomeScreen button {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    font-size: 16px;
    box-sizing: border-box;
}

#leaderboard {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    width: 80%;
    max-width: 400px;
}

#leaderboard h3 {
    color: gold;
    margin-bottom: 15px;
    font-size: 24px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.rank {
    color: gold;
    font-weight: bold;
    width: 40px;
}

.name {
    flex: 1;
    text-align: left;
    padding: 0 10px;
}

.score {
    color: #4CAF50;
    font-weight: bold;
    width: 40px;
}

.plays {
    color: #888;
    font-size: 0.8em;
    margin-left: 10px;
    width: 50px;
}

.button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.button-container button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-image: url('https://i.imgur.com/FWOqzE1.gif');
    background-size: cover;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Minecraft', Arial, sans-serif;
}

.button-container button:hover {
    opacity: 0.8;
}

#restartButton,
#resetButton {
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
    padding: 0 20px;
    font-size: 18px;
    font-family: 'Minecraft', Arial, sans-serif;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
}

#restartButton {
    background-color: #4CAF50;
}

#resetButton {
    background-color: #f44336;
}

#restartButton:hover,
#resetButton:hover {
    opacity: 0.9;
}

#errorOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Minecraft', Arial, sans-serif;
}

#errorOverlay p {
    color: white;
    font-size: 48px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
    max-width: 400px;
}

.menu-game-button {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    font-size: 24px;
    font-family: 'Minecraft', Arial, sans-serif;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    background-color: #4CAF50;
    transition: opacity 0.3s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.menu-game-button .description {
    font-size: 14px;
    margin-top: 5px;
    opacity: 0.8;
}

.menu-game-button:hover {
    opacity: 0.9;
}

.menu-game-button.disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

.menu-game-button.disabled:hover {
    opacity: 0.7;
}

.answer {
    background-image: url('https://i.imgur.com/FWOqzE1.gif');
    background-size: cover;
    background-repeat: no-repeat;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
}

/* Menu button styling */
.menu-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 20px;
    background-image: url('https://i.imgur.com/FWOqzE1.gif');
    background-size: cover;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Minecraft', Arial, sans-serif;
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000000;
    transition: opacity 0.2s;
}

.menu-button:hover {
    opacity: 0.9;
}

/* Override voor specifieke menu buttons */
a.menu-button, 
button.menu-button,
#overlay .button-container button {
    background-image: url('https://i.imgur.com/FWOqzE1.gif');
    background-size: cover;
    color: white;
    border: none;
    font-family: 'Minecraft', Arial, sans-serif;
}

/* Responsive styling */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    #gameArea {
        width: calc(100% - 30px);
        margin: 20px auto;
        position: relative;
        height: 50vh;
    }

    #score, #time {
        margin: 10px 15px;
    }

    #sum {
        margin: 15px;
        text-align: center;
    }

    .menu-button {
        margin: 10px 15px;
    }

    .answerButton {
        margin: 5px;
    }

    #welcomeScreen {
        width: 90%;
        max-width: 400px;
        padding: 20px;
        margin: 20px auto;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
    }

    #welcomeScreen input,
    #welcomeScreen button {
        width: 100%;
        margin: 10px 0;
        padding: 12px;
        font-size: 16px;
    }

    h1 {
        font-size: 24px;
        margin: 10px 0;
        padding: 0 10px;
    }

    #overlay {
        width: 90%;
        max-width: 400px;
        padding: 20px;
        margin: 0;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .button-container {
        flex-direction: column;
        gap: 10px;
    }

    .button-container button {
        width: 100%;
        margin: 5px 0;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    #gameArea {
        width: calc(100% - 20px);
        margin: 15px auto;
    }

    #score, #time {
        margin: 8px 10px;
    }

    #sum {
        margin: 10px;
    }

    .menu-button {
        margin: 8px 10px;
    }

    #welcomeScreen, #overlay {
        width: 95%;
        padding: 15px;
    }

    .answerButton {
        min-width: 50px;
        min-height: 50px;
        font-size: 14px;
    }

    h1 {
        font-size: 20px;
    }

    #welcomeScreen {
        padding: 15px;
    }

    #welcomeScreen input,
    #welcomeScreen button {
        padding: 10px;
        font-size: 14px;
    }
}

/* Ensure overlay is always visible and centered */
#welcomeScreen, #overlay {
    background-color: rgba(0, 0, 0, 0.9);
    border: 3px solid #654321;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Fix for mobile height issues */
@media screen and (max-height: 600px) {
    #gameArea {
        height: 40vh;
    }

    #welcomeScreen, #overlay {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Ensure buttons are always clickable */
.answerButton, 
.menu-button, 
#startButton, 
#restartButton, 
#resetButton {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Fix for iOS input zoom */
@media screen and (max-width: 768px) {
    input[type="text"] {
        font-size: 16px;
    }
} 