/* Base styles for body, container, and modal */
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: background-color 0.3s ease; /* Smooth theme transition */
}

/* Light Mode Base Colors */
body {
    background-color: #f0f4f8; /* Very light blue-gray */
}
.game-container {
    background-color: #ffffff;
    color: #2c3e50; /* Darker text for light mode */
}
.game-container h1, .game-container h2 {
    color: #2c3e50; /* Ensure headings are dark */
}
.modal-content {
    background-color: #ffffff;
}
.modal-content p {
    color: #2c3e50;
}
.player-name-input {
    background-color: #ffffff;
    color: #212121;
    border-color: #bdbdbd;
}
input[type="text"] {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
    background-color: #fcfcfc;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
    outline: none;
}


/* Dark Mode Base Colors */
body.dark {
    background-color: #212121; /* Dark background */
}
body.dark .game-container {
    background-color: #2c2c2c; /* Slightly lighter dark for container */
    color: #e0e0e0; /* Light text for dark mode */
}
body.dark .game-container h1, body.dark .game-container h2 {
    color: #e0e0e0; /* Ensure headings are light */
}
body.dark .modal-content {
    background-color: #3a3a3a;
}
body.dark .modal-content p {
    color: #e0e0e0;
}
body.dark .player-name-input {
    background-color: #4a4a4a;
    color: #f5f5f5;
    border-color: #546e7a;
}
body.dark input[type="text"] {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #546e7a;
}
body.dark input[type="text"]:focus {
    border-color: #5c6bc0;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.3);
}


.game-container {
    border-radius: 1.5rem; /* More rounded */
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* Stronger shadow */
    padding: 2.5rem; /* More padding */
    text-align: center;
    width: 100%;
    max-width: 480px; /* Slightly wider for better layout */
    position: relative; /* For theme toggle positioning */
}

/* Action Buttons (Create Game, Join Game, Reset Game, Mode Buttons) */
.action-button, .reset-button, .mode-button {
    color: #ffffff;
    padding: 0.85rem 1.8rem; /* More padding */
    border-radius: 1rem; /* More rounded */
    font-size: 1.25rem; /* Larger font */
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 10px -2px rgba(0, 0, 0, 0.15), 0 3px 6px -2px rgba(0, 0, 0, 0.1); /* Stronger shadow */
    display: inline-block;
    margin: 0.6rem; /* Adjusted margin */
}

.action-button:hover, .reset-button:hover, .mode-button:hover {
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 8px 12px -3px rgba(0, 0, 0, 0.2), 0 5px 8px -3px rgba(0, 0, 0, 0.15);
}

.action-button:active, .reset-button:active, .mode-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.1), 0 2px 3px -1px rgba(0, 0, 0, 0.08);
}

/* Specific button colors */
.reset-button {
    background-color: #4caf50; /* Green */
}
.reset-button:hover {
    background-color: #43a047;
}
.mode-button {
    background-color: #2196f3; /* Blue */
}
.mode-button:hover {
    background-color: #1976d2;
}
.action-button.bg-green-600 { /* Create New Game */
    background-color: #4caf50;
}
.action-button.bg-green-600:hover {
    background-color: #43a047;
}
.action-button.bg-purple-600 { /* Join Game */
    background-color: #9c27b0;
}
.action-button.bg-purple-600:hover {
    background-color: #8e24aa;
}
.action-button.bg-blue-600 { /* Send Chat */
    background-color: #2196f3;
}
.action-button.bg-blue-600:hover {
    background-color: #1976d2;
}
.back-button.bg-red-500 { /* Leave Game */
    background-color: #f44336;
}
.back-button.bg-red-500:hover {
    background-color: #e53935;
}
.back-button.bg-gray-600 { /* Exit Spectator Mode */
    background-color: #616161;
}
.back-button.bg-gray-600:hover {
    background-color: #424242;
}


/* Back Button */
.back-button {
    background-color: #757575; /* Gray */
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 1.2rem;
    box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
}

.back-button:hover {
    background-color: #616161;
    transform: translateY(-1px);
}
.back-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 0.5px 1px -1px rgba(0, 0, 0, 0.06);
}

/* Custom Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    padding: 2.5rem; /* More padding */
    border-radius: 1rem; /* More rounded */
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
    width: 400px; /* Wider modal */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .game-container {
        padding: 1.5rem;
        max-width: 95%;
    }
    .action-button, .reset-button, .mode-button {
        padding: 0.7rem 1.4rem;
        font-size: 1.1rem;
        margin: 0.4rem;
    }
}
