:root{
  --bg0:#050814; --bg1:#0b1020; --card:#111827; --card2:#0f172a; --border:#27324a;
  --text:#e5e7eb; --muted:#9ca3af; --accent:#10b981; --accent2:#059669;
  --danger:#ef4444; --warn:#f59e0b; --radius:16px;
}
*{box-sizing:border-box}
body{
  margin:0; color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(16,185,129,.12), transparent 55%),
              radial-gradient(900px 500px at 100% 0%, rgba(59,130,246,.10), transparent 55%),
              linear-gradient(180deg,var(--bg0),var(--bg1));
  min-height:100vh;
}
a{color:var(--accent); text-decoration:none}
a:hover{color:#34d399}
.wrap{max-width:1100px; margin:0 auto; padding:24px 14px 48px}
.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(11,16,32,.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(39,50,74,.8);
}
.topbar-inner{
  max-width:1100px; margin:0 auto;
  padding:14px 14px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.brand{display:flex; flex-direction:column; gap:2px; line-height:1.1;}
.brand .name{font-weight:900; letter-spacing:.2px; font-size:16px;}
.brand .tag{font-size:12px; color:var(--muted)}
.nav{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.nav a.navlink{
  color:var(--muted); padding:8px 10px; border-radius:999px; border:1px solid transparent;
  font-weight:700; font-size:13px;
}
.nav a.navlink:hover{ color:var(--text); border-color:rgba(39,50,74,.9); background:rgba(17,24,39,.45) }
.nav a.navlink.active{ color:var(--text); border-color:rgba(16,185,129,.35); background:rgba(16,185,129,.10) }
.right{display:flex; align-items:center; gap:10px;}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 14px; border-radius:999px; border:1px solid rgba(39,50,74,.9);
  background:rgba(17,24,39,.55); color:var(--text); font-weight:800; font-size:13px; cursor:pointer;
}
.btn:hover{ border-color:rgba(16,185,129,.45); background:rgba(16,185,129,.10) }
.btn.primary{
  border-color:rgba(16,185,129,.55);
  background: linear-gradient(180deg, rgba(16,185,129,.95), rgba(5,150,105,.95));
  color:#04120b;
}
.btn.primary:hover{ filter:brightness(1.03) }
.btn.ghost{ background:transparent }
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px; border:1px solid rgba(39,50,74,.9);
  background:rgba(17,24,39,.45); color:var(--muted); font-size:13px; cursor:pointer;
}
.chip:hover{ color:var(--text); border-color:rgba(39,50,74,1) }
.lang-dd{ position:relative }
.lang-dd .menu{
  position:absolute; right:0; top:calc(100% + 8px);
  width:260px; max-height:360px; overflow:auto;
  background:var(--card); border:1px solid var(--border);
  border-radius:14px; box-shadow:0 18px 50px rgba(0,0,0,.55);
  display:none; padding:6px;
}
.lang-dd.open .menu{ display:block }
.lang-item{
  width:100%; display:flex; align-items:center; gap:10px;
  padding:9px 10px; border-radius:12px; color:var(--text);
  border:1px solid transparent; background:transparent; cursor:pointer; text-align:left; font-weight:700;
}
.lang-item:hover{ border-color:rgba(39,50,74,1); background:rgba(15,23,42,.75) }
.flag{ width:18px; height:12px; border-radius:2px; box-shadow:0 0 0 1px rgba(55,65,81,.9) }

.card{
  background:rgba(17,24,39,.72);
  border:1px solid rgba(39,50,74,.95);
  border-radius:var(--radius);
  box-shadow:0 18px 60px rgba(0,0,0,.55);
  overflow:hidden;
}
.card-head{
  padding:18px 18px 14px 18px;
  background:linear-gradient(180deg, rgba(24,35,64,.7), rgba(17,24,39,.72));
  border-bottom:1px solid rgba(39,50,74,.95);
}
.card-head h1{ margin:0; font-size:18px }
.card-head p{ margin:6px 0 0 0; color:var(--muted); font-size:13px; line-height:1.35 }
.card-body{ padding:18px }

.grid{ display:grid; grid-template-columns: 1.1fr .9fr; gap:16px; }
@media (max-width: 860px){ .grid{ grid-template-columns: 1fr; } }

.tabs{ display:flex; gap:8px; margin-bottom:14px; }
.tab{
  padding:8px 12px; border-radius:999px;
  border:1px solid rgba(39,50,74,.9);
  background:rgba(15,23,42,.55);
  color:var(--muted);
  font-weight:900; font-size:13px;
  cursor:pointer;
}
.tab.active{ color:var(--text); border-color:rgba(16,185,129,.55); background:rgba(16,185,129,.10) }

label{ display:block; font-size:12px; color:var(--muted); margin:10px 0 6px 2px; font-weight:800; letter-spacing:.02em; }
input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(39,50,74,.95);
  background:rgba(2,6,23,.55);
  color:var(--text);
  outline:none;
}
input:focus{ border-color:rgba(16,185,129,.65); box-shadow:0 0 0 3px rgba(16,185,129,.16) }

