/* Игра */
.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.turn-indicator {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}
.turn-indicator.enemy {
  color: var(--danger);
}
.turn-phase {
  font-size: 13px;
  color: var(--text-dim);
}
.turn-number {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 700;
}

/* Доски */
.game-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex-shrink: 0;
  justify-items: center;
}



.board-wrapper {
  text-align: center;
  position: relative;

}
.game-boards .board-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 0;
  font-weight: 800;
  text-align: left;
}
.game-boards .board-label:nth-child(2) {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 0;
  font-weight: 800;
  text-align: right;
}

.board {
  display: grid;
  grid-template-columns: repeat(13, var(--cell-size));
  grid-template-rows: repeat(9, var(--cell-size));
    position:relative;
    display:grid;
    gap:var(--cell-gap);
    padding: var(--board-padding);
    border-radius:8px;
    background:
        linear-gradient(
            135deg,
            #0e2239,
            #08131f
        );
    border:1px solid rgba(82,132,184,.28);
}

.cell{
    position:relative;
    width:var(--cell-size);
    height:var(--cell-size);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    user-select:none;
    border-radius:4px;
    border:1px solid rgba(67,113,166,.32);
    background:
        linear-gradient(
            180deg,
            var(--water-light),
            var(--water-mid) 42%,
            var(--water-deep)
        );
	transition: all 0.1s ease;
}


.cell:hover{
    transform:translateY(-1px);
	border-width: 2px;
    border-color:rgba(95,185,255,.50);
		transition: all 0.1s ease;
}



.cell:active{
    transform:translateY(0);
		transition: all 0.1s ease;
}


.cell .ship-icon-overlay {
  font-size: calc(var(--cell-size) * 0.5);
  pointer-events: none;
  z-index: 7;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  opacity: 0.9;
  line-height: 1;
  position: relative;
}

.cell.ship-light-dmg .ship-icon-overlay,
.cell.ship-heavy-dmg .ship-icon-overlay {
  opacity: 0.5;
}

/* СВЕЧЕНИЕ БРОНИ */
.cell.has-armor {
  box-shadow: inset 0 0 8px rgba(130,200,255,0.7), 0 0 8px rgba(130,200,255,0.5);
  animation: shot-marker-ring 2.5s ease-in-out infinite;
filter: brightness(1.15);
    border-width: 2px;
    border-color: rgba(130, 200, 255, 0.5);
}
@keyframes armor-glow {
  0%, 100% { box-shadow: inset 0 0 6px rgba(130,200,255,0.6), 0 0 6px rgba(130,200,255,0.4); }
  50% { box-shadow: inset 0 0 12px rgba(130,200,255,0.9), 0 0 12px rgba(130,200,255,0.7); }
}

/* МАРКЕР ВЫСТРЕЛА */
.cell.shot-marker {
  animation: shot-marker-pulse 1.5s ease-in-out ;
}
.cell.shot-marker::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  border: 1px solid #ffaa00;
  z-index: 9;
  pointer-events: none;
  animation: shot-marker-ring 1.5s ease-in-out infinite;
}
@keyframes shot-marker-pulse {
  0%, 100% { box-shadow: inset 0 0 4px rgba(255,170,0,0.3); }
  50% { box-shadow: inset 0 0 8px rgba(255,170,0,0.6); }
}
@keyframes shot-marker-ring {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ТУМАН 
.cell.fog {
  background: var(--cell-fog);
  cursor: pointer;
}
.cell.fog::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 2px;
  background: 
    radial-gradient(circle at 30% 30%, rgba(200,215,230,0.5) 0%, rgba(130,155,180,0.65) 40%, rgba(50,70,100,0.8) 100%);
  pointer-events: none;
  z-index: 4;
}
.cell.fog:hover {
  background: #354868;
}*/
.cell.fog{

    background:
        radial-gradient(circle at 50% 30%,
            rgba(255,255,255,.08),
            rgba(255,255,255,0) 38%),

        linear-gradient(
            180deg,
            #304054,
            #27384b 45%,
            #1c2938
        );


}

