@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ── Proměnné ── */
:root {
  --bg:           #0e0d16;
  --surface:      #19182a;
  --surface-2:    #222138;
  --border:       #33315a;
  --border-light: #48467a;
  --text:         #ddd8f5;
  --text-muted:   #8b84b8;
  --accent:       #f5c842;
  --accent-hover: #e0b020;
  --accent-glow:  rgba(245, 200, 66, 0.18);
  --success:      #2ea84b;
  --success-bg:   #122a1e;
  --success-text: #6ee88a;
  --danger-bg:    #2a1212;
  --danger-text:  #f08080;
  --danger:       #c04040;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

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

/* ── Navigační lišta ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.navbar-brand {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand svg { opacity: 0.9; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.navbar-admin-badge {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--accent);
  background: rgba(245,200,66,.1);
  border: 1px solid rgba(245,200,66,.25);
  border-radius: 99px;
  padding: .2rem .7rem;
}

.navbar-logout { font-size: .8rem; }

/* ── Přihlašovací stránka ── */
.sign-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.sign-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.sign-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.sign-icon { font-size: 1.6rem; }

.sign-form { display: flex; flex-direction: column; gap: 1.1rem; }

/* ── Flash zprávy ── */
.flashes { padding: 0.5rem 1.5rem 0; }
.flash {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.flash.success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success); }
.flash.error   { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger); }

/* ══════════════════════════════════
   HOMEPAGE
══════════════════════════════════ */
.hero {
  text-align: center;
  padding: 4rem 2rem 2.5rem;
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.dungeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.dungeon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.dungeon-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-3px);
}

.dungeon-card--featured {
  background: linear-gradient(145deg, #1e1b35 0%, #201a2e 100%);
  border-color: rgba(245, 200, 66, 0.45);
  box-shadow: 0 0 18px rgba(245, 200, 66, 0.1), inset 0 1px 0 rgba(245,200,66,.12);
}

.dungeon-card--featured:hover {
  border-color: var(--accent);
  box-shadow: 0 0 36px rgba(245, 200, 66, 0.25), inset 0 1px 0 rgba(245,200,66,.2);
}

.dungeon-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

.dungeon-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.dungeon-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.level-dots {
  display: flex;
  gap: 3px;
}

.level-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-light);
}

.level-dot.active { background: var(--accent); }

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.card-admin-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface2, #2a2a3a);
  border: 1px solid var(--border);
  color: var(--text-muted, #888);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-btn:hover {
  background: var(--surface3, #33334a);
  color: var(--text, #eee);
}

/* active states */
.admin-btn--on.admin-btn--gold {
  background: rgba(255, 200, 50, 0.15);
  border-color: rgba(255, 200, 50, 0.5);
  color: #ffc832;
}
.admin-btn--on.admin-btn--gold:hover {
  background: rgba(255, 200, 50, 0.25);
}

.admin-btn--on.admin-btn--blue {
  background: rgba(80, 160, 255, 0.15);
  border-color: rgba(80, 160, 255, 0.5);
  color: #50a0ff;
}
.admin-btn--on.admin-btn--blue:hover {
  background: rgba(80, 160, 255, 0.25);
}

.admin-btn--on.admin-btn--red {
  background: rgba(255, 90, 90, 0.15);
  border-color: rgba(255, 90, 90, 0.5);
  color: #ff5a5a;
}
.admin-btn--on.admin-btn--red:hover {
  background: rgba(255, 90, 90, 0.25);
}

/* ══════════════════════════════════
   TLAČÍTKA
══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: #1a1200;
}
.btn-primary:hover { background: var(--accent-hover); color: #1a1200; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); }

/* ══════════════════════════════════
   DUNGEON – herní stránka
══════════════════════════════════ */
.dungeon-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  text-align: center;
}

.dungeon-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.dungeon-layout {
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  min-height: calc(100vh - 112px);
}

/* Boční navigační panely */
.nav-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.nav-panel.right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.nav-panel-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.2rem;
}

.btn-nav {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1200;
}

.btn-nav.back::before  { content: "← "; }
.btn-nav.forward::after { content: " →"; }

/* Střední panel s obsahem questu */
.quest-panel {
  padding: 2.5rem 3rem;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.quest-title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.quest-description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.8rem;
}

.quest-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.quest-media.no-image {
  grid-template-columns: 1fr;
}

.quest-image img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.quest-extras {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quest-formula {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  text-align: center;
  font-size: 1.05rem;
  overflow-x: auto;
}

.quest-link .btn {
  width: 100%;
  justify-content: center;
}

/* ── Formulář odpovědi ── */
.answer-section {
  margin-top: 2rem;
}

.answer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
}

.answer-box-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.answer-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.answer-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.answer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.answer-input::placeholder { color: var(--text-muted); }

