:root { --footer-h:72px; --naval-gold:#f2c761; --naval-line:#304768; --navy:#0b132b; }
* { box-sizing:border-box; }
html,body { margin:0; width:100%; height:100%; overflow:hidden; }
body { font-family:"Segoe UI",Arial,sans-serif; background:var(--navy); color:#edf3ff; touch-action:manipulation; }
[hidden] { display:none!important; }
button { font:inherit; cursor:pointer; }
button:disabled { cursor:default; }
button:focus-visible,a:focus-visible { outline:3px solid var(--naval-gold); outline-offset:2px; }
#game-page { position:fixed; inset:0 0 var(--footer-h); overflow:hidden; background:radial-gradient(ellipse at 50% 20%,#182b49,#091326 80%); }
.naval-layout { display:grid; grid-template-columns:clamp(220px,19vw,292px) minmax(0,1fr) clamp(220px,19vw,292px); height:100%; max-width:1920px; margin:auto; padding:12px; gap:12px; }
.panel { min-width:0; min-height:0; border:1px solid var(--naval-line); border-radius:16px; background:linear-gradient(160deg,#14243c,#0d192d); padding:12px; overflow:hidden; }
.my-side { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:10px; }
.rival-side { display:grid; grid-template-rows:auto minmax(0,1fr); gap:10px; }
.commander-card { display:flex; align-items:center; gap:10px; min-width:0; min-height:144px; }
.commander-portrait { width:clamp(78px,11dvh,116px); height:clamp(78px,11dvh,116px); object-fit:contain; flex:none; filter:drop-shadow(0 4px 7px #0004); }
.commander-copy { flex:1; min-width:0; }
.eyebrow { display:block; color:#c7ae72; font-size:11px; font-weight:750; letter-spacing:.07em; }
.commander-copy h1,.commander-copy h2 { font:700 clamp(24px,2.1vw,32px)/1.08 Georgia,serif; color:#fff0c6; margin:6px 0; }
.pirate-card h2 { font-size:clamp(22px,1.85vw,28px); }
.pirate-card .eyebrow { color:#d7a195; }
.commander-status { margin:0 0 7px; font-size:13px; line-height:1.3; color:#b7cae3; }
.fleet-health { display:flex; align-items:center; flex-wrap:nowrap; white-space:nowrap; gap:6px; font-size:13px; color:#b7c7de; }
.fleet-health strong { font-size:20px; color:#f8e8bd; font-variant-numeric:tabular-nums; }
.fleet-health b { color:#f47d85; font-size:21px; }
.health-track { margin-top:6px; height:4px; background:#293a54; border-radius:4px; overflow:hidden; }
.health-track span { display:block; width:100%; height:100%; background:#e8bc62; transition:width .2s; }
.pirate-card .health-track span { background:#df8980; }
.fleet-section,.fleet-list { min-height:0; min-width:0; }
.fleet-list { height:100%; display:grid; grid-template-rows:repeat(4,minmax(0,1fr)); gap:7px; }
.ship-row { display:flex; align-items:center; gap:10px; min-width:0; min-height:0; border:1px solid #ffffff12; border-radius:10px; background:#152943; padding:6px 8px; }
.ship-art { display:block; flex:none; width:clamp(58px,7vw,98px); height:100%; max-height:104px; min-height:0; background-size:contain; background-position:center; background-repeat:no-repeat; pointer-events:none; }
/* Pirátské PNG jsou již obrácené vlevo; nezrcadlit podruhé. */
.ship-label { min-width:0; }
.ship-row strong { display:block; font-size:15px; font-weight:650; }
.ship-row small { display:block; font-size:11px; line-height:1.3; color:#a9bad2; margin:4px 0; }
.ship-hp { display:flex; gap:3px; font-size:18px; line-height:1.1; }
.ship-hp .full { color:#f07c84; }
.ship-hp .empty { color:#4d617e; }
.ship-armor { display:flex; gap:3px; font-size:15px; line-height:1; margin-top:3px; }
.ship-armor .full { opacity:1; }
.ship-armor .empty { opacity:.22; filter:grayscale(1); }
.ship-row.is-sunk { background:#101e32; }
.ship-row.is-sunk .ship-label { opacity:.7; }

.ship-row.awaiting { border-style:dashed; }
.mini-map,.enemy-map { display:grid; grid-template-columns:15px minmax(0,1fr); grid-template-rows:15px minmax(0,1fr); gap:3px; margin:auto; }
.axis { display:grid; text-align:center; color:#98acc8; font-weight:650; font-size:11px; }
.axis.top { grid-column:2; grid-row:1; grid-template-columns:repeat(7,1fr); align-items:center; }
.axis.side { grid-column:1; grid-row:2; grid-template-rows:repeat(5,1fr); align-items:center; }
.map-grid { grid-column:2; grid-row:2; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); grid-template-rows:repeat(5,minmax(0,1fr)); gap:6px; aspect-ratio:7 / 5; min-width:0; min-height:0; }
.naval-cell { position:relative; min-width:0; min-height:0; aspect-ratio:1; padding:0; border:2px solid #627c9b; border-radius:10px; color:#163153; background:linear-gradient(155deg,#d9e5ee,#c6d7e5); display:grid; place-items:center; overflow:hidden; transition:border-color .12s,background-color .12s; }
.naval-cell:hover:not(:disabled) { background:#eff6ff; border-color:#f2c761; }
.naval-cell:disabled { opacity:1; }
.naval-cell:focus-visible { outline-offset:0; z-index:1; }
.naval-cell.has-ship { background:#c1d5e7; border-color:#81a0bd; }
.naval-cell.was-hit { background:#dfc8c1; border-color:#c47e6f; }
.naval-cell.sunk { background:#9baabc; border-color:#556c8c; }
.naval-cell.water-miss { background:#bcd8e5; border-color:#779eae; }
.naval-cell .life-marker { position:absolute; right:3px; bottom:3px; z-index:3; padding:2px 5px; background:#0a1934e8; border-radius:5px; color:white; font-size:clamp(11px,1vw,15px); font-weight:750; }
.naval-cell .ship-art { position:absolute; inset:1%; width:98%; height:98%; max-height:none; }
.water-impact { position:absolute; inset:12%; pointer-events:none; }
.water-impact img { width:100%; height:100%; object-fit:contain; }
#my-grid { gap:2px; }
#my-grid .naval-cell { border-width:1px; border-radius:3px; }
#my-grid .life-marker { font-size:8px; padding:0 2px; right:1px; bottom:1px; }
.side-actions button,.harbor-strip button,.confirm-actions button { border:1px solid #4c6280; border-radius:7px; background:#1b3150; color:#eaf0fb; padding:7px 5px; font-size:11px; font-weight:650; min-height:31px; }
.side-actions button:disabled { opacity:.45; }
.gold-action { border:1px solid #f3d395; border-radius:8px; background:#e9bd60; color:#152037; padding:9px 8px; font:750 14px/1.2 "Segoe UI",Arial; min-height:36px; }
.gold-action:hover:not(:disabled) { background:#ffda83; }
.gold-action:disabled { opacity:.45; }
.arena { min-width:0; min-height:0; display:flex; flex-direction:column; gap:8px; }
.board-outer { min-width:0; min-height:0; flex:1; display:grid; place-items:center; overflow:hidden; padding:4px 0 2px; }
.enemy-map { width:min(94%,780px); max-width:100%; margin:auto; grid-template-columns:22px minmax(0,1fr); grid-template-rows:22px minmax(0,1fr); gap:5px; }
.enemy-map .axis { font-family:Georgia,serif; font-size:15px; color:#dfcfaa; }
.harbor-strip { display:flex; flex:none; align-items:center; justify-content:center; gap:12px; padding:10px 12px; background:#112038; border:1px solid var(--naval-line); border-radius:12px; min-width:0; }
.harbor-brand { display:flex; align-items:center; gap:8px; color:#e9c980; text-decoration:none; font:650 12px/1.3 Georgia,serif; }
.harbor-brand img { object-fit:contain; flex:none; }
.harbor-terms { display:flex; flex-direction:column; gap:5px; flex:1; max-width:275px; }
.harbor-terms span { display:flex; align-items:center; gap:6px; font-size:12px; line-height:1.2; color:#d7e0ed; }
.harbor-terms img { object-fit:contain; }
.harbor-terms b { color:#e9c980; }
.harbor-strip button { font-size:12px; white-space:nowrap; }
#mission-rules { width:30px; border-radius:50%; }
.confirm-actions { display:flex; justify-content:flex-end; gap:10px; }
#confirm-restart { border-color:#ad6870; background:#61303d; }
body[data-game=namornictvo] .osli-dialog { overflow:hidden; max-height:calc(100dvh - 20px); padding:24px; width:min(620px,calc(100vw - 24px)); }
body[data-game=namornictvo] .osli-dialog h2 { margin:0 0 14px; }
body[data-game=namornictvo] .osli-dialog p { margin:9px 0; font-size:14px; line-height:1.5; }
body[data-game=namornictvo] .osli-dialog form { margin-top:14px; }
.log-pager { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; }
.log-pager button { border:1px solid #526582; border-radius:7px; padding:7px 12px; background:#1b3150; color:#eaf0fb; }
.log-pager button:disabled { opacity:.4; }
body[data-game=namornictvo] #naval-result { width:min(790px,calc(100vw - 24px)); padding:28px; background:radial-gradient(ellipse at 25% 45%,#294563,#111d31 75%); border-color:#bb9e5d; }
#naval-result[data-outcome=lose] { border-color:#71839a; }
.result-layout { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:24px; }
.result-admiral { display:block; width:100%; height:min(440px,62dvh); object-fit:contain; filter:drop-shadow(0 8px 14px #0005); }
.result-copy { min-width:0; }
.result-copy h2 { font:600 29px/1.15 Georgia,serif; margin:9px 0 14px!important; }
.result-copy p { font-size:15px!important; }
.result-copy .result-detail { font-size:12px!important; color:#b7c7dd; }
.result-close { position:absolute; right:9px; top:9px; width:32px; height:32px; border:1px solid #ffffff30; border-radius:50%; background:#0b172b; color:#eaf1ff; font-size:22px; }
.treasure-button { background:#e8bf68; border:1px solid #f6d590; color:#162238; font-weight:750; padding:12px 18px; border-radius:9px; width:100%; }
.treasure-button:hover:not(:disabled) { background:#ffda88; }
.treasure-button.is-open { background:#233e42; border-color:#537673; color:#bedecd; }
.result-copy .treasure-amount { color:#fff0b3; font-size:22px!important; font-weight:800; font-variant-numeric:tabular-nums; margin:10px 0; }
.result-copy #next-mission { width:100%; margin-top:10px; }
body[data-game=namornictvo] .of-panel { overflow:hidden; }
@media (max-width:1250px) and (min-width:761px) {
  .naval-layout { grid-template-columns:220px minmax(0,1fr) 220px; padding:8px; gap:8px; }
  .panel { padding:10px; }
  .commander-card { gap:6px; }
  .commander-portrait { width:74px; height:86px; }
  .commander-copy h1 { font-size:27px; }
  .pirate-card h2 { font-size:22px; }
  .eyebrow { font-size:10px; }
  .commander-status { font-size:12px; }
  .fleet-health { font-size:11px; gap:4px; }
  .fleet-health strong,.fleet-health b { font-size:18px; }
  .ship-art { width:68px; }
  .ship-row { gap:8px; padding:5px; }
  .ship-row strong { font-size:14px; }
  .harbor-brand { display:none; }
  .harbor-strip { gap:8px; padding:9px; }
  .harbor-terms span { font-size:11px; }
}
@media (max-height:800px) and (min-width:761px) {
  .naval-layout { padding:10px; gap:10px; }
  .panel { padding:10px; gap:8px; }
  .commander-card { min-height:130px; }
  .commander-portrait { width:82px; height:90px; }
  .commander-copy h1 { font-size:27px; }
  .pirate-card h2 { font-size:22px; }
  .commander-status { font-size:12px; }
  .fleet-list { gap:5px; }
  .ship-row strong { font-size:14px; }
  .ship-row small { font-size:10px; margin:3px 0; }
  .ship-hp { font-size:17px; }
  .harbor-strip { padding:7px 10px; }
}
@media (max-height:650px) and (min-width:761px) {
  .naval-layout { padding:6px; gap:8px; }
  .panel { padding:8px; gap:5px; }
  .commander-card { min-height:88px; }
  .commander-portrait { width:57px; height:60px; }
  .commander-copy h1,.pirate-card h2 { font-size:20px; margin:3px 0; }
  .eyebrow { font-size:9px; }
  .commander-status { font-size:10px; margin-bottom:3px; }
  .fleet-health { font-size:10px; gap:4px; }
  .fleet-health strong,.fleet-health b { font-size:15px; }
  .health-track { margin-top:3px; height:3px; }
  .ship-row { padding:3px 6px; gap:8px; }
  .ship-art { width:55px; }
  .ship-row strong { font-size:12px; }
  .ship-row small { display:none; }
  .ship-hp { font-size:13px; margin-top:3px; }
  .gold-action { font-size:12px; min-height:28px; padding:6px; }
  .harbor-strip { padding:5px 8px; }
  .harbor-terms { gap:3px; }
  .harbor-terms span { font-size:10px; }
  .harbor-terms img { width:16px; height:16px; }
}
@media (max-width:760px), (max-width:900px) and (min-height:651px) {
  .naval-layout { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:105px minmax(0,1fr) 98px auto; grid-template-areas:"admiral pirate" "arena arena" "ourfleet theirfleet" "actions actions"; padding:8px; gap:6px; }
  .my-side,.rival-side { display:contents; }
  .my-side .commander-card { grid-area:admiral; }
  .rival-side .commander-card { grid-area:pirate; }
  .my-side .fleet-section { grid-area:ourfleet; }
  .rival-side .fleet-section { grid-area:theirfleet; }
  .arena { grid-area:arena; gap:5px; }
  .commander-card { min-height:0; gap:6px; padding:5px; border:1px solid var(--naval-line); border-radius:10px; background:#112039; }
  .commander-portrait { width:58px; height:65px; }
  .eyebrow { font-size:8px; letter-spacing:.035em; }
  .commander-copy h1 { font-size:23px; margin:3px 0; }
  .pirate-card h2 { font-size:17px; margin:3px 0; }
  .commander-status { font-size:10px; margin-bottom:3px; }
  .fleet-health { font-size:9px; gap:3px; }
  .fleet-health strong,.fleet-health b { font-size:15px; }
  .health-track { height:3px; margin-top:3px; }
  .fleet-list { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:4px; }
  .ship-row { gap:3px; padding:3px; border-radius:6px; }
  .ship-art { width:clamp(28px,8vw,52px); }
  .ship-row strong { font-size:9px; }
  .ship-row small { display:none; }
  .ship-hp { font-size:10px; gap:1px; margin-top:4px; }
  .mini-map .axis { font-size:7px; }
  #my-grid { gap:1px; }
  #my-grid .life-marker { font-size:6px; }
  .gold-action { font-size:12px; min-height:31px; padding:7px; }
  #show-result { grid-column:1/-1; }
  .enemy-map { grid-template-columns:16px minmax(0,1fr); grid-template-rows:16px minmax(0,1fr); gap:3px; }
  .enemy-map .axis { font-size:12px; }
  #enemy-grid { gap:4px; }
  #enemy-grid .naval-cell { border-radius:7px; border-width:1px; }
  .harbor-strip { gap:7px; padding:4px 8px; border-radius:8px; }
  .harbor-brand { display:none; }
  .harbor-terms { gap:2px; max-width:none; }
  .harbor-terms span { font-size:9px; gap:4px; }
  .harbor-terms img { width:14px; height:14px; }
  .harbor-strip button { min-height:28px; font-size:10px; padding:5px; }
  #mission-rules { width:28px; }
  body[data-game=namornictvo] .osli-dialog { padding:18px; }
  body[data-game=namornictvo] .osli-dialog h2 { font-size:20px; margin-bottom:10px; }
  body[data-game=namornictvo] .osli-dialog p { font-size:12px; }
  body[data-game=namornictvo] #naval-result { padding:22px 16px; }
  .result-layout { grid-template-columns:1fr; gap:5px; }
  .result-admiral { height:min(230px,30dvh); }
  .result-copy h2 { font-size:25px; margin:7px 0!important; }
  .result-copy p { font-size:13px!important; }
  .result-copy .result-detail { font-size:10px!important; }
}
@media (max-width:380px) {
  .naval-layout { padding:5px; gap:5px; grid-template-rows:100px minmax(0,1fr) 90px auto; }
  .commander-card { gap:4px; padding:4px; }
  .commander-portrait { width:44px; height:57px; }
  .commander-copy h1 { font-size:21px; }
  .pirate-card h2 { font-size:16px; }
  .commander-status { font-size:9px; }
  .fleet-health strong,.fleet-health b { font-size:14px; }
  .fleet-health { font-size:8px; gap:2px; }
  .ship-art { width:24px; }
  .ship-row strong { font-size:8px; }
  .ship-hp { font-size:9px; }
}
@media (prefers-reduced-motion:reduce) { .health-track span,.naval-cell { transition:none; } }
@media (min-width:761px) and (max-height:500px) {
  .panel { padding:6px; }
  .commander-card { gap:4px; min-height:80px; }
  .commander-portrait { width:44px; height:48px; }
  .fleet-list { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:4px; }
  .ship-art { width:32px; }
  .ship-row { padding:3px; gap:4px; }
  .ship-row strong { font-size:10px; }
  .ship-hp { font-size:10px; gap:1px; }
  .harbor-brand { display:none; }
}

/* 3.3: the own map and attack details live in dialogs; fleets keep their space. */
.fleet-actions { display:flex; flex-direction:column; gap:7px; border-top:1px solid #ffffff18; padding-top:10px; }
.fleet-actions p { margin:0; color:#b8c9de; text-align:center; font-size:12px; line-height:1.4; }
.commander-copy h1 { font-size:clamp(23px,1.9vw,29px); }
.harbor-strip #map-btn { display:flex; align-items:center; gap:5px; }
.harbor-terms { max-width:none; }
#map-dialog { width:min(700px,calc(100vw - 24px)); }
.map-popup-layout { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:24px; align-items:center; }
.mini-map { width:100%; }
#my-grid { gap:5px; }
#my-grid .naval-cell { border-radius:6px; }
#my-grid .life-marker { font-size:11px; padding:1px 4px; }
.deployment-controls { display:flex; flex-direction:column; gap:12px; min-width:0; }
.deployment-controls p { margin:0!important; }
.place-status { color:#f1d48b; font-weight:650; }
#map-report { color:#b7c8de; }
.side-actions { display:flex; gap:7px; margin-bottom:10px; }
.side-actions button { font-size:12px; padding:8px; }
#start-btn { width:100%; }
.admission-price { display:block; margin-top:7px; text-align:center; font-size:11px; color:#aebed6; }
.attack-setting { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 2px; }















.result-values { margin:13px 0; }
.result-values>div { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px solid #ffffff17; font-size:13px; }
.result-values dt { color:#b8c8df; }
.result-values dd { margin:0; font-weight:700; text-align:right; color:#f5dfac; }
.result-copy #next-mission { font-size:13px; }
#open-chest.is-open { min-height:0; padding:6px; font-size:12px; }
@media(max-width:1250px) and (min-width:761px){.commander-copy h1{font-size:23px}.harbor-strip{gap:6px}.harbor-terms span{font-size:11px}.harbor-brand{display:none}}
@media(max-width:760px),(max-width:900px) and (min-height:651px){
  .fleet-actions { grid-area:actions; flex-direction:row; justify-content:center; align-items:center; padding-top:0; border:0; gap:6px; }
  .fleet-actions p { font-size:10px; }
  .fleet-actions .gold-action { flex-shrink:0; }
  .commander-copy h1 { font-size:18px; }
  #map-btn svg { width:18px; height:18px; }
  .harbor-terms span { font-size:10px; }
  .result-values>div { font-size:12px; padding:5px 0; }
}
@media(max-width:480px){
  .map-popup-layout { grid-template-columns:1fr; gap:14px; }
  .mini-map { width:min(100%,280px); }
  .deployment-controls { gap:8px; }
  .side-actions { margin:0; }
  #placement-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:center; }
  #placement-actions .admission-price { grid-column:1/-1; margin:0; }
  .side-actions button { font-size:10px; padding:6px; }
  .result-admiral { height:min(190px,24dvh); }
  .fleet-actions p { max-width:150px; }
}
@media(max-height:650px) and (min-width:761px){.commander-copy h1{font-size:18px}.fleet-actions{padding-top:5px;gap:4px}.fleet-actions p{font-size:10px}}
@media(max-height:500px) and (min-width:761px){.naval-layout{grid-template-columns:220px minmax(0,1fr) 220px}.fleet-actions p{display:none}.harbor-strip{gap:5px}.harbor-terms span{font-size:9px}.harbor-strip button{font-size:10px;min-height:26px}.commander-copy h1{font-size:17px}}

/* The latest turns stay below the map; the complete journal uses pages, never a scroll box. */
.battle-feed { display:flex; flex:none; align-items:center; gap:10px; min-width:0; padding:3px 2px; }
#battle-log { flex:1; min-width:0; margin:0; padding:0; list-style:none; color:#bdcde2; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
#battle-log li+li { margin-top:5px; color:#91a8c7; }
#battle-log-btn { flex:none; align-self:center; border:1px solid #304768; border-radius:7px; background:#152943; color:#ead19a; padding:7px 9px; font-size:12px; }
.repair-quote { flex:1; min-width:0; margin:0; color:#d7e0ed; font-size:14px; line-height:1.45; }
.repair-quote strong { color:#f4d490; white-space:nowrap; font-weight:700; font-variant-numeric:tabular-nums; }
.harbor-brand { flex:none; }
.harbor-strip button { flex:none; }
@media(max-width:1250px) and (min-width:761px){.repair-quote{font-size:13px}}
@media(max-width:760px),(max-width:900px) and (min-height:651px){
  .battle-feed { gap:6px; padding:0; }
  #battle-log { font-size:11px; line-height:1.3; }
  #battle-log li+li { margin-top:3px; }
  #battle-log-btn { font-size:11px; padding:6px; }
  .repair-quote { font-size:12px; line-height:1.35; }
}
@media(max-height:500px) and (min-width:761px){
  .arena { gap:5px; }
  #battle-log { font-size:10px; line-height:1.3; }
  #battle-log li+li { display:none; }
  #battle-log-btn { font-size:10px; padding:5px; }
  .repair-quote { font-size:11px; line-height:1.25; }
  #map-btn span { display:none; }
}

@media(max-width:520px){
  
  
  
  
  
  
  
}


/* 3.4.1 layout cleanup: larger board, bottom log, footer tools */
.my-side{grid-template-rows:auto minmax(0,1fr) auto;}
.fleet-actions{gap:6px;}
.fleet-actions p[hidden]{display:none!important;}
.bottom-feed{display:flex;align-items:center;gap:10px;min-width:0;padding:10px 12px;background:#112038;border:1px solid var(--naval-line);border-radius:12px;}
.naval-footer-tools{position:fixed;left:50%;bottom:78px;transform:translateX(-50%);display:flex;gap:6px;z-index:15;}
.naval-footer-tools button{border:1px solid #4c6280;border-radius:8px;background:#152943;color:#eaf0fb;padding:7px 10px;font-size:12px;font-weight:650;min-height:34px;display:flex;align-items:center;gap:6px;}
.naval-footer-tools #mission-rules{width:34px;justify-content:center;padding:7px 0;}
.naval-footer-tools.in-footer{position:static;left:auto;bottom:auto;transform:none;z-index:auto;margin-left:4px;}
.naval-footer-tools.in-footer button{min-height:36px;}
#battle-log{min-height:40px;}
#battle-log li{white-space:normal;}
#battle-log-btn{white-space:nowrap;}





@media(max-width:760px),(max-width:900px) and (min-height:651px){
  .bottom-feed{padding:6px 8px;gap:6px;border-radius:8px;}
  .naval-footer-tools{bottom:74px;}
  .naval-footer-tools button{min-height:30px;font-size:11px;padding:5px 8px;}
  .naval-footer-tools #mission-rules{width:30px;}
}
@media(max-width:520px){
  
}




/* 3.4.3 popup: one top row, no separator lines */




/* Admirál útočí: hlava vlevo, zasažená pirátská loď vpravo a míří k Admirálovi. */



/* Pirát útočí: zasažená královská loď vlevo nahoře, pirát vpravo nahoře. */





@media(max-width:520px){
  
  
  
  
}


/* 3.5.0 difficulty selector */
.difficulty-setting select,.attack-setting select{min-width:150px;border:1px solid #526582;border-radius:7px;background:#132640;color:#eef4ff;padding:6px 8px;}
.difficulty-note{display:block;margin:-7px 2px 8px;color:#9fb3cd;font-size:11px;line-height:1.35;}


/* 4.0.0 combat refresh — local naval UI only. Shared footer remains untouched. */

.fleet-health{gap:12px;align-items:center;flex-wrap:wrap;}
.fleet-resource{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;color:#d7e2f1;}
.fleet-resource strong{font-style:normal;font-variant-numeric:tabular-nums;}
.fleet-resource.hp b{color:#f47d85;font-size:22px;}
.fleet-resource.armor b{color:#b9d9ff;font-size:19px;filter:drop-shadow(0 1px 1px #0005);}
.fleet-resource.armor strong{color:#d7eaff;font-size:18px;}










@media(max-width:520px){
  .fleet-health{gap:6px;}
  .fleet-resource strong{font-size:13px!important;}
  
  
}


/* 4.0.6 — balanc Galeony + CSV log bitev v panelu Můj přehled */
.naval-analysis-toggle{
  display:flex;align-items:center;gap:9px;width:100%;padding:9px 10px;margin:4px 0;
  border:1px solid #ffffff18;border-radius:8px;background:#132640;color:#eaf1ff;
  font:600 12px/1.25 "Segoe UI",Arial,sans-serif;cursor:pointer;
}
.naval-analysis-toggle input{width:17px;height:17px;margin:0;accent-color:#e9bd60;flex:none;}
.naval-analysis-toggle:hover{border-color:#7d91ac;background:#172d4a;}

/* ==========================================================
   4.1.0 — kompletní vizuální přepracování Oslího námořnictva
   Království = modrá / zlato, Piráti = červená / černá.
   Sdílená patička zůstává beze změny.
   ========================================================== */
:root{
  --royal-blue:#0b55b7;
  --royal-blue-dark:#082b63;
  --royal-gold:#ffc83d;
  --royal-gold-deep:#c77b12;
  --pirate-red:#c9342f;
  --pirate-red-dark:#4a161c;
  --pirate-iron:#202c3b;
  --sea-deep:#071c35;
  --sea-mid:#0d4970;
  --sea-light:#68b9d6;
  --parchment:#eadbb8;
}

body[data-game="namornictvo"]{
  background:#071426;
}
#game-page{
  background:
    radial-gradient(circle at 50% 15%,#174b6b55,transparent 34%),
    linear-gradient(180deg,#09182b 0%,#06111f 100%);
}
.naval-layout{
  gap:12px;
  padding:12px;
  grid-template-columns:clamp(250px,21vw,330px) minmax(0,1fr) clamp(250px,21vw,330px);
}
.panel{
  position:relative;
  border-radius:18px;
  box-shadow:0 12px 30px #0007,inset 0 1px 0 #ffffff15;
}
.my-side{
  border:2px solid #e2b33f88;
  background:
    radial-gradient(circle at 18% 4%,#1566c255,transparent 34%),
    linear-gradient(155deg,#0e3974 0%,#0b2447 42%,#07182d 100%);
}
.my-side::before,
.rival-side::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:5px;
  border-radius:16px 16px 0 0;
  pointer-events:none;
}
.my-side::before{background:linear-gradient(90deg,#9b5a0d,#ffd85b,#fff0a0,#ffd85b,#9b5a0d);}
.rival-side{
  border:2px solid #a84a4288;
  background:
    radial-gradient(circle at 82% 4%,#a32f3150,transparent 36%),
    linear-gradient(205deg,#441921 0%,#241823 45%,#111724 100%);
}
.rival-side::before{background:linear-gradient(90deg,#171d27,#b4262c,#f16355,#b4262c,#171d27);}

.commander-card{
  min-height:132px;
  padding:5px 5px 8px;
  border-bottom:1px solid #ffffff15;
}
.commander-portrait{
  border-radius:18px;
  background:#06132666;
  padding:3px;
}
.my-side .commander-portrait{
  outline:2px solid #e7b54255;
  box-shadow:0 0 0 4px #0a2e5e80,0 8px 18px #0006;
}
.rival-side .commander-portrait{
  outline:2px solid #b7434355;
  box-shadow:0 0 0 4px #36131999,0 8px 18px #0006;
}
.my-side .eyebrow{color:#ffd96e;}
.rival-side .eyebrow{color:#ff9b8f;}
.my-side .commander-copy h1{color:#fff0ae;text-shadow:0 2px 0 #734d0f;}
.rival-side .commander-copy h2{color:#ffd2c9;text-shadow:0 2px 0 #4b141a;}
.commander-status{color:#cbd8e9;}

/* Nové malé herní ikony. Emoji zůstává jen jako textový fallback pro čtečky. */
.fleet-resource b,
.ship-hp span,
.ship-armor span{
  display:inline-block;
  background-position:center;
  background-repeat:no-repeat;
  background-size:contain;
  color:transparent!important;
  font-size:0!important;
  filter:none!important;
}
.fleet-resource b{width:27px;height:27px;flex:none;}
.my-side .fleet-resource.hp b{background-image:url("images/ui_royal_hp.opt12.webp");}
.my-side .fleet-resource.armor b{background-image:url("images/ui_royal_armor.opt12.webp");}
.rival-side .fleet-resource.hp b{background-image:url("images/ui_royal_hp.opt12.webp");}
.rival-side .fleet-resource.armor b{background-image:url("images/ui_pirate_armor.opt12.webp");}
.fleet-health{gap:10px;}
.fleet-resource{gap:4px;}
.fleet-resource strong{font-size:17px!important;color:#fff4ce!important;text-shadow:0 1px 2px #000;}
.rival-side .fleet-resource strong{color:#ffe0d9!important;}

.fleet-list{gap:6px;}
.ship-row{
  border-radius:12px;
  padding:6px 7px;
  overflow:hidden;
  transition:transform .12s,border-color .12s,background .12s;
}
.my-side .ship-row{
  border:1px solid #4d82bd66;
  background:linear-gradient(110deg,#0d315e,#102b4a 70%,#162844);
}
.rival-side .ship-row{
  border:1px solid #8e464755;
  background:linear-gradient(110deg,#351820,#251923 70%,#17202c);
}
.my-side .ship-row:not(.is-sunk){box-shadow:inset 3px 0 0 #d9ad3c88;}
.rival-side .ship-row:not(.is-sunk){box-shadow:inset -3px 0 0 #a52d3188;}

.ship-row.is-sunk{filter:saturate(.5);opacity:.78;}
.ship-row strong{font-family:Georgia,"Times New Roman",serif;font-size:14px;color:#fff4d2;}
.rival-side .ship-row strong{color:#ffd7cf;}
.ship-row small{margin:2px 0 4px;color:#aebed2;}
.ship-hp,.ship-armor{display:flex;gap:2px;align-items:center;}
.ship-hp span{width:17px;height:17px;}
.ship-armor span{width:15px;height:15px;margin-top:1px;}
.my-side .ship-hp span{background-image:url("images/ui_royal_hp.opt12.webp");}
.my-side .ship-armor span{background-image:url("images/ui_royal_armor.opt12.webp");}
.rival-side .ship-hp span{background-image:url("images/ui_royal_hp.opt12.webp");}
.rival-side .ship-armor span{background-image:url("images/ui_pirate_armor.opt12.webp");}
.ship-hp .empty,.ship-armor .empty{opacity:.16!important;filter:grayscale(.85)!important;}
.ship-art{filter:drop-shadow(0 5px 8px #0007);}

/* Střed hry = moře, nikoliv další panel. */
.arena{
  border:1px solid #3b7095;
  border-radius:18px;
  padding:8px 10px 9px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 38%,#17678c99 0%,#0d466a88 33%,transparent 64%),
    linear-gradient(180deg,#0a2947 0%,#071b31 100%);
  box-shadow:0 12px 32px #0008,inset 0 0 45px #1a6b8d20;
}
.arena-banner{
  flex:none;
  height:39px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:8px;
  padding:2px 8px 5px;
  border-bottom:1px solid #8ecbe033;
}
.arena-faction{display:flex;align-items:center;gap:6px;font:800 10px/1 "Segoe UI",Arial;letter-spacing:.07em;}
.arena-faction img{width:29px;height:29px;object-fit:contain;filter:drop-shadow(0 2px 3px #0008);}
.arena-faction.royal{color:#ffe486;justify-self:start;}
.arena-faction.pirate{color:#ffafa4;justify-self:end;}
.arena-title{text-align:center;white-space:nowrap;}
.arena-title strong{display:block;color:#f5e5bb;font:700 14px/1 Georgia,serif;letter-spacing:.05em;}
.arena-title small{display:block;margin-top:2px;color:#8ebdd0;font-size:9px;letter-spacing:.14em;}
.board-outer{padding:2px;}
.enemy-map{gap:4px;}
.enemy-map .axis{color:#e7d7ad;text-shadow:0 1px 2px #000;font-size:14px;}
.naval-cell{
  border:1px solid #77bad0aa;
  border-radius:8px;
  background:
    radial-gradient(circle at 28% 22%,#79cce055,transparent 18%),
    linear-gradient(145deg,#3c91ad,#1e6f91 52%,#165473);
  box-shadow:inset 0 0 0 1px #dff9ff18,inset 0 -7px 16px #06355155;
}
.naval-cell:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:#ffd65c;
  background:linear-gradient(145deg,#65b9ce,#2d86a4 55%,#1c6482);
  box-shadow:0 0 0 2px #ffd65c35,inset 0 -7px 16px #06355155;
}
.naval-cell.has-ship{background:linear-gradient(145deg,#5d9cb1,#34748e);border-color:#a9cad6;}
.naval-cell.was-hit{background:linear-gradient(145deg,#91665c,#603e43);border-color:#e79a7c;}
.naval-cell.sunk{background:linear-gradient(145deg,#48505d,#252c38);border-color:#7e8794;}
.naval-cell.water-miss{background:linear-gradient(145deg,#72bad0,#3f8aa6);border-color:#b1e2ec;}
.naval-cell .life-marker{
  right:2px;bottom:2px;
  border:1px solid #ffffff2c;
  background:#071423e8;
  color:#fff2d4;
  font-size:12px;
  box-shadow:0 2px 5px #0005;
}

/* Deník pod mapou vypadá jako lodní deník. */
.bottom-feed{
  border:1px solid #8a714b66!important;
  background:linear-gradient(180deg,#211b1aee,#15191fee)!important;
  border-radius:10px!important;
  box-shadow:inset 0 1px 0 #ffffff0a;
}
#battle-log{color:#e7dcc4!important;}
#battle-log-btn{color:#f2cd75!important;}

/* Tlačítka a ovládání */
.gold-action{
  border:1px solid #ffdd77;
  background:linear-gradient(#ffd964,#d99a27);
  color:#2d210d;
  box-shadow:inset 0 1px 0 #fff5bf,0 3px 8px #0004;
}
.gold-action:hover:not(:disabled){background:linear-gradient(#ffe790,#e8aa36);}
#naval-footer-tools button{
  border-color:#486a8b!important;
  background:#102942!important;
  color:#e9d69d!important;
}

/* Popup zásahu: méně technický, více herní. */









/* Dialog mapy a výsledku dostanou stejný jazyk jako hlavní hra. */
#map-dialog{
  background:linear-gradient(150deg,#0d3768,#0b203d 62%,#07172b)!important;
  border:2px solid #caa44f!important;
}
#map-dialog .mini-map{padding:8px;border-radius:12px;background:#071a2f88;border:1px solid #5b7b9855;}
#naval-result{
  border-radius:18px!important;
  background:radial-gradient(circle at 25% 45%,#245c7b,#0e2038 52%,#09162a)!important;
}
#naval-result[data-outcome="lose"]{background:radial-gradient(circle at 75% 45%,#61262c,#261820 48%,#101622)!important;}

/* Mobile / malé notebooky: stále bez scrollu. */
@media(max-width:1250px) and (min-width:761px){
  .naval-layout{grid-template-columns:230px minmax(0,1fr) 230px;gap:8px;padding:8px;}
  .arena-banner{height:32px;padding:0 5px 3px;}
  .arena-faction img{width:23px;height:23px;}
  .arena-faction{font-size:8px;}
  .arena-title strong{font-size:11px;}
  .fleet-resource b{width:22px;height:22px;}
  .ship-hp span{width:14px;height:14px;}.ship-armor span{width:13px;height:13px;}
}
@media(max-width:760px){
  .arena-banner{display:none;}
  .naval-layout{padding:6px;gap:6px;}
  .fleet-resource b{width:20px;height:20px;}
  .ship-hp span{width:13px;height:13px;}.ship-armor span{width:12px;height:12px;}
  .naval-cell{border-radius:5px;}
}
@media(max-height:690px) and (min-width:761px){
  .commander-card{min-height:92px;}
  .commander-portrait{width:68px;height:68px;}
  .arena-banner{height:30px;}
  .ship-hp span{width:13px;height:13px;}.ship-armor span{width:12px;height:12px;}
}

/* 1.0.0 FINAL — výkupné OslíCoin */
#harbor-ransom,#pay-ransom{background:#7f342e;border-color:#d99a67;color:#fff2cf;}
#harbor-ransom:hover:not(:disabled),#pay-ransom:hover:not(:disabled){background:#9a4038;}


/* 1.0.1 — vycentrovani bitevni plochy 5x7 */
.arena-banner{display:none!important;}
.arena{gap:7px;}
.board-outer{place-items:center;overflow:hidden;padding:2px 0;}
.enemy-map{width:min(94%,780px);margin:auto;}
#enemy-grid{gap:5px;}
.bottom-feed{padding:8px 10px;}
@media(max-width:1250px) and (min-width:761px){
  .enemy-map{width:min(93%,720px);}
  #enemy-grid{gap:4px;}
  .bottom-feed{padding:6px 8px;}
}
@media(max-height:760px) and (min-width:761px){
  .enemy-map{width:min(91%,690px);}
  #enemy-grid{gap:4px;}
  .bottom-feed{padding:5px 8px;}
}

/* 1.0.5 — jednoduchý 1s HP overlay nad lodí */
.board-outer{container-type:size}
.enemy-map{width:min(94cqw,calc((100cqh - 28px)*1.4 + 26px),780px)}
.ship-row{position:relative;overflow:visible;}
.ship-hit-fx{
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
  display:flex;
  align-items:center;
  justify-content:center;
  animation:shipHitFx 1s ease both;
}
.ship-hit-fx img{
  display:block;
  width:min(88%, 210px);
  height:auto;
  filter:drop-shadow(0 10px 14px rgba(0,0,0,.45));
}
@keyframes shipHitFx{
  0%{opacity:0;transform:scale(.78) translateY(8px);}
  15%{opacity:1;transform:scale(1.02) translateY(0);}
  70%{opacity:1;transform:scale(1) translateY(0);}
  100%{opacity:0;transform:scale(.96) translateY(-6px);}
}

/* 1.0.6 — nízké HP už nemění barvu karty lodě. Každá strana zůstává ve své vlastní barvě. */

/* ==========================================================
   4.4.0 — Přístav / vlastní flotila 1–4 lodě + nákup lodí
   ========================================================== */
#map-dialog{
  width:min(1120px,calc(100vw - 24px));
  max-width:1120px;
  max-height:min(86dvh,760px);
  overflow:auto;
}
#map-dialog .map-popup-layout{
  grid-template-columns:minmax(390px,.95fr) minmax(430px,1.05fr);
  gap:18px;
  align-items:start;
}
.map-card{min-width:0;display:flex;flex-direction:column;gap:12px;}
#map-dialog .mini-map{width:min(100%,520px);align-self:center;}
#map-dialog .deployment-controls{
  padding:11px 12px;border:1px solid #ffffff16;border-radius:12px;
  background:#07182a88;gap:8px;
}
.fleet-manager{
  min-width:0;padding:12px;border:1px solid #d7ad4c66;border-radius:14px;
  background:linear-gradient(160deg,#102c4cdd,#081b32ee);
  box-shadow:inset 0 1px 0 #ffffff10;
}
.fleet-manager-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:5px;}
.fleet-manager-head h3{margin:2px 0 0;color:#ffe9a3;font:700 22px/1.1 Georgia,"Times New Roman",serif;}
.fleet-manager-head .eyebrow{font-size:9px;color:#e9bd60;letter-spacing:.15em;font-weight:800;}
#fleet-selection-count{
  min-width:58px;text-align:center;padding:8px 10px;border-radius:999px;
  border:1px solid #8a7550;background:#1a2737;color:#d6dbe3;font-size:16px;
}
#fleet-selection-count.is-ready{border-color:#f0c758;background:#3b3219;color:#ffe89c;box-shadow:0 0 16px #f0c75822;}
.fleet-manager-help{margin:0 0 10px!important;color:#aebed2!important;font-size:11px!important;line-height:1.35;}
.fleet-market-link{display:inline-flex;align-items:center;justify-content:center;min-height:34px;margin:0 0 10px;padding:7px 10px;border:1px solid #d7ad4c66;border-radius:9px;color:#f4d37c;background:#0b2139;text-decoration:none;font-size:11px;font-weight:800;}
.fleet-market-link:hover,.fleet-market-link:focus-visible{border-color:#e8c665;color:#fff0b0;background:#12304f;}
.fleet-selector{display:grid;gap:7px;}
.fleet-choice{
  min-height:72px;display:grid;grid-template-columns:22px 86px minmax(0,1fr);align-items:center;gap:8px;
  padding:6px 9px;border:1px solid #ffffff16;border-radius:11px;
  background:linear-gradient(105deg,#0d3157,#11253d);transition:border-color .14s,background .14s,opacity .14s;
}
.fleet-choice.is-selected{border-color:#e4b84e88;background:linear-gradient(105deg,#123f70,#132c48);box-shadow:inset 3px 0 0 #e4b84e99;}
.fleet-choice.is-locked{opacity:.55;filter:saturate(.5);}
.fleet-choice>input[type="checkbox"]{width:18px;height:18px;margin:0;accent-color:#e8b94d;cursor:pointer;}
.fleet-choice-art{display:block;width:86px;height:62px;background-position:center;background-repeat:no-repeat;background-size:contain;filter:drop-shadow(0 4px 5px #0008);}
.fleet-choice-body{min-width:0;display:flex;flex-direction:column;gap:4px;}
.fleet-choice-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;}
.fleet-choice-head strong{color:#fff1be;font:700 14px/1.15 Georgia,"Times New Roman",serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fleet-choice-head span{color:#a9bfd5;font-size:10px;white-space:nowrap;}
.ship-name-input{
  width:100%;min-width:0;height:28px;padding:4px 8px;border:1px solid #5f7895;border-radius:7px;
  background:#07192b;color:#eef6ff;font:600 11px/1 "Segoe UI",Arial,sans-serif;outline:none;
}
.ship-name-input:focus{border-color:#e1b849;box-shadow:0 0 0 2px #e1b84922;}
.ship-name-input::placeholder{color:#71859c;font-weight:400;}
.fleet-choice small{color:#8fa6bd;font-size:9px;line-height:1.2;}

/* Volitelný velký 1s zásah. Malý -HP overlay v seznamu zůstává vždy. */
.ship-hit-popup{
  position:fixed;inset:0;z-index:240;pointer-events:none;
  display:grid;place-items:center;padding-bottom:var(--footer-h,0px);
}
.ship-hit-popup[hidden]{display:none!important;}
.ship-hit-popup-card{
  position:relative;width:min(430px,44vw);height:min(330px,43dvh);min-width:300px;min-height:230px;
  display:flex;align-items:center;justify-content:center;
  border:2px solid #d7b053;border-radius:18px;
  background:radial-gradient(circle at 50% 35%,#214d6edd,#0a1b31f2 70%);
  box-shadow:0 24px 70px #000c,inset 0 1px 0 #ffffff1a;
  overflow:hidden;
  animation:naval-hit-pop .14s ease-out both;
}
.ship-hit-popup-art{
  position:absolute;inset:16px 20px 48px;background-position:center;background-repeat:no-repeat;background-size:contain;
  filter:drop-shadow(0 10px 14px #0009);
}
/* Také náhled zásahu zachovává původní orientaci pirátské lodi. */
#ship-hit-popup-name{
  position:absolute;left:12px;right:12px;bottom:12px;text-align:center;color:#fff0bd;
  font:700 18px/1.1 Georgia,"Times New Roman",serif;text-shadow:0 2px 4px #000;
}
.ship-hit-popup-damage{
  position:absolute;right:14px;top:12px;width:118px;max-height:118px;object-fit:contain;
  filter:drop-shadow(0 7px 8px #0009);transform:rotate(5deg);
}
@keyframes naval-hit-pop{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}

@media(max-width:900px){
  #map-dialog{max-height:88dvh;}
  #map-dialog .map-popup-layout{grid-template-columns:1fr;}
  #map-dialog .mini-map{width:min(100%,390px);}
  .fleet-selector{grid-template-columns:1fr 1fr;}
  .fleet-choice{grid-template-columns:18px 56px minmax(0,1fr);min-height:64px;padding:5px;}
  .fleet-choice-art{width:56px;height:48px;}
  .fleet-choice-head{display:block;}.fleet-choice-head span{display:block;margin-top:2px;}
  .ship-hit-popup-card{width:min(390px,82vw);height:min(300px,46dvh);}
}
@media(max-width:560px){
  .fleet-selector{grid-template-columns:1fr;}
  .fleet-choice{grid-template-columns:18px 66px minmax(0,1fr);}
  .fleet-choice-art{width:66px;height:50px;}
  .ship-hit-popup-card{min-width:0;width:88vw;height:280px;}
  .ship-hit-popup-damage{width:88px;}
}

/* ==========================================================
   4.4.1 — TELEFON + TABLET NA VÝŠKU
   PC a tablet na šířku zůstávají beze změny.
   Po horních kartách velitelů se dostupná výška dělí 50 : 50:
   1/2 bitevní mapa, 1/2 flotily. Každá flotila má vlastní 50 % šířky.
   ========================================================== */
@media (max-width:900px) and (orientation:portrait) {
  .naval-layout {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:104px minmax(0,1fr) minmax(0,1fr) auto;
    grid-template-areas:
      "admiral pirate"
      "arena arena"
      "ourfleet theirfleet"
      "actions actions";
    gap:6px;
    padding:6px;
  }

  /* Horní karty zůstávají kompaktní, aby prostor dostala mapa a lodě. */
  .commander-card {
    min-height:0;
    padding:5px;
  }

  /* Horní polovina: mapa využije celou šířku i dostupnou výšku. */
  .arena {
    min-height:0;
    padding:5px 6px 6px;
    gap:5px;
  }
  .board-outer {
    min-height:0;
    padding:0;
    place-items:center;
  }
  .enemy-map {
    width:100%;
    max-width:none;
    grid-template-columns:17px minmax(0,1fr);
    grid-template-rows:17px minmax(0,1fr);
    gap:3px;
  }
  .enemy-map .axis { font-size:12px; }
  #enemy-grid { gap:3px; }
  #enemy-grid .naval-cell {
    border-width:1px;
    border-radius:6px;
  }

  /* Deník zabere jen nutné minimum a neukrajuje mapě zbytečně výšku. */
  .bottom-feed {
    flex:0 0 auto;
    min-height:40px;
    padding:5px 6px!important;
    gap:5px;
  }
  #battle-log {
    min-height:0;
    font-size:10px;
    line-height:1.22;
  }
  #battle-log li+li { margin-top:2px; }
  #battle-log-btn {
    padding:5px 6px;
    font-size:10px;
  }

  /* Dolní polovina: 50 % Admirál / 50 % Pirát.
     Uvnitř každé poloviny jsou 4 lodě pod sebou, takže karty nejsou titěrné. */
  .fleet-section {
    min-height:0;
    overflow:hidden;
  }
  .my-side .fleet-section { padding-right:2px; }
  .rival-side .fleet-section { padding-left:2px; }
  .fleet-list {
    height:100%;
    grid-template-columns:1fr;
    grid-template-rows:repeat(4,minmax(0,1fr));
    gap:5px;
  }
  .ship-row {
    min-height:0;
    gap:6px;
    padding:4px 6px;
    border-radius:8px;
  }
  .ship-art {
    width:clamp(54px,14vw,92px);
    height:100%;
    max-height:92px;
  }
  .ship-row strong {
    font-size:clamp(10px,2.7vw,14px);
    line-height:1.05;
  }
  .ship-row small { display:none; }
  .ship-hp {
    margin-top:3px;
    gap:1px;
  }
  .ship-hp span { width:clamp(11px,2.9vw,15px); height:clamp(11px,2.9vw,15px); }
  .ship-armor span { width:clamp(10px,2.6vw,14px); height:clamp(10px,2.6vw,14px); }

  .fleet-actions {
    min-height:34px;
    padding-top:0;
    gap:6px;
  }
}

/* Na velmi úzkém telefonu ještě trochu šetříme horní karty,
   samotné rozdělení 50 : 50 ale zůstává. */
@media (max-width:420px) and (orientation:portrait) {
  .naval-layout { grid-template-rows:96px minmax(0,1fr) minmax(0,1fr) auto; gap:5px; padding:5px; }
  .commander-portrait { width:48px; height:58px; }
  .commander-copy h1 { font-size:20px; }
  .pirate-card h2 { font-size:16px; }
  .ship-art { width:clamp(48px,13vw,64px); }
  .ship-row { padding:3px 4px; gap:4px; }
  .ship-row strong { font-size:10px; }
}

/* Na BOČNÍCH stranách jsou vždy lodě (i potopené). Pirát je pouze ve velké mapě. */
.enemy-map .naval-cell.pirate-sunk {
  background:linear-gradient(145deg,#24486a,#153550 60%,#11253d);
  border-color:#d2ab60;
}
.enemy-map .naval-cell .sunk-pirate {
  position:absolute;
  inset:0;
  display:block;
  width:100%; height:100%;
  background-position:center;
  background-repeat:no-repeat;
  background-size:contain;
  pointer-events:none;
  filter:drop-shadow(0 2px 2px #0007);
}
.fixed-difficulty { display:flex;justify-content:space-between;align-items:center;gap:12px; }
.fixed-difficulty strong { color:#f8dc90; font-size:1.05em; }
/* Po vyzvednutí pokladu se obrázek plynule změní na otevřenou truhlu. */
#naval-result[data-chest="opened"] .result-admiral { animation:naval-treasure-reveal .4s ease-out both; }
@keyframes naval-treasure-reveal {
  from {transform:scale(.97);opacity:.75;}
  to {transform:scale(1);opacity:1;}
}
@media(prefers-reduced-motion:reduce) {
  #naval-result[data-chest="opened"] .result-admiral { animation:none; }
}

/* Hotové PNG: bez dočasného dobarvování, úmyslného ztmavení nebo zmenšení. */
.ship-art.ship-type-sloop, .fleet-choice-art.ship-type-sloop {filter:drop-shadow(0 3px 5px #0008);}
.ship-art.ship-type-royal, .fleet-choice-art.ship-type-royal {filter:drop-shadow(0 3px 5px #0008);}
.fleet-choice.is-locked:has(.ship-type-royal) {opacity:.85;filter:none;border:1px dashed #c5a25e66;}
.fleet-choice.is-locked:has(.ship-type-royal) small {color:#f2cc85;}

/* Přehledné parametry lodí i na menších obrazovkách. */
.fleet-choice-head strong{font-size:16px;}
.ship-choice-stats{display:block;color:#e4d39f;font-size:12px;line-height:1.3;font-weight:750;white-space:normal;}
.fleet-choice small{font-size:11px;line-height:1.35;}
.fleet-choice{min-height:86px;}
.fleet-choice.is-locked{opacity:.75;}
@media(max-width:560px){.fleet-choice-head strong{font-size:15px;}.ship-choice-stats{font-size:11px;}.fleet-choice{min-height:82px;}}

/* 1.5.2 – výsledkové okno bez oprav, přesměrování do loděnic */
.result-dock-note { margin:10px 0 7px; padding:10px 12px; border:1px solid #4b637b; background:#17283e; border-radius:9px; color:#d8e4f4; font-size:13px; line-height:1.45; }
.result-dock-link { display:block; margin-top:9px; padding:10px 12px; text-align:center; text-decoration:none; font-weight:750; color:#f6e3b4; border:1px solid #806b45; border-radius:8px; background:#26344a; }
.result-dock-link:hover, .result-dock-link:focus-visible { border-color:#f2c761; background:#354560; }
.fleet-choice.is-damaged { border-color:#9f6664; }
.fleet-choice.is-damaged .fleet-choice-body small { color:#ffbdad; }

/* 1.5.3 – dva způsoby výkupného a přehlednější výsledky bitvy. */
.result-ransom-options { margin:11px 0 8px; }
.result-ransom-options .ransom-options-title { margin:0 0 8px!important; font-size:13px!important; color:#e5d2aa; font-weight:700; }
.ransom-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.ransom-choice { display:flex; align-items:center; justify-content:center; gap:8px; min-width:0; min-height:56px; padding:7px 10px; border:1px solid #af8b4e; border-radius:9px; background:linear-gradient(150deg,#2c3951,#1d2d44); color:#fff0c7; font:700 13px/1.3 "Segoe UI",Arial,sans-serif; cursor:pointer; }
.ransom-choice img { width:39px; height:39px; flex:none; object-fit:contain; }
.ransom-choice:hover:not(:disabled) { border-color:#f2c761; background:#354863; }
.ransom-choice:disabled { opacity:.45; cursor:not-allowed; }
.result-dock-link.is-locked { opacity:.45; cursor:not-allowed; filter:grayscale(.65); }
.result-dock-link.is-locked:hover { background:#26344a; border-color:#806b45; }
.result-copy .result-detail { margin:8px 0!important; }
.result-dock-note { margin:8px 0 0; }
.ransom-dialog { background:radial-gradient(ellipse at 30% 0%,#293247,#101b2d 78%); color:#f1e6c8; border:1px solid #ae884d; border-radius:16px; }
.ransom-dialog .ransom-modal-balance { color:#f5d997; font-weight:700; }
@media (max-width:480px) { .ransom-choice { font-size:12px; padding:6px; min-height:50px; } .ransom-choice img { width:32px; height:32px; } }

/* 1.5.3 – přehled střelby přímo pod aktuálním zůstatkem. */
#naval-result .result-values { margin-bottom:12px; }
#naval-result .result-values > div:nth-last-child(-n+3) dd { font-variant-numeric:tabular-nums; }
#naval-result .result-dock-link { display:flex; align-items:center; justify-content:center; min-height:44px; text-align:center; }
#naval-result .result-dock-link[aria-disabled="true"] { pointer-events:none; }
/* Výsledkový dialog musí být přístupný i na nižších displejích. */
body[data-game=namornictvo] #naval-result {
  overflow-y:auto;
  overscroll-behavior:contain;
  max-height:calc(100dvh - 20px);
}
body[data-game=namornictvo] #naval-result .result-copy { min-width:0; }


/* 1.5.4 – Třetí řádek statistik lodí: neutrální námořní dělo + běžný DMG.
   Původní velikosti srdcí, štítů i lodních karet zůstávají beze změny. */
.ship-dmg {
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:2px;
  line-height:1;
  white-space:nowrap;
  min-width:0;
}
.ship-dmg-icon {
  display:block;
  width:22px;
  height:22px;
  flex:0 0 22px;
  object-fit:contain;
  filter:drop-shadow(0 1px 2px #0008);
}
.ship-dmg-value {
  font:800 12px/1.1 "Segoe UI",Arial,sans-serif;
  color:#f2d997;
  letter-spacing:.01em;
  font-variant-numeric:tabular-nums;
}
.rival-side .ship-dmg-value {color:#f5c6b3;}
/* Nový ukazatel odpovídá kompaktním kartám v portrétním zobrazení.
   Existující HP/ARMOR ikony se zde neupravují. */
@media(max-width:900px) and (orientation:portrait) {
  .ship-dmg {margin-top:1px;gap:3px;}
}

/* 1.5.5 – Drobně zmenšená čísla a ikony HP/ARMOR u portrétů na obou stranách.
   Tato úprava nemění velikost lodních karet, HP/ARMOR ikon na lodích ani mapu. */
.fleet-health {gap:6px;}
.fleet-resource {gap:3px;}
.fleet-resource b {width:23px;height:23px;}
.fleet-resource strong {font-size:15px!important;line-height:1.1;}
@media (max-width:1250px) and (min-width:761px) {
  .fleet-health {gap:5px;}
  .fleet-resource b {width:21px;height:21px;}
  .fleet-resource strong {font-size:14px!important;}
}
@media (max-width:760px) {
  .fleet-resource b {width:19px;height:19px;}
  .fleet-resource strong {font-size:13px!important;}
}
@media (max-width:380px) {
  .fleet-resource b {width:17px;height:17px;}
  .fleet-resource strong {font-size:12px!important;}
}

/* Poškozená šalupa nyní používá vlastní obrázek salupa_1.png. */

/* 1.7.1 — 5×6 / 5×7, větší mapa, bez odhalování skrytých políček. */
:root {--naval-cols:6}
.map-grid{grid-template-columns:repeat(var(--naval-cols),minmax(0,1fr));aspect-ratio:var(--naval-cols) / 5;}
.axis.top{grid-template-columns:repeat(var(--naval-cols),minmax(0,1fr));}
/* Šířka mapy se automaticky přizpůsobí výšce obrazovky, políčka zůstanou čtvercová. */
.board-outer{padding:0 1px;}
.enemy-map{width:min(99cqw,calc(100cqh - 20px),970px)!important;max-width:100%;}
body[data-board-cols="6"] .enemy-map{width:min(99cqw,calc(120cqh - 28px),970px)!important;}
body[data-board-cols="7"] .enemy-map{width:min(99cqw,calc(140cqh - 35px),970px)!important;}
#enemy-grid{gap:5px;}
@media(max-width:760px), (max-width:900px) and (min-height:651px){
  .enemy-map{width:min(99cqw,calc(100cqh - 12px),970px)!important;}
  body[data-board-cols="6"] .enemy-map{width:min(99cqw,calc(120cqh - 18px),970px)!important;}
  body[data-board-cols="7"] .enemy-map{width:min(99cqw,calc(140cqh - 24px),970px)!important;}
  #enemy-grid{gap:3px;}
}

/* 2026-10-10: Správa lodí (modré okno) a výsledkové okno jsou oddělené. */
#map-dialog{width:min(1500px,calc(100vw - 20px));max-width:1500px;max-height:calc(100dvh - 24px);overflow:auto;}
#map-dialog .map-popup-layout{grid-template-columns:minmax(310px,0.72fr) minmax(0,1.48fr);gap:14px;align-items:start;}
#map-dialog .fleet-manager{padding:12px;min-width:0;}
#map-dialog .fleet-selector.fleet-grouped{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start;}
#map-dialog .fleet-group{min-width:0;background:#071a30a8;border:1px solid #355375;border-radius:11px;padding:9px;display:flex;flex-direction:column;gap:6px;}
#map-dialog .fleet-group h4{font:700 17px/1.2 Georgia,serif;color:#ffe8a5;margin:0;}
#map-dialog .fleet-group p{color:#a7bcd4;font:500 11px/1.4 "Segoe UI",Arial,sans-serif;margin:0 0 4px;}
#map-dialog .fleet-group-empty{display:block;padding:18px 4px;color:#829cb6;text-align:center;}
#map-dialog .fleet-group .fleet-choice{grid-template-columns:16px 50px minmax(0,1fr);gap:5px;padding:7px 5px;min-height:84px;}
#map-dialog .fleet-group .fleet-choice-art{width:50px;height:56px;}
#map-dialog .fleet-group .fleet-choice-head strong{font-size:13px;}
#map-dialog .fleet-group .ship-choice-stats{font-size:10px;line-height:1.25;white-space:normal;}
#map-dialog .fleet-group .ship-name-input{height:26px;font-size:10px;}
#map-dialog .fleet-group .fleet-choice small{font-size:10px;line-height:1.2;}
#map-dialog .fleet-group .fleet-choice.is-locked{opacity:.6;}
.fleet-single-repair{align-self:flex-start;border:1px solid #d6ab52;border-radius:7px;background:#234765;color:#ffe7a5;font:700 11px/1.3 "Segoe UI",Arial;padding:5px 8px;}
.fleet-single-repair:disabled{opacity:.4;cursor:not-allowed;}
.result-fleet-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:11px;}
#naval-result .result-fleet-actions button{margin:0;min-height:49px;font-size:14px;cursor:pointer;}
#naval-result .result-fleet-actions button:disabled{opacity:.45;cursor:not-allowed;}
#naval-result .result-fleet-actions .result-dock-link{width:100%;font:750 14px/1.2 "Segoe UI",Arial,sans-serif;}
@media(max-width:1250px){
  #map-dialog .map-popup-layout{grid-template-columns:minmax(260px,.75fr) minmax(0,1.25fr);}
  #map-dialog .fleet-selector.fleet-grouped{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:900px){
  #map-dialog .map-popup-layout{grid-template-columns:1fr;}
  #map-dialog .mini-map{width:min(100%,440px);}
  #map-dialog .fleet-selector.fleet-grouped{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:700px){
  #map-dialog .fleet-selector.fleet-grouped{grid-template-columns:1fr;}
  #map-dialog .fleet-group .fleet-choice{grid-template-columns:20px 62px minmax(0,1fr);}
  #map-dialog .fleet-group .fleet-choice-art{width:62px;}
}
@media(max-width:420px){.result-fleet-actions{grid-template-columns:1fr;}}

/* 1.8 – odhalení pouze útočící lodi na příští tah obránce; žádné odhalení moře. */
#enemy-grid .naval-cell.temporarily-spotted {
  border-color:#ffe59d;
  background:linear-gradient(150deg,#285e83,#103b60);
  box-shadow:inset 0 0 0 2px #f3d07a,0 0 11px #f1c66c72;
}
#enemy-grid .naval-cell.temporarily-spotted .ship-art { opacity:.92; }
#enemy-grid .spotting-marker {
  position:absolute;bottom:2px;left:2px;right:2px;z-index:5;
  font-size:clamp(7px,.85vw,11px);line-height:1.1;
  text-align:center;font-weight:800;letter-spacing:.015em;
  padding:3px 1px;border-radius:4px;
  background:#f6d27e; color:#172840;box-shadow:0 1px 5px #06142999;
}


/* 1.9: tři kroky výsledkového dialogu – výkupné, oprava, další výprava. */
#naval-result .result-repair-step{border:1px solid #5c7391;border-radius:10px;background:#12283e;padding:12px;margin:12px 0;}
#naval-result .result-repair-step h3{font:700 20px/1.25 Georgia,serif;color:#ffe2a2;margin:0 0 9px;}
#naval-result .result-repair-list{padding:0;margin:0 0 10px;list-style:none;max-height:190px;overflow-y:auto;}
#naval-result .result-repair-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid #ffffff1b;font-size:13px;}
#naval-result .result-repair-item strong{white-space:nowrap;color:#ffdd91;font-variant-numeric:tabular-nums;}
#naval-result .result-repair-summary{display:flex;justify-content:space-between;gap:8px;padding:5px 0;font-size:13px;color:#c6d8eb;}
#naval-result .result-repair-summary strong{color:#ffe2a2;font-variant-numeric:tabular-nums;}
#naval-result .result-fleet-actions{grid-template-columns:1fr 1fr;}
#naval-result[data-step="repair"] .result-fleet-actions{grid-template-columns:1fr;}
#naval-result .result-rest-link{display:flex;align-items:center;justify-content:center;text-align:center;min-height:49px;padding:10px;border:1px solid #667e94;border-radius:8px;background:#19324a;color:#e7f2ff;text-decoration:none;font-weight:700;font-size:14px;}
#naval-result .result-rest-link:hover{background:#284765;border-color:#eac56c;}
#naval-result[data-step="ready"] .result-copy h2{color:#ffe5a0;}
@media(max-width:760px){#naval-result .result-repair-list{max-height:120px;}#naval-result .result-repair-step{padding:9px;}}
@media(max-width:390px){#naval-result .result-fleet-actions{grid-template-columns:1fr;}}


/* 1.9.1 – větší a čitelnější akční tlačítka pouze ve výsledkovém popupu. */
#naval-result .ransom-choice{
  min-height:68px;
  padding:12px 14px;
  gap:12px;
  font-size:17px;
  font-weight:800;
}
#naval-result .ransom-choice img{width:46px;height:46px;}
#naval-result .result-fleet-actions button,
#naval-result .result-fleet-actions .result-rest-link{
  min-height:62px;
  padding:13px 12px;
  font-size:16px;
  font-weight:800;
}
#naval-result .treasure-button{min-height:60px;font-size:16px;}
@media(max-width:480px){
  #naval-result .ransom-choice{min-height:60px;padding:9px 7px;gap:7px;font-size:14px;}
  #naval-result .ransom-choice img{width:36px;height:36px;}
  #naval-result .result-fleet-actions button,
  #naval-result .result-fleet-actions .result-rest-link{min-height:56px;font-size:15px;}
}

/* Aktualizace CRIT/ARMOR: přesný efekt bez zavádějícího −1 HP. */
.naval-impact-text{
  display:inline-flex;align-items:center;justify-content:center;
  padding:8px 12px;border-radius:13px;border:2px solid #8cd1ff;
  background:linear-gradient(150deg,#1469ae,#122c64 72%);
  color:#eefaff;font:900 clamp(17px,2.5vw,29px)/1.15 Georgia,serif;
  white-space:nowrap;text-shadow:0 2px 2px #091a3b;
  box-shadow:0 5px 16px #0008, inset 0 1px 0 #d8f5ff99;
}
.ship-hit-fx .naval-impact-text{transform:rotate(-4deg);max-width:98%;font-size:clamp(13px,2vw,24px)}
.ship-hit-popup-effect{
  position:absolute;right:10px;top:12px;z-index:3;
  transform:rotate(5deg);font-size:clamp(18px,3vw,26px);
}
.ship-hit-popup-effect[hidden]{display:none!important}
@media(max-width:560px){.ship-hit-popup-effect{font-size:19px;padding:7px 9px}}

/* Černá Merry: pouze stopa po teleportu, nikoliv zobrazení aktuální pozice. */
#enemy-grid .naval-cell.merry-vanished{background:linear-gradient(145deg,#3d2d58,#201c3c);border-color:#aa78e4;}
#enemy-grid .naval-cell .merry-trace{display:grid;place-items:center;width:100%;height:100%;font-size:clamp(22px,3.4vw,39px);color:#cc99ff;text-shadow:0 0 10px #ab42ed;}

/* ADMIN: testovací účet jen v paměti, přes společný účet se nezapisuje. */
#naval-admin-status[hidden],#naval-csv-log-row[hidden],#naval-admin-export[hidden]{display:none!important;}
#naval-admin-status{position:fixed;top:81px;left:50%;transform:translateX(-50%);z-index:33;display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:center;background:#15213f;color:#fff;border:2px solid #d9aa49;border-radius:13px;padding:9px 14px;box-shadow:0 8px 26px #000a;font-weight:700;max-width:min(98vw,800px);}
#naval-admin-status strong{color:#ffd261;white-space:nowrap;}
#naval-admin-status span{white-space:nowrap;}
#naval-admin-status button{background:#244264;color:#fff;border:1px solid #bda05c;border-radius:8px;padding:8px 10px;cursor:pointer;font-weight:700;}
#naval-admin-status #naval-admin-logout{background:#652b2b;}
#admin-test-button{white-space:nowrap;}
body.naval-admin-active #admin-test-button{background:#5a3326;color:#ffd261;border-color:#c49c50;}
.naval-admin-dialog{max-width:min(96vw,540px);color:#fff;}
.naval-admin-dialog form{display:grid;gap:12px;}
.naval-admin-dialog input{width:100%;font-size:18px;padding:12px;background:#102035;color:white;border:1px solid #9ab5c2;border-radius:8px;}
#naval-admin-error{color:#ff9d9d;font-weight:700;}
@media(max-width:680px){#naval-admin-status{top:70px;gap:7px;padding:6px;font-size:12px;}#naval-admin-status button{padding:5px;}#admin-test-button{font-size:11px;}}

/* Správa flotily 2026-10-12: seskupené typy, samostatné vybrané instance. */
#map-dialog .fleet-group-chosen .fleet-selected-row{display:grid;grid-template-columns:65px minmax(0,1fr) 32px;gap:7px;align-items:center;padding:7px 5px;border:1px solid #b28b3960;border-radius:10px;background:#133252;min-width:0}
#map-dialog .fleet-selected-row .fleet-choice-art{width:65px;height:56px}
#map-dialog .fleet-selected-row .fleet-choice-body{min-width:0}
#map-dialog .fleet-selected-row strong,#map-dialog .fleet-kind strong{font:700 15px/1.25 Georgia,serif;color:#ffdf98}
#map-dialog .fleet-selected-row small,#map-dialog .fleet-kind small{font:500 12px/1.35 "Segoe UI",sans-serif;color:#c0d6ec}
#map-dialog .fleet-kind{min-width:0;display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:7px;border:1px solid #375976;background:#0d2946;border-radius:10px;padding:7px}
#map-dialog .fleet-kind .fleet-choice-art{width:58px;height:54px}
#map-dialog .fleet-kind-info{min-width:0;display:flex;flex-direction:column;gap:3px}
#map-dialog .fleet-kind-info .fleet-single-repair{margin-top:3px;font-size:11px}
#map-dialog .fleet-kind-controls{display:flex;gap:4px;flex-wrap:nowrap}
#map-dialog .fleet-step-button{flex:none;display:flex;align-items:center;justify-content:center;width:32px;height:34px;background:linear-gradient(#28639d,#173f6b);color:#fff0bb;border:1px solid #8db3d1;border-radius:8px;font:800 23px/1 "Segoe UI",sans-serif;cursor:pointer}
#map-dialog .fleet-step-button:hover:not(:disabled){filter:brightness(1.2)}
#map-dialog .fleet-step-button:disabled{opacity:.32;cursor:not-allowed}
#map-dialog .fleet-kind-locked{opacity:.58;filter:saturate(.55);grid-template-columns:58px minmax(0,1fr)}
@media(max-width:700px){#map-dialog .fleet-kind{grid-template-columns:45px minmax(0,1fr) auto;gap:5px}#map-dialog .fleet-kind .fleet-choice-art{width:45px;height:44px}#map-dialog .fleet-step-button{width:28px;height:31px;font-size:20px}#map-dialog .fleet-group-chosen .fleet-selected-row{grid-template-columns:49px minmax(0,1fr) 28px}#map-dialog .fleet-selected-row .fleet-choice-art{width:49px;height:48px}}


/* 2026-10-12 · Jednotný seznam lodí; oprava zakázaných +/− a úpravy v hlavní hře. */
#map-dialog .fleet-selector.fleet-grouped{display:block;grid-template-columns:none;}
.fleet-roster-list{display:flex;flex-direction:column;gap:8px;}
.fleet-roster-row{display:grid;grid-template-columns:74px minmax(0,1fr) 82px;gap:12px;align-items:center;padding:9px 12px;border:1px solid #396383;background:linear-gradient(120deg,#0d2946,#102b4c);border-radius:11px;min-width:0;}
.fleet-roster-row.is-locked{opacity:.54;}
.fleet-roster-row .fleet-choice-art{width:74px;height:62px;}
.fleet-roster-info{display:flex;flex-direction:column;min-width:0;gap:4px;}
.fleet-roster-info strong{color:#ffe1a2;font:700 18px/1.2 Georgia,serif;}
.fleet-roster-info small{color:#bed0e5;font:600 12px/1.3 'Segoe UI',sans-serif;}
.fleet-roster-stats{color:#fff0c5;font:750 13px/1.25 'Segoe UI',sans-serif;}
.fleet-roster-instance{color:#a7c7df!important;font-size:11px!important;}
.fleet-roster-row .fleet-kind-controls{display:flex;gap:5px;justify-content:flex-end;}
.fleet-roster-row .fleet-step-button{display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;background:#17477a;color:#ffdf9a;border:1px solid #709bb6;border-radius:8px;font:800 25px/1 Arial;cursor:pointer;}
.fleet-roster-row .fleet-step-button:hover:not(:disabled){background:#276ca6;}
.fleet-roster-row .fleet-step-button:disabled{opacity:.3;cursor:not-allowed;}
.fleet-roster-row .fleet-single-repair{align-self:flex-start;margin-top:4px;padding:4px 7px;font-size:11px;}
.fleet-quick-panel{border:1px solid #6387ac7a;border-radius:9px;background:#071a30aa;min-height:0;}
.fleet-quick-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:4px;cursor:pointer;padding:7px 10px;color:#ffdf9a;font:750 13px/1.3 'Segoe UI',sans-serif;list-style:none;}
.fleet-quick-panel>summary::-webkit-details-marker{display:none;}
.fleet-quick-panel>summary::before{content:'▸';font-size:16px;}
.fleet-quick-panel[open]>summary::before{content:'▾';}
.fleet-quick-panel>summary span{font-size:11px;color:#b6d2ed;}
#fleet-quick-selector{max-height:30dvh;overflow:auto;padding:4px;}
#fleet-quick-selector .fleet-roster-list{gap:5px;}
#fleet-quick-selector .fleet-roster-row{grid-template-columns:43px minmax(0,1fr) 59px;gap:3px;padding:5px;}
#fleet-quick-selector .fleet-choice-art{width:43px;height:42px;}
#fleet-quick-selector .fleet-roster-info strong{font-size:12px;}
#fleet-quick-selector .fleet-roster-stats{font-size:10px;}
#fleet-quick-selector .fleet-roster-info small{font-size:10px;}
#fleet-quick-selector .fleet-step-button{width:28px;height:30px;font-size:21px;}
#fleet-quick-selector .fleet-kind-controls{gap:3px;}
.my-side:has(.fleet-quick-panel){grid-template-rows:auto minmax(0,1fr) auto auto;}
.naval-name-settings{margin:9px 0 4px;padding:9px;border:1px solid #577596;border-radius:9px;}
.naval-name-settings summary{cursor:pointer;color:#ffdc9b;font-weight:800;}
.naval-ship-name-list{display:flex;flex-direction:column;gap:7px;margin-top:10px;max-height:36dvh;overflow:auto;}
.naval-ship-rename-row{display:grid;grid-template-columns:1fr 1.3fr;gap:6px;align-items:center;font-size:12px;color:#e9d5a7;}
.naval-ship-rename-row input{width:100%;min-width:0;padding:8px;border:1px solid #54789c;border-radius:7px;background:#0a1a2e;color:white;}
@media(max-width:760px){.fleet-roster-row{grid-template-columns:48px minmax(0,1fr) 67px;gap:5px;padding:6px;}.fleet-roster-row .fleet-choice-art{width:48px;height:48px;}.fleet-roster-info strong{font-size:15px;}.fleet-roster-info small{font-size:10px;}.fleet-roster-stats{font-size:11px;}.fleet-roster-row .fleet-step-button{width:29px;height:33px;font-size:22px;} .fleet-quick-panel{margin-top:3px;}}

/* Přehled typů lodí: výrazný poměr nasazeno/vlastněno napravo. */
#map-dialog .fleet-roster-row{grid-template-columns:74px minmax(0,1fr) 82px 82px;gap:10px;}
#map-dialog .fleet-roster-selected-count{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;white-space:nowrap;}
#map-dialog .fleet-roster-selected-count strong{padding:6px 10px;border:1px solid #d2a947;border-radius:9px;background:#2f2b1d;color:#ffe29b;font:800 19px/1 'Segoe UI',sans-serif;}
#map-dialog .fleet-roster-selected-count small{font:650 10px/1.25 'Segoe UI',sans-serif;color:#bfd0e4;}
#naval-result .result-repair-item>span{flex:1;min-width:0;overflow-wrap:anywhere;color:#e3effa;}
#naval-result .result-repair-item strong{flex:0 0 auto;font-size:14px;font-weight:800;}
#fleet-quick-selector .fleet-roster-compact-count{color:#ffe1a2;font-weight:800;}
@media(max-width:760px){
  #map-dialog .fleet-roster-row{grid-template-columns:45px minmax(0,1fr) 54px 65px;gap:5px;padding:6px;}
  #map-dialog .fleet-roster-row .fleet-choice-art{width:45px;height:45px;}
  #map-dialog .fleet-roster-selected-count strong{padding:5px 4px;font-size:15px;}
  #map-dialog .fleet-roster-selected-count small{font-size:9px;}
  #fleet-quick-selector .fleet-roster-row{grid-template-columns:43px minmax(0,1fr) 59px;}
}

/* Vítězství: čtyři čitelné obrazovky, otevření truhly zůstává viditelné. */
#naval-result[data-step="victory"] .result-fleet-actions,
#naval-result[data-step="repair"] .result-fleet-actions{grid-template-columns:1fr;}
#naval-result .treasure-next-button{display:block;width:100%;min-height:46px;margin-top:10px;padding:10px 13px;border:1px solid #c8a85f;border-radius:8px;background:#223a50;color:#ffe6aa;font:800 14px/1.2 "Segoe UI",Arial,sans-serif;cursor:pointer;}
#naval-result .treasure-next-button[hidden]{display:none!important;}
#naval-result .treasure-amount{display:block;text-align:center;padding:11px;border:1px solid #9b824c;border-radius:8px;background:#162e40;font-size:20px!important;}
#naval-result[data-step="loot"][data-chest="opened"] .result-admiral{animation:naval-treasure-reveal .38s ease-out both;}
@media(prefers-reduced-motion:reduce){#naval-result[data-step="loot"][data-chest="opened"] .result-admiral{animation:none;}}

/* Oslí námořnictvo: na telefonu raději jasná textová informace než miniaturní herní prvky.
   Tablet a desktop nejsou blokovány; media queries cílí dotykové telefony. */
#naval-phone-notice { display:none; }
@media (pointer: coarse) and (max-width: 600px), (pointer: coarse) and (max-width: 1000px) and (max-height: 540px) {
  #naval-phone-notice {
    display:flex !important; position:fixed; inset:0; z-index:2147483600;
    justify-content:center; align-items:center; padding:20px;
    background:#0b132b; color:#edf3ff; overflow:auto;
    text-align:center; box-sizing:border-box;
  }
  #naval-phone-notice .naval-phone-notice-body { max-width:410px; margin:auto; padding:16px 10px; }
  #naval-phone-notice h1 { color:#f2c761; font:700 clamp(25px,7vw,34px)/1.2 Georgia,serif; margin:12px 0 20px; }
  #naval-phone-notice p { font:400 17px/1.55 "Segoe UI",Arial,sans-serif; margin:12px 0; }
  #naval-phone-notice a {
    display:inline-block; margin-top:16px; padding:13px 21px;
    border-radius:9px; background:#e9bd60; color:#152037;
    font:750 16px/1.2 "Segoe UI",Arial,sans-serif; text-decoration:none;
  }
  #naval-phone-notice a:focus-visible { outline:3px solid #fff; outline-offset:3px; }
  body[data-game="namornictvo"] #game-page,
  body[data-game="namornictvo"] #naval-footer-tools,
  body[data-game="namornictvo"] #paticka { display:none !important; }
}
