:root {
  --bg: #0b1120;
  --bg-2: #121a2e;
  --panel: rgba(255,255,255,.045);
  --panel-line: rgba(255,255,255,.09);
  --fg: #eef2ff;
  --muted: #8f9bb8;
  --accent: #5eb3ff;
  --warm: #ffb86b;
  --cold: #7cc7ff;
  --rain: #4ea8ff;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 700px at 15% -10%, #1d3a63 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 0%, #2a2154 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  backdrop-filter: blur(14px);
}
.login-card h1 { margin: 14px 0 4px; font-size: 22px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 18px; font-size: 14px; }
.login-card input, .login-card button {
  width: 100%;
  font-size: 16px;
  border-radius: 12px;
  padding: 13px 14px;
  border: 1px solid var(--panel-line);
}
.login-card input {
  background: rgba(0,0,0,.28);
  color: var(--fg);
  margin-bottom: 10px;
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button {
  background: var(--accent);
  color: #06203a;
  font-weight: 650;
  border: none;
  cursor: pointer;
}
.error { color: #ff8f8f; font-size: 13px; margin-top: 12px !important; }

/* ---------- shell ---------- */
#app { max-width: 720px; margin: 0 auto; padding: calc(14px + var(--safe-top)) 16px 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 17px; letter-spacing: -.01em; }
.sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mark {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), #8f7bff);
  color: #05172c;
  font-weight: 800;
  font-size: 17px;
}
.mark.big { width: 48px; height: 48px; font-size: 23px; margin: 0 auto; border-radius: 15px; }

.icon-btn {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--fg);
  font-size: 17px;
  cursor: pointer;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: rgba(94,179,255,.16);
  border-color: rgba(94,179,255,.45);
  color: var(--fg);
}

/* ---------- karty ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* hero */
.hero { display: flex; align-items: center; gap: 18px; }
.hero-icon { font-size: 58px; line-height: 1; flex: none; }
.hero-main { min-width: 0; flex: 1; }
.hero-temp { font-size: 54px; font-weight: 250; letter-spacing: -.04em; line-height: 1; }
.hero-desc { font-size: 15px; margin-top: 4px; text-transform: lowercase; }
.hero-meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hero-range { text-align: right; font-size: 13px; color: var(--muted); line-height: 1.7; flex: none; }
.hero-range b { color: var(--fg); font-weight: 600; }

/* hodinovy pas */
.hours { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hours::-webkit-scrollbar { display: none; }
.hour {
  flex: none;
  width: 58px;
  text-align: center;
  padding: 10px 0;
  border-radius: 13px;
}
.hour.now { background: rgba(94,179,255,.14); }
.hour .h-time { font-size: 12px; color: var(--muted); }
.hour .h-ico { font-size: 21px; margin: 5px 0 3px; }
.hour .h-temp { font-size: 15px; font-weight: 560; }
.hour .h-pop { font-size: 11px; color: var(--rain); min-height: 14px; }

/* denna predpoved */
.day {
  display: grid;
  grid-template-columns: 42px 30px 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,.05);
}
.day:first-of-type { border-top: none; }
.d-name { font-size: 14px; font-weight: 560; }
.d-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.d-ico { font-size: 20px; text-align: center; }
.d-pop { font-size: 12px; color: var(--rain); text-align: right; }
.d-min, .d-max { font-size: 14px; }
.d-min { color: var(--muted); text-align: right; }
.d-max { font-weight: 560; }
.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); position: relative; }
.bar span {
  position: absolute;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cold), var(--warm));
}

/* detaily */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: rgba(0,0,0,.18); border-radius: 13px; padding: 12px 14px; }
.stat .s-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .s-value { font-size: 19px; font-weight: 560; margin-top: 3px; }

.empty { text-align: center; padding: 60px 20px; }
.empty .big { font-size: 18px; margin: 0 0 6px; }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 0 8px; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fc;
    --panel: rgba(255,255,255,.72);
    --panel-line: rgba(15,32,66,.1);
    --fg: #101a30;
    --muted: #5d6b8a;
  }
  body {
    background:
      radial-gradient(1100px 700px at 15% -10%, #d6e6ff 0%, transparent 60%),
      radial-gradient(900px 600px at 90% 0%, #e5ddff 0%, transparent 55%),
      var(--bg);
  }
  .login-card input { background: rgba(255,255,255,.9); }
  .stat { background: rgba(255,255,255,.6); }
}
