body {
    background:
        radial-gradient(circle at 14% 12%, rgba(250, 204, 21, 0.18), transparent 40%),
        radial-gradient(circle at 86% 82%, rgba(14, 116, 144, 0.22), transparent 38%),
        linear-gradient(145deg, #f4fbff, #e9f4f8);
    margin: 0;
    color: #2e3a44;
    line-height: 1.6;
}

main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

#game-section {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 2.2rem;
    margin-bottom: 3rem;
}

.planes-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.3rem;
}

.planes-status {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    color: #1f3646;
}

.planes-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.planes-difficulty-controls {
    justify-content: center;
}

.planes-difficulty-under-board {
    margin-top: 0.2rem;
}

.planes-difficulty-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #365167;
    white-space: nowrap;
}

.planes-btn {
    border: none;
    background: linear-gradient(135deg, #1d7874, #0d3b66);
    color: #ffffff;
    padding: 0.58rem 0.92rem;
    border-radius: 10px;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.planes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 59, 102, 0.24);
}

.planes-btn.is-alt {
    background: #ffffff;
    color: #153041;
    border: 1px solid #8ecae6;
    font-weight: 600;
}

.planes-btn.is-alt.active {
    border: none;
    background: linear-gradient(135deg, #1d7874, #0d3b66);
    color: #ffffff;
    font-weight: 700;
}

.planes-layout {
    width: auto;
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 0.9rem;
    align-items: start;
}

.board-card {
    border: 1px solid #dce9f3;
    border-radius: 14px;
    background: linear-gradient(160deg, #fafdff, #f2f8ff);
    padding: 0.72rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.board-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f3551;
}

.board-meta {
    font-size: 0.85rem;
    color: #4a6477;
    font-weight: 600;
}

.board {
    --cell-size: clamp(18px, 2.2vw, 30px);
    display: grid;
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows: repeat(10, var(--cell-size));
    width: fit-content;
    border: 2px solid #7698b5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(10, 40, 68, 0.16);
    background: #d7e9f9;
}

.cell {
    border: 1px solid rgba(81, 125, 164, 0.34);
    width: var(--cell-size);
    height: var(--cell-size);
    padding: 0;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f4fbff, #e7f2ff);
    touch-action: manipulation;
}

.cell.player-ship {
    background: linear-gradient(180deg, #99dcff, #5bb5e8);
}

.cell.player-head {
    background: linear-gradient(180deg, #ffd08a, #f59e0b);
}

.cell.enemy-unknown {
    cursor: crosshair;
}

.cell.enemy-unknown:hover {
    background: linear-gradient(180deg, #dceeff, #cde4fb);
}

.cell.shot-miss::after {
    content: '';
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: #7a8ea2;
}

.cell.shot-hit::after {
    content: '';
    width: 72%;
    height: 72%;
    border-radius: 8px;
    background: linear-gradient(180deg, #ff9b9b, #dc2626);
    box-shadow: 0 2px 6px rgba(130, 20, 20, 0.4);
}

.cell.shot-head::after {
    content: '';
    width: 74%;
    height: 74%;
    border-radius: 8px;
    background: linear-gradient(180deg, #ff9b9b, #dc2626);
    box-shadow: 0 2px 6px rgba(130, 20, 20, 0.4);
}

.cell.ai-hit::before,
.cell.ai-head::before,
.cell.ai-miss::before {
    content: '';
    position: absolute;
    inset: 18%;
    border-radius: 50%;
}

.cell.ai-hit::before {
    background: #ef4444;
}

.cell.ai-head::before {
    background: #ef4444;
}

.cell.ai-miss::before {
    background: #7a8ea2;
}

.cell.ai-last-shot {
    box-shadow: inset 0 0 0 2px rgba(255, 196, 64, 0.95), 0 0 12px rgba(255, 166, 0, 0.55);
    z-index: 2;
    animation: aiLastShotPulse 1.3s ease-in-out infinite;
}

@keyframes aiLastShotPulse {
    0% {
        box-shadow: inset 0 0 0 2px rgba(255, 196, 64, 0.95), 0 0 8px rgba(255, 166, 0, 0.45);
    }
    50% {
        box-shadow: inset 0 0 0 2px rgba(255, 214, 120, 1), 0 0 18px rgba(255, 166, 0, 0.75);
    }
    100% {
        box-shadow: inset 0 0 0 2px rgba(255, 196, 64, 0.95), 0 0 8px rgba(255, 166, 0, 0.45);
    }
}

.legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: #3c5567;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-chip {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-ship { background: #66bde9; }
.legend-head { background: #f59e0b; }
.legend-hit { background: #dc2626; }
.legend-miss { background: #7a8ea2; }

.info-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2.4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-section-centered {
    display: block;
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #003366;
    margin-top: 0;
    margin-bottom: 1.3rem;
}

.info-card h4 {
    font-size: 1.25rem;
    color: #005f9e;
    margin-bottom: 0.5rem;
}

.info-card p,
.info-card li {
    color: #343a40;
}

.info-card ul {
    padding-left: 20px;
}

.internal-nav {
    text-align: center;
    margin-bottom: 3rem;
}

.internal-nav h3 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #003366;
    margin-top: 0;
    margin-bottom: 2rem;
}

.game-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.game-btn {
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    color: #343a40;
    text-decoration: none;
}

.game-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.game-btn img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.game-btn span {
    font-size: 1.25rem;
    font-weight: 600;
}

@media (max-width: 1080px) {
    .planes-layout {
        grid-template-columns: 1fr;
        width: 100%;
        justify-content: stretch;
    }

    .board-card {
        width: fit-content;
        margin: 0 auto;
    }
}

@media (max-width: 992px) {
    .info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main {
        padding: 2rem 1rem;
    }

    #game-section,
    .info-section {
        padding: 1.4rem;
    }

    .board {
        --cell-size: clamp(24px, 6.1vw, 32px);
    }

    .legend {
        grid-template-columns: repeat(2, minmax(0, auto));
    }
}

@media (max-width: 460px) {
    .planes-toolbar {
        gap: 0.45rem;
    }

    .planes-btn {
        font-size: 0.86rem;
        padding: 0.5rem 0.68rem;
    }

    .board {
        --cell-size: clamp(21px, 7.3vw, 28px);
    }
}
