/* X GAME — Lodě */
.ld { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
.ld .hlaska { margin: 2px 0; }

/* ---------- moře ---------- */
.ld-deska {
  --sea1: #0d2a45; --sea2: #0a2038; --grid: #1d4a72;
  display: grid; grid-template-columns: 18px 1fr; grid-template-rows: 18px 1fr; gap: 3px;
  width: 100%; position: relative;
}
.ld-roh { grid-area: 1 / 1; }
.ld-pism, .ld-cisla { display: grid; color: #6f9cc4; font: 800 11px/1 ui-monospace, Menlo, monospace; }
.ld-pism { grid-area: 1 / 2; grid-template-columns: repeat(10, 1fr); align-items: end; }
.ld-cisla { grid-area: 2 / 1; grid-template-rows: repeat(10, 1fr); align-items: center; justify-items: end; padding-right: 2px; }
.ld-pism span, .ld-cisla span { text-align: center; }
.ld-more {
  grid-area: 2 / 2; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, #1a4d7a55, transparent 60%),
    radial-gradient(ellipse at 80% 90%, #0e3a6255, transparent 55%),
    linear-gradient(160deg, var(--sea1), var(--sea2));
  box-shadow: 0 0 0 1px #1f5182, 0 8px 24px #0008, inset 0 0 30px #0006;
}
.ld-more::before { /* jemné vlnky */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(115deg, transparent 0 14px, #2a6aa018 14px 16px);
  animation: ld-vlny 9s linear infinite;
}
@keyframes ld-vlny { to { background-position: 60px 0; } }
.ld-mrizka, .ld-lode { position: absolute; inset: 0; }
.ld-mrizka { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); z-index: 2; }
.ld-lode { z-index: 1; pointer-events: none; }
.ld-b {
  position: relative; border: 0; padding: 0; margin: 0; background: transparent;
  box-shadow: inset -1px -1px 0 #1d4a7266; min-width: 0; min-height: 0;
  display: grid; place-items: center; transition: background .12s;
}
.ld-b:nth-child(10n) { box-shadow: inset 0 -1px 0 #1d4a7266; }
.ld-b:nth-child(n+91) { box-shadow: inset -1px 0 0 #1d4a7266; }
.ld-b:nth-child(100) { box-shadow: none; }

/* střela do vody */
.ld-b.ld-o::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: #e8f3ff; box-shadow: 0 0 6px #bfe0ff99; }
.ld-b.ld-a::after { content: ""; width: 16%; height: 16%; border-radius: 50%; background: #9cc3e655; }
.ld-b.ld-o, .ld-b.ld-a { background: #06182b55; }
/* zásah */
.ld-b.ld-x { background: radial-gradient(circle, #ff7a1a55 0, transparent 70%); }
.ld-b.ld-x::before {
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, #ffd27a 0, #ff6a1a 45%, #e5283b 75%, transparent 76%);
  filter: drop-shadow(0 0 4px #ff5a1a);
  clip-path: polygon(50% 0, 61% 32%, 96% 20%, 70% 48%, 100% 64%, 64% 66%, 70% 100%, 50% 74%, 28% 100%, 34% 66%, 0 64%, 30% 48%, 6% 20%, 40% 32%);
}
.ld-b.ld-x::after { content: "✕"; position: relative; color: #fff; font-weight: 900; font-size: clamp(11px, 3.6vw, 16px); text-shadow: 0 1px 2px #6a0010; }
.ld-b.novy::before, .ld-b.novy::after { animation: ld-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.ld-b.ld-a.novy::after { animation: ld-fade .5s .15s both; }
@keyframes ld-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ld-fade { from { opacity: 0; transform: scale(.3); } }

/* lodě (SVG pohled shora) */
.ld-lod { position: absolute; pointer-events: none; transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease; }
.ld-lod svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 2px #000a); }
.ld-lod.vybrana { z-index: 1; animation: ld-houp 1.2s ease-in-out infinite; }
.ld-lod.vybrana svg { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 7px #ffcc00) drop-shadow(0 2px 2px #000a); }
.ld-lod.vybrana::after { content: ""; position: absolute; inset: 1px; border: 2px dashed #ffcc00; border-radius: 8px; pointer-events: none; }
@keyframes ld-houp { 50% { transform: translateY(-2px); } }
.ld-lod.pot svg { filter: grayscale(.6) brightness(.62) sepia(.3) drop-shadow(0 2px 2px #000a); }
.ld-lod.pot::after { content: ""; position: absolute; inset: 2px; border: 2px solid #c0182f; border-radius: 9px; box-shadow: 0 0 10px #c0182f66, inset 0 0 8px #c0182f44; }
.ld-lod.nove { animation: ld-potop .7s ease-out both; }
@keyframes ld-potop { 0% { opacity: 0; transform: scale(1.12); } 60% { opacity: 1; } 100% { transform: scale(1); } }
.ld-ohen { animation: ld-plamen .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes ld-plamen { from { transform: scale(.88, .8); opacity: .85; } to { transform: scale(1.05, 1.1); opacity: 1; } }

/* zásah na viditelné lodi: menší značka, ať je vidět oheň na palubě */
.ld-b.ld-x.na-lodi { background: none; }
.ld-b.ld-x.na-lodi::before { inset: 30%; opacity: .55; }
.ld-b.ld-x.na-lodi::after { font-size: clamp(9px, 2.8vw, 12px); opacity: .9; }

/* přehled flotily */
.ld-seznam { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ld-sz {
  display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 9px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; text-align: left; color: var(--text);
}
.ld-seznam.klik .ld-sz { min-height: 44px; }
.ld-sz:first-child { grid-column: 1 / -1; }
.ld-sz-d { display: inline-flex; gap: 1px; flex: none; }
.ld-sz-d i { width: 6px; height: 9px; background: #8d99a8; border-radius: 2px; }
.ld-sz-d i:first-child { border-radius: 5px 2px 2px 5px; }
.ld-sz-n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-sz em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.ld-sz.zas { border-color: #ff6a1a66; }
.ld-sz.zas .ld-sz-d i { background: #ff8a3a; }
.ld-sz.zas em { color: #ffaa66; }
.ld-sz.pot { opacity: .6; border-color: #c0182f66; }
.ld-sz.pot .ld-sz-n { text-decoration: line-through; }
.ld-sz.pot .ld-sz-d i { background: #b0182e; }
.ld-sz.pot em { color: #ff8a9c; }
.ld-sz.vyb { border-color: var(--accent); background: #2a2614; box-shadow: 0 0 0 2px #ffcc0033; }
.ld-vyb-jm { color: var(--accent); }

/* klepací moře soupeře */
.ld-tap .ld-more { box-shadow: 0 0 0 2px var(--accent), 0 0 24px #ffcc0040, 0 8px 24px #0008, inset 0 0 30px #0006; }
.ld-tap .ld-b:not(.ld-o):not(.ld-a):not(.ld-x) { cursor: crosshair; }
.ld-tap .ld-b:not(.ld-o):not(.ld-a):not(.ld-x):active { background: #ffcc0055; box-shadow: inset 0 0 0 2px var(--accent); }
.ld-b.miri { background: #ffcc0066 !important; box-shadow: inset 0 0 0 2px var(--accent) !important; animation: ld-miri .5s ease-in-out infinite alternate; }
@keyframes ld-miri { to { background: #ff8a0088; } }
.ld-deska.ceka .ld-more { filter: brightness(.92); }
.ld-deska.tlumit .ld-more { filter: grayscale(.8) brightness(.7); }
.ld-rozm .ld-tap .ld-more { box-shadow: 0 0 0 1px #2b6ba5, 0 8px 24px #0008, inset 0 0 30px #0006; }
.ld-rozm .ld-tap .ld-b:active { background: #ffffff18; }

.ld-deska.tres { animation: ld-tres .4s; }
@keyframes ld-tres { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ---------- rozmístění ---------- */
.ld-pripr { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; color: var(--muted); }
.ld-pripr-n { flex: none; }
.ld-pripr-bar { flex: 1; height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.ld-pripr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #7df0b0); border-radius: 99px; transition: width .3s; }
.ld-napoveda { color: var(--muted); font-size: 13px; text-align: center; margin: 0; min-height: 36px; }
.ld-tlacitka { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ld-cekam { display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); min-height: 44px; }

/* ---------- boj ---------- */
.ld-stav { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--muted); min-height: 24px; text-align: center; }
.ld-stav.moje { color: var(--accent); font-size: 17px; animation: ld-puls 1.4s ease-in-out infinite; }
.ld-stav.ven { color: #ff8a9c; }
.ld-stav.konec { color: var(--accent); font-size: 22px; font-weight: 900; }
@keyframes ld-puls { 50% { opacity: .65; } }
.ld-banner {
  font-size: 15px; font-weight: 700; padding: 8px 12px; border-radius: 12px; margin: 0 !important;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.ld-banner b { font-family: ui-monospace, Menlo, monospace; color: #9fd0ff; }
.ld-banner.ld-zasah { border-color: #ff6a1a88; background: #2a1510; }
.ld-banner.ld-potopena { border-color: #e5283b; background: #33111a; }
.ld-banner.na-me.ld-zasah, .ld-banner.na-me.ld-potopena { box-shadow: 0 0 0 2px #e5283b55; }
.ld-banner.novy { animation: ld-banner .35s ease-out; }
@keyframes ld-banner { from { transform: translateY(-6px) scale(.97); opacity: .3; } }
.ld-ven { display: inline-block; color: #ff8a9c; font-weight: 900; }

.ld-chipy { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.ld-chipy::-webkit-scrollbar { display: none; }
.ld-chip {
  flex: 1 0 auto; min-width: 74px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); line-height: 1.15;
  transition: transform .1s, border-color .15s;
}
.ld-chip:active { transform: scale(.96); }
.ld-chip-j { font-weight: 800; font-size: 14px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-chip-s { font-size: 11px; color: var(--muted); font-weight: 600; }
.ld-chip.akt { border-color: #3aa0ff; background: #12273d; }
.ld-chip.tah .ld-chip-j::after { content: " •"; color: var(--accent); }
.muj-tah .ld-chip.akt:not(.ja) { border-color: var(--accent); background: #2a2614; }
.ld-chip.ven { opacity: .45; }
.ld-chip.ven .ld-chip-j { text-decoration: line-through; }

.ld-popis-desky { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 600; padding: 0 2px 0 21px; }
.ld-popis-desky b { color: var(--text); }
.ld-zbyva { font-size: 12px; }

.ld-log { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.ld-log li { padding: 3px 8px; border-left: 3px solid var(--line); }
.ld-log li.ld-zasah { border-color: #ff6a1a; }
.ld-log li.ld-potopena { border-color: #e5283b; }
.ld-log b { font-family: ui-monospace, Menlo, monospace; color: var(--text); }

.ld-poradi { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.ld-poradi li { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.ld-poradi li.ja { border-color: var(--accent); }
.ld-poradi span { font-size: 20px; width: 28px; text-align: center; }
.ld-poradi b { flex: 1; }
.ld-poradi em { font-style: normal; font-size: 12px; color: var(--muted); }
