:root {
  --bg: #0b1220;
  --panel: rgba(12, 18, 32, 0.82);
  --panel-border: rgba(255,255,255,0.08);
  --text: #e8eef8;
  --muted: #9aa8bc;
  --accent: #3db8ff;
  --active: #1e6fff;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0,0,0,0.45);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); overflow:hidden; }
#map { position:fixed; inset:0; }

.panel {
  position: fixed; top: 14px; left: 14px; width: 232px;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; z-index: 5;
  max-height: calc(100% - 110px); overflow: auto;
}
.brand { display:flex; gap:10px; align-items:center; margin-bottom:10px; }
.logo { width:36px; height:36px; }
.logo-mark { width:36px; height:36px; border-radius:9px; background:linear-gradient(135deg,#1e6fff,#3db8ff); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:16px; }
.brand-title { font-weight:700; letter-spacing:0.04em; font-size:14px; }
.brand-sub { font-size:12px; color:var(--muted); }

.seg { display:flex; gap:4px; margin-bottom:10px; background:rgba(255,255,255,0.04); border-radius:8px; padding:3px; }
.seg-btn {
  flex:1; border:0; background:transparent; color:var(--muted); padding:6px 0;
  border-radius:6px; cursor:pointer; font-weight:600; font-size:12px;
}
.seg-btn.active { background:var(--active); color:#fff; }
.seg-btn:disabled { opacity:0.4; cursor:not-allowed; }

.layers { display:flex; flex-direction:column; gap:4px; }
.layer-btn {
  display:flex; align-items:center; gap:8px; width:100%;
  border:0; background:transparent; color:var(--text); text-align:left;
  padding:8px 10px; border-radius:8px; cursor:pointer; font-size:13px;
}
.layer-btn:hover { background:rgba(255,255,255,0.06); }
.layer-btn.active { background:rgba(30,111,255,0.35); color:#fff; }
.layer-btn .ico { width:18px; text-align:center; opacity:0.9; }

.opts { margin-top:10px; display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); }
.chk { display:flex; gap:6px; align-items:center; cursor:pointer; }
.meta-box { margin-top:12px; padding-top:10px; border-top:1px solid var(--panel-border); font-size:11px; color:var(--muted); line-height:1.45; }

.legend {
  position:fixed; left:14px; bottom:72px; z-index:5;
  background:var(--panel); backdrop-filter:blur(12px);
  border:1px solid var(--panel-border); border-radius:10px;
  padding:8px 10px; box-shadow:var(--shadow); min-width:220px;
}
.legend-title { font-size:11px; color:var(--muted); margin-bottom:4px; }
.legend-bar { height:12px; border-radius:4px; border:1px solid rgba(255,255,255,0.15); }
.legend-ticks { display:flex; justify-content:space-between; font-size:10px; color:var(--muted); margin-top:3px; }

.timebar {
  position:fixed; left:50%; transform:translateX(-50%); bottom:16px; z-index:5;
  display:flex; align-items:center; gap:10px;
  background:var(--panel); backdrop-filter:blur(12px);
  border:1px solid var(--panel-border); border-radius:999px;
  padding:8px 14px; box-shadow:var(--shadow); min-width:min(640px, calc(100vw - 120px));
}
.tb-btn {
  width:34px; height:34px; border-radius:50%; border:0; cursor:pointer;
  background:var(--active); color:#fff; font-size:13px;
}
#timeSlider { flex:1; accent-color:var(--accent); }
.time-label { font-size:13px; font-weight:600; min-width:110px; text-align:right; white-space:nowrap; }

.zoom-ctrl {
  position:fixed; right:14px; bottom:16px; z-index:5;
  display:flex; flex-direction:column; gap:6px;
}
.zoom-ctrl button {
  width:40px; height:40px; border-radius:10px; border:1px solid var(--panel-border);
  background:var(--panel); color:var(--text); font-size:20px; cursor:pointer;
  backdrop-filter:blur(12px); box-shadow:var(--shadow);
}
.attrib {
  position:fixed; right:14px; bottom:104px; z-index:4;
  font-size:10px; color:rgba(255,255,255,0.55); text-shadow:0 1px 2px #000;
  max-width:160px; text-align:right; pointer-events:none;
}

/* City value pills via MapLibre HTML markers alternative — we use symbol layer */
.maplibregl-ctrl-attrib { display:none !important; }

@media (max-width: 700px) {
  .panel { width: min(200px, calc(100vw - 28px)); padding:10px; top:8px; left:8px; }
  .legend { left:8px; bottom:64px; min-width:160px; }
  .timebar { bottom:10px; padding:6px 10px; min-width: calc(100vw - 100px); }
  .layer-btn { padding:6px 8px; font-size:12px; }
}

.leg-snow {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 3px solid #7ec8e8;
  color: #cfefff;
}

/* HTML city markers — coloured pills + names */
.city-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  user-select: none;
  transform: translateY(0);
}
.city-mark-name {
  color: #fff;
  font: 700 11px/1.15 "Noto Sans", system-ui, sans-serif;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,0.55),
     1px -1px 0 rgba(0,0,0,0.55),
    -1px  1px 0 rgba(0,0,0,0.55),
     1px  1px 0 rgba(0,0,0,0.55),
     0 1px 3px rgba(0,0,0,0.4);
  white-space: nowrap;
  margin-bottom: 3px;
}
.city-mark--name {
  /* keep label fully above the lat/lon so nothing renders as a pin */
  padding-bottom: 16px;
}
.city-mark--name .city-mark-name {
  margin-bottom: 0;
}
.city-mark-pill {
  color: #12141c;
  font: 700 12px/1.05 "Noto Sans", system-ui, sans-serif;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1.5px solid rgba(8,10,18,0.88);
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  white-space: nowrap;
  min-width: 1.6em;
  text-align: center;
}

/* World GFS — temperature circles (dense circle style) */
.city-mark--circle .city-mark-circle {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 "Noto Sans", system-ui, sans-serif;
  color: #0a1020;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.city-mark--circle .city-mark-name {
  font-size: 10px; margin-bottom: 2px;
}

/* Cursor / tap readout */
#mapHover {
  position: fixed; z-index: 40; pointer-events: none;
  display: none; padding: 5px 9px; border-radius: 8px;
  background: rgba(8,12,24,0.88); color: #f2f5ff;
  font: 600 12.5px/1.25 "Noto Sans", system-ui, sans-serif;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  white-space: nowrap; transform: translate(12px, 14px);
  backdrop-filter: blur(6px);
}
#mapHover.is-touch { transform: translate(-50%, -120%); }

.city-mark--pill-only .city-mark-name { display: none; }
.city-mark--pill-only { pointer-events: none; }

/* Satelit mode toggle (Živo / HD) */
.sat-modes { margin-top: 8px; }
.sat-modes[hidden] { display: none !important; }
.layer-btn[data-layer="sat"].active + .sat-modes,
.sat-modes.is-on { display: flex; }

.sat-modes.is-on { align-items: center; flex-wrap: wrap; gap: 6px; }
.sat-hd-date-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px; font-size: 11px; color: var(--muted);
}
.sat-hd-date-wrap[hidden] { display: none !important; }
.sat-hd-date {
  background: rgba(0,0,0,0.25); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 3px 6px; font: inherit; font-size: 11px;
  color-scheme: dark;
}

