/* WaveWager — морская тема */
:root {
  --sea-deep: #0a2e3a;
  --sea-mid: #1a4a5f;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --accent: #1abc9c;
  --deck: #2ecc71;
  --deck-hover: #27ae60;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --ship: #3498db;
  --hit: #e74c3c;
  --miss: #7f8c8d;
  --tg-bg: var(--tg-theme-bg-color, var(--sea-deep));
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(165deg, var(--sea-deep) 0%, var(--sea-mid) 55%, #0d3d4d 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Фон-море + лёгкая анимация */
.sea-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #0a2e3a 0%, #1a4a5f 50%, #0f3d4a 100%);
  animation: sea-shift 12s ease-in-out infinite alternate;
}

@keyframes sea-shift {
  0% {
    filter: hue-rotate(0deg) brightness(1);
  }
  100% {
    filter: hue-rotate(8deg) brightness(1.03);
  }
}

/* Волны */
.waves {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: min(28vh, 200px);
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.wave {
  position: absolute;
  bottom: 0;
  left: -50%;
  width: 200%;
  height: 80px;
  border-radius: 45%;
  background: rgba(26, 188, 156, 0.12);
  animation: wave-ride 10s linear infinite;
}

.wave.w2 {
  bottom: 8px;
  opacity: 0.7;
  animation-duration: 14s;
  animation-delay: -2s;
  background: rgba(52, 152, 219, 0.1);
}

.wave.w3 {
  bottom: 16px;
  opacity: 0.5;
  animation-duration: 18s;
  animation-delay: -4s;
  background: rgba(255, 255, 255, 0.06);
}

@keyframes wave-ride {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  100% {
    transform: translateX(25%) rotate(2deg);
  }
}

.app-root {
  position: relative;
  z-index: 1;
  max-width: 768px;
  margin: 0 auto;
  padding: 10px 12px 28px;
  min-height: 100vh;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Шапка */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 16px;
  animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand-emoji {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text {
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-crown {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
  animation: crown-glow 2s ease-in-out infinite;
}

@keyframes crown-glow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.premium-crown.hidden {
  display: none;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
}

.coin-icon {
  font-size: 1.1rem;
}

.main-content {
  animation: fade-in 0.6s ease-out 0.1s both;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-anim {
  animation: fade-in 0.45s ease-out;
}

.hidden {
  display: none !important;
}

.screen-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(26, 188, 156, 0.35);
}

.hint {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  line-height: 1.45;
}

.card {
  padding: 18px 16px;
}

.lobby-card {
  position: relative;
}

/* Ставки */
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 400px) {
  .chips {
    grid-template-columns: repeat(3, 1fr);
  }
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.chip:hover,
.chip:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 188, 156, 0.25);
}

.chip:active {
  transform: translateY(0);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(26, 188, 156, 0.2);
  box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.45);
}

.chip-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.chip-val {
  font-size: 1.1rem;
}

.chip-sub {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  transition: transform 0.12s, filter 0.12s, box-shadow 0.12s;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 1.15rem;
}

.btn-deck {
  width: 100%;
  background: linear-gradient(180deg, var(--deck) 0%, #219a52 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.35);
  margin-top: 4px;
}

.btn-deck:hover {
  box-shadow: 0 8px 28px rgba(46, 204, 113, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  flex: 1;
  min-width: 0;
}

.btn-danger {
  background: linear-gradient(180deg, var(--danger) 0%, #c0392b 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.35);
}

.btn-ready-pulse:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ready-pulse:not(:disabled) {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(180deg, var(--deck) 0%, #219a52 100%);
  color: #fff;
  animation: ready-glow 1.8s ease-in-out infinite;
}

@keyframes ready-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5);
  }
  50% {
    box-shadow: 0 0 24px 4px rgba(46, 204, 113, 0.35);
  }
}

#btn-ready.btn-ready-sent {
  animation: none;
  background: linear-gradient(180deg, #5a6570 0%, #3d4650 100%) !important;
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
  cursor: default;
}

#btn-ready.btn-ready-error {
  animation: none;
  border: 3px solid var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.5);
}

.placement-status {
  min-height: 24px;
  margin-top: 12px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.placement-status.placement-waiting {
  color: rgba(200, 210, 220, 0.95);
}

.placement-status.placement-battle {
  color: var(--deck);
  font-size: 1.05rem;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Поиск */
.lobby-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  margin-top: 8px;
}

.lobby-search.hidden {
  display: none !important;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-text {
  margin: 0;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

.status {
  min-height: 22px;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Сетки */
.board-wrap {
  width: 100%;
  max-width: min(100vw - 32px, 400px);
  margin: 0 auto;
}

.board-wrap.tight {
  max-width: min(100vw - 48px, 380px);
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  width: 100%;
  aspect-ratio: 1;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 2px solid rgba(26, 188, 156, 0.35);
}

.battle-grid .cell {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
}

.board.interactive .cell {
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.board.interactive .cell:hover {
  background: rgba(26, 188, 156, 0.25);
}

.cell.ship {
  background: var(--ship) !important;
  border-color: rgba(52, 152, 219, 0.8);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.cell.hit {
  background: linear-gradient(145deg, #ff6b6b, var(--hit)) !important;
  animation: hit-flash 0.45s ease-out;
}

/* Подбит, корабль ещё плавает */
.cell.hit-partial {
  background: linear-gradient(145deg, #f39c12, #e67e22) !important;
  animation: hit-flash 0.35s ease-out;
}

/* Уничтожен — последняя клетка корабля */
.cell.sunk {
  background: linear-gradient(145deg, #c0392b, #922b21) !important;
  animation: sunk-burst 0.65s ease-out;
}

.cell.miss {
  background: rgba(127, 140, 141, 0.85) !important;
}

@keyframes hit-flash {
  0% {
    filter: brightness(2);
    box-shadow: 0 0 12px #fff;
  }
  100% {
    filter: brightness(1);
    box-shadow: none;
  }
}

@keyframes sunk-burst {
  0% {
    filter: brightness(1.8);
    transform: scale(1.08);
    box-shadow: 0 0 18px #ff9f43;
  }
  50% {
    filter: brightness(1.2);
    transform: scale(1);
  }
  100% {
    filter: brightness(1);
    box-shadow: none;
  }
}

.cell-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.55rem, 2.8vw, 0.95rem);
  pointer-events: none;
  line-height: 1;
}

/* Бой */
.turn-banner {
  text-align: center;
  font-weight: 900;
  font-size: clamp(0.85rem, 3.5vw, 1.05rem);
  letter-spacing: 0.06em;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.turn-banner.my-turn {
  background: rgba(46, 204, 113, 0.25);
  border-color: var(--deck);
  color: #a8f5c8;
  text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.turn-banner.foe-turn {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.45);
  color: #f5b7b0;
}

.battle-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.board-panel {
  padding: 12px;
}

.panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.85);
}

.panel-title.accent {
  color: var(--accent);
}

.panel-attack .battle-grid {
  border-color: rgba(231, 76, 60, 0.35);
}

.battle-actions {
  margin-top: 8px;
}

.banner {
  margin-top: 12px;
  padding: 14px;
}

.banner p {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

/* Экран конца */
.end-card {
  text-align: center;
  padding: 28px 20px;
}

.end-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--accent);
}

.end-detail {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 12px 20px;
  z-index: 100;
  max-width: 90%;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Адаптив 320–768 */
@media (max-width: 360px) {
  .chips {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .chip {
    min-height: 64px;
    padding: 8px 4px;
    font-size: 0.9rem;
  }

  .brand-text {
    font-size: 1rem;
  }
}

@media (min-width: 600px) {
  .battle-stack {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  .battle-stack .board-panel {
    flex: 1;
    min-width: 0;
  }
}

/* Эпичное уничтожение */
.ww-destroy-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ww-destroy-overlay.hidden {
  display: none !important;
}

.ww-destroy-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 80, 80, 0.55) 35%,
    rgba(120, 0, 0, 0.4) 70%,
    transparent 85%
  );
  animation: epic-flash 0.35s ease-out;
}

@keyframes epic-flash {
  0% {
    opacity: 0;
    transform: scale(1.2);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
}

.ww-destroy-text {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 12px 20px;
  max-width: min(92vw, 420px);
  text-align: center;
  font-weight: 900;
  font-size: clamp(1.15rem, 5.5vw, 1.75rem);
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255, 50, 50, 0.9),
    0 2px 8px #000,
    0 0 2px #000;
  animation: destroy-text-pop 0.5s ease-out;
}

@keyframes destroy-text-pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

body.ww-epic-body {
  overflow: hidden;
}

/* Начало боя */
#turn-strip.battle-start-flash .turn-banner-main {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.45), rgba(39, 174, 96, 0.25));
  border-color: rgba(46, 204, 113, 0.85);
  color: #eafff3;
  text-shadow: 0 0 12px rgba(46, 204, 113, 0.8);
  animation: battle-pulse 0.6s ease-in-out 2;
}

@keyframes battle-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* Своя доска */
.cell.ship-intact-cell {
  background: linear-gradient(145deg, #2980b9, #1f6dad) !important;
  border-color: rgba(52, 152, 219, 0.9);
}

.cell.own-hit {
  background: radial-gradient(circle at 50% 50%, #c0392b 0%, #922b21 100%) !important;
}

.cell.own-sunk.burn-cell {
  background: linear-gradient(180deg, #b83232 0%, #5c1010 100%) !important;
  animation: fire-pulse 0.45s ease-in-out infinite;
}

.cell.epic-fire-cell {
  animation: fire-pulse 0.35s ease-in-out infinite, epic-cell-glow 0.5s ease-out 4;
}

@keyframes fire-pulse {
  0%,
  100% {
    filter: brightness(1.05);
    box-shadow: inset 0 0 6px rgba(255, 150, 50, 0.5);
  }
  50% {
    filter: brightness(1.25);
    box-shadow:
      inset 0 0 14px rgba(255, 200, 80, 0.65),
      0 0 8px rgba(255, 100, 30, 0.4);
  }
}

@keyframes epic-cell-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 220, 100, 0.8);
  }
  100% {
    box-shadow: 0 0 16px 4px rgba(255, 100, 30, 0.35);
  }
}

.fire-layer {
  filter: drop-shadow(0 0 4px rgba(255, 120, 40, 0.9));
}

.cell.miss-own {
  background: rgba(127, 140, 141, 0.35) !important;
}

/* Доска атаки */
.cell.atk-hit {
  background: rgba(192, 57, 43, 0.35) !important;
}

.hit-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 76, 60, 0.95) 0%, #c0392b 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.25);
}

.hit-emoji {
  font-size: clamp(0.5rem, 2.4vw, 0.85rem);
  line-height: 1;
}

.cell.atk-sunk {
  background: linear-gradient(145deg, #6c3483, #4a235a) !important;
}

/* ——— Экран боя: две доски без лишнего скролла ——— */
.screen-play-fit {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 52px);
  overflow: hidden;
}

#app.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.turn-strip {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 12px;
  margin: 0 -4px 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}

.turn-strip.my-turn-strip {
  border-color: rgba(46, 204, 113, 0.65);
  box-shadow: 0 0 24px rgba(46, 204, 113, 0.25);
  animation: strip-pulse-me 1.6s ease-in-out infinite;
}

.turn-strip.foe-turn-strip {
  border-color: rgba(231, 76, 60, 0.5);
  box-shadow: 0 0 18px rgba(231, 76, 60, 0.2);
  animation: strip-pulse-foe 1.8s ease-in-out infinite;
}

@keyframes strip-pulse-me {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(46, 204, 113, 0.2);
  }
  50% {
    box-shadow: 0 0 28px rgba(46, 204, 113, 0.45);
  }
}

@keyframes strip-pulse-foe {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(231, 76, 60, 0.15);
  }
  50% {
    box-shadow: 0 0 26px rgba(231, 76, 60, 0.35);
  }
}