.cell.fog::after{

    content:"";

    position:absolute;
    inset:0;

    background:
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,.025) 0px,
            rgba(255,255,255,.025) 4px,
            transparent 4px,
            transparent 8px
        );

    pointer-events:none;
}


.cell.fog-revealed {
  background: var(--cell-fog-revealed);
  background-image: url('../img/abilities/miss.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}


/* РАЗВЕДКА — зелёная (чисто) */
.cell.recon-highlight-clear {
  /*box-shadow: inset 0 0 0 3px rgba(46,204,113,0.9), 0 0 12px rgba(46,204,113,0.5);*/
  animation: shot-marker-ring 1.5s ease-in-out infinite;
   	filter: brightness(1.1);
        border-width: 2px;
        border-color: rgba(46, 204, 113, 0.9);
}
@keyframes recon-pulse-clear {
  0%, 100% { box-shadow: inset 0 0 0 3px rgba(46,204,113,0.9), 0 0 12px rgba(46,204,113,0.5); }
  50% { box-shadow: inset 0 0 0 5px rgba(46,204,113,1), 0 0 20px rgba(46,204,113,0.8); }
}

/* РАЗВЕДКА — красная (враг) */
.cell.recon-highlight-danger {
  /*box-shadow: inset 0 0 0 3px rgba(255,60,40,0.9), 0 0 12px rgba(255,60,40,0.5);*/
   	filter: brightness(1.1);
        border-width: 2px;
        border-color: rgba(255,60,40, 0.9);
  animation: shot-marker-ring 1.2s ease-in-out infinite;
}
@keyframes recon-pulse-danger {
  0%, 100% { box-shadow: inset 0 0 0 3px rgba(255,60,40,0.9), 0 0 12px rgba(255,60,40,0.5); }
  50% { box-shadow: inset 0 0 0 5px rgba(255,60,40,1), 0 0 20px rgba(255,60,40,0.8); }
}

/* КОРАБЛЬ */
.cell.ship-intact {
  /*background: var(--cell-ship);*/
  background: #243550;
}
/*.cell.ship-intact{

    background:
        linear-gradient(
            180deg,
            #647789,
            #46596c 16%,
            #2b3946
        );
}*/






/* ИКОНКИ СОСТОЯНИЙ */
.cell.ship-light-dmg::after,
.cell.ship-heavy-dmg::after,
.cell.ship-destroyed::after,
.cell.hit-armor-icon::after,
.cell.ship-light-hit::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cell-size) * 0.55);
  pointer-events: none;
}