.row{ display:flex; gap:12px }
.row > div{ flex:1 1 0 }
.hint{ margin-top:10px; color:var(--muted); font-size:13px; line-height:1.45 }

.alert{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(39,50,74,.95);
  background:rgba(15,23,42,.7);
  color:var(--text);
  font-weight:700; font-size:13px;
  margin-bottom:12px;
}
.alert.success{ border-color:rgba(16,185,129,.55); background:rgba(16,185,129,.10) }
.alert.error{ border-color:rgba(239,68,68,.55); background:rgba(239,68,68,.10) }

.panel{
  padding:16px;
  background:rgba(15,23,42,.55);
  border:1px solid rgba(39,50,74,.95);
  border-radius:16px;
}
.panel h2{ margin:0 0 10px 0; font-size:14px }
.panel .k{ color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em }
.panel .v{ margin-top:4px; font-size:13px; font-weight:800 }

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.spacer{ height:10px }
.footer{ margin-top:22px; color:var(--muted); font-size:12px; text-align:center; }

/* ===== Onboarding modal ===== */
.cd-modal-overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px 12px;
  z-index: 999999;
}
.cd-modal-card{
  width: min(92vw, 620px);
  background: rgba(17,24,39,.92);
  border: 1px solid rgba(39,50,74,.95);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
  overflow:hidden;
}
.cd-modal-head{
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(24,35,64,.8), rgba(17,24,39,.92));
  border-bottom: 1px solid rgba(39,50,74,.95);
}
.cd-modal-title{ font-weight: 900; font-size: 16px; }
.cd-modal-sub{ margin-top:6px; color: var(--muted); font-size: 13px; line-height:1.4; }
.cd-modal-body{ padding: 16px 18px; }

.cd-select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(39,50,74,.95);
  background: rgba(2,6,23,.55);
  color: var(--text);
  outline:none;
}
.cd-input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(39,50,74,.95);
  background: rgba(2,6,23,.55);
  color: var(--text);
  outline:none;
}
.cd-input:focus, .cd-select:focus{
  border-color: rgba(16,185,129,.65);
  box-shadow: 0 0 0 3px rgba(16,185,129,.16);
}

.cd-suggest{
  margin-top:10px;
  border:1px solid rgba(39,50,74,.95);
  background: rgba(2,6,23,.65);
  border-radius: 12px;
  overflow:hidden;
  max-height: 280px;
  overflow-y:auto;
}
.cd-suggest-item{
  padding:10px 12px;
  cursor:pointer;
  border-top:1px solid rgba(39,50,74,.55);
}
.cd-suggest-item:first-child{ border-top:none; }
.cd-suggest-item:hover{ background: rgba(16,185,129,.12); }
.cd-suggest-name{ font-weight:800; }
.cd-suggest-meta{ color: var(--muted); font-size:12px; margin-top:2px; }

.cd-onb-selected{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(16,185,129,.45);
  background: rgba(16,185,129,.10);
  font-weight:800;
}
/* ===== Map layout ===== */
.cd-map-shell{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 1000px){
  .cd-map-shell{ grid-template-columns: 1fr; }
}

/* väčšia mapa – skoro full-screen */
.cd-map-stage{
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: clamp(560px, calc(100vh - 220px), 1050px);
}

/* canvas sa natiahne na maximum */
.cd-map-canvas-wrap{
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: clamp(520px, calc(100vh - 270px), 1000px);
}

#cdMapCanvas{
  width:100%;
  height:100%;
  display:block;
  cursor: grab;
}
#cdMapCanvas:active{ cursor: grabbing; }

