/* ChciHry.cz — Lodě (Námořní bitva). Standalone styl.
 * Sdílené tokeny + reset + @font-face DĚDÍ z tokens.css (načten PŘED tímto souborem).
 * Zde jen námořní tokeny + layout + komponenty. Animace pouze transform/opacity/filter,
 * a výhradně událostní (žádná stálá smyčka v klidu). */

:root {
    /* námořní herní tokeny */
    --sea: #0e2a47;
    --sea-deep: #07182b;
    --sea-line: rgba(91, 200, 232, 0.16);
    --cell-fog: #14253c;
    --cell-fog2: #0e1a2d;
    --cell-water: #173455;
    --cell-water2: #0f2742;
    --foam: #e8f4fb;
    --fire: #ff7a3c;
    --fire-deep: #c9302c;
    --steel: #8a98a7;
    --steel-dark: #4a5563;
    --ghost-ok: rgba(92, 184, 92, 0.55);
    --ghost-bad: rgba(217, 83, 79, 0.55);
    /* velikosti desek */
    --board-primary: min(100vw - 1.4rem, 64svh);
    --board-secondary: min(46vw, 24svh, 200px);
    --lbl: clamp(0.8rem, 3.4vw, 1.25rem);
    --board: var(--board-primary);
}

html { height: 100%; }
body {
    font-family: 'Montserrat', 'Montserrat-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-dark);
    color: var(--text-primary);
    min-height: 100svh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 18% 12%, rgba(91, 200, 232, 0.07) 0%, transparent 46%),
        radial-gradient(circle at 85% 85%, rgba(212, 175, 55, 0.05) 0%, transparent 52%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
svg { display: block; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- layout ---------- */
.shell {
    container-type: inline-size; container-name: app;
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right))
             0.5rem max(0.5rem, env(safe-area-inset-left));
}
.app {
    display: grid; justify-items: center;
    gap: clamp(0.4rem, 1.4dvh, 1rem);
    max-width: 1500px; margin: 0 auto; width: 100%;
}
.hd { grid-area: head; text-align: center; min-width: 0; }
.enemy-zone { grid-area: enemy; }
.mine-zone { grid-area: mine; }
.dock { grid-area: dock; }
.panel { grid-area: panel; }

/* fázová emfáze (portrait výchozí) */
.phase-setup { grid-template-areas: "head" "mine" "dock"; }
/* bitva: deska pod palbou (.primary) je velká, deska střelce (.secondary) malá; prohazují se dle tahu */
.phase-battle { grid-template-areas: "head" "primary" "secondary" "panel"; }
.phase-setup .enemy-zone, .phase-setup .panel { display: none; }
.phase-battle .dock { display: none; }

.phase-battle .board-zone.primary { grid-area: primary; --board: var(--board-primary); }
.phase-battle .board-zone.secondary { grid-area: secondary; --board: var(--board-secondary); }
.phase-setup .mine-zone { --board: var(--board-primary); }

/* ---------- hlavička ---------- */
.hd h1 {
    font-size: clamp(1.1rem, 4.2vw, 2rem); font-weight: 900; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary) 0%, #F5E6D3 55%, var(--primary-dark) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.hd .h1-sub { font-weight: 600; font-size: 0.66em; white-space: nowrap; }
.status {
    margin-top: 0.2rem; font-size: clamp(0.85rem, 2.6vw, 1.05rem); font-weight: 600;
    color: var(--text-secondary); min-height: 1.4em;
}
.status.thinking { color: #5BC8E8; }
.status.hit { color: var(--fire); }
.status.miss { color: var(--text-secondary); }
.status.over { color: var(--primary); }

/* ---------- desky + souřadnicový rám ---------- */
.board-zone { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.board-head {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
    width: var(--board); max-width: 100%;
}
.board-name { font-weight: 800; font-size: clamp(0.85rem, 2.4vw, 1.05rem); color: var(--text-secondary); }

.board-frame {
    width: var(--board);
    display: grid;
    grid-template-columns: var(--lbl) calc(var(--board) - var(--lbl));
    grid-template-rows: var(--lbl) calc(var(--board) - var(--lbl));
}
.corner { grid-column: 1; grid-row: 1; }
.col-hdr { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(10, 1fr); column-gap: 2px; }
.row-hdr { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(10, 1fr); row-gap: 2px; }
.col-hdr span, .row-hdr span {
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(0.55rem, 1.8vw, 0.8rem); font-weight: 700; color: var(--text-muted);
}
.board {
    grid-column: 2; grid-row: 2; position: relative;
    display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr);
    gap: 2px; width: 100%; height: 100%;
    border: 3px solid var(--primary-dark); border-radius: var(--radius-sm);
    background: var(--sea-line);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 50px rgba(91, 200, 232, 0.06);
    touch-action: manipulation; -webkit-user-select: none; user-select: none;
}

/* ---------- buňky ---------- */
.cell { position: relative; border-radius: 2px; overflow: hidden; }
.cell:focus { outline: none; }
.cell:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; z-index: 4; }