/* ЛЁГКИЙ ДЫМ — 💨 */
.cell.ship-light-dmg {
  background: var(--cell-ship-light-dmg);
    z-index: 10;
}
.cell.ship-light-dmg::after {
  content: '';
  background-image: url('../img/abilities/hit_light.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  animation: light-smoke 2.5s ease-out infinite;
}
@keyframes light-smoke {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

/* ТЯЖЁЛЫЙ ДЫМ — 💥 */
.cell.ship-heavy-dmg {
  background: var(--cell-ship-heavy-dmg);
    z-index: 10;
}
.cell.ship-heavy-dmg::after {
  content: '';
  background-image: url('../img/abilities/hit_big.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  animation: heavy-smoke 1.8s ease-out infinite;
}
@keyframes heavy-smoke {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

/* УНИЧТОЖЕН — 💀 */
.cell.ship-destroyed {
  background: var(--cell-ship-destroyed);
  
      z-index: 10;
 /* 
 box-shadow: inset 0 0 12px var(--fire-glow), 0 0 6px var(--fire-glow);
 animation: fire-flicker 0.2s ease-in-out infinite alternate;*/
}
.cell.ship-destroyed::after {
  content: '';
  background-image: url('../img/abilities/hit_dead.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  /* animation: fire-blaze 0.8s ease-out 2s;*/
}
.cell.ship-destroyed .ship-icon-overlay {
  opacity: 0;
}
@keyframes fire-blaze {
  0%, 100% { opacity: 0.8; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes fire-flicker {
  from { box-shadow: inset 0 0 10px var(--fire-glow), 0 0 4px var(--fire-glow); }
  to { box-shadow: inset 0 0 20px var(--fire-glow), 0 0 12px var(--fire); }
}

/* ЗНАЧОК БРОНИ ПРИ ПОПАДАНИИ — 🛡️ */
.cell.hit-armor-icon::after {
  content: '';
  background-image: url('../img/abilities/hit_armor.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  
  animation: armor-flash 2s ease-out;
}
@keyframes armor-flash {
  0% { opacity: 0.6; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* СЛАБОЕ ПОПАДАНИЕ (0.5 урона) — пульсирующий красный */
.cell.ship-light-hit {
  background: var(--cell-ship-light-dmg);
  box-shadow: inset 0 0 10px rgba(255,60,40,0.6), 0 0 8px rgba(255,60,40,0.3);
  animation: shot-marker-ring 1.5s ease-in-out infinite;
}
@keyframes light-hit-pulse {
  0%, 100% { box-shadow: inset 0 0 8px rgba(255,60,40,0.5), 0 0 6px rgba(255,60,40,0.2); }
  50% { box-shadow: inset 0 0 16px rgba(255,60,40,0.9), 0 0 14px rgba(255,60,40,0.5); }
}

.cell.mine {
   background: var(--cell-mine);
  background-image: url('../img/abilities/mine.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
}
/*.cell.mine::after {
  content: '💣';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cell-size) * 0.5);
  z-index: 7;
  pointer-events: none;
}*/

/* Подсветки */
.cell.highlight-valid {
  /*box-shadow: 0 0 0 1px var(--success), 0 0 14px rgba(46,204,113,0.5);
  cursor: pointer;
  animation: pulse-valid 1.2s ease-in-out infinite;*/
	filter: brightness(1.1);
        border-width: 1px;
        border-color: rgba(46, 204, 113, 0.9);
}
.cell.highlight-target {
  /*box-shadow: 0 0 0 1px var(--danger), 0 0 14px rgba(231,76,60,0.5);*/
  	filter: brightness(1.1);
        border-width: 1px;
        border-color: rgba(231,76,60, 0.6);
  cursor: pointer;
}
.cell.highlight-hover {
      filter:brightness(1.1);
border-width: 2px;
    border-color:rgba(95,185,255,.50);
  animation: none;
}
.cell.selected {
  /*box-shadow: 0 0 0 2px white, 0 0 16px rgba(255,255,255,0.6);*/
      filter: brightness(1.1);
    border-width: 2px;
    border-color: rgba(255, 255, 255, .90);
}
@keyframes pulse-valid {
  0%, 100% { box-shadow: 0 0 0 2px var(--success), 0 0 14px rgba(46,204,113,0.5); }
  50% { box-shadow: 0 0 0 4px var(--success), 0 0 22px rgba(46,204,113,0.7); }
}

/* Анимация выстрела */
.cell.shot-animation {
  animation: shot-flash 0.8s ease-out;
}
.cell.shot-animation::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 6px;
  border: 3px solid var(--danger);
  z-index: 15;
  pointer-events: none;
  animation: shot-ring 0.8s ease-out forwards;
}
@keyframes shot-flash {
  0% { background: rgba(255,200,50,0.9); }
  100% { background: transparent; }
}
@keyframes shot-ring {
  0% { transform: scale(0.8); opacity: 1; border-color: #ffdd44; }
  100% { transform: scale(1.4); opacity: 0; border-color: var(--danger); }
}

.cell.hit-animation {
  animation: hit-shake 0.9s ease-out;
}
.cell.hit-animation::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 6px;
  border: 3px solid #ff4422;
  z-index: 15;
  pointer-events: none;
  animation: hit-blast 0.9s ease-out forwards;
}
@keyframes hit-shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-3px); }
  20% { transform: translateX(3px); }
  30% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  50% { transform: translateX(-1px); }
  60% { transform: translateX(1px); }
}
@keyframes hit-blast {
  0% { transform: scale(0.5); opacity: 1; border-color: #ffaa00; }
  100% { transform: scale(1.8); opacity: 0; border-color: #ff2200; }
}

.cell.miss-animation {
  animation: miss-fade 0.6s ease-out;
}
.cell.miss-animation::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 5px;
  border: 2px solid #8899aa;
  z-index: 15;
  pointer-events: none;
  animation: miss-ring 0.6s ease-out forwards;
}
@keyframes miss-fade {
  0% { background: rgba(150,170,190,0.5); }
  100% { background: transparent; }
}
@keyframes miss-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 0; }
}

.cell.ability-animation {
  animation: ability-glow 1s ease-out;
}
.cell.ability-animation::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 7px;
  border: 3px solid var(--accent);
  z-index: 15;
  pointer-events: none;
  animation: ability-ring 1s ease-out forwards;
}
@keyframes ability-glow {
  0% { background: rgba(59,139,235,0.7); box-shadow: 0 0 20px var(--accent-glow); }
  100% { background: transparent; box-shadow: none; }
}
@keyframes ability-ring {
  0% { transform: scale(0.7); opacity: 1; border-color: var(--accent); }
  100% { transform: scale(1.6); opacity: 0; border-color: #88bbff; }
}

/* Всплывающие подсказки на клетках */
.cell-float {
  position: absolute;
  pointer-events: none;
  z-index: 125;
  font-weight: 800;
  font-size: 13px;
  text-shadow: none;
  white-space: nowrap;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  transition: opacity 0.8s, transform 0.8s;
}
.cell-float.hit { color: #ffdd44; }
.cell-float.miss { color: #aabbcc; }
.cell-float.destroyed { color: #ff4422; font-size: 15px; }
.cell-float.armor { color: #88bbdd; }



/* Панель способностей */
.abilities-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 10px 8px;
  margin-bottom: 2px;
  margin-top: 6px;
  flex-shrink: 0;
}
.abilities-panel h4 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.abilities-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ability-block {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.ability-block {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 210px;
  min-height: 150px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ability-block .ability-block-header .ability-block-icon img{
height:52px;
object-fit:contain;
border-radius: 5px;
}
.ability-block:hover {
  border-color: var(--accent);
  background: #1a2540;
}
.ability-block.deploy-only.hidden {
  display: none;
}
.ability-block.on-cooldown {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: transparent;
}
.ability-block.on-cooldown:hover {
  border-color: transparent;
  background: var(--bg);
}
.ability-block.selected-ability {
  border-color: var(--accent);
  background: #1a3050;
}
.ability-block .ability-block-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ability-block .ability-block-icon {
  font-size: 20px;
}
.ability-block .ability-block-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.ability-block .ability-block-type {
  font-size: 11px;
  color: var(--accent);
  background: rgba(59,139,235,0.15);
  padding: 1px 6px;
  border-radius: 8px;
  align-self: flex-start;
}
.ability-block .ability-block-cd {
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}
.ability-block .ability-block-cd.ready {
  color: var(--success);
}
.ability-block .ability-block-cd.waiting {
  color: var(--warning);
}
.ability-block .ability-block-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.3;
}
.ability-block .ability-block-source {
  font-size: 11px;
  color: #cdd0d3;
  font-style: italic;
  margin-top: 2px;
}

/* Инфо о действии */
.action-info {
  text-align: center;
  font-size: 16px;
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 700;
}

/* История боя */
.battle-log {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-top: 4px;
  margin-bottom: 0;
  flex-shrink: 0;
  max-height: 170px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.battle-log h4 {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.battle-log-entries {
  padding: 4px 12px;
  overflow-y: auto;
  flex: 1;
  
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.battle-log-entries::-webkit-scrollbar {
  width: 5px;
}
.battle-log-entries::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
.battle-log-entries::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.battle-log-entries::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.battle-log-entry {
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  line-height: 1.4;
}
.battle-log-entry:last-child {
  border-bottom: none;
}
.battle-log-entry .log-turn {
  color: var(--accent);
  font-weight: 600;
  margin-right: 6px;
}
.battle-log-entry .log-hit {
  color: #ffcc00;
}
.battle-log-entry .log-miss {
  color: #8899aa;
}
.battle-log-entry .log-destroyed {
  color: #ff4422;
  font-weight: 700;
}
.battle-log-entry .log-ability {
  color: #88bbff;
}
.battle-log-entry .log-deploy {
  color: var(--success);
}
.battle-log-entry.enemy-turn {
  background: rgba(231, 76, 60, 0.16);
}

/* Уведомление между полями */
@keyframes battle-notif-in {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes battle-notif-out {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* Модалка вывода */
#modal-deploy .modal {
  /*max-width: 920px;*/
  max-width: 75vw;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#modal-deploy .modal::-webkit-scrollbar {
  width: 5px;
}
#modal-deploy .modal::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
#modal-deploy .modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
#modal-deploy .modal::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
#modal-deploy .modal h3{
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 500;
}
.deploy-level-header {
  font-size: 14px;
  font-weight: 300;
  color: var(--accent);
  padding: 8px 0 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  margin-top: 4px;
}
.deploy-level-header:first-child { margin-top: 0; }
.deploy-ship-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.deploy-ship-block {
  width: 195px;
  min-height: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.deploy-ship-block:hover { border-color: var(--accent); background: #1a2540; }
.deploy-ship-block.disabled { opacity: 0.35; cursor: not-allowed; }
.deploy-ship-block .deploy-ship-mini { flex-shrink: 0; }
.deploy-ship-block .deploy-ship-name { font-size: 14px; font-weight: 700; }
.deploy-ship-block .deploy-ship-stats { 	font-size: 13px;
    color: #d9d9d9;
    font-weight: 600;
	display: flex;
  }
.deploy-abilities {
  width: 100%;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.deploy-ability { text-align: left; font-size: 12px; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: center;}
.deploy-ability-name { font-weight: 600; color: var(--warning);  display: block; margin-left: 4px;font-size: 13px;}
.deploy-ability-type { color: var(--accent); font-size: 10px; margin-left: 0;  display: block;}
.deploy-ability-desc { color: var(--text-dim); display: block; margin-top: 1px; }

.deploy-ability .ability-block-icon img{
	height:42px;
	object-fit:contain;
	border-radius:4px;
}

/* Модалка выбора цели */
.target-ship-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.target-ship-list::-webkit-scrollbar {
  width: 5px;
}
.target-ship-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
.target-ship-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.target-ship-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
.target-ship-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  cursor: pointer;
}
.target-ship-card:hover { border-color: var(--accent); }
.target-ship-card .ship-icon { font-size: 24px; }

/* Мобильный тултип подтверждения */
.mobile-confirm-tooltip {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  gap: 16px;
  z-index: 60;
  opacity: 1;
  transition: opacity 0.3s ease;
}
@keyframes tooltip-up {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.mobile-confirm-tooltip .confirm-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
}
.mobile-confirm-tooltip .confirm-btn.confirm-yes {
  border-color: var(--success);
  color: var(--success);
}
.mobile-confirm-tooltip .confirm-btn.confirm-yes:hover,
.mobile-confirm-tooltip .confirm-btn.confirm-yes:active {
  background: var(--success);
  color: white;
}
.mobile-confirm-tooltip .confirm-btn.confirm-no {
  border-color: var(--danger);
  color: var(--danger);
}
.mobile-confirm-tooltip .confirm-btn.confirm-no:hover,
.mobile-confirm-tooltip .confirm-btn.confirm-no:active {
  background: var(--danger);
  color: white;
}
.mobile-confirm-tooltip .confirm-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 13px;
  color: var(--text);
  text-align: center;
  min-width: 80px;
}

/* Большие уведомления над клетками */
.cell-big-float {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.8s, transform 0.8s;
    overflow-wrap: break-word;
  word-wrap: break-word;   
  word-break: break-all;
}

#deploy-hint{
	display: none;
}

/* Кнопка опасности */
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  flex: 1;
}
.btn-danger:hover {
  background: #f05040;
}

/* Нижняя панель игры */
.game-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  margin-top: 0;
  flex-shrink: 0;

}
.game-bottom-bar .btn {
  font-size: 14px;
  padding: 10px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  border-radius: var(--border-radius);
}
.game-bottom-bar .btn:hover {
  border-color: var(--accent);
  color: var(--text-bright);
}

/* Модалка помощи */
.help-section {
  margin-bottom: 14px;
}
.help-section h4 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.help-section p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 2px 0;
}
.help-section p b {
  color: var(--text);
}
#modal-help .modal{
max-width:900px;
max-height:85vh;
overflow-y:auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#modal-help .modal::-webkit-scrollbar {
  width: 5px;
}
#modal-help .modal::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
#modal-help .modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
#modal-help .modal::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.cell {
  will-change: background, box-shadow;
}
.cell-float, .cell-big-float {
  will-change: transform, opacity;
}

/* Приоритет подсветки над всеми состояниями
.cell.highlight-hover {
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px var(--accent-glow) !important;
  animation: none !important;
  z-index: 20;
} */

.cell.highlight-valid {
 /* box-shadow: 0 0 0 1px var(--success), 0 0 18px rgba(46,204,113,0.7) !important;
  animation: none !important;*/
 	filter: brightness(1.1);
        border-width: 1px;
        border-color: rgba(46, 204, 113, 0.9);
}

.cell.selected {
  /*box-shadow: 0 0 0 1px white, 0 0 20px rgba(255,255,255,0.8) !important;*/
  animation: none !important;
        filter: brightness(1.1);
    border-width: 2px;
    border-color: rgba(255, 255, 255, .90);
  z-index: 20;
}
/*.cell.shot-marker.highlight-hover,
.cell.shot-marker.highlight-valid,
.cell.shot-marker.selected {
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--accent-glow) !important;
}*/
.cell.shot-marker.highlight-valid {
  /*box-shadow: 0 0 0 1px var(--success), 0 0 18px rgba(46,204,113,0.7) !important;*/
          filter: brightness(1.1);
    border-width: 2px;
    border-color: rgba(46,204,113, .80);
}
.cell.shot-marker.selected {
  /*box-shadow: 0 0 0 1px white, 0 0 20px rgba(255,255,255,0.8) !important;*/
        filter: brightness(1.1);
    border-width: 2px;
    border-color: rgba(255, 255, 255, .90);
}
.hover-tooltip {
  pointer-events: none;
}
.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.btn-close-modal:hover {
  color: var(--text);
}
#modal-deploy .modal-head{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:12px;
}

.mobile-action-modal .action-modal-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.mobile-action-modal .action-modal-btn:hover {
  border-color: var(--accent);
}
.mobile-action-modal .action-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

/* Прогресс — карточки */
.progress-ships-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-ship-card {
  width: 150px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 12px;
  text-align: center;
  transition: all var(--transition-fast);
}
.progress-ship-card:hover {
  border-color: var(--accent);
}
.progress-ship-card.locked {
  opacity: 0.5;
}
.progress-ship-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.progress-ship-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.progress-ship-level {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}
.progress-ship-cells {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.progress-ship-hp {
  font-size: 11px;
  color: var(--text);
  margin-bottom: 4px;
}
.progress-ship-armor {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 2px;
}
.progress-ship-abilities {
  font-size: 10px;
  color: var(--warning);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.progress-ship-unlock {
  font-size: 11px;
  color: var(--success);
  margin-top: 6px;
  font-weight: 600;
}
.ship-unlock-info {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 600;
}

.turn-timer {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: -2px;
    margin-bottom: 2px;
	  opacity: 0;
}
.turn-timer.active {
  visibility: visible;
  opacity: 1;
}
.turn-timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  transition: width 1s linear, background 0.5s;
  background: var(--success);
}
.turn-timer-bar.warning {
  background: var(--warning);
}
.turn-timer-bar.danger {
  background: var(--danger);
}