body { font-family: 'Courier New', Courier, monospace; background-color: #000d00; color: #00ff00; margin: 0; padding: 20px; text-transform: uppercase; overflow-x: hidden; }
.grid-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.grid-wrapper { border: 2px solid #005500; padding: 10px; background: rgba(0, 10, 0, 0.8); position: relative; display: flex; flex-direction: column; align-items: center; }
.grid-title { text-align: center; color: #00ff00; font-size: 1.2em; border-bottom: 2px solid #005500; padding-bottom: 5px; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: 30px repeat(10, 30px); gap: 2px; width: max-content; margin: 0 auto; }
.cell { width: 30px; height: 30px; background-color: #002200; display: flex; align-items: center; justify-content: center; border: 1px solid #004400; font-size: 0.8em; color: #00aa00; font-weight: bold; }
.cell.header { background-color: transparent; border: none; color: #00ff00; }
.cell.ship { background-color: #006600; }
.cell.hit { background-color: #990000; color: white; }
.cell.miss { background-color: #004400; color: #555; }
.cell.opponent-target:hover { background-color: #00aa00; cursor: crosshair; }
#log { width: 100%; height: 150px; background-color: #001100; border: 2px solid #005500; color: #00cc00; font-family: 'Courier New', sans-serif; padding: 10px; overflow-y: scroll; margin-top: 20px; box-sizing: border-box; }
h1, h2 { text-align: center; color: #00ff00; text-shadow: 0 0 5px #00ff00; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: repeating-linear-gradient(0deg, rgba(0, 30, 0, 0.1) 0px, rgba(0, 30, 0, 0.1) 1px, transparent 1px, transparent 2px); pointer-events: none; z-index: 10; }
button { background-color: #00ff00; color: #000; border: none; padding: 10px 20px; cursor: pointer; font-family: inherit; text-transform: uppercase; font-weight: bold; }
button:hover { background-color: #fff; color: #000; }
button:disabled { background-color: #2f5a2f; color: #9bc39b; cursor: not-allowed; }
.board-controls { margin-top: 12px; border-top: 1px solid #005500; padding-top: 10px; width: 100%; }
.placement-status { text-align: center; margin-bottom: 10px; color: #00ff00; }
.ship-palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.ship-token { display: inline-flex; gap: 2px; align-items: center; background-color: #003700; border: 1px solid #00aa00; color: #00ff00; padding: 6px; font-size: 0.75em; user-select: none; cursor: grab; }
.ship-token:active { cursor: grabbing; }
.ship-token-segment { width: 14px; height: 14px; background-color: #00aa00; border: 1px solid #006600; }
.board-buttons { display: flex; gap: 8px; justify-content: center; }
.cell.player-drop-target { background-color: #005500; }
.cell.destroyed { box-shadow: inset 0 0 0 1px #ffcc00; }
.cell.boom { animation: boomFlash 0.55s ease-out; }
.log-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1000px, calc(100% - 24px));
    height: auto;
    max-height: 32vh;
    z-index: 30;
    box-shadow: 0 0 18px rgba(0, 255, 0, 0.35);
}

body.battle-ended::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 25;
    pointer-events: none;
}

@keyframes boomFlash {
    0% { background-color: #ffd400; box-shadow: 0 0 0 rgba(255, 212, 0, 0.9); }
    40% { background-color: #ff6a00; box-shadow: 0 0 18px rgba(255, 120, 0, 0.9); }
    100% { background-color: #990000; box-shadow: 0 0 0 rgba(255, 120, 0, 0); }
}