.enemy-zone .cell {
    background: radial-gradient(circle at 50% 40%, var(--cell-fog), var(--cell-fog2));
    cursor: crosshair;
}
.mine-zone .cell {
    background: linear-gradient(135deg, var(--cell-water), var(--cell-water2));
}
.phase-battle .mine-zone .cell { cursor: default; }
/* rozmístění drag & drop: tažení prstem bez scrollu, kurzory grab/grabbing */
.phase-setup .mine-zone .board { touch-action: none; }
.phase-setup .mine-zone .cell.ship { cursor: grab; }
.phase-setup .mine-zone .board.grabbing,
.phase-setup .mine-zone .board.grabbing .cell { cursor: grabbing; }

/* minutí = usazené soustředné vlnky po žbluňknutí projektilu do vody (statické, žádná smyčka;
   rozpínavé vlnky při dopadu řeší přechodný .ripple). Ztlumené (méně prominentní): opacity 0.2,
   tenké prstence (polovina, min 1px), chladnější odstupňované barvy — střed = barva pův. 1. kružnice,
   1. kružnice = barva pův. 2. kružnice, 2. kružnice = nová odstupňovaná. */
.cell.miss::after {
    content: ''; position: absolute; inset: 6%; border-radius: 50%; opacity: 0.2;
    background:
        radial-gradient(circle closest-side, rgba(186, 226, 247, 0.95) 0 9%, transparent 12%),
        radial-gradient(circle closest-side, transparent 39%, rgba(156, 208, 236, 0.9) 43% 47%, transparent 51%),
        radial-gradient(circle closest-side, transparent 74%, rgba(124, 184, 220, 0.85) 78% 82%, transparent 86%);
}
/* zásah = poškozená šedá (oheň je jen krátká animace .boom při dopadu) */
.cell.hit {
    background: linear-gradient(135deg, var(--steel) 0%, var(--steel-dark) 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.cell.hit::after { content: ''; position: absolute; inset: 32%; border-radius: 50%; background: #25282e; }
/* potopená loď: buňky zůstávají VODA dané desky (stejný modrý gradient jako prázdná voda —
   enemy fog vs mine water); jednolitý trup kreslí .ship-hull přes footprint (plave na vodě). */
.cell.sunk { box-shadow: none; }
.cell.sunk::after { content: none; }
.hull-layer { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); gap: 2px; pointer-events: none; z-index: 2; }
.ship-hull { align-self: stretch; justify-self: stretch; animation: hullReveal 0.45s ease-out; }
.ship-hull svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55)); }
@keyframes hullReveal { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
/* vlastní lodě = brand zlato-oranžová (jen vlastní deska; zasažené části zešednou přes .hit) */
.cell.ship {
    background: linear-gradient(135deg, #F5C24A 0%, #E8A03A 52%, #C8821C 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.28);
}
/* zaměřovač (jen jedna buňka při náhledu — levná animace) */
.cell.aim::before {
    content: ''; position: absolute; inset: 12%; border-radius: 50%;
    border: 2px solid var(--primary); box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    animation: aimPulse 1.1s ease-in-out infinite;
}
.cell.aim::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(var(--primary), var(--primary)) center / 2px 60% no-repeat,
        linear-gradient(var(--primary), var(--primary)) center / 60% 2px no-repeat;
    opacity: 0.7;
}
/* náhled rozmístění */
.cell.ghost-ok { box-shadow: inset 0 0 0 2px var(--ghost-ok); background: linear-gradient(135deg, rgba(92,184,92,0.5), rgba(92,184,92,0.3)); }
.cell.ghost-bad { box-shadow: inset 0 0 0 2px var(--ghost-bad); background: linear-gradient(135deg, rgba(217,83,79,0.5), rgba(217,83,79,0.3)); }
/* potopení — krátký otřes desky */
.board.shake { animation: shake 0.4s ease-out; }

/* dopad do vody — soustředné vlnky rozestupující se v rámci políčka (jako kámen do vody) */
.ripple { position: absolute; inset: 0; pointer-events: none; }
.ripple i {
    position: absolute; top: 50%; left: 50%; width: 24%; height: 24%; margin: -12% 0 0 -12%;
    border-radius: 50%; border: 2px solid rgba(155, 225, 255, 0.9);
    transform: scale(0.3); opacity: 0; animation: rippleExpand 0.9s ease-out forwards;
}
.ripple i:nth-child(2) { animation-delay: 0.15s; }
.ripple i:nth-child(3) { animation-delay: 0.3s; }
/* dopad na loď — záblesk výbuchu v rámci políčka */
.boom { position: absolute; inset: 0; pointer-events: none; }
.boom i {
    position: absolute; inset: 6%; border-radius: 50%;
    background: radial-gradient(circle, #fff6d5 0%, var(--fire) 45%, rgba(201, 48, 44, 0) 72%);
    transform: scale(0.2); opacity: 0; animation: boomFlash 0.5s ease-out forwards;
}

@keyframes rippleExpand { 0% { transform: scale(0.3); opacity: 0.95; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes boomFlash { 0% { transform: scale(0.2); opacity: 1; } 55% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes aimPulse { 0%, 100% { opacity: 0.6; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---------- brána konce tahu (ruční přepnutí) ---------- */
.turn-gate {
    position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 85;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.9rem 1.7rem; min-height: 56px;
    font-size: clamp(1rem, 3.2vw, 1.35rem); font-weight: 800; letter-spacing: 0.01em;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.4));
    border: 2px solid var(--primary); border-radius: 9999px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), 0 0 24px rgba(212, 175, 55, 0.3);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
    cursor: pointer; animation: gatePulse 1.7s ease-in-out infinite;
}
.turn-gate[hidden] { display: none; }
.turn-gate.to-ai { border-color: var(--fire); }
.turn-gate:hover { transform: translate(-50%, -50%) scale(1.04); border-color: #F5E6D3; }
.turn-gate:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@keyframes gatePulse {
    0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 22px rgba(212,175,55,0.28); }
    50% { box-shadow: 0 12px 44px rgba(0,0,0,0.6), 0 0 40px rgba(212,175,55,0.5); }
}

/* ---------- fleet pips (zbývající lodě) ---------- */
.fleet-pips { display: inline-flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.pip { display: inline-flex; gap: 1px; }
.pip i { width: 7px; height: 7px; border-radius: 1px; background: var(--steel); display: block; }
.pip.sunk i { background: var(--fire-deep); opacity: 0.55; }

/* ---------- potvrzovací lišta ---------- */
.confirm-bar { display: flex; gap: 0.5rem; }
.confirm-bar[hidden] { display: none; }

/* ---------- dock (rozmístění) ---------- */
.dock {
    display: flex; flex-direction: column; align-items: stretch; gap: 0.55rem;
    width: 100%; max-width: calc(var(--board-primary) + 1rem);
}
.dock-hint { font-size: 0.85rem; color: var(--text-secondary); text-align: center; line-height: 1.4; }
.roster { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.ship-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.6rem; border-radius: 9999px;
    border: 1px solid var(--gold-border); background: rgba(30, 41, 59, 0.6);
    font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
}
.ship-chip .hull { display: inline-flex; gap: 2px; }
.ship-chip .hull i { width: 9px; height: 9px; border-radius: 2px; background: var(--steel); display: block; }
.ship-chip[data-left="0"] { opacity: 0.4; }
.ship-chip.active { border-color: var(--primary); background: rgba(212, 175, 55, 0.14); color: var(--primary); box-shadow: 0 0 12px rgba(212, 175, 55, 0.25); }
.dock-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }

/* ---------- panel (bitva) ---------- */
.panel {
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem; width: 100%;
    max-width: calc(var(--board-primary) + 1rem);
}
.counts { display: flex; gap: 1rem; font-weight: 700; font-size: 0.95rem; color: var(--text-secondary); flex-wrap: wrap; justify-content: center; }
.btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; width: 100%; }
.btn.span2 { grid-column: 1 / -1; }

/* moderní posuvné přepínače (Google settings style) */
.switches { display: flex; flex-direction: column; gap: 0.45rem; width: 100%; }
.switch {
    display: flex; align-items: center; gap: 0.55rem; width: 100%;
    min-height: 44px; padding: 0.45rem 0.9rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.04));
    border: 1px solid var(--gold-border); border-radius: 9999px;
    color: var(--text-primary); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
    cursor: pointer; text-align: left; transition: border-color 0.15s ease;
}
.switch:hover { border-color: var(--primary); }
.switch:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.switch .sw-lbl { flex: 1 1 auto; white-space: nowrap; }
.switch .sw-state { color: var(--text-muted); font-weight: 700; }
.switch[aria-checked="true"] .sw-state { color: var(--primary); }
.switch .sw-track {
    position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 9999px;
    background: rgba(120, 130, 145, 0.45); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease;
}
.switch .sw-knob {
    position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: #e8ecf0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background 0.2s ease;
}
.switch[aria-checked="true"] .sw-track { background: var(--primary); }
.switch[aria-checked="true"] .sw-knob { transform: translateX(18px); background: #fff; }

/* ---------- tlačítka ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; min-width: 44px; padding: 0.5rem 0.7rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--gold-border); border-radius: 9999px;
    color: var(--text-primary); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
    transition: border-color 0.15s ease, transform 0.15s ease; text-align: center;
}
.btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--surface-dark); border-color: var(--primary); }
.btn-primary:hover { border-color: #F5E6D3; }
.btn-fire { background: linear-gradient(135deg, rgba(255,122,60,0.3), rgba(201,48,44,0.18)); border-color: rgba(255,122,60,0.55); }
.btn[hidden] { display: none; }

/* ---------- dialogy ---------- */
dialog.dlg {
    margin: auto; max-width: min(92vw, 26rem); width: 100%;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.97));
    color: var(--text-primary); border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius-xl); padding: 1.3rem;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 90px rgba(91, 200, 232, 0.1);
}
dialog.dlg::backdrop { background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(4px); }
.dlg h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.6rem; color: var(--primary); text-align: center; }
.dlg .dlg-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; text-align: center; }
.dlg fieldset { border: 0; margin: 0.9rem 0; }
.dlg legend { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.4rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.4rem; }
.seg label {
    display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.45rem 0.4rem;
    border: 1px solid var(--gold-border); border-radius: var(--radius-lg); background: rgba(30, 41, 59, 0.6);
    font-size: 0.82rem; font-weight: 600; text-align: center; cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--primary); }