.cd-map-topline{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 14px;
  border-bottom:1px solid rgba(39,50,74,.95);
  background: rgba(15,23,42,.55);
}
.cd-map-status, .cd-map-zoom{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.cd-map-tooltip{
  position:absolute;
  min-width: 240px;
  max-width: 320px;
  z-index: 50;
  background: rgba(2,6,23,.92);
  color: var(--text);
  border: 1px solid rgba(39,50,74,.95);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.cd-map-tooltip .tt-title{ font-weight: 900; margin-bottom: 6px; }
.cd-map-tooltip .tt-coord{ color: var(--muted); font-weight: 800; margin-left: 6px; }
.cd-map-tooltip .tt-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  padding-top:4px;
}
.cd-map-tooltip .tt-k{ color: var(--muted); font-weight: 800; }
.cd-map-tooltip .tt-v{ font-weight: 800; }

.cd-map-hud{
  position:absolute;
  left: 12px;
  bottom: 12px;
  z-index: 40;
  background: rgba(2,6,23,.65);
  border:1px solid rgba(39,50,74,.85);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
/* ===== Page MAP: full width ===== */
.page-map .wrap{
  max-width: calc(100vw - 24px);
  padding: 18px 12px 48px;
}

/* širší panel filtrov na veľkých monitoroch */
.page-map .cd-map-shell{
  grid-template-columns: 420px 1fr;
}
@media (max-width: 1200px){
  .page-map .cd-map-shell{ grid-template-columns: 360px 1fr; }
}
@media (max-width: 1000px){
  .page-map .cd-map-shell{ grid-template-columns: 1fr; }
}

/* filters: nech dropdowny neoreže */
.cd-map-filters{ overflow: visible; }

/* input + dropdown wrapper */
.cd-field{ position: relative; }
.cd-field .cd-suggest{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 2000;
  margin-top: 0;
}

/* map stage väčší */
.page-map .cd-map-stage{
  height: clamp(640px, calc(100vh - 170px), 1100px);
}
.page-map .cd-map-canvas-wrap{
  min-height: clamp(600px, calc(100vh - 240px), 1050px);
}

/* ===== axis (coords around map) ===== */
.cd-axis{
  position:absolute;
  pointer-events:none;
  z-index: 60;
  font-size: 12px;
  font-weight: 900;
  color: rgba(229,231,235,.85);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.cd-axis-top{
  top: 0; left: 44px; right: 44px; height: 22px;
  display:flex; align-items:flex-end;
}
.cd-axis-bottom{
  bottom: 0; left: 44px; right: 44px; height: 22px;
  display:flex; align-items:flex-start;
}
.cd-axis-left{
  left: 0; top: 22px; bottom: 22px; width: 44px;
}
.cd-axis-right{
  right: 0; top: 22px; bottom: 22px; width: 44px;
}
.cd-axis .tick{
  position:absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: .9;
}
.cd-axis-left .tick,
.cd-axis-right .tick{
  transform: translateY(-50%);
}

/* malé “pozadie” aby boli čísla čitateľné */
.cd-axis-top, .cd-axis-bottom, .cd-axis-left, .cd-axis-right{
  background: rgba(2,6,23,.25);
  backdrop-filter: blur(3px);
}

/* ===== layers / markers UI ===== */
.cd-mini-title{
  margin-top: 14px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}
.cd-layer-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top: 8px;
}
.cd-color{
  width: 44px;
  height: 34px;
  border: 1px solid rgba(39,50,74,.95);
  border-radius: 10px;
  background: rgba(2,6,23,.55);
  padding: 0;
}
.cd-list{
  margin-top: 10px;
  border: 1px solid rgba(39,50,74,.95);
  background: rgba(2,6,23,.55);
  border-radius: 12px;
  overflow:hidden;
}
.cd-list-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px 10px;
  border-top: 1px solid rgba(39,50,74,.55);
}
.cd-list-item:first-child{ border-top: none; }
.cd-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6);
}
.cd-list-name{
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-list-meta{
  margin-left:auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.cd-xbtn{
  margin-left: 10px;
  border: 1px solid rgba(39,50,74,.95);
  background: rgba(17,24,39,.45);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 900;
  cursor:pointer;
}
.cd-xbtn:hover{ border-color: rgba(16,185,129,.45); background: rgba(16,185,129,.10); }

/* selected village box */
.cd-selected-box{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.35);
  background: rgba(59,130,246,.08);
  font-weight: 900;
}
/* ===== Page Players Inactive: full width + split layout ===== */
.page-players-inactive .wrap{
  max-width: calc(100vw - 24px);
  padding: 18px 12px 48px;
}
.page-players-inactive .cd-map-shell{
  grid-template-columns: 420px 1fr;
}
@media (max-width: 1200px){
  .page-players-inactive .cd-map-shell{ grid-template-columns: 360px 1fr; }
}
@media (max-width: 1000px){
  .page-players-inactive .cd-map-shell{ grid-template-columns: 1fr; }
}

.cd-inactive-stage{
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: clamp(560px, calc(100vh - 220px), 1050px);
}
.cd-inactive-scroll{
  overflow: auto;
  flex: 1 1 auto;
  padding: 14px;
}
.cd-pager{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid rgba(39,50,74,.95);
  background: rgba(15,23,42,.55);
}

.cd-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.cd-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(39,50,74,.9);
  background: rgba(17,24,39,.45);
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
}
.cd-chip .x{
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  padding: 0 2px;
}
.cd-chip .x:hover{ color: var(--text); }