/* Tropical cyclone overlay panel */
.tc-panel {
  position: fixed; top: 14px; right: 14px; z-index: 6;
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100% - 110px); overflow: auto;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px 14px;
  color: var(--text); font-size: 12.5px; line-height: 1.4;
}
.tc-panel[hidden] { display: none !important; }
.tc-close {
  position: absolute; top: 8px; right: 10px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.tc-head { padding-right: 22px; margin-bottom: 8px; }
.tc-name { font-weight: 700; font-size: 15px; }
.tc-cat { font-size: 12px; font-weight: 600; margin-top: 2px; }
.tc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  margin-bottom: 10px;
}
.tc-k { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.tc-v { font-weight: 600; }
.tc-fcst { margin-top: 4px; }
.tc-fcst-h, .tc-adv-h {
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.03em;
}
.tc-fcst table { width: 100%; border-collapse: collapse; font-size: 11px; }
.tc-fcst td { padding: 2px 4px 2px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.tc-fcst td:nth-child(3), .tc-fcst td:nth-child(4) { text-align: right; white-space: nowrap; }
.tc-adv-body {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-height: 160px; overflow: auto;
  background: rgba(0,0,0,0.25); padding: 8px; border-radius: 8px;
  color: #d7e0ef;
}
.tc-muted { color: var(--muted); font-size: 11px; margin: 0; }
.tc-links { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tc-more, .tc-orig {
  color: var(--accent); font-weight: 600; font-size: 12px; text-decoration: none;
}
.tc-more:hover, .tc-orig:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .tc-panel { top: auto; bottom: 64px; right: 8px; left: 8px; width: auto; max-height: 42vh; }
}
