:root {
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.72);
  --faint: rgba(244, 247, 251, 0.5);
  --glass: rgba(14, 20, 32, 0.48);
  --glass-strong: rgba(14, 20, 32, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.13);
  --accent: #7dd3fc;
  --accent-ink: #06202e;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: #0b1220 linear-gradient(135deg, #0b1220 0%, #16324a 55%, #24506a 100%) fixed;
  display: flex;
  flex-direction: column;
}
h1, h2, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

/* ---------- Tapeta ---------- */
#wallpaper, .shade { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.wall-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.5s ease;
}
.wall-video.is-on { opacity: 1; }
.shade {
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 9, 16, 0.5) 0%, rgba(5, 9, 16, 0.28) 35%, rgba(5, 9, 16, 0.62) 100%);
}

/* ---------- Rozvržení ---------- */
.topbar { display: flex; justify-content: center; padding: 18px 16px 0; }
.nav {
  display: flex; gap: 4px; padding: 5px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.nav a {
  padding: 7px 18px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 16px 32px; flex: 1; }
.wrap-wide { max-width: 1400px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col { display: grid; gap: 18px; }
.sp { margin-top: 18px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}
.card-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 12px;
}
.page-title { font-size: 28px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 18px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.hint { color: var(--faint); font-size: 13px; margin-top: 10px; }
.hint a { color: var(--accent); }

/* ---------- Hodiny a počasí ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px;
  align-items: end; margin-bottom: 22px;
}
.clock-box { text-shadow: 0 2px 26px rgba(0, 0, 0, 0.5); padding: 6px 4px; }
.greeting { color: var(--muted); font-size: 17px; }
.clock {
  font-size: clamp(64px, 13vw, 148px); font-weight: 200; line-height: 1; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; margin: 2px 0 6px;
}
.clock-s { font-size: 0.26em; font-weight: 300; color: var(--muted); margin-left: 0.3em; letter-spacing: 0; }
.clock-date { font-size: 19px; color: var(--muted); }

.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-icon { font-size: 50px; line-height: 1; }
.wx-temp { font-size: 42px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-place { color: var(--muted); margin-top: 4px; }
.wx-meta { color: var(--faint); font-size: 13px; }
.wx-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wx-day { display: grid; justify-items: center; gap: 2px; font-size: 13px; }
.wx-day-name { color: var(--faint); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.wx-day-icon { font-size: 21px; }
.wx-day-temp { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-day-rain { color: var(--accent); font-size: 12px; }

/* ---------- Dlaždice odkazů ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.tile {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border-radius: 13px; text-decoration: none;
  background: rgba(255, 255, 255, 0.06); border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.tile:hover { background: var(--hover); border-color: var(--line); transform: translateY(-1px); }
.tile:focus-visible, .btn:focus-visible, .tab:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, .video:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.tile-icon, .tile-mono { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.tile-icon { object-fit: contain; background: rgba(255, 255, 255, 0.92); padding: 3px; }
.tile-mono { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ---------- Tlačítka a formuláře ---------- */
.btn {
  font: inherit; color: var(--text); cursor: pointer;
  padding: 8px 15px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line);
  transition: background 0.15s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.18); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: #a5e3fd; }
.btn-small { padding: 4px 10px; font-size: 13px; border-radius: 9px; }
.file-btn { display: inline-block; }
.link-btn { font: inherit; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0; text-decoration: underline; }
.link-btn:hover { color: var(--text); }
input[type="text"], input[type="search"], input[type="number"], select {
  font: inherit; color: var(--text); min-width: 0;
  padding: 8px 11px; border-radius: 11px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line);
}
input[type="text"], input[type="search"] { flex: 1 1 180px; }
input::placeholder { color: var(--faint); }
input[type="file"] { color: var(--muted); font: inherit; max-width: 100%; }
select option { color: #111; }

/* ---------- Pomodoro ---------- */
.pomo { text-align: center; }
.pomo .card-title { text-align: left; }
.pomo-time { font-size: 68px; font-weight: 200; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pomo-label { color: var(--muted); min-height: 1.45em; }
.pomo-dots { display: flex; justify-content: center; gap: 7px; margin: 12px 0 14px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.dot.is-done { background: var(--accent); }
.dot.is-now { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2); }
.pomo-config { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.field { display: grid; gap: 5px; justify-items: center; }
.field-label { font-size: 12px; color: var(--faint); }
.field input { width: 100%; text-align: center; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 30px; height: 36px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 18px;
  color: var(--text); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line);
}
.stepper button:hover { background: rgba(255, 255, 255, 0.18); }
.stepper span { min-width: 26px; font-size: 18px; font-variant-numeric: tabular-nums; }
.pomo-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pomo-player { margin-top: 14px; border-radius: 13px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.pomo-player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- YouTube ---------- */
.yt-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.yt-head .page-title { margin: 0 auto 0 0; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 13px; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tab { font: inherit; color: var(--muted); background: none; border: 0; padding: 7px 14px; border-radius: 10px; cursor: pointer; }
.tab:hover { color: var(--text); background: var(--hover); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.status { color: var(--muted); min-height: 1.45em; margin-bottom: 8px; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }
.status.is-error { color: #fecaca; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pager-range { color: var(--muted); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }

.day { margin-bottom: 22px; }
.day-title, .cat-title {
  font-size: 18px; font-weight: 600; margin-bottom: 10px; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  display: flex; align-items: baseline; gap: 10px;
}
.day-title small, .cat-title small { color: var(--faint); font-weight: 400; font-size: 13px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.video {
  display: block; text-decoration: none; border-radius: 14px; overflow: hidden;
  background: var(--glass-strong); border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.video:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.34); }
.video img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.video-body { padding: 10px 12px 12px; }
.video-title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { color: var(--faint); font-size: 12.5px; margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge { padding: 1px 8px; border-radius: 999px; background: rgba(125, 211, 252, 0.18); color: var(--accent); font-size: 11.5px; }
.cat-block { margin-bottom: 26px; }
.more { margin-top: 12px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
.chip button { font: inherit; width: 20px; height: 20px; line-height: 1; border-radius: 50%; border: 0; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, 0.14); }
.chip button:hover { background: rgba(248, 113, 113, 0.6); }
.ch-list { display: grid; gap: 2px; }
.ch-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 190px) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.ch-row:hover { background: rgba(255, 255, 255, 0.06); }
.ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.ch-name:hover { text-decoration: underline; }
.ch-row select { width: 100%; padding: 5px 8px; }

/* ---------- Patička ---------- */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 18px 16px; color: var(--faint); font-size: 12.5px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }

@media (max-width: 900px) {
  .grid, .hero, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero { align-items: stretch; }
}
@media (max-width: 520px) {
  .nav a { padding: 7px 13px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .videos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .ch-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ch-row select { grid-column: 1 / -1; grid-row: 2; }
  .pomo-time { font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
