/* doprava.Dataviz – tmavý „světelný“ styl */
:root {
  --bg: #000;
  --fg: #e8e8f0;
  --muted: rgba(232, 232, 240, 0.55);
  --panel: rgba(14, 14, 20, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent: #ff9f43;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --pad: clamp(12px, 2vw, 24px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--font); overflow: hidden; }
body { -webkit-font-smoothing: antialiased; }
canvas#gl, canvas#labels { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#gl { cursor: grab; touch-action: none; }
canvas#gl.grabbing { cursor: grabbing; }
canvas#labels { pointer-events: none; }

.hud { position: fixed; z-index: 5; }
[hidden] { display: none !important; }

/* horní lišty */
.top-left { top: var(--pad); left: var(--pad); display: flex; flex-direction: column; gap: 6px; }
.brand { text-decoration: none; font-weight: 600; letter-spacing: 0.01em; font-size: 17px; color: var(--fg); }
.b1 { color: var(--fg); } .b2 { color: var(--accent); }
.meta { font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.meta .sep { margin: 0 8px; }

.clock-wrap { top: calc(var(--pad) - 4px); left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
.clock { font-family: var(--mono); font-weight: 300; font-size: clamp(30px, 4.2vw, 48px); letter-spacing: 0.06em; line-height: 1; color: #fff; text-shadow: 0 0 24px rgba(255,255,255,0.25); }
.clock-sub { margin-top: 6px; font-size: 10px; letter-spacing: 0.35em; color: var(--muted); }

.top-right { top: var(--pad); right: var(--pad); display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 210px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--panel-border); backdrop-filter: blur(8px); cursor: pointer; user-select: none; font-size: 13px; transition: opacity .2s; }
.legend li:hover { border-color: rgba(255,255,255,0.18); }
.legend li.off { opacity: 0.38; }
.legend li.off .dot { box-shadow: none !important; filter: grayscale(1); }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend .name { flex: 1; }
.legend .cnt { font-family: var(--mono); font-size: 12px; color: #fff; min-width: 3ch; text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 10px 0; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.total b { font-family: var(--mono); font-weight: 400; color: var(--fg); font-size: 13px; }

.note { top: calc(var(--pad) + 60px); left: var(--pad); max-width: 320px; padding: 8px 12px; border-radius: 8px; background: rgba(255,159,67,0.10); border: 1px solid rgba(255,159,67,0.35); color: #ffd9b8; font-size: 12px; line-height: 1.4; }

/* spodní ovládání */
.bottom { left: 50%; bottom: calc(var(--pad) + 14px); transform: translateX(-50%); width: min(920px, calc(100vw - 2 * var(--pad))); display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; gap: 8px 14px; align-items: center; }
.play { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); background: var(--panel); color: #fff; font-size: 13px; cursor: pointer; backdrop-filter: blur(8px); }
.play:hover { border-color: rgba(255,255,255,0.4); }
.timeline { position: relative; height: 30px; }
.timeline .ticks { position: absolute; left: 0; right: 0; top: -4px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--muted); pointer-events: none; }
.timeline .track { position: absolute; left: 0; right: 0; top: 16px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.14); overflow: hidden; }
.timeline .fill { height: 100%; width: 0; background: linear-gradient(90deg, rgba(255,159,67,0.6), #ffd166); }
.timeline input[type=range] { position: absolute; left: 0; right: 0; top: 4px; width: 100%; height: 26px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.timeline input[type=range]::-webkit-slider-runnable-track { height: 3px; background: transparent; }
.timeline input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px rgba(255,209,102,0.8); border: 0; }
.timeline input[type=range]::-moz-range-track { height: 3px; background: transparent; }
.timeline input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 10px rgba(255,209,102,0.8); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 12px; color: var(--muted); }
.speed { display: inline-flex; border-radius: 7px; overflow: hidden; border: 1px solid var(--panel-border); background: var(--panel); backdrop-filter: blur(8px); }
.speed button { border: 0; background: transparent; color: var(--muted); font: inherit; font-family: var(--mono); font-size: 11.5px; padding: 6px 9px; cursor: pointer; }
.speed button.on { background: rgba(255,255,255,0.12); color: #fff; }
.speed button:hover { color: #fff; }
select.day, .ghost-btn { border: 1px solid var(--panel-border); background: var(--panel); color: var(--fg); font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 7px; backdrop-filter: blur(8px); cursor: pointer; }
select.day option { background: #111; color: #eee; }
.ghost-btn:hover, select.day:hover { border-color: rgba(255,255,255,0.3); }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); margin: 0; }

.credit { right: var(--pad); bottom: 8px; font-size: 10px; color: rgba(232,232,240,0.35); display: flex; gap: 14px; }
.fps { font-family: var(--mono); }

/* úvodní obrazovka */
.start { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(20,16,30,0.86), rgba(0,0,0,0.94)); backdrop-filter: blur(6px); padding: var(--pad); }
.panel { position: relative; width: min(560px, 100%); padding: 32px 34px 26px; border-radius: 16px; background: rgba(12,12,18,0.9); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.panel h1 { margin: 0 0 8px; font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.panel .lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.panel h2 { margin: 0 0 12px; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); color: var(--fg); font: inherit; text-align: left; position: relative; }
button.choice { cursor: pointer; }
button.choice:hover { background: rgba(255,159,67,0.12); border-color: rgba(255,159,67,0.4); }
.choice b { font-size: 15px; font-weight: 600; }
.choice small { color: var(--muted); font-size: 12.5px; }
.choice .row { display: flex; gap: 8px; }
.choice select, .choice input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.5); color: var(--fg); }
.choice select option { background: #111; }
.choice .row button { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 8px; border: 1px solid rgba(255,159,67,0.5); background: rgba(255,159,67,0.15); color: #ffd9b8; cursor: pointer; }
.choice .row button:hover { background: rgba(255,159,67,0.3); }
.suggest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.suggest:empty { display: none; }
.suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; }
.suggest li small { color: var(--muted); font-size: 11.5px; }
.suggest li:hover { background: rgba(255,255,255,0.08); }
.fine { margin: 20px 0 0; font-size: 11.5px; line-height: 1.5; color: rgba(232,232,240,0.45); }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.close:hover { color: #fff; }

.loading { left: 50%; bottom: 50%; transform: translate(-50%, 50%); display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-border); font-size: 13px; z-index: 30; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { left: 50%; top: 40%; transform: translateX(-50%); max-width: 520px; padding: 14px 18px; border-radius: 10px; background: rgba(120,20,30,0.85); border: 1px solid rgba(255,80,100,0.5); font-size: 13px; z-index: 30; }

/* mobil */
@media (max-width: 720px) {
  .top-right { width: 150px; }
  .legend li { padding: 4px 8px; font-size: 11.5px; gap: 6px; }
  .legend .cnt { font-size: 11px; }
  .total { display: none; }
  .top-left { max-width: calc(100vw - 190px); }
  .meta { font-size: 10px; letter-spacing: 0.1em; line-height: 1.4; }
  .clock-wrap { top: 78px; left: var(--pad); transform: none; text-align: left; }
  .clock { font-size: 28px; }
  .clock-sub { letter-spacing: 0.25em; }
  .bottom { bottom: 12px; grid-template-columns: 40px 1fr; gap: 6px 10px; }
  .controls { font-size: 11px; gap: 6px 8px; }
  .credit { display: none; }
  .note { top: auto; bottom: 170px; max-width: calc(100vw - 2 * var(--pad)); }
  .panel { padding: 22px 18px 18px; }
  .panel h1 { font-size: 24px; }
}
