/* battleship.css */

.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

.bs-grid {
    display: grid;
    grid-template-columns: 24px repeat(10, 1fr);
    grid-template-rows: 24px repeat(10, 1fr);
    gap: 1px;
    aspect-ratio: 11 / 11;
    width: 100%;
    max-width: 380px;
    background: #1e293b;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.25);
}
.bs-label {
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bs-cell {
    background: linear-gradient(135deg, #0c4a6e, #082f49);
    border: 1px solid #0c4a6e;
    border-radius: 2px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    font-size: 18px;
    line-height: 1;
}
/* Свій корабель */
.bs-cell.ship {
    background: linear-gradient(135deg, #475569, #1e293b);
    border-color: #94a3b8;
}
.bs-cell.miss {
    background: linear-gradient(135deg, #0369a1, #075985);
}
.bs-cell.miss::after {
    content: '•';
    color: #bae6fd;
    font-size: 26px;
    line-height: 0;
}
.bs-cell.hit {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}
.bs-cell.hit::after {
    content: '✕';
    color: #fef2f2;
    font-weight: 900;
    font-size: 20px;
}
.bs-cell.sunk {
    background: linear-gradient(135deg, #7f1d1d, #450a0a);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}
.bs-cell.sunk::after {
    content: '☠';
    color: #fecaca;
    font-size: 18px;
}
.bs-cell.last-shot {
    box-shadow: 0 0 0 3px #fbbf24, 0 0 12px rgba(251, 191, 36, 0.6);
    z-index: 1;
}
.bs-cell.targetable {
    cursor: crosshair;
}
.bs-cell.targetable:hover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: inset 0 0 8px rgba(255,255,255,0.3);
}

/* --- Режим розстановки --- */
.bs-cell.placement-picked {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    border-color: #fef3c7;
    box-shadow: 0 0 0 2px #fbbf24, 0 0 10px rgba(251, 191, 36, 0.6);
    z-index: 1;
}
.bs-cell.placement-pickable {
    cursor: pointer;
}
.bs-cell.placement-pickable:hover {
    filter: brightness(1.3);
}
.bs-cell.placement-droppable {
    cursor: pointer;
}
.bs-cell.placement-droppable:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(22, 163, 74, 0.5));
    box-shadow: inset 0 0 6px rgba(34, 197, 94, 0.8);
}

/* Мобільна адаптація — менший шрифт у клітинках */
@media (max-width: 480px) {
    .bs-cell { font-size: 14px; }
    .bs-cell.miss::after { font-size: 20px; }
    .bs-cell.hit::after { font-size: 14px; }
    .bs-cell.sunk::after { font-size: 14px; }
    .bs-label { font-size: 9px; }
    .bs-grid { padding: 4px; gap: 1px; }
}

/* Mini кораблі-індикатори у списку */
.fleet-ship {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
}
.fleet-ship .cell {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #94a3b8, #475569);
    border: 1px solid #cbd5e1;
    border-radius: 2px;
}
.fleet-ship.sunk .cell {
    background: linear-gradient(135deg, #7f1d1d, #450a0a);
    border-color: #fecaca;
    opacity: 0.5;
}