.turn-banner-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  font-size: clamp(1rem, 4.2vw, 1.35rem);
  letter-spacing: 0.08em;
  padding: 6px 8px;
  border-radius: 10px;
  border: 2px solid transparent;
}

.turn-banner-main.my-turn {
  background: rgba(46, 204, 113, 0.22);
  border-color: rgba(46, 204, 113, 0.55);
  color: #d5ffe8;
  text-shadow: 0 0 18px rgba(46, 204, 113, 0.55);
}

.turn-banner-main.foe-turn {
  background: rgba(231, 76, 60, 0.18);
  border-color: rgba(231, 76, 60, 0.45);
  color: #ffd5d0;
  text-shadow: 0 0 14px rgba(231, 76, 60, 0.35);
}

.turn-submsg {
  margin-top: 8px;
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.92rem, 3.8vw, 1.1rem);
  color: #ffeaa7;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  animation: submsg-pop 0.35s ease-out;
}

.turn-submsg.hidden {
  display: none !important;
}

@keyframes submsg-pop {
  from {
    transform: translateY(-6px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.battle-log {
  padding: 8px 10px;
  margin-bottom: 8px;
  max-height: 76px;
  overflow: hidden;
  border-radius: 10px;
}

.battle-log-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.battle-log-lines {
  max-height: 52px;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}

.battle-log-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.battle-log-line:last-child {
  border-bottom: none;
}

.battle-stack-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.board-panel-self .board-wrap-compact {
  max-width: min(92vw, 300px);
  margin: 0 auto;
  transform: scale(0.94);
  transform-origin: top center;
}

.board-wrap-attack {
  position: relative;
  max-width: min(100vw - 20px, 440px);
  margin: 0 auto;
}

.board-wrap-attack.attack-readonly .board.battle-grid {
  opacity: 0.55;
  filter: saturate(0.85);
}

.attack-wait-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 30, 0.42);
  border-radius: 12px;
  backdrop-filter: blur(2px);
}

.attack-wait-overlay.hidden {
  display: none !important;
}

.attack-wait-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.attack-spinner {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.cell.incoming-hit-flash {
  animation: incoming-flash 0.85s ease-out !important;
}

@keyframes incoming-flash {
  0% {
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(255, 60, 60, 0.95);
    filter: brightness(2);
  }
  100% {
    box-shadow: none;
    filter: brightness(1);
  }
}

.cell.my-hit-pulse {
  animation: my-hit-pulse 0.65s ease-out;
}

@keyframes my-hit-pulse {
  0% {
    transform: scale(1.12);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@media (min-width: 700px) {
  .battle-stack-mobile {
    flex-direction: row;
    align-items: flex-start;
    overflow: visible;
  }

  .board-panel-self {
    flex: 0 0 38%;
    max-width: 380px;
  }

  .board-panel-attack {
    flex: 1;
    min-width: 0;
  }

  .board-panel-self .board-wrap-compact {
    transform: scale(1);
    max-width: none;
  }
}
