/* Basic reset and mobile setup */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a202c; /* Dark blue-grey background */
    color: white;
    overflow: hidden;
}

/* --- CORE SCREEN VISIBILITY LOGIC --- */
.screen {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-sizing: border-box;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* --- Join Screen Styles --- */
.content-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #a0aec0;
    margin-bottom: 8px;
    text-transform: uppercase;
}

input[type="text"] {
    font-size: 1.25rem;
    padding: 15px;
    border: none;
    background-color: #2d3748;
    color: white;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: bold;
}

input[type="text"]::placeholder {
    color: #718096;
    font-weight: bold;
}

.pfp-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

input[type="file"] {
    display: none;
}

.pfp-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #4A709D;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1rem;
    transition: background-color: 0.1s ease;
}

.pfp-label:hover {
    background-color: #5a80c0;
}

.pfp-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #D4B268;
    object-fit: cover;
    background-color: #3e4c5b;
}

button {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background-color: #4A709D;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background-color: 0.1s ease;
}

button:hover:not(:disabled) {
    background-color: #5a80c0;
}

button:disabled {
    background-color: #2d3748;
    color: #a0aec0;
    cursor: not-allowed;
}


#error-message {
    color: #e53e3e;
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
}


/* --- Board Screen Styles --- */
#board-screen {
    justify-content: center;
    padding: 10px;
}

#player-name-board {
    font-size: 1.5rem;
    text-transform: uppercase;
    color: #a0aec0;
    margin: 0 0 15px 0;
    text-align: center;
    width: 100%;
}

#player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    padding: 5px 10px;
    background-color: #2d3748;
    border-radius: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

#player-pfp {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #D4B268;
}

#player-score {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

#board-grid {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

#category-container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 5px;
    margin-bottom: 5px;
}

.category-label {
    background-color: #22365B;
    padding: 10px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 0.7rem;
    border-radius: 4px;
    text-transform: uppercase;
}

#grid-container {
    display: grid;
    gap: 5px;
}

.word-button {
    background-color: #4A709D;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 15px 5px;
    font-size: 1.2rem;
    font-weight: bold;
}

.word-button:disabled {
    background-color: #1a202c;
    color: #4A709D;
}


/* --- Buzzer Overlay Styles --- */
#buzzer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#buzzer-overlay.hidden {
    display: none;
}

#buzzer-overlay #buzzer-button {
    width: 80vw;
    height: 80vw;
    max-width: 400px;
    max-height: 400px;
    border-radius: 50%;
    font-size: 3rem;
    padding: 20px;
    margin: 0;
}

#buzzer-overlay #buzzer-button:disabled {
    background-color: #2d3748;
    color: #718096;
}

/* --- NEW: Game Over Screen Styles --- */
#game-over-message {
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
}

#game-over-message.win {
    color: #D4B268; /* Gold color for winning */
}

#game-over-message.lose {
    color: #a0aec0; /* Grey color for losing */
}


/* --- Responsive Styles for Mobile --- */
@media (max-width: 600px) {
    .category-label {
        font-size: 0.6rem;
        padding: 8px 2px;
        word-break: break-all;
    }

    .word-button {
        font-size: 1rem;
        padding: 12px 5px;
    }
}