.btn-answer {
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-answer:hover { background: var(--accent-hover); }

/* ── Správná odpověď ── */
.success-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  color: var(--success-text);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

.success-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════
   EDITOR – obecné
══════════════════════════════════ */
.ed-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ed-title {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  margin: 0;
}

.ed-title-dungeon {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
}

.ed-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ed-badge-start {
  background: rgba(245,200,66,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.ed-badge-new {
  background: rgba(46,168,75,0.15);
  border-color: var(--success);
  color: var(--success-text);
}

.btn-sm  { font-size: 0.82rem; padding: 0.4rem 0.9rem; }
.btn-xs  { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
.btn-lg  { font-size: 1rem;    padding: 0.7rem 1.8rem; }
.btn-danger {
  background: transparent;
  color: var(--danger-text);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.ed-section {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.ed-section-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ed-count {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  color: var(--text-muted);
}

.ed-empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ══════════════════════════════════
   EDITOR – karta questu
══════════════════════════════════ */
.ed-quest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ed-quest-card:hover { border-color: var(--border-light); }

.ed-quest-new {
  border-color: var(--success);
  box-shadow: 0 0 16px rgba(46,168,75,0.2);
}

.ed-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.ed-quest-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.ed-quest-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.ed-quest-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ed-quest-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ed-quest-desc {
  padding: 0 1.2rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ── Preview accordion ── */
.ed-preview {
  border-top: 1px solid var(--border);
}

.ed-preview-toggle {
  list-style: none;
  padding: 0.65rem 1.2rem;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.ed-preview-toggle:hover { background: var(--surface-2); }
.ed-preview[open] .ed-preview-toggle { background: var(--surface-2); }

.ed-preview-content {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.ed-preview-inner {
  padding: 1.5rem;
  max-width: 640px;
}

.ed-preview-inner h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.ed-preview-inner p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.ed-preview-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  display: block;
}

.ed-preview-answer { margin-top: 1rem; }

.ed-preview-correct {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.ed-preview-edit-hint {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Hrany u questu ── */
.ed-edges-out {
  padding: 0.7rem 1.2rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.83rem;
}

.ed-edges-label {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.ed-edge-list { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }

.ed-edge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ed-edge-arrow { color: var(--accent); font-weight: 700; }
.ed-edge-target { color: var(--text); }
.ed-edge-target em { color: var(--text-muted); font-style: normal; font-size: 0.8em; }
.ed-edge-label-text { color: var(--accent); font-style: italic; }
.ed-edge-back { color: var(--text-muted); font-style: italic; }

.ed-edge-delete {
  color: var(--danger-text);
  border: 1px solid var(--danger);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.ed-edge-delete:hover { background: var(--danger); color: #fff; }

.ed-edges-none { color: var(--text-muted); font-style: italic; }

/* ══════════════════════════════════
   EDITOR – správa hran
══════════════════════════════════ */
.ed-add-edge-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.ed-form-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.ed-edge-form-grid { display: flex; flex-direction: column; gap: 0.9rem; }

.ed-form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ed-form-group { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 160px; }
.ed-form-group label, .ed-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.ed-required { color: var(--accent); }

.ed-input, .ed-select, .ed-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.15s;
  width: 100%;
}

.ed-input:focus, .ed-select:focus, .ed-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.ed-input-narrow { max-width: 100px; }
.ed-textarea { resize: vertical; min-height: 100px; }
.ed-hint { font-size: 0.77rem; color: var(--text-muted); }
.ed-field-error { font-size: 0.8rem; color: var(--danger-text); }

.ed-form-arrow {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  padding-bottom: 0.4rem;
  align-self: flex-end;
}

.ed-form-check { justify-content: flex-end; }
.ed-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* ── Tabulka hran ── */
.ed-edge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ed-edge-table th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

.ed-edge-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ed-edge-table tr:last-child td { border-bottom: none; }
.ed-edge-table tr:hover td { background: var(--surface-2); }

.ed-tbl-name { color: var(--text); font-weight: 600; }
.ed-tbl-id   { color: var(--text-muted); font-size: 0.78em; margin-left: 0.3em; }
.ed-tbl-arrow { color: var(--accent); font-weight: 700; text-align: center; }
.ed-tbl-label { color: var(--text-muted); font-style: italic; }
.ed-tbl-reverse { text-align: center; color: var(--success-text); }

/* ══════════════════════════════════
   EDITOR – formulář questu
══════════════════════════════════ */
.ed-form-page {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.ed-quest-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}

.ed-form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.ed-form-col { display: flex; flex-direction: column; gap: 1.2rem; }

.ed-form-submit {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ed-latex-preview {
  margin-top: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
}

.ed-image-preview {
  margin-top: 0.6rem;
  max-width: 100%;
  max-height: 160px;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.ed-form-errors { margin-bottom: 1rem; }

/* ── Upload zóna ── */
.ed-upload-zone {
  margin-top: 0.6rem;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.1rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ed-upload-zone:hover,
.ed-upload-drag {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text);
}

.ed-upload-idle { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }

.ed-upload-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.ed-upload-pick {
  background: none;
  border: none;
  color: var(--accent);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.ed-upload-pick:hover { color: var(--accent-hover); }

.ed-upload-progress { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }

.ed-upload-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.ed-upload-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s;
  width: 0%;
}

/* ── Kotvy a přechody ── */
.ed-select-wrap { display: flex; flex-direction: column; gap: 0.35rem; }

.ed-goto-quest {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.ed-goto-quest:hover { color: var(--accent-hover); }

.ed-tbl-anchor {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.ed-tbl-anchor:hover .ed-tbl-name { color: var(--accent); }
.ed-tbl-anchor:hover .ed-tbl-id   { color: var(--accent); }

/* Pulzující highlight při navigaci kotvou */
@keyframes quest-highlight {
  0%   { box-shadow: 0 0 0 0 rgba(245,200,66,0.5); border-color: var(--accent); }
  50%  { box-shadow: 0 0 0 8px rgba(245,200,66,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,200,66,0); border-color: var(--border); }
}

.ed-quest-highlight {
  animation: quest-highlight 1.8s ease-out;
}

@media (max-width: 720px) {
  .ed-form-two-col { grid-template-columns: 1fr; }
  .ed-form-row { flex-direction: column; }
  .ed-form-arrow { display: none; }
  .ed-quest-head { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════
   LIGHTBOX
══════════════════════════════════ */
.quest-image img {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.quest-image img:hover { opacity: 0.88; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.8);
  transform: scale(0.94);
  transition: transform 0.2s;
  display: block;
}

.lightbox-overlay.open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lightbox-close:hover {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 900px) {
  .dungeon-layout {
    grid-template-columns: 1fr;
  }

  .nav-panel {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
  }

  .nav-panel.right {
    border-left: none;
    border-top: 1px solid var(--border);
    border-bottom: none;
  }

  .btn-nav { width: auto; }

  .quest-panel { padding: 1.5rem; }

  .quest-media {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .dungeon-grid { grid-template-columns: 1fr; padding: 1rem; }
  .quest-panel { padding: 1rem; }
  .answer-row { flex-direction: column; }
  .btn-answer { width: 100%; }
  .navbar { padding: 0 1rem; }
}

/* ══════════════════════════════════
   TAGY
══════════════════════════════════ */

/* Chip obecný */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #1e1a3a;
  border: 1px solid #4a3f8a;
  color: #b8acf0;
  border-radius: 99px;
  padding: .18rem .55rem;
  font-size: .78rem;
  font-family: 'Nunito', sans-serif;
  white-space: nowrap;
  line-height: 1.4;
}

/* Malá varianta (na kartách v editoru) */
.tag-chip-sm {
  font-size: .72rem;
  padding: .12rem .45rem;
}

.tag-chip-label { pointer-events: none; }

.tag-chip-remove {
  background: none;
  border: none;
  color: #7a6ec0;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  padding: 0 .1rem;
  transition: color .15s;
}
.tag-chip-remove:hover { color: var(--danger-text); }

/* Řada tagů na quest kartě */
.ed-quest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .5rem;
}

/* Tag input wrap (jako textové pole) */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  cursor: text;
  min-height: 42px;
  transition: border-color .2s;
}
.tag-input-wrap:focus-within { border-color: var(--accent); }

.tag-chips { display: contents; }

.tag-text-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: .9rem;
  flex: 1;
  min-width: 120px;
}
.tag-text-input::placeholder { color: var(--text-muted); }

/* Search box nad výběrem questu */
.ed-quest-search-wrap { margin-bottom: .2rem; }

.ed-quest-search {
  width: 100%;
  font-size: .95rem;
}

/* ══════════════════════════════════
   SCENARY — příběhová vrstva
══════════════════════════════════ */

/* Badge v editoru */
.ed-badge-scen {
  background: #2d1f5e;
  color: #c4adff;
  border: 1px solid #5a3eb5;
}

/* Příběhový popis v preview editoru */
.ed-preview-scen-desc {
  font-style: italic;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: .8rem;
  margin-bottom: .5rem;
  font-size: .93rem;
}

/* Referenční karta questu na stránce editScenary */
.ed-scenary-page { max-width: 720px; }

.ed-scenary-ref {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.8rem;
}

.ed-scenary-ref-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .7rem;
}

.ed-scenary-ref-row {
  display: flex;
  gap: .6rem;
  font-size: .9rem;
  margin-bottom: .35rem;
  align-items: flex-start;
}

.ed-scenary-ref-key {
  color: var(--text-muted);
  min-width: 70px;
  flex-shrink: 0;
}

.ed-scenary-ref-img {
  max-height: 80px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ed-hint-inline {
  font-weight: 400;
  font-size: .8rem;
  color: var(--text-muted);
  margin-left: .3rem;
}

/* Příběhový popis v pohledu studenta */
.quest-scenary-desc {
  font-style: italic;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding: .5rem .9rem;
  margin-bottom: .8rem;
  background: rgba(245, 200, 66, 0.06);
  border-radius: 0 6px 6px 0;
  line-height: 1.7;
}

/* ══════════════════════════════════
   HOMEPAGE — filtr + featured
══════════════════════════════════ */

.dungeon-list-header {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  gap: .6rem;
  align-items: center;
}

.dungeon-filter-input {
  flex: 1;
  font-size: 1rem;
}

.dungeon-filter-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* Featured badge v názvu karty */
.featured-badge {
  color: var(--accent);
  font-size: 1rem;
  margin-right: .25rem;
  text-shadow: 0 0 8px rgba(245,200,66,.6);
}

/* Tlačítko featured — zapnutý stav */
.btn-featured-on {
  color: var(--accent);
  border-color: rgba(245,200,66,.4);
  background: rgba(245,200,66,.08);
}
.btn-featured-on:hover {
  background: rgba(245,200,66,.18);
}

/* Frequency badge v názvu karty */
.frequency-badge {
  display: inline-flex;
  align-items: center;
  color: #7dd4f0;
  margin-right: .2rem;
  filter: drop-shadow(0 0 5px rgba(100,200,255,.5));
}

/* Tlačítko frequency — zapnutý stav (admin) */
.btn-frequency-on {
  color: #7dd4f0;
  border-color: rgba(100,200,255,.4);
  background: rgba(100,200,255,.08);
}
.btn-frequency-on:hover {
  background: rgba(100,200,255,.18);
}

/* Frequency filtr tlačítko */
.dungeon-freq-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.dungeon-freq-btn--active {
  color: #7dd4f0;
  border-color: rgba(100,200,255,.5);
  background: rgba(100,200,255,.1);
  box-shadow: 0 0 10px rgba(100,200,255,.15);
}

/* Draft filtr tlačítko (pouze admin) */
.dungeon-draft-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.dungeon-draft-btn--active {
  color: #ff8a8a;
  border-color: rgba(255,90,90,.5);
  background: rgba(255,90,90,.1);
  box-shadow: 0 0 10px rgba(255,90,90,.15);
}

/* Draft karta — pouze viditelná adminovi */
.dungeon-card--draft {
  opacity: .6;
  border-style: dashed;
  border-color: var(--border-light);
  background: var(--surface);
}

.dungeon-card--draft:hover {
  opacity: .85;
}

.draft-badge {
  display: inline-block;
  font-size: .68rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-light);
  border-radius: 4px;
  padding: .1rem .4rem;
  margin-left: .4rem;
  vertical-align: middle;
}

.btn-draft-on {
  color: #a0c8ff;
  border-color: rgba(160,200,255,.4);
  background: rgba(160,200,255,.08);
}

.dungeon-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

/* ══════════════════════════════════
   DUNGEON CARD IMAGE
══════════════════════════════════ */
.dungeon-card-img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -1.2rem -1.2rem 1rem;
  width: calc(100% + 2.4rem);
}

/* ══════════════════════════════════
   DUNGEON INTRO PAGE
══════════════════════════════════ */
.dungeon-intro {
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.intro-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.intro-hero-plain {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  min-height: 160px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.intro-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 60%, transparent 100%);
}

.intro-title {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.9);
  padding: 1.5rem 2rem;
  z-index: 1;
}

.intro-hero-plain .intro-title {
  position: static;
  color: var(--accent);
  text-align: center;
  padding: 2rem;
}

.intro-body {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.intro-story {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}

.intro-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.intro-meta-label { font-weight: 600; }

.intro-start {
  align-self: flex-start;
  font-size: 1.1rem;
  padding: .85rem 2.2rem;
  letter-spacing: .03em;
}

.intro-password-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intro-password-hint {
  color: var(--text-muted);
  font-size: .95rem;
}

.intro-password-form { display: contents; }

.intro-password-row {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
}

.intro-password-row .ed-input {
  flex: 1;
  min-width: 180px;
}

/* Zachovat zalomení řádků v příběhových textech (rádiové zprávy, výpisy robotů) */
.quest-description,
.quest-scenary-desc,
.intro-story {
  white-space: pre-line;
}
