/* Clan — tmavý e-sportový vzhled. Bez frameworků, kontrast dle WCAG 2.1 AA. */

:root {
  --bg:      #0d0f14;   /* pozadí stránky */
  --bg-alt:  #151823;   /* karty a plochy */
  --bg-raise:#1b1f2c;   /* zvýrazněná plocha (hover, admin) */
  --line:    #262b3a;   /* linky a rámečky */
  --text:    #e8ebf4;
  --muted:   #a3abc0;   /* na tmavé ≥ 7:1 — AA ok */
  --accent:  #ff4655;   /* klanová červená (texty a efekty na tmavé) */
  --accent-btn: #c9313d;/* červená pozadí tlačítek (bílý text ≥ 4,5:1) */
  --ok:      #57c979;
  --err:     #ff6b7a;

  /* aliasy pro přepis z configu (theme) — historické názvy */
  --navy:   var(--bg-alt);
  --navy-d: var(--bg);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  /* plnoformátové sekce (.hero, .discord-band) používají 100vw — uřízni přesah o šířku scrollbaru */
  overflow-x: clip;
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.2rem 0 .8rem; }
h2 { font-size: 1.45rem; margin: 0 0 .6rem; }
h3 { font-size: 1.05rem; margin: .8rem 0 .3rem; }

a { color: #7fb2ff; }
a:hover { color: #a8ccff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.lead  { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.more  { font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* --- sekce homepage --- */
.section { padding: 3rem 0 1rem; }
.kicker {
  display: block; font-size: .8rem; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .3rem;
}
.section-head { margin-bottom: 1.2rem; }
.section-head h2 {
  font-size: 1.7rem; text-transform: uppercase; letter-spacing: .04em;
}

/* --- tlačítka --- */
.btn {
  display: inline-block; padding: .8rem 1.7rem; border-radius: 6px;
  font-weight: 700; font-size: 1.02rem; text-decoration: none;
  letter-spacing: .03em; transition: transform .15s ease, box-shadow .15s ease,
  background .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--accent-btn); color: #fff;
  box-shadow: 0 4px 24px rgba(255, 70, 85, .35);
}
.btn-primary:hover {
  background: #db3945; color: #fff; transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 70, 85, .45);
}
.btn-ghost {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.03);
}
.btn-ghost:hover {
  border-color: var(--accent); color: #fff; transform: translateY(-2px);
}

/* --- přístupnost --- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent-btn); color: #fff; padding: .6rem 1rem; z-index: 30;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- hlavička --- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 15, 20, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* na mobilu je hlavička (logo + hledání + menu) příliš vysoká na přišpendlení */
@media (max-width: 700px) {
  .site-header { position: static; }
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem 1.25rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text); }
.brand-mark {
  background: var(--accent-btn); color: #fff; font-weight: 800;
  padding: .45rem .7rem; border-radius: 6px; letter-spacing: .08em;
  box-shadow: 0 2px 14px rgba(255, 70, 85, .35);
}
.brand-name { font-weight: 700; max-width: 16rem; line-height: 1.25; letter-spacing: .02em; }

.search-form { display: flex; gap: .4rem; }
.search-form input {
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px;
  min-width: 13rem; font-size: 1rem;
  background: var(--bg-alt); color: var(--text);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button, .admin-form button {
  padding: .5rem 1rem; border: 0; border-radius: 6px; font-size: 1rem;
  background: var(--bg-raise); color: var(--text); cursor: pointer;
  border: 1px solid var(--line);
}
.search-form button:hover, .admin-form button:hover { border-color: var(--accent); color: #fff; }
.search-big { margin: 1rem 0 1.5rem; }
.search-big input { flex: 1; }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem;
}
.site-nav a {
  display: block; padding: .65rem .9rem; color: var(--muted);
  text-decoration: none; font-weight: 600; letter-spacing: .02em;
  border-bottom: 2px solid transparent; transition: color .15s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.nav-discord {
  margin-left: auto;
}
.nav-discord a {
  color: #fff; background: #5865f2; border-radius: 6px; border-bottom: 0;
  padding: .45rem 1rem; margin: .3rem 0; font-weight: 700;
}
.nav-discord a:hover { background: #6a76ff; }

/* --- hero --- */
.hero {
  /* přes celou šířku okna i uvnitř .wrap */
  width: 100vw; margin-left: calc(50% - 50vw);
  padding: 5.5rem 1.25rem 4rem; text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 70% 0%, rgba(255, 70, 85, .16), transparent),
    radial-gradient(ellipse 50% 45% at 20% 10%, rgba(88, 101, 242, .12), transparent),
    repeating-linear-gradient(115deg, transparent 0 48px, rgba(255,255,255,.015) 48px 50px),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 900; margin: 0 0 .8rem;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.1;
  text-shadow: 0 0 40px rgba(255, 70, 85, .35);
}
.hero .lead { max-width: 38rem; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* jemné najetí hero prvků při načtení */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero-cta {
    animation: rise .6s ease both;
  }
  .hero .lead { animation-delay: .12s; }
  .hero-cta  { animation-delay: .24s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}

/* --- živý pás (Discord) --- */
.live-bar {
  display: flex; align-items: center; justify-content: center; gap: 1.6rem;
  flex-wrap: wrap; padding: 1rem 1.4rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px;
}
.live-item { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); }
.live-item strong { color: var(--text); }
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 10px rgba(87, 201, 121, .8);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
  }
}
.btn-sm { padding: .5rem 1.1rem; font-size: .95rem; }