.seg label:has(input:checked) { border-color: var(--primary); background: rgba(212, 175, 55, 0.14); box-shadow: 0 0 12px rgba(212, 175, 55, 0.25); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.dlg-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.1rem; flex-wrap: wrap; }
.dlg-actions .btn { flex: 1 1 auto; }
.dlg .stats-line { text-align: center; margin-top: 0.7rem; color: var(--text-secondary); font-size: 0.9rem; }
.dlg .result-emoji { display: block; text-align: center; font-size: 2.6rem; margin-bottom: 0.3rem; }

/* ---------- toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
    display: flex; gap: 0.6rem; align-items: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.97));
    border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 9999px;
    padding: 0.55rem 0.6rem 0.55rem 1rem; font-size: 0.85rem; font-weight: 600;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6); z-index: 90;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast[hidden] { display: none; }
.toast.hiding { opacity: 0; transform: translateX(-50%) translateY(10px); }
.toast .btn { min-height: 36px; padding: 0.3rem 0.8rem; font-size: 0.78rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* ---------- obsahová sekce (SEO/GEO) ---------- */
.content {
    max-width: 820px; margin: 2.5rem auto 0;
    padding: 0 max(1rem, env(safe-area-inset-right)) 2.5rem max(1rem, env(safe-area-inset-left));
    line-height: 1.65; color: var(--text-secondary);
    content-visibility: auto; contain-intrinsic-size: auto 1400px;
}
.content .answer-first {
    font-size: 1.02rem; color: var(--text-primary); background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--gold-border); border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg); padding: 1rem 1.2rem;
}
.content h2 { font-size: clamp(1.25rem, 3.4vw, 1.6rem); font-weight: 800; color: var(--text-primary); margin: 2.2rem 0 0.8rem; }
.content h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin: 1.3rem 0 0.45rem; }
.content p { margin-bottom: 0.8rem; }
.content ul, .content ol { margin: 0 0 0.9rem 1.4rem; }
.content li { margin-bottom: 0.35rem; }
.content strong { color: var(--text-primary); }
.faq-item { background: rgba(15, 23, 42, 0.85); border: 1px solid var(--gold-border); border-radius: var(--radius-lg); padding: 0.9rem 1.1rem; margin-bottom: 0.7rem; }
.faq-item h3 { margin: 0 0 0.4rem; }
.faq-item p { margin: 0; font-size: 0.95rem; }
.more-games { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
.more-games a { padding: 0.45rem 1rem; background: rgba(212, 175, 55, 0.1); border: 1px solid var(--gold-border); border-radius: 9999px; font-size: 0.875rem; font-weight: 600; transition: border-color 0.15s ease, transform 0.15s ease; }
.more-games a:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--primary); }
.more-games .all { flex-basis: 100%; display: flex; justify-content: center; margin-top: 0.6rem; }
.updated { margin-top: 2rem; font-size: 0.8rem; color: var(--text-muted); }

