* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #2a2a2a 50%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title-bomb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    vertical-align: middle;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

h3 {
    text-align: center;
    color: #555;
    margin-bottom: 15px;
}

.screen {
    display: block;
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.setup-options {
    margin: 20px 0;
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
}

.mode-option {
    display: flex;
    flex: 1;
    max-width: 250px;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-button {
    display: block;
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    border: 3px solid #667eea;
    border-radius: 12px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-option input[type="radio"]:checked + .mode-button {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.mode-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.bomb-input {
    margin: 20px 0;
    text-align: center;
}

.bomb-input label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}

.bomb-input input {
    width: 100px;
    padding: 10px;
    font-size: 1.2em;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 8px;
}

.btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

#player-info,
#single-player-info {
    text-align: center;
    margin-bottom: 20px;
}

#current-player-text,
#single-player-text {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.player-turn-text {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.info-text {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.player-section {
    margin: 20px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 15px;
    transition: background 0.3s;
}

/* Player 1 - Blue */
#player1-grid {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 3px solid #2196f3;
}

/* Player 2 - Red */
#player2-grid {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 3px solid #f44336;
}

/* Single player grid - neutral */
#single-player-grid {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 3px solid #757575;
}

.cell {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.cell:hover:not(.revealed) {
    background: #f0f0f0;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.cell.revealed {
    cursor: default;
    background: #e8e8e8;
}

.cell.bomb:not(.revealed) {
    background: #fff3e0;
    border-color: #ff9800;
}

.cell.bomb.revealed {
    background: #ffebee;
    border-color: #f44336;
}

.cell.safe {
    background: #e8f5e9;
    border-color: #4caf50;
}

.bomb-icon {
    width: 70%;
    height: 70%;
    object-fit: contain;
    display: block;
    margin: auto;
}

#game-over-screen {
    text-align: center;
}

#game-over-text {
    font-size: 2em;
    margin-bottom: 20px;
    color: #f44336;
}

#game-over-text.winner-text {
    color: #4caf50;
    font-weight: bold;
}

/* Reset button styling - smaller and positioned lower */
#reset-game-btn,
#reset-single-btn {
    width: auto;
    padding: 8px 20px;
    font-size: 0.9em;
    margin: 40px auto 10px auto;
    max-width: 200px;
    display: block;
}

/* Footer */
.footer {
    background: #1a1a1a;
    color: #ffffff;
    padding: 20px;
    margin-top: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
}

.footer-content h3 {
    color: #2196f3;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.footer-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.footer-content ul li {
    margin-bottom: 10px;
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

.footer-content ul li:before {
    content: "•";
    color: #2196f3;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.footer-note {
    text-align: center;
    font-size: 1.1em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    color: #ccc;
}

/* Footer bomb image sizing */
.footer-bomb-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

/* Small-screen inline How-to-Play panel (hidden by default) */
.how-to-play-panel.small-only {
    display: none;
}

/* Responsive: show the inline panel under the select on small screens and hide the footer */
@media (max-width: 600px) {
    .footer {
        display: none;
    }

    .how-to-play-panel.small-only {
        display: block;
        background: #1a1a1a;
        color: #ffffff;
        padding: 16px;
        margin-top: 15px;
        border-radius: 10px;
    }

    .how-to-play-panel.small-only h3 {
        color: #2196f3;
        margin-bottom: 10px;
        font-size: 1.1em;
    }

    .how-to-play-panel.small-only ul {
        list-style: none;
        padding: 0;
        margin: 0 0 10px 0;
    }

    .how-to-play-panel.small-only ul li {
        margin-bottom: 8px;
        padding-left: 18px;
        position: relative;
        line-height: 1.4;
        color: #ddd;
    }

    .how-to-play-panel.small-only ul li:before {
        content: "•";
        color: #2196f3;
        font-weight: bold;
        position: absolute;
        left: 0;
    }

    .how-to-play-panel.small-only .footer-note {
        text-align: center;
        font-size: 1em;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #333;
        color: #ccc;
    }
}

