/* Základ: reset, rozloženie, hlavička, spodná navigácia */
*, *::before, *::after { box-sizing: border-box; }
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 72px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text); overflow-x: clip;
  font-family: var(--f-text); font-size: var(--fs-m); line-height: 1.55;
  font-variant-numeric: oldstyle-nums proportional-nums; text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + var(--s-4));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: 0.02em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-l); }
p { margin: 0 0 var(--s-3); max-width: 68ch; }
a { color: var(--gold-hi); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.muted { color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: var(--r-1); }
.skip { position: absolute; left: var(--s-3); top: -60px; z-index: 50; background: var(--gold); color: var(--bg); padding: var(--s-2) var(--s-3); border-radius: var(--r-1); }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + var(--s-2)); }

/* Hlavička */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4); min-height: 56px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.25rem; display: flex; align-items: center; gap: var(--s-2); color: var(--gold-hi); letter-spacing: 0.08em; }
.brand-mark { width: 10px; height: 10px; transform: rotate(45deg); border: 1.5px solid var(--gold); display: inline-block; }
.hud { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; font-size: var(--fs-xs); color: var(--muted); min-width: 0; }
.hud-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hud-item .ico { width: 18px; height: 18px; }
.hud-gold { color: var(--gold-hi); }

/* Spodná navigácia (mobil) / bočný pás (desktop) */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--panel); border-top: 1px solid var(--line);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 0.875rem; min-height: 44px; position: relative;
}
.tabs a[aria-current="page"] { color: var(--gold-hi); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }

main { max-width: var(--maxw); margin: 0 auto; padding: var(--s-4); outline: none; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.view[hidden] { display: none; }
.view-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

@media (min-width: 1000px) {
  body { padding-bottom: var(--s-6); padding-left: 96px; }
  .tabs { top: 0; right: auto; width: 96px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 84px; align-content: center; border-top: 0; border-right: 1px solid var(--line); padding-bottom: 0; }
  .tabs a[aria-current="page"]::before { top: 25%; bottom: 25%; left: auto; right: 0; width: 2px; height: auto; }
  .topbar { padding-left: var(--s-5); }
  main { padding: var(--s-5); }
  #view-mesto { max-width: 1080px; }
  main:has(#view-mesto:not([hidden])) { max-width: 1120px; }
}

.gate { min-height: 50vh; display: grid; place-content: center; text-align: center; gap: var(--s-3); }
.gate[hidden] { display: none; }
.noscript { padding: var(--s-5); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