/* ---------- responzivita ---------- */
/* tablet a výš: dvě desky vedle sebe + panel/dock vpravo */
@media (min-width: 900px) {
    :root { --board-primary: min(74svh, calc(100vw - 640px), 680px); --board-secondary: min(34svh, 340px); }
    .phase-setup .mine-zone { --board: min(74svh, calc(100vw - 420px), 680px); }

    .phase-battle {
        grid-template-areas: "head head head" "primary secondary panel";
        grid-template-columns: auto auto minmax(200px, 260px);
        align-items: start; justify-content: center; column-gap: 1.6rem;
    }
    .phase-setup {
        grid-template-areas: "head head" "mine dock";
        grid-template-columns: auto minmax(250px, 330px);
        align-items: start; justify-content: center; column-gap: 1.6rem;
    }
    .panel, .dock { position: sticky; top: 1rem; max-width: none; align-self: start; }
    .btns { grid-template-columns: 1fr; }
    .dock-btns { grid-template-columns: 1fr; }
    .counts { flex-direction: column; gap: 0.3rem; font-size: 1.05rem; }
    .board-head { width: auto; }
}

/* desktop širší */
@media (min-width: 1440px) {
    :root { --board-primary: min(78svh, 760px); --board-secondary: min(36svh, 380px); }
    .phase-setup .mine-zone { --board: min(78svh, 760px); }
}

