body {
    text-align: center;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #24056d, #7213ca);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.back-btn, #reset-game  {
    display: inline-block;
    padding: 12px 24px;
    background: #6b0707;
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.MainGrid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    flex: 1;
}

.Container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.Container:hover {
    transform: translateY(-5px);
}

.Container.header h1 {
    color: #2c3e50;
    font-size: 2.8em;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#menu h2, #menu h3 {
    color: #34495e;
    margin: 15px 0;
    font-weight: 700;
}

#game-mode, #play-on {
    padding: 10px;
    font-size: 1.1em;
    border-radius: 8px;
    border: 1px solid #bdc3c7;
    background: #ecf0f1;
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
    transition: border-color 0.3s ease;
}

#game-mode:focus, #play-on:focus {
    border-color: #3498db;
    outline: none;
}

#start-game{
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: none;
    padding: 12px 25px;
    color: white;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    margin: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

#start-game:hover, #reset-game:hover, .back-btn:hover {
    background: linear-gradient(45deg, #c0392b, #a93226);
    transform: scale(1.05);
}

#status-bar {
    background: rgba(236, 240, 241, 0.8);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#current-player, #player-info {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.2em;
    margin: 5px;
}

#current-player .player-color, #player-info span {
    vertical-align: middle;
    margin-right: 8px;
}

table {
    margin: 0 auto;
    border-collapse: collapse;
    background: #3498db;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%; /* Ensure table fits container */
    max-width: 100%; /* Prevent overflow */
}

th, td {
    border: 2px solid #2980b9;
    padding: 6px; /* Reduced padding for mobile */
}

th {
    background: #2980b9;
    font-weight: 700;
    color: white;
}

th button {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: none;
    padding: 8px 15px;
    color: white;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

th button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

th button:hover:not(:disabled) {
    background: linear-gradient(45deg, #c0392b, #a93226);
    transform: scale(1.05);
}

.Yellow, .Red, .Grey {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.Yellow {
    background-color: #f1c40f;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.Red {
    background-color: #e74c3c;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.Grey {
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.Grey:hover {
    background-color: #dfe6e9;
    transform: scale(1.1);
}

footer {
    margin-top: auto;
    padding: 10px;
    color: #34495e;
    font-size: 1em;
}
