body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Use min-height */
    margin: 0;
    font-family: sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw; /* Fullscreen width */
    height: 100vh; /* Fullscreen height */
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#timer, #score, #valid-colors-display, #current-animal-display {
    position: relative; /* Position relative to the flex container */
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    font-size: 1.3em;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
    /* Ensure width is based on content */
    width: fit-content;
}

#gameplay-info {
    position: absolute;
    top: 10px;
    left: 10px;
    /* Stack info items vertically */
    display: flex;
    flex-direction: column;
    gap: 5px; /* Space between info items */
    pointer-events: none; /* Allow clicks to go through to teeth */
    z-index: 5; /* Make sure it is above mouth but below overlays */
}

#valid-colors-display {
    /* Already a flex container, just ensure alignment */
    align-items: center;
}

#valid-colors-display span {
    margin-right: 8px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-left: 5px;
    display: inline-block; /* Or use flex inside the parent */
}

#mouth {
    position: absolute;
    /* Center the mouth area */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Define size for the teeth circle */
    width: 350px; /* Adjust size as needed */
    height: 350px;
    /* Remove visual styling */
    background-color: transparent;
    border: none;
    /* Ensure child teeth can be positioned absolutely within */
    display: block; /* Or position: relative; */
    box-sizing: border-box;
}

.tooth {
    position: absolute; /* Positioned by JS */
    width: 40px; /* Fixed size for teeth */
    height: 50px;
    background-color: white;
    border: 1px solid black;
    margin: 0; /* Remove margin */
    border-radius: 2px 2px 5px 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tooth.bad.green {
    background-color: #228B22; /* Forest Green */
}

.tooth.bad.blue {
    background-color: #0000CD; /* Medium Blue */
}

.tooth.bad.red {
    background-color: #DC143C; /* Crimson */
}

.tooth.bad.yellow {
    background-color: #FFD700; /* Gold */
}

/* Style for the brief black flash when a valid tooth is clicked */
.tooth.clicked-valid {
    background-color: black !important; /* Override other colors */
    transition: none !important; /* Prevent transition during flash */
}

.tooth.pulled {
    opacity: 0.3;
    pointer-events: none; /* Cannot click pulled teeth */
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 10px; /* Match container radius */
}

#game-over h2 {
    margin-bottom: 10px;
}

#game-over p {
    margin-bottom: 20px;
}

#restart-button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
}

.hidden {
    display: none !important; /* Add !important for higher specificity */
}

/* Basic Mouth Closed State (simple overlay) */
#t-rex.closed #mouth {
    height: 10%; /* Make mouth smaller */
    background-color: #A0522D; /* Same as head */
    border-top: 3px solid #663300;
}

#t-rex.closed .tooth {
    display: none; /* Hide teeth when mouth is closed */
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 10px; /* Match container radius */
    z-index: 10; /* Ensure it's above other elements */
}

#start-screen h2 {
    margin-bottom: 20px;
    font-size: 2em;
}

#start-button {
    padding: 15px 30px;
    font-size: 1.5em;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
}

/* Style for Round Clear Screen */
#round-clear-screen {
    position: absolute;
    /* Ensure it covers the new container */
    inset: 0; /* top, right, bottom, left = 0 */
    background-color: rgba(0, 100, 0, 0.85); /* Darker Green */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 10px;
    z-index: 20; /* Above everything else */
}

#round-clear-screen h2 {
    margin-bottom: 15px;
    font-size: 2.5em;
}

#round-clear-screen p {
    font-size: 1.5em;
    margin: 5px 0;
}

/* Styles for Orientation Warning */
#orientation-warning {
    position: fixed; /* Cover viewport */
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: none; /* Hidden by default (in landscape) */
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    padding: 20px;
    z-index: 100; /* Above everything */
}

/* Media Query for Portrait Orientation */
@media (orientation: portrait) {
    #orientation-warning {
        display: flex; /* Show the warning in portrait */
    }
    #game-container {
        display: none; /* Hide the game container in portrait */
    }
}

/* Styles for Persistent Buttons */
#persistent-buttons {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 50; /* Above game elements, below overlays like game over */
    display: flex;
    gap: 10px;
}

#persistent-buttons button {
    padding: 8px 15px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
}

#persistent-buttons button:hover {
    background-color: rgba(220, 220, 220, 0.9);
} 