:root {
  --bg-top: #0f2448;
  --bg-bottom: #a9c3ea;
  --panel: #ffffff;
  --panel-2: #f3f7fd;
  --line: #d6e1f1;
  --head: #e3ecf9;
  --head-2: #edf2fa;
  --text: #1c2533;
  --muted: #5d6b80;
  --accent: #2858a8;
  --accent-2: #1d4486;
  --accent-soft: #e2ebfa;
  --new: #f5a524;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgb(16 32 64 / 0.08), 0 6px 20px rgb(16 32 64 / 0.10);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #070d19;
    --bg-bottom: #14223b;
    --panel: #141c2b;
    --panel-2: #1a2436;
    --line: #2a3850;
    --head: #1d2a40;
    --head-2: #19243a;
    --text: #e4e9f2;
    --muted: #93a1b8;
    --accent: #7aa7f0;
    --accent-2: #a3c2f7;
    --accent-soft: #22324d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 520px) no-repeat, var(--bg-bottom);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sprite { display: none; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- hlavička ---------- */

.top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6b5e, #b3140a 70%);
  border: 3px solid #fff;
  font-weight: 800; letter-spacing: -1px; font-size: 17px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}
.brand-text { font-size: 17px; opacity: .92; }
.brand-text b { font-weight: 700; }
.who { display: flex; align-items: center; gap: 8px; }
.who .nick { font-weight: 600; }
.who form { margin: 0; }
.top .icon-btn { color: #fff; background: rgb(255 255 255 / 0.12); }
.top .icon-btn:hover { background: #c0392b; }

/* ---------- rozložení ---------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.side {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}
.side a {
  padding: 8px 12px;
  border-radius: 7px;
  font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text);
}
.side a:hover { background: var(--panel-2); text-decoration: none; }
.side a.active { background: var(--accent-soft); color: var(--accent); }

.main {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 0 16px;
  min-width: 0;
}

.forum-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--head);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}
.crumbs { font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .04em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--text); }
.crumbs .sep { margin: 0 8px; color: var(--muted); }

.main > *:not(.forum-head) { margin-left: 16px; margin-right: 16px; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; }

/* ---------- ovládání ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #0b1324; } }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { padding: 5px 12px; font-size: 14px; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 30px; height: 30px; padding: 0 6px; justify-content: center;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  cursor: pointer; font: inherit; font-size: 13px;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.icon-btn.danger:hover { background: #fde5e2; color: var(--danger); }
.icon-btn.reply { color: var(--accent); font-weight: 600; }

.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { width: 100%; resize: vertical; min-height: 180px; }

.toolbar-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px;
}
.search { display: flex; flex-wrap: wrap; gap: 6px; }
.search input { width: 180px; }

.pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  margin-top: 12px; padding: 8px 12px;
  background: var(--head-2); border-radius: 8px;
  font-size: 14px;
}
.pager span { color: var(--muted); }

.note { margin-top: 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 8px 8px 0; font-size: 14px; }
.empty, .muted { color: var(--muted); }
.alert { padding: 8px 12px; border-radius: 8px; background: #fde5e2; color: #8e2318; }
.success { padding: 8px 12px; border-radius: 8px; background: #dff5e3; color: #1d6b31; }
@media (prefers-color-scheme: dark) {
  .alert { background: #4a1d19; color: #ffc9c2; }
  .success { background: #173b22; color: #b9efc7; }
  .icon-btn.danger:hover { background: #4a1d19; }
}

.reset-new { margin-top: 12px; text-align: right; font-size: 14px; }
.forum-head .reset-new { margin-top: 0; flex-shrink: 0; font-size: 13px; }
.reset-btn {
  padding: 5px 12px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--new); color: #3b2500;
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.reset-btn:hover { filter: brightness(0.93); }
.reset-btn:disabled { background: var(--panel-2); color: var(--muted); border-color: var(--line); cursor: default; filter: none; opacity: 0.8; }

/* ---------- příspěvky ---------- */

.posts { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }

.post {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  scroll-margin-top: 12px;
}
.post:target { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.post.new { border-left: 4px solid var(--new); }

.post-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 4px 6px 4px 12px;
  background: linear-gradient(180deg, var(--head-2), var(--head));
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  min-height: 38px;
}
.author { font-weight: 700; color: var(--text); }
.date { color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { background: var(--new); color: #3b2500; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.actions form { margin: 0; display: contents; }

.post-content { padding: 10px 14px 14px; }
.post-title { margin: 0 0 4px; font-size: 15px; color: var(--accent); }
.post-body { overflow-wrap: anywhere; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; }
.post-body i:first-child { color: var(--muted); }
.smiley { font-style: normal; }
.post.deleted { background: var(--panel-2); color: var(--muted); }

/* strom vlákna */
.tree { list-style: none; margin: 12px 16px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tree li { position: relative; }
.tree li:not(.d0)::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.tree .d1 { margin-left: 20px; } .tree .d2 { margin-left: 40px; } .tree .d3 { margin-left: 60px; }
.tree .d4 { margin-left: 80px; } .tree .d5 { margin-left: 100px; } .tree .d6 { margin-left: 120px; }
.tree .d7 { margin-left: 140px; } .tree .d8 { margin-left: 160px; } .tree .d9 { margin-left: 180px; }
.tree .d10, .tree .d11, .tree .d12, .tree .d13, .tree .d14, .tree .d15 { margin-left: 200px; }

/* ---------- formuláře ---------- */

.card { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.card.narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack label, .compose-form label { font-weight: 600; font-size: 14px; margin-top: 6px; }
.stack .btn { margin-top: 12px; align-self: flex-start; }
/* Místo pro widget Turnstile, aby se stránka po jeho načtení neposouvala. */
.cf-turnstile { min-height: 65px; margin-top: 10px; }

.compose-form { display: flex; flex-direction: column; gap: 6px; }
.compose-form input[name=nadpis] { width: 100%; }
.toolbar, .smileys { display: flex; flex-wrap: wrap; gap: 4px; }
.toolbar button, .smileys button {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 6px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 14px; min-width: 34px;
}
.smileys button { font-size: 19px; padding: 1px 4px; border-color: transparent; background: transparent; }
.toolbar button:hover, .smileys button:hover { background: var(--accent-soft); }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.hint { color: var(--muted); font-size: 13px; }
.preview { margin-bottom: 16px; }
.preview-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.help { margin-top: 14px; font-size: 14px; color: var(--muted); }
.help summary { cursor: pointer; }

.hidden-list { list-style: none; padding: 0; margin: 0; }
.hidden-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hidden-list form { margin: 0; }
.privacy ul { margin: 0 0 12px; padding-left: 20px; }
.privacy li { margin-bottom: 6px; }
.privacy p { margin: 0 0 10px; }
.privacy p:last-child { margin-bottom: 0; }

/* ---------- o webu ---------- */

.about { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.about .card { margin-top: 0; }
.about-hero {
  padding: 24px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--panel-2) 70%);
}
.about-hero h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; }
.about-hero .lead { margin: 0; font-size: 17px; color: var(--muted); }
.about-hero .lead b { color: var(--text); }
.about-cta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.about-card { --tone: var(--accent); --tone-bg: var(--accent-soft); border-top: 3px solid var(--tone); }
.about-card.ok { --tone: #1f8a3d; --tone-bg: #dff5e3; }
.about-card.no { --tone: #9a6b5f; --tone-bg: #f6e9e4; }
@media (prefers-color-scheme: dark) {
  .about-card.ok { --tone: #5fd07f; --tone-bg: #173b22; }
  .about-card.no { --tone: #d79c8b; --tone-bg: #3a2621; }
}

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; align-items: flex-start; gap: 10px; }
.ticks .icon {
  width: 24px; height: 24px; padding: 5px; margin-top: -1px;
  border-radius: 50%; background: var(--tone-bg); color: var(--tone); stroke-width: 3;
}

.callout {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 8px;
  background: var(--panel-2); border-left: 3px solid var(--accent);
}
.callout + .callout { margin-top: 12px; }
.callout > .icon { width: 22px; height: 22px; margin-top: 2px; color: var(--accent); }
.callout h3 { margin: 0 0 4px; font-size: 15px; }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--new); }
.callout.warn > .icon { color: var(--new); }


/* ---------- mobil ---------- */

@media (max-width: 760px) {
  body { font-size: 15px; }
  .top { padding: 12px 16px; }
  .logo { width: 38px; height: 38px; font-size: 14px; }
  .brand-text { font-size: 15px; }
  .wrap { grid-template-columns: 1fr; gap: 10px; }
  .side { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .side a { white-space: nowrap; padding: 6px 10px; }
  .main > *:not(.forum-head) { margin-left: 10px; margin-right: 10px; }
  .tree { margin: 12px 10px 0; }
  .post-content { padding: 8px 10px 12px; }
  .actions { margin-left: 0; width: 100%; justify-content: flex-end; }
  .icon-btn.reply span { display: none; }
  .search { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .search input { grid-column: 1 / -1; width: 100%; }
  .brand-pre { display: none; }
  .who .nick { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toolbar-row > .btn { width: 100%; }
  .tree .d1 { margin-left: 10px; } .tree .d2 { margin-left: 20px; } .tree .d3 { margin-left: 30px; }
  .tree .d4 { margin-left: 40px; } .tree .d5, .tree .d6, .tree .d7, .tree .d8, .tree .d9, .tree .d10,
  .tree .d11, .tree .d12, .tree .d13, .tree .d14, .tree .d15 { margin-left: 50px; }
  .tree li:not(.d0)::before { left: -6px; }
  .hint { display: none; }
  .about-hero { padding: 18px 16px; }
  .about-hero h1 { font-size: 21px; }
  .about-hero .lead { font-size: 16px; }
  .about-grid { grid-template-columns: 1fr; }
  .callout { padding: 10px 12px; }
}
