body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #888;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    width: 100vw;
    /*max-width: 1000px;*/
    height: 100vh;
}

.board {
    flex: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

#center-box {
    display: flex;
    flex-direction: column;
    align-items: top; /* Center align contents */
    justify-content: center;
    width: 100%;
}

#center-box h1 {
    font-size: 3rem; /* Adjust as needed */
    font-weight: bold;
    font-variant: small-caps;
    text-align: center;
    letter-spacing: 2px;
    color: #333; /* Dark gray for readability */
}

.grid-container {
    flex: 0 0 50vw;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 1vh;
    width: 100%;
    max-width: 40vw;
    align-items: top;
}

.grid-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* Keeps squares responsive */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3vw; /* Scales with screen size */
    font-weight: bold;
    color: black;
    background-color: #E3DAC9; /* Bone color */
    border-radius: 15px;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    height: 100%; /* Ensures it takes full height of its container */
    width: 100%;
    overflow: hidden; /* Prevents overflow issues */
}

.score {
    font-size: 2vw; /* Scales with screen size */
    font-weight: bold;
    margin-bottom: 20px;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 1.5vw; /* Scales with screen size */
    margin-bottom: 10px;
}

#word-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-height: 80vh; /* Prevents overflow */
    overflow-y: auto; /* Enables scrolling */
    display: flex;
    flex-direction: column; /* Ensures single-column layout */
}

#word-list li {
    font-size: 1.5vw;
    padding: 5px 10px;
    opacity: 1;
    animation: wordEntry 0.5s ease-out; /* Applies animation */
}

@keyframes wordEntry {
    0% {
        font-size: 2.5vw; /* Starts larger */
        opacity: 0;
	color: red;
    }
    100% {
        font-size: 1.5vw; /* Shrinks to normal */
        opacity: 1;
	color: black;
    }
}

#timer {
	font-size: 2.5vw;
}

.tile.highlight {
    background-color: yellow !important;
    box-shadow: 0 0 15px yellow;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

#left-box {
    display: flex;
    flex: 0 0 25vw; /* Takes space on the left */
    max-height: 100vh; /* Limit height */
    width: 25vw;
}

/* Style for the player list container */
.player-list-container {
    flex-direction: column;
    display: none; /* Hidden during "create a game" */
    align-items: flex-start;
    padding: 20px;
    background-color: #f0f0f0;
    border-right: 2px solid #ccc;
    overflow-y: auto; /* Scroll if too many players */
}

#game-state {
    flex: 0 0 25vw; /* Takes space on the left */
    flex-direction: column;
    align-items: flex-start;
}

/* Heading style */
.player-list-container h2 {
    font-size: 1.8vw;
    margin-bottom: 10px;
}

/* Player list styles */
#player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-height: 80vh; /* Prevents overflow */
}

#player-list li {
    font-size: 1.5vw;
    padding: 5px;
    margin-bottom: 5px;
    background: white;
    border-radius: 8px;
    text-align: left;
}

#create-game-container {
    padding-top: 5vh;
}

#ready-state {
    padding-top: 5vh;
    font-size: 1.4vw;
}

#waiting-state {
    padding-top: 25vh;
    font-size: 1.5vw;
}

@keyframes randomColor {
    0% { color: red; }
    25% { color: blue; }
    50% { color: green; }
    75% { color: orange; }
    100% { color: purple; }
}

#join-code {
    font-size: 1.8vw;
    animation: randomColor 10s infinite alternate;
}

button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4A90E2, #007AFF);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    outline: none;
    position: relative;
    overflow: hidden;
}

/* 🔵 Hover State */
button:hover {
    background: linear-gradient(135deg, #007AFF, #4A90E2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* 🔘 Active (Pressed) State */
button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 🟡 Focus State */
button:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(0, 122, 255, 0.6);
}

/* ✨ Ripple Effect (Optional) */
button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.3);
    transition: transform 0.5s, opacity 0.5s;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

button:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: 0s;
}


/* ❌ Disabled State */
button:disabled,
button.disabled {
    background: #C0C0C0; /* Gray out the button */
    color: #666; /* Dim text */
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.6;
    pointer-events: none; /* Prevent clicks */
}

/* 🛑 Optional: Disabled Ripple Effect */
button:disabled::after,
button.disabled::after {
    display: none;
}

/* Gray out the background */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent gray */
    z-index: 99;
    display: none;
}

/* Game Over Screen Styling */
#game-over-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: white;
    border: 5px solid black;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    z-index: 100;
    overflow: hidden;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

/* Expanded state */
#game-over-screen.active {
    width: 60vw;
    height: 50vh;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Text Styling */
#game-over-screen h1 {
    font-size: 3vw;
    margin-bottom: 10px;
}

#game-over-screen p {
    font-size: 2vw;
    margin: 5px 0;
}

.game-summary-container {
    width: 60%;
    margin: auto;
    padding: 20px;
    background: white;
    border: 2px solid black;
    text-align: center;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid black;
    background: darkorange;
}

.tab-button:hover {
    background: gray;
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.word-list-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px;
}

.word-list {
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid gray;
    padding: 10px;
    text-align: left;
}