/* --- eventy --- */
.event-card time { font-size: .85rem; color: var(--accent); font-weight: 700; }
.event-live {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .85rem; font-weight: 800; color: var(--ok);
  text-transform: uppercase; letter-spacing: .08em;
}
.event-card h3 { margin-top: .35rem; }
.event-meta { margin-top: .6rem !important; }

/* --- statistiky --- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin: 0;
}
.stat {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.2rem 1rem; text-align: center;
}
.stat-value {
  display: block; font-size: 2rem; font-weight: 900; color: var(--accent);
  letter-spacing: .02em; line-height: 1.15;
}
.stat-label {
  display: block; font-size: .82rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-top: .3rem;
}

/* --- nábor --- */
.role-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin: 0 0 1.5rem;
}
.role {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.2rem; font-weight: 700; font-size: 1.05rem;
}
.role-open   { border-left: 4px solid var(--ok); }
.role-closed { border-left: 4px solid var(--line); color: var(--muted); }
.role-state {
  font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px;
}
.role-open   .role-state { color: var(--ok); background: rgba(87, 201, 121, .12); }
.role-closed .role-state { color: var(--muted); background: rgba(255,255,255,.05); }

/* --- karty (hry, novinky) --- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.card {
  display: block; padding: 1.2rem 1.3rem; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: var(--text);
  background: var(--bg-alt);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h3, .card-h { margin: 0 0 .35rem; color: #fff; font-size: 1.1rem; }
.card p { margin: 0; font-size: .92rem; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 2.5rem; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* --- historie (časová osa) --- */
.timeline { list-style: none; margin: 1rem 0; padding: 0 0 0 1.4rem; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: .32rem; top: .5rem; bottom: .5rem;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 1.4rem; }
.timeline li::before {
  content: ""; position: absolute; left: -1.35rem; top: .45rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px rgba(255, 70, 85, .6);
}
.timeline-year { font-weight: 900; color: var(--accent); letter-spacing: .05em; }
.timeline-text { display: block; color: var(--muted); }

