@import url('/fonts/fonts.css');
:root {
  /* Motyw „Centrum dowodzenia” */
  --bg: #070B10;
  --bg2: #0B121A;
  --card: #0E1620;
  --card2: #121E2A;
  --line: #1F2E3E;
  --text: #D7E3EE;
  --muted: #8DA1B4;
  --red: #FF5A4E;
  --gold: #F5C76B;
  --amber: #F5A623;
  --cyan: #39D0E0;
  --ok: #3DDC97;
  --warn: #F5A623;
  --display: 'Rajdhani', 'Inter', system-ui, sans-serif;
  --serif: var(--display);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.gold { color: var(--gold); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.neg { color: #ff8a8a; }
.hidden { display: none !important; }
.loading { padding: 2rem; color: var(--muted); }

/* Ramki nicku (kosmetyki) */
.pname { padding: 0 .3rem; border-radius: 4px; }
.frame-oak { border: 2px solid #8b5a2b; }
.frame-silver { border: 2px solid #c0c7d2; box-shadow: 0 0 6px rgba(192,199,210,.35); }
.frame-gold { border: 2px solid var(--gold); box-shadow: 0 0 8px rgba(224,180,76,.45); }
.frame-season { border: 2px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(90deg, #b07cf0, var(--red), var(--gold)) border-box; }
.me-pill .ptitle { display: none; }

/* Pasek górny */
.topbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .5rem 1rem; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--red); }
.clock { flex: 1; display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.battle-timer { background: #3a1820; color: #ffd4d8; padding: .1rem .55rem; border-radius: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.who { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; font-size: .88rem; color: var(--text); font: inherit; font-size: .88rem; }
.pill.gold { color: var(--gold); }
.pill.korony { color: #c9a2ff; }
.bell { cursor: pointer; }
.bell.has { border-color: var(--red); background: #3a1820; }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 4px; background: #2c3446; vertical-align: middle; }
.tag.ok { background: #1f4630; color: #c6f0d4; }
.tag.gold { background: #4a3b16; color: #ffe6a8; }
.woj-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; white-space: nowrap; }
.woj-chip::before { content: ''; width: .75rem; height: .75rem; border-radius: 3px; background: var(--c); display: inline-block; }
.ptitle { font-size: .75rem; color: var(--gold); font-style: italic; }

.tabs { display: flex; gap: .1rem; padding: 0 1rem; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: .55rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--red); }
.tabs .tab-czat { display: none; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; padding: 1rem; max-width: 1600px; margin: 0 auto; }
.side { position: sticky; top: 100px; height: calc(100vh - 120px); }
@media (max-width: 700px) {
  .topbar { gap: .4rem; padding: .45rem .6rem; }
  .brand { font-size: 1.1rem; }
  .clock { order: 3; flex-basis: 100%; font-size: .82rem; gap: .35rem; }
  .who { margin-left: auto; }
  .who .me-pill, .who .woj-chip { display: none; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; padding: .5rem; }
  .side { display: none; }
  .tabs .tab-czat { display: block; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; }
.row.wrap { flex-wrap: wrap; }
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.stat-row:last-of-type { border-bottom: 0; }
.note { background: #1f2c45; padding: .5rem .7rem; border-radius: 6px; font-size: .9rem; }
.pinned { background: #2a2416; border-left: 3px solid var(--gold); padding: .4rem .6rem; border-radius: 4px; }
.errors { color: #ff9a9a; }

.btn { font: inherit; background: var(--gold); color: #1a1408; border: 0; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.big { width: 100%; padding: .75rem; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.danger { background: var(--red); color: #fff; }
.btn[disabled] { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .55rem; width: 100%; }
input[type=range] { padding: 0; accent-color: var(--red); }
input[type=checkbox] { width: auto; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
label input, label select { margin-top: .2rem; }
label.inline { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
.row input { flex: 1; min-width: 70px; width: auto; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); padding: .3rem .4rem; }
.tbl td { padding: .4rem; border-bottom: 1px solid var(--line); }

/* Mapa */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1300px) { .map-layout { grid-template-columns: 1fr; } }
.map-wrap { background: #0c1016; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; }
.map-host { position: relative; }
svg.map { width: 100%; height: auto; max-height: calc(100vh - 210px); aspect-ratio: 1000 / 941; display: block; touch-action: none; user-select: none; cursor: grab; }
svg.map:active { cursor: grabbing; }
.pw { stroke: rgba(10, 12, 16, .55); stroke-width: calc(.55px / var(--z, 1)); transition: filter .15s; }
.pw:hover { filter: brightness(1.25); }
.pw.dim { filter: saturate(.55) brightness(.75); }
.pw.dim:hover { filter: saturate(.8) brightness(1); }
.pw.front { stroke: #fff; stroke-width: calc(1.3px / var(--z, 1)); stroke-dasharray: calc(3px / var(--z, 1)) calc(2px / var(--z, 1)); }
.pw.attacked { stroke: #ff3b4e; stroke-width: calc(2px / var(--z, 1)); animation: pulse 1.4s infinite; }
.pw.sel { stroke: #ffe28a; stroke-width: calc(2.4px / var(--z, 1)); stroke-dasharray: none; filter: brightness(1.2); }
@keyframes pulse { 50% { stroke-opacity: .25; } }
.woj-borders path { fill: none; stroke: rgba(8, 10, 14, .95); stroke-width: calc(1.6px / var(--z, 1)); pointer-events: none; }
.overlay { pointer-events: none; }
.overlay .star { fill: #ffe28a; stroke: #1a1408; stroke-width: .6; }
.overlay .cap-label { font: 600 9px var(--sans); fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: 2.5px; font-size: calc(9px / max(1, var(--z, 1) * .6)); }
.overlay .shield { fill: #cfd8e6; stroke: #11151c; stroke-width: .6; }
.overlay .fort { font: 6px var(--sans); fill: #fff; text-anchor: middle; paint-order: stroke; stroke: #000; stroke-width: 1.5px; }
.overlay .home { fill: #fff; stroke: #000; stroke-width: 1; }
.overlay .target circle { fill: none; stroke: #ff3b4e; stroke-width: 2; }
.overlay .target path { stroke: #ff3b4e; stroke-width: 2; }
.map-tip { position: absolute; display: none; pointer-events: none; background: rgba(17,21,28,.95); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .55rem; font-size: .85rem; z-index: 5; white-space: nowrap; }
.map-controls { position: absolute; right: .5rem; top: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.map-controls button { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.map-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); padding: .4rem .3rem 0; }
.lg { display: inline-block; width: 14px; height: 10px; vertical-align: middle; border-radius: 2px; margin-right: .2rem; }
.lg.front { border: 1.5px dashed #fff; }
.lg.attacked { border: 2px solid #ff3b4e; }
.lg.occ { background: repeating-linear-gradient(45deg, #888 0 3px, #444 3px 5px); }

.panel .points-big { font: 700 1.8rem var(--serif); }
.orders { padding-left: 1rem; margin: .3rem 0; }
.orders .attack { color: #ff8a95; }
.orders .defend { color: #9fd4ff; }
.order-box { background: var(--bg2); border-radius: 8px; padding: .7rem; margin-top: .6rem; }
.order-box .btn { flex: 1; }
.gov-box { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .4rem; }
.ad { margin-top: .6rem; border: 1px dashed var(--line); border-radius: 6px; padding: .45rem .6rem; font-size: .9rem; }

/* Strona startowa */
.landing { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 440px); gap: 1.5rem; padding: 1.5rem; max-width: 1400px; margin: 0 auto; align-items: center; min-height: 100vh; }
@media (max-width: 900px) { .landing { grid-template-columns: 1fr; padding: .8rem; } }
.landing-map { background: #0c1016; border-radius: 14px; padding: .5rem; border: 1px solid var(--line); }
.landing-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem; }
.landing-card h1 { font-size: 2.3rem; line-height: 1.1; }
.landing-card h1 span { color: var(--red); }
.lead { font-family: var(--serif); font-size: 1.1rem; }
.howto { padding-left: 1.1rem; margin: .4rem 0 0; color: var(--text); }
.howto li { margin: .15rem 0; }
.auth-tabs { display: flex; gap: .3rem; margin: 1rem 0 .8rem; }
.auth-tabs button { flex: 1; font: inherit; padding: .45rem; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { background: var(--bg2); color: var(--text); border-color: var(--red); }
.oauth { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.oauth .btn { flex: 1; text-align: center; text-decoration: none; }
.public { max-width: 1100px; margin: 0 auto; padding: 1rem; }

/* Raport, ranking */
.report-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.mvp { font-size: 1.05rem; }
.report-img { max-width: 100%; border-radius: 8px; margin-top: .5rem; }
.rank { padding-left: 1.3rem; }
.rank li { padding: .2rem 0; }
.hall { border-bottom: 1px dashed var(--line); padding: .4rem 0; }
.cands { padding-left: 1rem; }
.cands li { padding: .3rem 0; }
.notifs { list-style: none; padding: 0; margin: 0; }
.notifs li { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.notifs li.unread { color: #fff; font-weight: 500; }
.woj-card { border-top: 4px solid var(--c); }
.siedziba { background-image: linear-gradient(160deg, rgba(224,180,76,.08), transparent 60%); }
.siedziba.skin-zamek { background-image: linear-gradient(160deg, rgba(140,160,200,.18), transparent 60%); }
.siedziba.skin-dworek { background-image: linear-gradient(160deg, rgba(92,184,122,.14), transparent 60%); }
.siedziba.skin-kamienica { background-image: linear-gradient(160deg, rgba(214,41,59,.12), transparent 60%); }

/* Sklep */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.shop-item { border: 1px solid var(--line); border-radius: 8px; padding: .6rem; display: flex; flex-direction: column; gap: .35rem; }
.shop-item.owned { border-color: #3d5a45; }
.si-preview { min-height: 1.6rem; font-size: 1rem; }
.tiers { padding-left: 1.1rem; }
.tiers li.done { color: var(--ok); }

/* Czat */
.chat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; height: 100%; display: flex; flex-direction: column; }
.chat.full { height: calc(100vh - 150px); }
.chat-tabs { display: flex; gap: .25rem; margin-bottom: .5rem; flex-wrap: wrap; }
.chat-tabs button { font: inherit; font-size: .82rem; padding: .2rem .55rem; border-radius: 5px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chat-tabs button.on { color: var(--text); border-color: var(--red); }
.msgs { flex: 1; overflow-y: auto; font-size: .9rem; margin-bottom: .5rem; word-wrap: break-word; }
.msg { padding: .15rem 0; }
.msg.system { color: var(--gold); font-style: italic; }
.chat-form { display: flex; gap: .4rem; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 160%); background: #1f2c45; color: #fff; padding: .6rem 1.1rem; border-radius: 8px; transition: transform .25s; z-index: 50; max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: #6e1d27; }
.toast.ok { background: #1f4630; }

/* ===================== Klimat: wojskowa mapa sztabowa ===================== */
body {
  background-color: #12161c;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(214,41,59,.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.topbar { background: linear-gradient(180deg, #1d232d, #151a22); border-bottom: 2px solid #3a2f1a; box-shadow: 0 2px 0 rgba(224,180,76,.15); }
.brand { font-variant: small-caps; letter-spacing: .04em; }
.tabs { background: #151a22; }
.tabs a { font-variant: small-caps; letter-spacing: .03em; font-size: .98rem; }
.card { background: linear-gradient(180deg, #1f2633, #1a202b); border-color: #303a4e; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25); }
h2, h3 { font-variant: small-caps; letter-spacing: .02em; }
.ico { width: 18px; height: 18px; flex: none; }
.res { display: inline-flex; align-items: center; gap: .25rem; background: #10141a; border: 1px solid #36404f; border-radius: 6px; padding: .15rem .5rem; color: var(--text); font: inherit; font-size: .9rem; text-decoration: none; cursor: default; font-variant-numeric: tabular-nums; }
button.res, a.res { cursor: pointer; }
.res small { color: var(--muted); }
.res-points { color: #ffb3bb; }
.res-gold b { color: var(--gold); }
.res-korony b { color: #c9a2ff; }
.res.bell.has { border-color: var(--red); background: #3a1820; }
.res.bell.has b { color: #fff; }
.me-herb { display: inline-flex; }
.herb { display: inline-block; vertical-align: middle; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }

/* Mapa: teren i kolory */
.map-wrap { background: #1b1d1f; border: 2px solid #3a2f1a; border-radius: 12px; box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(0,0,0,.45) inset; position: relative; overflow: hidden; }
.map-wrap::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(0,0,0,.55); border-radius: 10px; }
svg.map { aspect-ratio: 1060 / 981; max-height: calc(100vh - 190px); background: #1b1d1f; }
.sea { fill: url(#seaGrad); }
.sea-waves { fill: url(#waves); }
.land-shadow { fill: rgba(0,0,0,.55); transform: translate(3px, 5px); filter: blur(3px); }
.terrain { opacity: 1; }
.pw { fill-rule: evenodd; fill-opacity: .6; mix-blend-mode: multiply; stroke: rgba(40, 30, 20, .45); stroke-width: calc(.45px / var(--z, 1)); }
.pw:hover { fill-opacity: .4; filter: none; }
.pw.dim { fill-opacity: .42; filter: grayscale(.45); }
.pw.dim:hover { fill-opacity: .3; filter: none; }
.pw.mine { fill-opacity: .66; }
.pw.front { stroke: #fff; stroke-width: calc(1.4px / var(--z, 1)); stroke-dasharray: calc(3px / var(--z, 1)) calc(2px / var(--z, 1)); mix-blend-mode: normal; fill-opacity: .55; }
.pw.attacked { stroke: #ff2d40; stroke-width: calc(2.2px / var(--z, 1)); mix-blend-mode: normal; fill-opacity: .6; animation: pulse 1.2s infinite; }
.pw.sel { stroke: #ffe28a; stroke-width: calc(2.6px / var(--z, 1)); stroke-dasharray: none; mix-blend-mode: normal; fill-opacity: .45; filter: drop-shadow(0 0 4px rgba(255,226,138,.8)); }
.pw.flash { mix-blend-mode: normal; animation: flash .45s ease-in-out 2; stroke: #fff; stroke-width: calc(2.5px / var(--z, 1)); }
@keyframes flash { 50% { fill-opacity: 1; filter: brightness(2.2); } }
.rivers path { fill: none; stroke: #3d6f98; stroke-width: calc(var(--rw) * 1px); stroke-linecap: round; stroke-linejoin: round; opacity: .9; pointer-events: none; }
.river-labels text { font: italic 8px var(--display); fill: #a9cbe6; paint-order: stroke; stroke: rgba(10,20,30,.6); stroke-width: 2px; pointer-events: none; }
.woj-borders path { stroke: rgba(30, 22, 14, .95); stroke-width: calc(1.8px / var(--z, 1)); }
.woj-labels text { font: 700 15px var(--display); letter-spacing: .18em; text-anchor: middle; fill: rgba(255,255,255,.72); paint-order: stroke; stroke: rgba(20,14,8,.55); stroke-width: 3px; pointer-events: none; transition: opacity .3s; }
svg.zoomed .woj-labels text { opacity: .0; }
.neighbors text { font: 600 13px var(--display); letter-spacing: .35em; fill: rgba(232,226,214,.22); text-anchor: middle; pointer-events: none; }
.neighbors text.sea-label { fill: rgba(170,205,235,.45); font-style: italic; letter-spacing: .25em; }
.overlay .city { fill: #2a2118; stroke: #f3e7cc; stroke-width: .6; }
.overlay .city-label { font: 600 5px system-ui, sans-serif; fill: #2a2118; paint-order: stroke; stroke: rgba(255,248,230,.85); stroke-width: 1.4px; opacity: 0; transition: opacity .3s; }
svg.zoomed .overlay .city-label { opacity: 1; }
.overlay .star { fill: #ffe28a; stroke: #2a1d08; stroke-width: .7; }
.overlay .star.lost { fill: #8a8a8a; }
.overlay .cap-label { font: 700 9.5px var(--display); fill: #1e170e; paint-order: stroke; stroke: rgba(255,248,230,.9); stroke-width: 2.4px; }
.overlay .arrow { fill: none; stroke: #ff3b4e; stroke-width: calc(2.4px / var(--z, 1) + .6px); stroke-linecap: round; stroke-dasharray: 6 3; animation: march 1s linear infinite; filter: drop-shadow(0 0 2px rgba(0,0,0,.8)); }
@keyframes march { to { stroke-dashoffset: -9; } }
.overlay .def-mark path { fill: #9fd4ff; stroke: #0d2236; stroke-width: .8; }
.overlay .home circle { fill: none; stroke: #fff; stroke-width: 1.6; }
.overlay .home .dot { fill: #fff; }
.overlay .capture-float { font: 800 9px var(--display); text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.85); stroke-width: 2.5px; animation: rise 2.4s ease-out forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } to { opacity: 0; transform: translateY(-14px); } }
.map-tip .sw, .sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin: 0 .25rem; vertical-align: -1px; }
.lg.arrow { height: 3px; background: #ff3b4e; border-radius: 2px; }

/* Układ ekranu mapy: front | mapa | panel powiatu (czat w zakładce) */
body[data-view="mapa"] .layout { grid-template-columns: 1fr; }
body[data-view="mapa"] .side { display: none; }
.map-layout { grid-template-columns: 270px minmax(0, 1fr) 340px; }
@media (max-width: 1400px) { .map-layout { grid-template-columns: minmax(0, 1fr) 330px; } .front { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; } }
@media (max-width: 1000px) { .map-layout { grid-template-columns: 1fr; } }
.front { display: flex; flex-direction: column; gap: .8rem; }
.front-card { background: linear-gradient(180deg, #1f2633, #1a202b); border: 1px solid #303a4e; border-radius: 10px; padding: .75rem .85rem; }
.front-card h3 { margin: 0 0 .45rem; font-size: .95rem; display: flex; align-items: center; gap: .35rem; }
.woj-banner { border-top: 4px solid var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #1f2633), #1a202b); }
.wb-head { display: flex; gap: .6rem; align-items: center; }
.wb-name { font: 700 1.15rem var(--display); font-variant: small-caps; }
.wb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin: .6rem 0; text-align: center; }
.wb-stats > div { background: rgba(0,0,0,.25); border-radius: 6px; padding: .3rem; display: flex; flex-direction: column; }
.wb-stats b { font-size: 1.15rem; }
.wb-stats span { font-size: .72rem; color: var(--muted); }
.up { color: var(--ok); font-weight: 700; }
.down { color: #ff7b86; font-weight: 700; }
.threats, .captures, .mini-rank { list-style: none; padding: 0; margin: 0; }
.threats li { display: flex; align-items: center; gap: .45rem; padding: .22rem 0; border-bottom: 1px dashed #303a4e; }
.threats li a { flex: 1; }
.threat { font-size: .72rem; padding: 0 .4rem; border-radius: 3px; background: #4a3b16; }
.threat.t-duży, .threat.t-ogromny { background: #6e1d27; color: #ffd4d8; }
.captures li { padding: .18rem 0; }
.captures li.mine { font-weight: 700; }
.mini-rank { counter-reset: r; }
.mini-rank li { counter-increment: r; display: flex; align-items: center; gap: .4rem; padding: .18rem 0; }
.mini-rank li::before { content: counter(r) '.'; width: 1.2rem; color: var(--muted); font-size: .85rem; }
.mini-rank li span { flex: 1; }
.mini-rank li.me { color: var(--gold); }
.target-card a { font: 700 1.05rem var(--display); color: #ff8a95; }

/* Odliczanie i ekran bitwy */
.battle-countdown { position: fixed; top: 110px; left: 50%; transform: translateX(-50%); z-index: 60; text-align: center; background: rgba(40,10,14,.92); border: 2px solid var(--red); border-radius: 14px; padding: .6rem 1.6rem; box-shadow: 0 0 40px rgba(214,41,59,.45); pointer-events: none; }
.bc-label { font: 700 .85rem var(--display); letter-spacing: .3em; color: #ffb3bb; }
.bc-time { font: 800 3rem var(--display); color: #fff; line-height: 1; animation: beat 1s infinite; }
.bc-sub { font-size: .8rem; color: #ffd4d8; }
@keyframes beat { 50% { transform: scale(1.12); } }
.battle-overlay { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.bo-banner { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); text-align: center; background: linear-gradient(180deg, rgba(30,8,12,.95), rgba(20,8,10,.9)); border: 2px solid var(--red); border-radius: 12px; padding: .7rem 2rem; animation: drop .5s ease-out; pointer-events: auto; }
.bo-title { font: 800 2rem var(--display); letter-spacing: .12em; color: #fff; }
.bo-sub { color: #ffd4d8; }
@keyframes drop { from { transform: translate(-50%, -40px); opacity: 0; } }
.bo-feed { position: absolute; left: 1rem; bottom: 1rem; width: min(420px, 90vw); max-height: 45vh; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; }
.bo-item { background: rgba(17,21,28,.94); border-left: 4px solid #8d96a8; border-radius: 6px; padding: .4rem .6rem; animation: slide .35s ease-out; pointer-events: auto; }
.bo-item.good { border-left-color: var(--ok); }
.bo-item.bad { border-left-color: var(--red); }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.bo-summary { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 92vw); background: linear-gradient(180deg, #232b3a, #1a202b); border: 2px solid var(--gold); border-radius: 14px; padding: 1.2rem 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: pop .4s ease-out; pointer-events: auto; }
.bo-summary h2 { font-size: 1.5rem; color: var(--gold); text-align: center; }
.bo-row { display: flex; gap: .8rem; align-items: center; margin: .5rem 0 .8rem; }
.bo-mvp { background: #2a2416; border-radius: 6px; padding: .45rem .6rem; margin-bottom: .6rem; }
@keyframes pop { from { transform: translate(-50%, -45%) scale(.92); opacity: 0; } }

/* Samouczek */
.tut { position: fixed; inset: 0; z-index: 80; }
.tut.pass { pointer-events: none; }
.tut-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(5,8,12,.68); border: 2px solid var(--gold); transition: all .3s ease; pointer-events: none; }
.tut-bubble { position: fixed; width: min(340px, 92vw); background: linear-gradient(180deg, #2a2416, #1f1b12); border: 2px solid var(--gold); border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 12px 40px rgba(0,0,0,.6); pointer-events: auto; transition: top .3s, left .3s; }
.tut-bubble h3 { color: var(--gold); margin: .1rem 0 .35rem; }
.tut-bubble p { margin: 0 0 .5rem; }
.tut-bubble .row { justify-content: flex-end; flex-wrap: wrap; }
.tut-step { font-size: .75rem; color: var(--muted); letter-spacing: .1em; }

.tut.dim { background: rgba(5,8,12,.68); }
@media (max-width: 700px) { .topbar [data-act=logout] { display: none; } .res { padding: .12rem .4rem; } }

/* ---------- Utrzymanie: rozkazy, seria, derby, wydarzenia, oddziały ---------- */
.rank-badge { display: inline-block; margin-left: .3rem; font-size: .72rem; padding: 0 .4rem; border-radius: 4px; background: #3a3220; color: var(--gold); border: 1px solid #5c4a1f; vertical-align: middle; }
.missions ul { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .45rem; }
.missions li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .88rem; }
.missions li > div { flex: 1; }
.missions li.claimed { opacity: .55; }
.missions li.done > div { color: var(--ok); }
.mbar { height: 4px; border-radius: 2px; background: var(--line); margin-top: .2rem; overflow: hidden; }
.mbar > div { height: 100%; background: linear-gradient(90deg, #8a6a24, var(--gold)); }
.streak { float: right; font-size: .85rem; color: #ffb35c; font-weight: 600; }
.event-card { border-color: #7a4a1c !important; background: linear-gradient(135deg, rgba(160, 80, 20, .22), transparent 70%), var(--card) !important; }
.event-card h3 { color: #ffb35c; }
.derby-row { display: flex; align-items: center; justify-content: center; gap: .9rem; margin: .3rem 0; }
.derby-row .score { font-size: 1.5rem; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.squad-card h2 { margin-bottom: .2rem; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: .3rem 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, #8a6a24, var(--gold)); transition: width .4s; }
.bar.big { height: 14px; border-radius: 7px; }
.patron-box { border-top: 1px dashed var(--line); margin-top: .6rem; padding-top: .5rem; }
.patron-box .row { margin-top: .35rem; }
.patron-box input { max-width: 90px; }
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

/* Bohater zdobycia + efekty */
.hero { font-size: .78rem; margin-top: .15rem; color: var(--muted); }
.hero.fx-zloto { color: #ffd76a; text-shadow: 0 0 8px rgba(255, 200, 80, .8); font-weight: 600; }
.hero.fx-ogien { color: #ff8a3c; text-shadow: 0 0 6px #ff4d00, 0 0 14px rgba(255, 80, 0, .6); font-weight: 600; animation: fxflicker .8s infinite alternate; }
.hero.fx-burza { color: #9fd3ff; text-shadow: 0 0 8px #3aa0ff; font-weight: 600; animation: fxflash 2.2s infinite; }
@keyframes fxflicker { from { opacity: .85; } to { opacity: 1; text-shadow: 0 0 10px #ff4d00, 0 0 20px rgba(255, 120, 0, .7); } }
@keyframes fxflash { 0%, 88%, 100% { opacity: 1; } 92% { opacity: .4; } 95% { opacity: 1; } 97% { opacity: .6; } }

/* Patroni na mapie */
.map svg text.patron { font-size: 9px; fill: #ffd76a; stroke: #3a2a08; stroke-width: .6px; paint-order: stroke; text-anchor: middle; pointer-events: none; }

/* Motywy mapy */
svg.theme-stara { filter: sepia(.55) saturate(.8) contrast(1.05); }
svg.theme-zima { filter: saturate(.55) brightness(1.12) hue-rotate(-10deg); }
svg.theme-noc { filter: brightness(.72) saturate(.85) hue-rotate(15deg); }
@media (max-width: 700px) { .tracks { grid-template-columns: 1fr; } }
.theme-swatch { display: block; height: 46px; border-radius: 6px; background: linear-gradient(135deg, #7d9a6a 0 30%, #b49a6a 30% 55%, #6f8fa8 55% 70%, #a8826a 70%); border: 1px solid var(--line); }
.theme-swatch.theme-stara { filter: sepia(.55) saturate(.8) contrast(1.05); }
.theme-swatch.theme-zima { filter: saturate(.55) brightness(1.12) hue-rotate(-10deg); }
.theme-swatch.theme-noc { filter: brightness(.72) saturate(.85) hue-rotate(15deg); }

/* Panel GM: wykres aktywnych, multikonta */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: .3rem; }
.spark > div { flex: 1; max-width: 46px; height: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.spark i { position: absolute; bottom: 14px; left: 0; right: 0; background: #3c5a86; border-radius: 3px 3px 0 0; max-height: calc(100% - 14px); }
.spark b { position: absolute; bottom: 14px; left: 30%; right: 30%; background: var(--gold); border-radius: 2px 2px 0 0; max-height: calc(100% - 14px); }
.spark span { position: absolute; bottom: 0; font-size: .65rem; color: var(--muted); }
.lg-a, .lg-n { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; background: #3c5a86; vertical-align: middle; }
.lg-n { background: var(--gold); }
.tag.warn { background: #5a2a1c; color: #ffc9b0; }
a.banned { text-decoration: line-through; opacity: .6; }
.check { display: flex; gap: .5rem; align-items: flex-start; line-height: 1.35; }
.check input { width: auto; margin-top: .2rem; flex: none; }

/* Udostępnianie */
.share-modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.share-box { max-width: 520px; width: 100%; max-height: 94vh; overflow: auto; position: relative; }
.share-box img { width: 100%; border-radius: 8px; margin: .4rem 0 .7rem; border: 1px solid var(--line); }
.share-box .share-x { position: absolute; top: .7rem; right: .7rem; }
.share-box input { margin-top: .4rem; font-size: .85rem; }

/* Zgłoszenia czatu */
.msg { position: relative; }
.msg-flag { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 0 .25rem; opacity: 0; transition: opacity .15s; margin-left: .2rem; }
.msg:hover .msg-flag, .msg-flag:focus { opacity: .8; }
@media (hover: none) { .msg-flag { opacity: .45; } }
.small-box { max-width: 380px; }
.reason-list { display: grid; gap: .4rem; margin: .6rem 0; }
.reports td.actions { white-space: normal; }
.reports td.actions .btn { margin: .1rem 0; }
.reports-open { border-color: #7a3a2a; }

/* ---------- Telefon: zwarty nagłówek, przyklejone zakładki, legenda na żądanie ---------- */
.legend-toggle { display: none; }
@media (max-width: 700px) {
  .topbar { position: static; padding: .4rem .6rem; gap: .3rem .5rem; }
  .brand { font-size: 1rem; }
  .clock { order: 0; flex: 1; flex-basis: auto; justify-content: flex-end; font-size: .78rem; }
  .clock .clk-day, .clock .clk-season, .clock .clk-test { display: none; }
  .clock .battle-timer { font-size: .78rem; padding: .05rem .4rem; }
  .who { order: 2; flex-basis: 100%; justify-content: space-between; display: flex; gap: .3rem; margin: 0; }
  .who .me-herb { display: none; }
  .res { padding: .1rem .45rem; font-size: .88rem; }
  .tabs { position: sticky; top: 0; z-index: 25; padding: 0 .3rem; scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: .55rem .6rem; font-size: .9rem; }
  .map-legend { font-size: .78rem; gap: .25rem .7rem; }
  .map-legend > :not(.legend-toggle):not(label) { display: none; }
  .map-legend.open > * { display: inline-flex; }
  .legend-toggle { display: inline-block; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; font-size: .78rem; padding: .1rem .5rem; }
  .card { padding: .85rem .9rem; }
  .front-card { padding: .75rem .85rem; }
  /* Bitwa o 21:00 na pełnym ekranie */
  .battle-overlay { pointer-events: auto; background: rgba(8,10,14,.82); overflow-y: auto; z-index: 90; }
  .bo-banner { top: 12px; padding: .45rem 1.2rem; }
  .bo-title { font-size: 1.3rem; letter-spacing: .06em; white-space: nowrap; }
  .bo-feed { left: .5rem; right: .5rem; width: auto; bottom: .5rem; max-height: 30vh; }
  .bo-summary { top: auto; bottom: 34vh; transform: translateX(-50%); padding: .9rem 1rem; max-height: 60vh; overflow-y: auto; }
  .bo-summary h2 { font-size: 1.2rem; }
  .bo-summary .row { flex-wrap: wrap; }
  .bo-summary .row .btn { flex: 1 1 auto; }
  .share-box { padding: .9rem; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tbl { font-size: .85rem; }
  .tbl td, .tbl th { padding: .3rem .25rem; }
  .reports td.actions .btn { display: block; width: 100%; }
}


/* ================= Motyw „Centrum dowodzenia” (kierunek B) ================= */
html, body { background: var(--bg); }
body { background-image: radial-gradient(1200px 520px at 50% -12%, rgba(57,208,224,.07), transparent 70%); background-attachment: fixed; }
a { color: var(--cyan); }
h1, h2, h3 { font-family: var(--display); letter-spacing: .02em; }
.card h2, .front-card h3, .panel h2, .panel h3 { text-transform: uppercase; letter-spacing: .1em; font-size: .95rem; color: #EAF2F9; }
.card h2 { font-size: 1.02rem; }

.topbar { background: rgba(11,18,26,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); box-shadow: none; }
.brand { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-variant: normal; font-size: 1.35rem; }
.brand span { color: var(--cyan); }
.battle-timer { background: #3A1216; color: #FF8A80; font-family: var(--mono); font-weight: 700; border-radius: 8px; padding: .15rem .6rem; }
.res { background: #101B26; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-weight: 600; }
.res-points { color: var(--cyan); }
.res-gold b { color: var(--gold); }
.res-korony b { color: #C6A8FF; }
.rank-badge { background: #13303A; color: #7FE7F2; border-color: #1E4A5A; }

.tabs { background: var(--bg2); border-bottom: 1px solid var(--line); }
.tabs a { font-family: var(--display); font-variant: normal; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .95rem; }
.tabs a.active { color: #EAF2F9; border-bottom-color: var(--cyan); }

.card, .front-card, .landing-card, .chat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.stat-row { border-bottom-color: var(--line); }
.tbl th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.tag { background: #172433; color: var(--text); }
input, select, textarea { background: #0A121A; border-color: var(--line); border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(57,208,224,.5); outline-offset: 1px; border-color: var(--cyan); }
input[type=range] { accent-color: var(--cyan); }

.btn { background: var(--cyan); color: #04161A; border-radius: 10px; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.btn.small { letter-spacing: .05em; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid #2E4A62; }
.btn.ghost:hover { border-color: var(--cyan); filter: none; }
.btn.danger { background: var(--red); color: #fff; }
.btn:focus-visible { outline: 2px solid #EAF2F9; outline-offset: 2px; }

/* Panel frontu */
.front-card { background: var(--card); }
.woj-banner { border-top: 3px solid var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 18%, #0E1620), #0E1620 70%); }
.wb-name { font-family: var(--display); font-variant: normal; text-transform: uppercase; letter-spacing: .08em; }
.wb-stats > div { background: #13303D33; border: 1px solid var(--line); border-radius: 8px; }
.wb-stats b, .points-big, .score, .streak, .mbar + span { font-family: var(--mono); }
.threats li { border-bottom-color: var(--line); }
.threat { background: #3A2A10; color: #F5C76B; }
.threat.t-duży, .threat.t-ogromny { background: #3A1216; color: #FF8A80; }
.mbar { background: #1A2836; }
.mbar > div, .bar > div { background: linear-gradient(90deg, #1E8C99, var(--cyan)); }
.event-card { border-color: #5A3A10 !important; background: linear-gradient(135deg, rgba(245,166,35,.12), transparent 70%), var(--card) !important; }
.event-card h3 { color: var(--amber); }
.panel .points-big { color: #EAF2F9; }

/* Mapa jako ekran taktyczny */
.map-wrap, .landing-map { background: #081018; border: 1px solid var(--line); border-radius: 12px;
  background-image: linear-gradient(rgba(57,208,224,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(57,208,224,.05) 1px, transparent 1px);
  background-size: 40px 40px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.map-wrap::after { box-shadow: inset 0 0 80px rgba(0,0,0,.6); }
.terrain { opacity: .45; filter: grayscale(.35) brightness(.75) contrast(1.05); }
.pw { mix-blend-mode: normal; fill-opacity: .38; stroke: rgba(120,160,190,.28); }
.pw:hover { fill-opacity: .55; }
.pw.dim { fill-opacity: .2; filter: saturate(.6); }
.pw.dim:hover { fill-opacity: .35; }
.pw.mine { fill-opacity: .55; }
.pw.front { stroke: var(--cyan); fill-opacity: .42; }
.pw.sel { stroke: var(--amber); }
.woj-labels text { font-family: var(--display); fill: rgba(234,242,249,.6); stroke: rgba(4,10,16,.8); letter-spacing: .22em; }
.overlay .cap-label { font-family: var(--display); fill: #EAF2F9; stroke: rgba(4,10,16,.9); }
.neighbors text { fill: rgba(141,161,180,.28); font-family: var(--display); }
.map-legend { color: var(--muted); }
.lg.arrow { background: var(--cyan); }

/* Odliczanie i bitwa */
.battle-countdown { background: rgba(14,22,32,.94); border: 1px solid #FF5A4E; box-shadow: 0 0 40px rgba(255,90,78,.35); border-radius: 12px; }
.bc-label { font-family: var(--display); color: #FF8A80; }
.bc-time { font-family: var(--mono); font-weight: 700; color: #fff; }
.bo-banner { background: rgba(14,22,32,.95); border: 1px solid #FF5A4E; border-radius: 12px; box-shadow: 0 0 40px rgba(255,90,78,.3); }
.bo-title { font-family: var(--display); text-transform: uppercase; }
.bo-summary { background: var(--card); border: 1px solid var(--cyan); box-shadow: 0 0 0 1px rgba(57,208,224,.15), 0 24px 60px rgba(0,0,0,.6); }
.bo-summary h2 { color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.bo-item { background: rgba(14,22,32,.95); }
.bo-mvp { background: #1A2433; border: 1px solid var(--line); }

/* Strona startowa */
.landing-card h1 { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 2.6rem; }
.landing-card h1 span { color: var(--cyan); }
.lead { font-family: var(--sans); color: #C3D2DF; }
.auth-tabs button.on { border-color: var(--cyan) !important; color: #EAF2F9; }

/* Czat */
.chat-tabs button.on { border-color: var(--cyan); }
.msg b, .pname { font-weight: 600; }
.overlay .arrow { stroke: var(--cyan); filter: drop-shadow(0 0 3px rgba(57,208,224,.6)); }
.lg.attacked { border-color: var(--red) !important; }
.overlay .target circle, .overlay .target path { stroke: var(--amber); }
.auth-tabs button.on { background: #101B26; }
