:root {
  color-scheme: dark;
  --night: #120a06;
  --wood: #2a180d;
  --wood-2: #3a2312;
  --parchment: #ecd7a6;
  --ink: #f2e4c4;
  --ink-muted: #c4ab7f;
  --gold: #e2b04a;
  --gold-soft: #b8892f;
  --gold-dim: #8f611866;
  --blood: #b3201a;
  --blood-glow: #ff4d2e;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.5;
  padding: 1.5rem 1rem 3rem;
}

/* pozadí: pergamen (html::before) + mapa Středozemě nad ním (body::before);
   obrázky + verze v URL jsou v partials/head.ejs */
html::before,
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
html::before { background: var(--night) center/cover no-repeat; }
body::before {
  background: center/cover no-repeat;
  opacity: 0.78;
  mix-blend-mode: multiply;
}

a { color: var(--gold); }
a:hover { color: #ffd27a; }

.page { max-width: 760px; margin: 0 auto; }

h1, h2, h3, .cinzel {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* rám jako dřevěné destičky hráčů ve streamu */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff08, #00000030),
    repeating-linear-gradient(95deg, var(--wood) 0 7px, var(--wood-2) 7px 9px, var(--wood) 9px 16px);
  border: 2px solid var(--gold-soft);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 4px #1a0e06,
    inset 0 0 0 5px var(--gold-dim),
    0 10px 40px #000a;
  padding: 1.6rem 1.4rem;
  margin-bottom: 1.5rem;
}

.hero { text-align: center; padding-top: 2rem; }

.emblem {
  width: 190px;
  height: 190px;
  margin: 0 auto 0.6rem;
  display: block;
  filter: drop-shadow(0 0 18px #ffb34a55) drop-shadow(0 6px 14px #000c);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  50% { filter: drop-shadow(0 0 30px #ff7a2a88) drop-shadow(0 6px 14px #000c); }
}

@media (prefers-reduced-motion: reduce) {
  .emblem { animation: none; }
}

.kicker {
  font-family: 'Cinzel', serif;
  color: var(--ink-muted);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0;
}

.hero h1 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  margin: 0.2rem 0 0.4rem;
  color: var(--gold);
  text-shadow: 0 2px 0 #000, 0 0 24px #e2b04a44;
  line-height: 1.15;
}

.hero .lead {
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--gold-soft);
  margin: 1.2rem auto;
  max-width: 420px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

.session-title { text-transform: none; letter-spacing: 0.06em; font-size: 1.5rem; margin: 0 0 0.2rem; color: var(--parchment); }
.session-desc { margin: 0 0 0.8rem; color: var(--ink-muted); font-style: italic; }

.when {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0.4rem 0 1.2rem;
}
.when strong { color: var(--gold); font-weight: 700; }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  max-width: 480px;
  margin: 0 auto 1.4rem;
}
.countdown div {
  background: #0d0604cc;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.6rem 0.2rem 0.4rem;
}
.countdown b {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: var(--parchment);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown span {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: #ffd9c9;
  background: #5c0f0bcc;
  border: 1px solid var(--blood-glow);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 0 24px #ff4d2e55;
}
.live::before {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--blood-glow);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: #1c0f05;
  background: linear-gradient(180deg, #f6d77c, #c18d2c);
  border: 1px solid #5a3a0c;
  border-radius: 4px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 0 #5a3a0c, inset 0 1px 0 #fff6;
}
.btn:hover { color: #1c0f05; filter: brightness(1.08); }
.btn.secondary {
  color: var(--gold);
  background: #0d0604aa;
  border-color: var(--gold-soft);
  box-shadow: none;
}
.btn.secondary:hover { color: #ffd27a; }
.btn.danger { color: #ffd9c9; background: #5c0f0b; border-color: var(--blood-glow); box-shadow: none; }
.btn svg { width: 1.1em; height: 1.1em; }

h2 {
  font-size: 1.1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 0.8rem;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--gold-dim);
}
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--ink-muted); font-size: 0.95rem; white-space: nowrap; }
.list .name { color: var(--parchment); }
.list .sub { display: block; color: var(--ink-muted); font-size: 0.95rem; font-style: italic; }

.empty { text-align: center; color: var(--ink-muted); font-style: italic; }

footer {
  text-align: center;
  color: #f2e4c4aa;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px #000;
}
footer a { color: inherit; }
footer .credit { font-size: 0.75rem; opacity: 0.8; margin-top: -0.4rem; }

.list li { flex-wrap: wrap; }
.list li .recordings { flex-basis: 100%; }
.recordings { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--gold);
  background: #0d0604aa;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
.chip:hover { border-color: var(--gold-soft); color: #ffd27a; }
.chip::before { content: '▶ '; font-size: 0.7em; color: var(--blood-glow); }

.list li .people { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.15rem; }
.people-label { font-family: 'Cinzel', serif; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); margin-right: 0.15rem; }
.chip.plain { color: var(--ink-muted); border-style: dashed; }
.chip.plain::before { content: none; }

/* role v kronice */
.list li .roles { flex-basis: 100%; }
.roles summary {
  cursor: pointer; font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.05em;
  color: var(--ink-muted); list-style: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.roles summary::-webkit-details-marker { display: none; }
.roles summary::before { content: '🩸'; }
.roles[open] summary { color: var(--gold); margin-bottom: 0.6rem; }
.tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.7rem 0.4rem; }
.token { margin: 0; display: grid; justify-items: center; text-align: center; gap: 0.25rem; }
.token img, .token-fallback {
  width: 64px; height: 64px; border-radius: 50%;
  box-shadow: 0 0 0 2px #1a0e06, 0 0 0 3px var(--gold-soft), 0 4px 10px #000a;
}
.token.evil img, .token.evil .token-fallback { box-shadow: 0 0 0 2px #1a0e06, 0 0 0 3px var(--blood-glow), 0 0 14px #ff4d2e66; }
.token-fallback {
  display: grid; place-items: center; font-family: 'Cinzel Decorative', serif; font-size: 1.6rem;
  background: radial-gradient(circle at 40% 35%, #f3e3bd, #c9ad78); color: #1f3d73;
}
.token.evil .token-fallback { color: #8c1712; }
.token-img { position: relative; display: block; }
.token figcaption { font-size: 0.8rem; color: var(--ink-muted); line-height: 1.15; }
.token figcaption b { display: block; font-family: 'Cinzel', serif; font-weight: 600; color: var(--parchment); font-size: 0.8rem; }
.token.evil figcaption b { color: #ffb4a3; }

/* kdo streamuje */
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.9rem 0.6rem; }
.channel { display: grid; justify-items: center; gap: 0.15rem; text-align: center; text-decoration: none; color: var(--ink); }
.channel img, .avatar-fallback {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--gold-soft); box-shadow: 0 0 0 3px #1a0e06, 0 0 0 4px var(--gold-dim);
}
.avatar-fallback { display: grid; place-items: center; font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--gold); background: #0d0604; }
.channel:hover img, .channel:hover .avatar-fallback { border-color: #ffd27a; }
.channel-name { font-family: 'Cinzel', serif; font-size: 0.8rem; color: var(--gold); word-break: break-word; margin-top: 0.3rem; }
.channel-char { font-size: 0.85rem; font-style: italic; color: var(--ink-muted); line-height: 1.1; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; }

/* živě teď */
.live-panel { border-color: var(--blood-glow); box-shadow: inset 0 0 0 4px #1a0e06, inset 0 0 0 5px #ff4d2e44, 0 0 30px #ff4d2e33, 0 10px 40px #000a; }
.live-panel h2 { display: flex; align-items: center; gap: 0.5rem; color: #ffd9c9; }
.live-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--blood-glow); animation: pulse 1.4s infinite; }
.streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.stream { display: grid; gap: 0.2rem; text-decoration: none; color: var(--ink); }
.stream:hover .thumb img { filter: brightness(1.1); }
.stream:hover .stream-name { color: #ffd27a; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border: 1px solid var(--gold-soft); border-radius: 4px; overflow: hidden; background: #0d0604; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 0.4rem; top: 0.4rem; font-family: 'Cinzel', serif; font-size: 0.7rem; font-weight: 700; color: #fff; background: #b3201ae6; border-radius: 3px; padding: 0.1rem 0.4rem; }
.stream-name { font-family: 'Cinzel', serif; font-weight: 600; color: var(--gold); }
.stream-title { font-size: 0.9rem; color: var(--ink-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* admin */
form.grid { display: grid; gap: 0.9rem; }
form.grid label { display: grid; gap: 0.25rem; font-family: 'Cinzel', serif; font-size: 0.85rem; color: var(--ink-muted); letter-spacing: 0.05em; }
form.grid .row { display: grid; grid-template-columns: 2fr 1fr; gap: 0.9rem; }
input, textarea, select {
  font: inherit;
  font-family: 'EB Garamond', Georgia, serif;
  letter-spacing: normal;
  font-size: 1rem;
  color: var(--ink);
  background: #0d0604cc;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; }
.error { color: #ffb4a3; background: #5c0f0b99; border: 1px solid var(--blood); padding: 0.5rem 0.8rem; border-radius: 4px; }
.inline { display: inline; }
.admin-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.admin-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

@media (max-width: 520px) {
  body { font-size: 1.05rem; }
  .panel { padding: 1.2rem 1rem; }
  .list li { gap: 0.2rem 1rem; }
  .countdown { gap: 0.35rem; }
  form.grid .row { grid-template-columns: 1fr; }
}
