/* MAPWAR — war room. Jeden świadomy, ciemny motyw (spektakl), tła malowane jawnie. */
:root {
  --bg: #0B0F0C;
  --bg2: #10160F;
  --card: #131A14;
  --ink: #E9F2EA;
  --muted: #8FA394;
  --line: #22301F;
  --accent: #43D68F;
  --accent-dim: #1E7A50;
  --hot: #FF5A3C;
  --gold: #E8C15A;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  --sans: system-ui, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11,15,12,0.92); backdrop-filter: blur(6px); z-index: 20;
}
.brand { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: 0.06em; }
.brand span { color: var(--accent); }
.global { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.global-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.global-amount {
  font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(67,214,143,0.35);
}
.langs { display: flex; gap: 4px; }
.langs button {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 11px; padding: 4px 8px; border-radius: 3px;
}
.langs button.on { color: var(--accent); border-color: var(--accent-dim); }

/* hero */
.hero { text-align: center; padding: 26px 20px 8px; }
.hero h1 { font-size: clamp(22px, 3.6vw, 36px); margin: 0 0 6px; letter-spacing: -0.01em; }
.hero .sub { color: var(--muted); margin: 0 auto; max-width: 62ch; }
.rivalries { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 4px; }
.riv {
  font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px; background: var(--bg2);
  display: flex; gap: 8px; align-items: center; cursor: pointer;
}
.riv b { color: var(--ink); font-weight: 600; }
.riv .vs { color: var(--hot); }
.riv .amt { color: var(--accent); font-variant-numeric: tabular-nums; }

/* stage */
.stage { display: grid; grid-template-columns: 1fr 360px; gap: 0; align-items: stretch; }
@media (max-width: 980px) { .stage { grid-template-columns: 1fr; } }

.mapwrap { position: relative; overflow: hidden; min-height: 62vh; background: radial-gradient(ellipse at 50% 40%, #101711 0%, var(--bg) 70%); }
.maploading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); }
.mapwrap svg { width: 100%; height: auto; display: block; }
.mapwrap svg .landxx, .mapwrap svg path { transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.mapwrap g[id], .mapwrap path[id] { cursor: pointer; }
.mapwrap g[id]:hover, .mapwrap path[id]:hover { filter: brightness(1.5); }

.maptip {
  position: absolute; pointer-events: none; z-index: 15;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); white-space: nowrap;
}
.maptip .t-name { color: var(--ink); font-weight: 700; }
.maptip .t-row { color: var(--muted); }
.maptip .t-row b { color: var(--accent); font-weight: 600; }

/* panel */
.panel { border-left: 1px solid var(--line); background: var(--bg2); padding: 18px; overflow-y: auto; max-height: calc(100vh - 60px); position: sticky; top: 56px; }
@media (max-width: 980px) { .panel { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); } }
.panel-empty p { color: var(--muted); }
.lb h3, .kronika h3 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.lb ol { list-style: none; margin: 0; padding: 0; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.lb .pos { font-family: var(--mono); color: var(--muted); width: 22px; }
.lb .name { flex: 1; }
.lb .bar { height: 4px; background: var(--accent-dim); border-radius: 2px; }
.lb .amt { font-family: var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }

.back { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; padding: 2px 10px; margin-bottom: 8px; }
.panel-country h2 { margin: 4px 0 12px; font-size: 24px; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pc-stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.pc-stats .k { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pc-stats .v { font-size: 17px; font-weight: 700; color: var(--accent); }
.pc-president { font-family: var(--mono); font-size: 12.5px; color: var(--gold); min-height: 20px; margin-bottom: 12px; }

/* payform */
.payform { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.amounts { display: flex; gap: 6px; }
.amounts button {
  flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); padding: 8px 0; border-radius: 4px; font-size: 14px;
}
.amounts button.sel { border-color: var(--accent); color: var(--accent); }
.amounts input {
  width: 74px; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); border-radius: 4px; padding: 8px; font-size: 14px;
}
.payform input[type=text] {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 4px; padding: 9px 12px; font-size: 14px;
}
.payform input:focus, .amounts input:focus { outline: 1px solid var(--accent-dim); }
.consent { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.consent a { color: var(--accent); }
.paybtn {
  background: var(--accent); color: #06130B; border: 0; border-radius: 4px;
  font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: 0.04em;
  padding: 12px; transition: transform 0.1s;
}
.paybtn:hover { transform: translateY(-1px); }
.paybtn:disabled { background: var(--accent-dim); cursor: not-allowed; }
.paynote { font-size: 11px; color: var(--muted); margin: 0; }
.payerr { color: var(--hot); font-family: var(--mono); font-size: 12.5px; margin: 0; }

/* kronika */
.kronika ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.kronika li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kronika .kr-top { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); }
.kronika .kr-nick { color: var(--ink); }
.kronika .kr-amt { color: var(--accent); font-variant-numeric: tabular-nums; }
.kronika .kr-msg { color: var(--muted); font-style: italic; }
.kronika .kr-no { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* live feed */
.feed {
  position: fixed; left: 16px; bottom: 16px; z-index: 30;
  display: flex; flex-direction: column-reverse; gap: 8px; max-width: 380px;
}
.feed .f-item {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 8px 12px; font-family: var(--mono); font-size: 12.5px;
  animation: fin 0.3s ease-out; box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.feed .f-item.overtake { border-left-color: var(--hot); }
.feed .f-item .f-amt { color: var(--accent); }
.feed .f-item .f-ot { color: var(--hot); font-weight: 700; }
@keyframes fin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* success modal */
.success {
  position: fixed; inset: 0; z-index: 40; background: rgba(5,8,6,0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.success h2 { color: var(--accent); font-family: var(--mono); margin: 0; }
.success p { color: var(--muted); margin: 0; }
.success canvas { max-width: min(680px, 92vw); height: auto; border: 1px solid var(--line); border-radius: 6px; }
.successBtns { display: flex; gap: 10px; }
.successBtns button {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 4px; padding: 10px 18px; font-family: var(--mono);
}
.successBtns #dlCard { background: var(--accent); color: #06130B; border: 0; font-weight: 700; }

/* footer */
.foot {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 18px 20px 28px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.foot a { color: var(--accent); }
.foot .off { color: var(--gold); font-family: var(--mono); }
