/* Valcourt r5 — the Fleet tab (fleet-ui.js). Deep blue and silver. */
.fl-sub { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 12px 0 18px; }
.ship-svg { display: block; width: 100%; height: auto; }
.ship-svg .sail.glow { filter: drop-shadow(0 0 6px rgba(150,220,255,.6)); }
.ship-svg .crystal { animation: flPulse 2.4s ease-in-out infinite; }
@keyframes flPulse { 50% { opacity: .65; } }
.fl-top { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.fl-top.nomap { grid-template-columns: 1fr; }
.fl-map { height: 520px; }
.fl-map .wm-svg { width: 100%; height: 100%; }
.fl-port circle { fill: rgba(10,22,50,.85); stroke: #99a3af; stroke-width: 2; }
.fl-port.has circle { fill: #1b3a7a; stroke: #f0c654; stroke-width: 3; filter: drop-shadow(0 0 6px rgba(240,198,84,.6)); }
.fl-port text { fill: #fff3c4; font-size: 16px; text-anchor: middle; font-family: 'Cinzel', serif; }
.fl-port text.tag { text-anchor: start; font-size: 22px; fill: #f4f1e6; paint-order: stroke; stroke: rgba(4,10,24,.9); stroke-width: 4px; }
.fl-port text.tag.sq { fill: #f0c654; }
.fl-sq { padding: 12px 14px; }
.fl-sq-h { display: flex; gap: 8px; align-items: center; }
.fl-name { flex: 1; min-width: 0; background: rgba(4,10,24,.6); border: 1px solid var(--border-soft); color: var(--goldb); font-family: 'Cinzel', serif; font-size: 1.02rem; padding: 5px 8px; border-radius: 4px; width: 100%; }
.fl-name:focus { outline: none; border-color: var(--goldb); }
.fl-sel { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.fl-sel label { display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); gap: 2px; flex: 1; min-width: 140px; }
.fl-sel select, .fl-newsq input, .fl-newsq select, .fl-build input, .fl-build select { background: #0b1324; color: var(--text); border: 1px solid var(--border-soft); border-radius: 4px; padding: 6px 7px; font: inherit; font-size: .9rem; min-width: 0; }
.fl-sq-ships { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.fl-sq-ships .mini { width: 110px; text-align: center; background: rgba(4,10,24,.5); border-radius: 4px; padding: 2px; }
.fl-sq-ships small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-newsq { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fl-newsq input { flex: 1 1 180px; }
.fl-ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 18px; }
.fl-ship { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.fl-ship .pic, .fl-class .pic { background: radial-gradient(ellipse at 50% 20%, #24406f, #0a1630 75%); border-radius: 4px; border: 1px solid var(--border-soft); overflow: hidden; }
.fl-ship.dock .pic { filter: grayscale(.5) brightness(.8); }
.fl-cond { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: .82rem; margin-top: 6px; }
.fl-cond .bar, .fl-queue .bar, .fy-stat .bar { height: 8px; background: var(--bar-bg); border-radius: 4px; overflow: hidden; border: 1px solid rgba(153,163,175,.25); position: relative; display: block; }
.fl-cond .bar i, .fl-queue .bar i, .fy-stat .bar i { display: block; height: 100%; background: linear-gradient(90deg, #284b93, #b9c1cc); }
.fl-cond .bar i.low { background: linear-gradient(90deg, #6a1f1f, #c9744a); }
.fl-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.fl-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fl-queue { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fl-queue li { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; }
.fl-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.fl-class { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fl-class.fantasy { box-shadow: var(--frame), 0 0 18px rgba(127,180,216,.18); }
.fl-class h3 small { font-family: 'Source Sans 3', sans-serif; font-size: .8rem; }
.fl-build { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.fl-build input { flex: 1 1 120px; }
.fy-stats { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; }
.fy-stat { display: grid; grid-template-columns: 74px 1fr 66px; gap: 8px; align-items: center; font-size: .82rem; }
.fy-stat .l { color: var(--muted); }
.fy-stat .v { text-align: right; font-weight: 600; color: var(--goldb); }
.fy-stat .bar b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #f0c654; }
em.up { color: #8fd18f; font-style: normal; font-size: .78rem; } em.dn { color: #e48a7a; font-style: normal; font-size: .78rem; }
.fy-econ { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; margin: 6px 0; }
.fy-econ span { background: rgba(4,10,24,.55); border: 1px solid var(--border-soft); border-radius: 4px; padding: 4px 2px; font-size: .86rem; }
.fy-econ small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fy-econ b { color: var(--goldb); }
.fy-classes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.fy-cls { flex: 0 0 116px; background: rgba(8,14,28,.8); border: 1px solid var(--border-soft); border-radius: 6px; color: var(--text); padding: 3px; cursor: pointer; font: inherit; font-size: .76rem; }
.fy-cls.on { border-color: #f0c654; box-shadow: 0 0 10px rgba(240,198,84,.35); color: var(--goldb); }
.fy-wrap { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
.fy-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.fy-title input { background: transparent; border: 0; border-bottom: 1px dashed var(--border); color: var(--goldb); font-family: 'Cinzel', serif; font-size: 1.3rem; padding: 2px; max-width: 320px; }
.fy-stage { background: radial-gradient(ellipse at 50% 15%, #2b4b80 0%, #10224a 55%, #071226 100%); border-radius: 6px; border: 1px solid var(--border); touch-action: none; user-select: none; -webkit-user-select: none; }
.fy-stage .part { cursor: grab; }
.fy-stage .part:hover { filter: brightness(1.2) drop-shadow(0 0 4px rgba(240,198,84,.7)); }
.slot circle { fill: rgba(240,198,84,.18); stroke: #f0c654; stroke-width: 2; stroke-dasharray: 4 3; cursor: pointer; }
.slot text { fill: #f0c654; font-size: 18px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.slot.full circle { fill: transparent; stroke: rgba(240,198,84,.0); }
.slot.full:hover circle { stroke: rgba(240,198,84,.7); }
.slot.want circle { fill: rgba(240,198,84,.35); stroke-dasharray: none; animation: flPulse 1s infinite; }
.slot.want.full circle { stroke: rgba(240,198,84,.85); }
.slot.dim { opacity: .15; }
.slot.hi circle { fill: rgba(143,209,143,.55); stroke: #8fd18f; stroke-width: 3; animation: none; }
.slot.sel circle { stroke: #8fd18f; stroke-width: 3; stroke-dasharray: none; fill: rgba(143,209,143,.25); }
.fy-insp, .fy-hint { margin-top: 8px; font-size: .9rem; }
.fy-insp .mod { font-size: .78rem; margin-right: 4px; } .fy-insp .mod.up { color: #8fd18f; } .fy-insp .mod.dn { color: #e48a7a; }
.fy-cat { margin-bottom: 10px; border-radius: 6px; padding: 4px; }
.fy-cat.want { background: rgba(240,198,84,.08); box-shadow: inset 0 0 0 1px rgba(240,198,84,.4); }
.fy-cat h4 { font-family: 'IM Fell English SC', serif; color: var(--goldb); font-size: .95rem; letter-spacing: .06em; margin: 2px 0 6px; }
.fy-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.fy-part { background: linear-gradient(180deg, #13213f, #0a1428); border: 1px solid var(--border-soft); border-radius: 6px; color: var(--text); padding: 4px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font: inherit; display: flex; flex-direction: column; align-items: center; }
.fy-part:hover { border-color: #f0c654; }
.fy-part.fantasy { border-color: rgba(127,180,216,.6); }
.fy-part .part-svg { width: 100%; height: 62px; pointer-events: none; }
.fy-part span { font-size: .72rem; line-height: 1.15; text-align: center; }
.fy-part small { font-size: .68rem; color: var(--muted); }
.fy-ghost { position: fixed; z-index: 9999; width: 96px; height: 80px; transform: translate(-50%, -60%); pointer-events: none; opacity: .9; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.fy-ghost.ok { filter: drop-shadow(0 0 10px rgba(143,209,143,.9)); }
.fy-ghost.rm { opacity: .45; filter: grayscale(1); }
.fy-ghost .part-svg { width: 100%; height: 100%; }
.fy-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.fy-btns #fyDone { grid-column: 1 / -1; font-size: 1.05rem; }
.fy-style h4 { font-family: 'IM Fell English SC', serif; color: var(--goldb); font-size: .9rem; margin: 10px 0 4px; letter-spacing: .05em; }
.fy-style small { font-size: .74rem; color: var(--muted); display: block; margin: 4px 0 2px; }
.fy-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: #0b1324; border: 1px solid var(--border-soft); color: var(--text); border-radius: 12px; padding: 3px 9px; font: inherit; font-size: .78rem; cursor: pointer; }
.chip.on { border-color: #f0c654; color: #f0c654; background: #16264a; }
.fy-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); cursor: pointer; padding: 0; }
.sw span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sw.on { border-color: #f0c654; box-shadow: 0 0 0 2px rgba(240,198,84,.35); }
.fy-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lg-fleet .fl-led { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.lg-fleet .fl-led span { background: rgba(4,10,24,.55); border: 1px solid var(--border-soft); border-radius: 4px; padding: 6px 8px; }
.lg-fleet .fl-led small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 980px) {
  .fl-top, .fy-wrap { grid-template-columns: 1fr; }
  .fl-map { height: 380px; }
}
@media (max-width: 560px) {
  .fl-ships, .fl-classes { grid-template-columns: 1fr; }
  .fy-econ { grid-template-columns: repeat(3, 1fr); }
  .fy-parts { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .fy-part .part-svg { height: 50px; }
  .fl-queue li { grid-template-columns: 70px 1fr; } .fl-queue li .btn { grid-column: 1 / -1; }
}
/* keep the ship in view while scrolling the parts box, so a part can always be dragged onto it */
.fy-stagebox { position: sticky; top: 0; z-index: 6; background: var(--panel); }
.fy-stage svg { max-height: 58vh; }
@media (max-width: 980px) { .fy-stagebox { padding: 8px; } .fy-stage svg { max-height: 38vh; } .fy-title input { font-size: 1.05rem; } }
@media (max-width: 560px) { .fy-stagebox .fy-hint { font-size: .74rem; line-height: 1.25; margin-top: 4px; } }
.fl-bl { color: var(--goldb); margin: 0 0 6px; }
.fl-blz { fill: rgba(240,198,84,.16); stroke: #f0c654; stroke-width: 4; stroke-dasharray: 10 6; pointer-events: none; }

/* r5b — at sea: map markers and courses, orders, other fleets, design picker, sea-battle reports */
.fl-route { fill: none; stroke: #f0c654; stroke-width: 6; stroke-dasharray: 4 12; stroke-linecap: round; opacity: .95; pointer-events: none; }
.fl-route.foe { stroke: #e46a5a; opacity: .7; }
.fl-mk circle { fill: #1b3a7a; stroke: #f0c654; stroke-width: 3; filter: drop-shadow(0 0 5px rgba(240,198,84,.55)); }
.fl-mk.foe circle { fill: var(--fc, #8a1f1f); stroke: #ffb3a6; filter: drop-shadow(0 0 6px rgba(228,106,90,.7)); }
.fl-mk.neutral circle { fill: var(--fc, #555); stroke: #c4c9d1; filter: none; opacity: .9; }
.fl-mk text { fill: #fff3c4; font-size: 22px; text-anchor: middle; font-family: 'Cinzel', serif; }
.fl-mk text.tag { text-anchor: start; font-size: 24px; font-weight: 700; fill: #f4f1e6; paint-order: stroke; stroke: rgba(4,10,24,.92); stroke-width: 6px; }
.fl-mk text.tag.sq { fill: #f0c654; } .fl-mk text.tag.foe { fill: #ffb3a6; }
.fl-status { margin: .3rem 0 .4rem; color: #dfe6f1; background: rgba(27,58,122,.35); border-left: 3px solid #f0c654; padding: .3rem .5rem; border-radius: 4px; }
.fl-orders select { max-width: 100%; }
.fl-dsel { font-size: .8rem; padding: 1px 4px; max-width: 12rem; }
.fl-away { color: #f0c654; font-weight: 600; }
.fl-meta .warn { color: #ffb08a; }
.fl-foes { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.fl-foe { border-top: 4px solid var(--fc, #8a1f1f); }
.fl-foe.neutral { opacity: .92; }
.fl-foe-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.fl-foe .pill.bad { background: #7a1f1f; color: #ffe2dc; }
.mini.foe svg { transform: scaleX(-1); }
.fy-designs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .2rem 0 .8rem; padding: .5rem .6rem; background: rgba(10,22,50,.45); border: 1px solid rgba(196,201,209,.25); border-radius: 8px; }
.fy-designs .lab { font-family: 'Cinzel', serif; color: #c4c9d1; font-size: .85rem; margin-right: .3rem; }
.fy-dchip { display: flex; flex-direction: column; align-items: center; width: 108px; padding: .25rem; border-radius: 8px; border: 1px solid rgba(196,201,209,.3); background: rgba(20,36,72,.6); color: #f4f1e6; cursor: pointer; }
.fy-dchip svg { width: 96px; height: auto; }
.fy-dchip span { font-size: .78rem; line-height: 1.1; text-align: center; } .fy-dchip small { color: #99a3af; font-size: .7rem; }
.fy-dchip.on { border-color: #f0c654; box-shadow: 0 0 0 2px rgba(240,198,84,.4); background: rgba(27,58,122,.8); }
.fb-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.fb-list { display: flex; flex-direction: column; gap: .35rem; }
.fb-item { text-align: left; padding: .4rem .55rem; border-radius: 6px; border: 1px solid rgba(196,201,209,.25); background: rgba(20,36,72,.55); color: #f4f1e6; cursor: pointer; border-left: 4px solid #99a3af; }
.fb-item small { display: block; color: #99a3af; font-size: .72rem; }
.fb-item.us { border-left-color: #f0c654; } .fb-item.them { border-left-color: #e46a5a; } .fb-item.on { background: rgba(27,58,122,.9); }
.fb-head h2 { margin: 0; } .fb-head.us h2 { color: #f0c654; } .fb-head.them h2 { color: #ff9c8c; } .fb-head small { color: #99a3af; }
.fb-sea { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; margin: .8rem 0; padding: .8rem; border-radius: 10px;
  background: linear-gradient(180deg, rgba(120,160,210,.18), rgba(10,30,70,.65) 55%, rgba(6,18,44,.9)), repeating-linear-gradient(170deg, rgba(255,255,255,.04) 0 6px, transparent 6px 18px); border: 1px solid rgba(196,201,209,.25); }
.fb-side h3 { margin: 0; font-size: 1rem; } .fb-side > small { color: #99a3af; }
.fb-side.them h3 { color: #ffb3a6; }
.fb-vs { align-self: center; font-size: 2rem; color: #f0c654; text-shadow: 0 0 10px rgba(240,198,84,.6); }
.fb-ships { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.fb-ship { margin: 0; width: 150px; text-align: center; }
.fb-pic { position: relative; height: 104px; display: flex; align-items: flex-end; justify-content: center; }
.fb-pic svg { width: 146px; height: auto; transition: transform .3s; }
.fb-ship.mir .fb-pic svg { transform: scaleX(-1); }
.fb-ship.sunk .fb-pic svg { transform: rotate(14deg) translateY(18px); filter: grayscale(1) brightness(.55); opacity: .7; clip-path: inset(0 0 22% 0); }
.fb-ship.sunk.mir .fb-pic svg { transform: scaleX(-1) rotate(14deg) translateY(18px); }
.fb-ship.taken .fb-pic svg { filter: saturate(.5); }
.fb-ship.burn .fb-pic::after { content: ''; position: absolute; left: 30%; bottom: 30%; width: 40%; height: 45%; background: radial-gradient(ellipse at 50% 90%, rgba(255,170,60,.85), rgba(220,70,20,.5) 40%, transparent 70%); mix-blend-mode: screen; pointer-events: none; }
.fb-smoke { position: absolute; left: 20%; top: 0; width: 60%; height: 60%; background: radial-gradient(ellipse at 50% 70%, rgba(60,60,66,.9), rgba(60,60,66,0) 70%); pointer-events: none; }
.fb-tag { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: .7rem; padding: 1px 6px; border-radius: 4px; letter-spacing: .04em; text-transform: uppercase; }
.fb-tag.sunk { background: #3a3a44; color: #e8e8ee; } .fb-tag.taken { background: #f0c654; color: #1b2a4a; }
.fb-ship figcaption b { display: block; font-size: .8rem; } .fb-ship figcaption small { display: block; color: #99a3af; font-size: .7rem; }
.fb-cond { display: block; height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; margin: 2px 6px; overflow: hidden; }
.fb-cond i { display: block; height: 100%; background: #6cc070; } .fb-cond i.low { background: #e46a5a; }
.fb-tally { display: flex; flex-wrap: wrap; gap: 1.2rem; padding: .4rem 0; border-top: 1px solid rgba(196,201,209,.2); }
.fb-lines { margin: .5rem 0 0 1.1rem; padding: 0; } .fb-lines li { margin: .2rem 0; }
@media (max-width: 760px) {
  .fb-wrap { grid-template-columns: 1fr; }
  .fb-list { flex-direction: row; overflow-x: auto; } .fb-item { min-width: 170px; }
  .fb-sea { grid-template-columns: 1fr; } .fb-vs { justify-self: center; font-size: 1.4rem; }
  .fb-ship { width: 96px; } .fb-pic svg { width: 92px; }
  .fy-dchip { width: 92px; } .fy-dchip svg { width: 80px; }
  .fl-strip #endTurn { width: 100%; margin-top: .4rem; }
}