/* mobil landscape: desky + panel vedle sebe, herní plocha bez scrollu */
@media (max-height: 540px) and (orientation: landscape) {
    .app { gap: 0.4rem; }
    :root { --board-primary: min(80svh, 40vw); --board-secondary: min(44svh, 22vw, 200px); }
    .phase-battle {
        grid-template-areas: "head head head" "primary secondary panel";
        grid-template-columns: auto auto minmax(118px, 200px);
        align-items: start; justify-content: center; column-gap: 0.7rem;
    }
    .phase-setup { grid-template-areas: "mine dock"; grid-template-columns: auto 1fr; column-gap: 0.8rem; align-items: start; }
    .phase-setup .mine-zone { --board: min(88svh, 44vw); }
    .phase-setup .hd { display: none; }
    .hd h1 { font-size: 1rem; }
    .panel { max-width: none; }
    .btns { grid-template-columns: 1fr; }
    .dock-btns { grid-template-columns: 1fr; }
    .counts { flex-direction: row; gap: 0.6rem; font-size: 0.78rem; }
    .btn { min-height: 38px; font-size: 0.7rem; padding: 0.35rem 0.45rem; }
    .board-head { width: auto; }
}

/* 4K / ultrawide */
@media (min-width: 2560px) {
    :root { --board-primary: min(80svh, 900px); --board-secondary: min(38svh, 440px); }
    .phase-setup .mine-zone { --board: min(80svh, 900px); }
    .content { max-width: 1000px; font-size: 1.1rem; }
}

/* ---------- omezený pohyb ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