/* --- dokumenty --- */
.doc-list { list-style: none; margin: .8rem 0; padding: 0; }
.doc-item { border-bottom: 1px solid var(--line); }
.doc-link {
  display: grid; grid-template-columns: auto 1fr; column-gap: .9rem;
  padding: .7rem .2rem; text-decoration: none; color: var(--text);
}
.doc-link:hover .doc-title { text-decoration: underline; color: #fff; }
.doc-ext {
  grid-row: span 2; align-self: center;
  background: var(--bg-raise); border: 1px solid var(--line);
  color: var(--accent); font-size: .72rem; font-weight: 800;
  padding: .35rem .45rem; border-radius: 6px; min-width: 3.2em; text-align: center;
}
.doc-title { font-weight: 600; color: var(--text); }
.doc-meta  { font-size: .85rem; color: var(--muted); }

.filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.filter a {
  padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-size: .92rem; color: var(--muted);
}
.filter a:hover { color: #fff; border-color: var(--accent); }
.filter a[aria-current="true"] {
  background: var(--accent-btn); color: #fff; border-color: var(--accent-btn);
}

/* --- aktuality, články --- */
.news-teaser { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.news-teaser p { margin: .2rem 0; }
.news-card { padding: 1.2rem 1.3rem; }
.news-card time { font-size: .85rem; color: var(--muted); }
.news-card h3 { margin-top: 0; }
.news-card h3 a { color: #fff; text-decoration: none; }
.news-card h3 a:hover { color: var(--accent); }
.article table { border-collapse: collapse; margin: 1rem 0; }
.article th, .article td { border: 1px solid var(--line); padding: .45rem .7rem; text-align: left; }
.article th { background: var(--bg-alt); }

/* --- hledání --- */
.hit-list { list-style: none; margin: 1rem 0; padding: 0; }
.hit { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.hit-kind {
  display: inline-block; font-size: .75rem; font-weight: 700;
  color: var(--accent); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 4px;
  padding: .05rem .45rem; margin-right: .5rem;
}
.hit-title { font-weight: 600; }
.hit .doc-meta { display: block; margin-top: .15rem; }
.hit-snippet { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }

/* --- admin --- */
.admin-form {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 10px; padding: .3rem 1.1rem .6rem; margin: .8rem 0 1.5rem;
}
.admin-form label { font-weight: 600; }
.admin-form input[type=text], .admin-form input[type=password], .admin-form select {
  padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; font-size: 1rem;
  max-width: 100%; background: var(--bg-raise); color: var(--text);
}
.admin-table { border-collapse: collapse; width: 100%; margin: .8rem 0; }
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line); padding: .45rem .6rem; text-align: left;
  font-size: .93rem;
}
.admin-table th { background: var(--bg-alt); }

.msg { padding: .6rem .9rem; border-radius: 6px; font-weight: 600; }
.msg-ok  { background: rgba(87, 201, 121, .12); color: var(--ok); }
.msg-err { background: rgba(255, 107, 122, .12); color: var(--err); }

/* --- Discord pás --- */
.discord-band {
  width: 100vw; margin-left: calc(50% - 50vw);
  margin-top: 3rem; padding: 3rem 1.25rem; text-align: center;
  background:
    radial-gradient(ellipse 55% 70% at 50% 100%, rgba(88, 101, 242, .18), transparent),
    var(--bg-alt);
  border-top: 1px solid var(--line);
}
.discord-band h2 { text-transform: uppercase; letter-spacing: .04em; }
.discord-band p { color: var(--muted); max-width: 32rem; margin: .5rem auto 1.5rem; }
.btn-discord {
  background: #5865f2; color: #fff;
  box-shadow: 0 4px 24px rgba(88, 101, 242, .4);
}
.btn-discord:hover {
  background: #6a76ff; color: #fff; transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(88, 101, 242, .5);
}

/* --- patička --- */
.site-footer {
  margin-top: 0; background: var(--bg); color: var(--text);
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: #fff; }
.footer-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.6rem 1.25rem;
}
@media (max-width: 600px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-h {
  font-size: .9rem; margin: 0 0 .5rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: .14em;
}
.site-footer address { font-style: normal; color: var(--muted); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: .25rem 0; }
.footer-note {
  border-top: 1px solid var(--line);
  padding: .8rem 1.25rem; font-size: .85rem; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}

/* === Editor obsahu v adminu (/admin/obsah) === */
.btn-new { display: inline-block; background: var(--navy); color: #fff; padding: .5rem 1rem; border-radius: 8px; font-weight: 600; }
.btn-new:hover { background: var(--navy-d); }
.ed-meta { display: flex; flex-wrap: wrap; gap: 0 1.25rem; align-items: end; }
.ed-meta .ed-title { flex: 2 1 260px; }
.ed-meta .ed-perex { flex: 1 1 100%; }
.ed-meta input[type=text] { width: 100%; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .75rem 0 .4rem; }
.ed-toolbar button { padding: .3rem .7rem; border: 1px solid #ccc; background: #fff; color: #333; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.ed-toolbar button:hover { background: #f0f0f0; }
.ed-hint { margin-left: auto; font-size: .85rem; }
.ed-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.ed-panes textarea { width: 100%; min-height: 420px; resize: vertical; font: 14px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: .9rem; border: 1px solid #ccc; border-radius: 8px; }
.ed-preview { border: 1px dashed #ccc; border-radius: 8px; padding: .9rem 1.1rem; overflow-y: auto; max-height: 620px; background: #fff; }
.ed-save { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
@media (max-width: 900px) { .ed-panes { grid-template-columns: 1fr; } }

/* === Správa menu webu v adminu === */
.nav-inline { display: inline; }
.nav-inline button { padding: .2rem .6rem; border: 1px solid #ccc; background: #fff; color: #333; border-radius: 6px; cursor: pointer; }
.nav-inline button:hover { background: #f0f0f0; }
.nav-order form { margin-right: .25rem; }
.nav-add input[type=text] { width: 14rem; max-width: 100%; }
.nav-add label { margin-left: .75rem; }
.nav-add label:first-child { margin-left: 0; }
.nav-reset { background: #fff; color: #333; border: 1px solid #ccc; }
.msg-tip { background: #fff8e6; border: 1px solid #e6cf8a; padding: .6rem 1rem; border-radius: 8px; }
.btn-armed { background: #b91c1c !important; color: #fff !important; border-color: #b91c1c !important; }

/* Dlaždice editoru na hlavní stránce adminu — ať nezapadne */
.admin-tile { background: linear-gradient(135deg, #fdf6ec, #fff); border: 2px solid var(--accent); border-radius: 12px; padding: 1.1rem 1.4rem 1.2rem; margin: 1.2rem 0 2rem; }
.admin-tile h2 { margin-top: 0; }
.admin-tile-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 0; }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-secondary:hover { background: var(--bg-alt, #f5f5f5); }
.admin-ver { font-size: .55em; font-weight: 400; color: #999; vertical-align: middle; }
