/* =========================================================================
   combat.css
   -------------------------------------------------------------------------
   Styly pro stránku souboje (templates/combat_sheet.html).
   Staví nad charsheet.css — tam, kde sdílíme .cs-* komponenty, nic nezměníme.
   Vlastní třídy mají prefix .cb-* a .cb-page jako root scope.
   ========================================================================= */

.cb-page {
  /* Stejná šířka jako karta postavy, ať je UX konzistentní */
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* =========================================================================
   BATTLE LAYOUT — enemies+party vlevo, iniciativa vpravo
   ========================================================================= */
.cb-battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.cb-battle-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.cb-battle-main > .cb-section { margin-bottom: 0; }

/* Iniciativa jako pravá bočnice */
.cb-initiative-section--side {
  position: sticky;
  top: 1rem;
  margin-bottom: 0;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
.cb-initiative-section--side .cb-section__header--column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.cb-initiative-section--side .cb-section__header--column .cb-section__actions {
  align-self: stretch;
  justify-content: flex-end;
}
.cb-initiative-section--side .cb-initiative-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Vertikální varianta tracku */
.cb-initiative-track--vertical {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem;
  min-height: 60px;
  flex: 1;
}
.cb-initiative-track--vertical .cb-init-item {
  width: 100%;
  flex-shrink: 0;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
}
.cb-init-item__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.1rem;
}
.cb-init-item__body .cb-init-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-init-item__hp {
  font-size: 0.72rem;
  color: var(--red-bright);
  font-family: 'Crimson Text', serif;
}
.cb-init-item__hp--hero { color: var(--green-bright); }
.cb-init-item__detail {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.cb-init-item__detail:hover { color: var(--gold); border-color: var(--gold); }

@media (max-width: 900px) {
  .cb-battle-layout { grid-template-columns: 1fr; }
  .cb-initiative-section--side { position: static; max-height: none; }
  .cb-initiative-track--vertical { max-height: 280px; }
}

/* ---- View switch (Karta/Souboj) ---- */
.cb-view-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}
.cb-view-switch__btn {
  padding: 0.4rem 0.9rem;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.cb-view-switch__btn:hover { color: var(--gold-light); background: var(--gold-dim); }
.cb-view-switch__btn--active {
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 700;
  cursor: default;
}

/* =========================================================================
   RIBBON (top)
   ========================================================================= */
.cb-ribbon {
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(139, 26, 26, 0.12), rgba(201, 162, 39, 0.06));
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.cb-ribbon__group { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.cb-ribbon__label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.cb-ribbon__value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.1;
}
.cb-ribbon__value--turn { font-size: 1.2rem; font-weight: 600; }
.cb-ribbon__status { font-size: 1rem; padding: 0.2rem 0.7rem; border-radius: var(--radius); border: 1px solid var(--border-dim); }
.cb-ribbon__status--idle   { color: var(--text-muted); }
.cb-ribbon__status--active { color: var(--green-bright); border-color: var(--green-bright); background: rgba(39, 174, 96, 0.12); }
.cb-ribbon__status--ended  { color: var(--red-bright); border-color: var(--red-bright); background: rgba(192, 57, 43, 0.12); }
.cb-ribbon__actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }

/* =========================================================================
   SECTION WRAPPER
   ========================================================================= */
.cb-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.cb-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
  flex-wrap: wrap;
}
.cb-section__title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold-light);
  margin: 0;
}
.cb-section__actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.cb-enemy-count { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================================================
   ENEMIES GRID
   ========================================================================= */
.cb-enemies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.cb-enemies-empty, .cb-initiative-empty {
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  grid-column: 1 / -1;
}

/* ---- Enemy card ---- */
.cb-enemy-card {
  --race-color: var(--border-dim);
  position: relative;
  background: linear-gradient(180deg, var(--bg-card2), var(--bg-card));
  border: 1px solid var(--border-dim);
  border-left: 4px solid var(--race-color);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.cb-enemy-card:hover { transform: translateY(-2px); border-color: var(--border); }
.cb-enemy-card--turn {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 2px var(--gold), 0 4px 18px rgba(201, 162, 39, 0.35);
}
.cb-enemy-card--dead { opacity: 0.55; filter: grayscale(0.6); }
.cb-enemy-card--dead:hover { transform: none; }
.cb-enemy-card__dead-overlay {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: rgba(139, 26, 26, 0.8);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
}

.cb-enemy-card__header { display: flex; align-items: center; gap: 0.6rem; }
.cb-enemy-card__icon { font-size: 1.6rem; flex-shrink: 0; }
.cb-enemy-card__title-wrap { flex: 1; min-width: 0; }
.cb-enemy-card__name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-enemy-card__race {
  font-size: 0.75rem;
  color: var(--race-color, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cb-enemy-card__more {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.cb-enemy-card__more:hover { color: var(--gold); border-color: var(--gold); }

/* HP bar */
.cb-enemy-hp-bar {
  height: 10px;
  background: rgba(139, 26, 26, 0.25);
  border: 1px solid var(--red);
  border-radius: 5px;
  overflow: hidden;
}
.cb-enemy-hp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #c0392b, #e74c3c);
  transition: width 0.3s ease;
}
.cb-enemy-hp-bar__fill--hero {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}
.cb-enemy-hp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.cb-enemy-hp-val {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--text);
  min-width: 70px;
  text-align: center;
}

/* Stats strip */
.cb-enemy-card__stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  text-align: center;
}
.cb-enemy-stat {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.25rem 0.1rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.cb-enemy-stat b { color: var(--gold-light); font-size: 0.9rem; }

/* Effects — now use cs-effect-pill from charsheet.css */
.cb-enemy-effects, .cb-hero-effects {
  display: flex; gap: 0.2rem; flex-wrap: wrap; padding-top: 0.2rem;
}

/* Icon input + picker tlačítko */
.cb-icon-input-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.cb-icon-input-row input[type="text"] {
  flex: 0 1 5rem;
  text-align: center;
  font-size: 1.1rem;
}
.cb-icon-input-row .btn { flex-shrink: 0; }

/* Icon picker modal grid */
.cb-icon-picker-group { margin-bottom: 1rem; }
.cb-icon-picker-group__label {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 0.2rem;
}
.cb-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr));
  gap: 0.3rem;
}
.cb-icon-picker-item {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cb-icon-picker-item:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
  transform: scale(1.08);
}

/* Dice range warning */
.cb-dice-warn {
  font-size: 0.78rem;
  color: var(--gold-light, #c9a227);
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  margin-top: 0.25rem;
}

/* Abilities row */
.cb-enemy-abilities { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cb-enemy-ability-btn {
  background: rgba(142, 68, 173, 0.18);
  color: var(--text);
  border: 1px solid rgba(142, 68, 173, 0.5);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-family: 'Crimson Text', serif;
  cursor: pointer;
  transition: all var(--transition);
}
.cb-enemy-ability-btn:hover:not(:disabled) {
  background: rgba(142, 68, 173, 0.35);
  border-color: var(--purple);
}
.cb-enemy-ability-btn--cd, .cb-enemy-ability-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Card actions (edit/reset/dup/remove) — zakotveno na spodní hranu */
.cb-enemy-card__actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.2rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cb-enemy-card__actions .btn--ghost {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.45rem;
  font-size: 0.85rem;
  min-width: 32px;
}
.cb-enemy-card__actions .btn--ghost:hover {
  background: rgba(201,162,39,0.15);
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* =========================================================================
   PARTY (hero card)
   ========================================================================= */
.cb-party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}
.cb-hero-card {
  position: relative;
  background: linear-gradient(180deg, rgba(39, 174, 96, 0.08), var(--bg-card));
  border: 2px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.cb-hero-card--turn {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3), 0 4px 24px rgba(201, 162, 39, 0.25);
}
.cb-hero-card--dead { opacity: 0.55; filter: grayscale(0.6); }
.cb-hero-card__top { display: flex; gap: 0.7rem; align-items: center; }
.cb-hero-card__portrait {
  width: 64px; height: 64px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  object-fit: cover;
}
.cb-hero-card__portrait--fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: var(--bg-card2);
  color: var(--gold);
}
.cb-hero-card__name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold-light);
  font-weight: 700;
}
.cb-hero-card__meta { font-size: 0.85rem; color: var(--text-muted); }
.cb-hero-card__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

/* =========================================================================
   INITIATIVE TRACK
   ========================================================================= */
.cb-initiative-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem;
  min-height: 70px;
  align-items: center;
}
.cb-init-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  touch-action: none;
}
.cb-init-item:hover { border-color: var(--border); }
.cb-init-item--current {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.15);
  box-shadow: 0 0 0 2px var(--gold-light);
}
.cb-init-item--hero { border-left: 3px solid var(--green-bright); }
.cb-init-item--enemy { border-left: 3px solid var(--red-bright); }
.cb-init-item--dead { opacity: 0.45; filter: grayscale(0.7); }
.cb-init-item--dragging { cursor: grabbing; opacity: 0.8; box-shadow: 0 8px 20px rgba(0,0,0,0.6); }
.cb-init-item--drop-before { border-left: 3px solid var(--gold-light); }
.cb-init-item__num {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.85rem;
}
.cb-init-item__icon { font-size: 1.1rem; }
.cb-init-item__name { font-size: 0.9rem; color: var(--text); }
.cb-initiative-help { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

/* =========================================================================
   ACTION BAR
   ========================================================================= */
.cb-actionbar-section {
  background: linear-gradient(180deg, rgba(201,162,39,0.08), var(--bg-card));
  border: 2px solid var(--border);
}
.cb-actionbar__header { margin-bottom: 0.7rem; }
.cb-actionbar__title {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}
.cb-actionbar__hint { color: var(--text-muted); font-size: 0.9rem; }
.cb-actionbar__buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* =========================================================================
   COMBAT LOG
   ========================================================================= */
.cb-log {
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.5rem;
  font-size: 0.88rem;
  font-family: 'Crimson Text', serif;
}
.cb-log__empty { padding: 2rem; text-align: center; color: var(--text-muted); font-style: italic; }
.cb-log__round-group { margin-bottom: 0.7rem; }
.cb-log__round-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}
.cb-log__entry {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px dashed rgba(107, 84, 0, 0.3);
  align-items: center;
}
.cb-log__entry:last-child { border-bottom: none; }
.cb-log__entry:hover { background: rgba(201, 162, 39, 0.06); }
.cb-log__icon { text-align: center; }
.cb-log__text { color: var(--text); }
.cb-log__time { color: var(--text-muted); font-size: 0.75rem; font-family: monospace; }
.cb-log__rewind {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0;
  transition: all var(--transition);
}
.cb-log__entry:hover .cb-log__rewind { opacity: 1; }
.cb-log__rewind:hover { border-color: var(--gold); color: var(--gold-light); }
/* Color variants */
.cb-log__entry--gold   { color: var(--gold-light); }
.cb-log__entry--red    .cb-log__text { color: #e8a49a; }
.cb-log__entry--green  .cb-log__text { color: #7ed5a1; }
.cb-log__entry--blue   .cb-log__text { color: #87c5e5; }
.cb-log__entry--purple .cb-log__text { color: #c594e8; }
.cb-log__entry--dim    .cb-log__text { color: var(--text-muted); }

/* =========================================================================
   HERO STATS SECTION (condensed)
   ========================================================================= */
.cb-hero-stats-section { background: var(--bg-card); }
.cb-hero-stats-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: normal;
  font-family: 'Crimson Text', serif;
}
.cb-stats-compact, .cb-effects-compact { margin-top: 1rem; }

/* ── Effect cards in combat sheet: stronger contrast on dark bg ── */
.cb-effects-compact .cs-effects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.45rem;
}
.cb-effects-compact .cs-effect-card {
  border-left-width: 3px;
  background: var(--bg-deep);
}
.cb-effects-compact .cs-effect-card--buff {
  border-left-color: rgba(39, 174, 96, 0.85);
  background: linear-gradient(100deg, rgba(39, 174, 96, 0.10) 0%, var(--bg-deep) 55%);
}
.cb-effects-compact .cs-effect-card--debuff {
  border-left-color: rgba(192, 57, 43, 0.85);
  background: linear-gradient(100deg, rgba(192, 57, 43, 0.10) 0%, var(--bg-deep) 55%);
}
.cb-effects-compact .cs-effect-card--custom {
  border-left-color: rgba(212, 175, 55, 0.85);
  background: linear-gradient(100deg, rgba(212, 175, 55, 0.10) 0%, var(--bg-deep) 55%);
}
.cb-effects-compact .cs-effect-card__name { font-size: 0.88rem; }
.cb-effects-compact .cs-effect-card__sub  { font-size: 0.75rem; }

.cb-subsection__title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =========================================================================
   PICKER MODAL (enemy picker)
   ========================================================================= */
.cb-picker-help {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.cb-picker-quick {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-dim);
}
.cb-picker-race {
  --race-color: var(--border-dim);
  margin-bottom: 1.5rem;
}
.cb-picker-race-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: linear-gradient(90deg, var(--race-color), transparent);
  border-left: 4px solid var(--race-color);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.cb-picker-race-icon { font-size: 1.3rem; }
.cb-picker-race-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold-light);
  flex: 1;
}
.cb-picker-race-count {
  background: var(--bg-card2);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.cb-picker-race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
}
.cb-picker-card {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.cb-picker-card:hover {
  border-color: var(--gold);
  background: var(--bg-card);
  transform: translateY(-1px);
}
.cb-picker-card__icon { font-size: 1.6rem; flex-shrink: 0; }
.cb-picker-card__body { flex: 1; min-width: 0; }
.cb-picker-card__name { font-family: 'Cinzel', serif; font-weight: 600; color: var(--gold-light); font-size: 0.95rem; }
.cb-picker-card__desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.3; margin: 0.15rem 0 0.3rem; }
.cb-picker-card__stats { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.75rem; color: var(--text); }

/* =========================================================================
   ENEMY EDITOR MODAL
   ========================================================================= */
.cb-editor { display: flex; flex-direction: column; gap: 0.7rem; }
.cb-editor-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}
.cb-editor-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0.8rem 0 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cb-editor-hint { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.cb-editor-empty { color: var(--text-muted); font-style: italic; padding: 0.5rem; }

/* Strukturované odměny (plnohodnotné itemy) */
.cb-editor-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.cb-editor-items__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.cb-editor-items__header label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cb-editor-items__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cb-reward-item-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}
.cb-reward-item-row__icon { font-size: 1.2rem; }
.cb-reward-item-row__body { min-width: 0; }
.cb-reward-item-row__name {
  font-weight: 700;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-reward-item-row__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Detail panel hrdiny */
.cb-detail-hero { display: flex; flex-direction: column; gap: 0.8rem; }
.cb-detail-hero__head {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-dim);
}
.cb-detail-portrait {
  width: 72px;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.cb-detail-portrait--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--bg-card2);
  color: var(--gold);
}
.cb-detail-hero__name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
}
.cb-detail-hero__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cb-detail-rewards__items {
  margin: 0.3rem 0 0 1.2rem;
  padding: 0;
  color: var(--text);
}
.cb-detail-rewards__items li {
  padding: 0.15rem 0;
  font-size: 0.9rem;
}
.cb-editor-abilities { display: flex; flex-direction: column; gap: 0.4rem; }
.cb-editor-ability {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}
.cb-editor-ability__icon { font-size: 1.3rem; }
.cb-editor-ability__name { font-weight: 700; color: var(--gold-light); }
.cb-editor-ability__trig { font-size: 0.78rem; color: var(--text-muted); }
.cb-editor-ability__desc { font-size: 0.83rem; color: var(--text-muted); }
.cb-editor-pool-label {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0.5rem 0 0.2rem;
}
.cb-editor-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.cb-editor-pool-btn {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border-dim);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: 'Crimson Text', serif;
  cursor: pointer;
  transition: all var(--transition);
}
.cb-editor-pool-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.cb-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-dim);
}

/* =========================================================================
   ACTION MODAL (attack/cast)
   ========================================================================= */
.cb-action-step {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--border-dim);
}
.cb-action-step:last-child { border-bottom: none; }
.cb-action-step__label {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.cb-action-step__hint { font-size: 0.83rem; color: var(--text-muted); margin-top: 0.3rem; }
.cb-target-list, .cb-attack-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cb-target-option, .cb-attack-option {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.cb-target-option:hover, .cb-attack-option:hover {
  border-color: var(--gold);
  background: var(--bg-card);
}
.cb-target-option input:checked ~ *, .cb-attack-option input:checked ~ * { color: var(--gold-light); }
.cb-target-option:has(input:checked), .cb-attack-option:has(input:checked) {
  border-color: var(--gold-light);
  background: rgba(201, 162, 39, 0.1);
}
.cb-target-option__icon { font-size: 1.3rem; }
.cb-target-option__body, .cb-attack-option__body { flex: 1; }
.cb-target-option__name, .cb-attack-option__name { font-weight: 700; }
.cb-target-option__stats, .cb-attack-option__rolls { font-size: 0.8rem; color: var(--text-muted); }

/* Defense choice (enemy attack modal) */
.cb-defense-choice {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.cb-defense-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
}
.cb-defense-option:hover { border-color: var(--gold); }
.cb-defense-option:has(input:checked) {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.07);
}
.cb-defense-option input[type="radio"] { accent-color: var(--gold); }
.cb-defense-option span:nth-child(2) { flex: 1; font-size: 0.95rem; }
.cb-defense-result {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.cb-roll-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.cb-roll-row label { display: flex; gap: 0.3rem; align-items: center; }
.cb-roll-row input {
  width: 80px;
  padding: 0.3rem 0.5rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--gold-light);
  font-weight: 700;
  text-align: center;
  font-family: 'Cinzel', serif;
}

/* Resolve card (hit/miss reveal) */
.cb-resolve-card {
  padding: 1rem;
  border: 2px solid var(--border-dim);
  border-radius: var(--radius);
  margin: 0.7rem 0;
  background: var(--bg-card2);
}
.cb-resolve-card--hit { border-color: var(--green-bright); background: rgba(39, 174, 96, 0.08); }
.cb-resolve-card--miss { border-color: var(--red-bright); background: rgba(192, 57, 43, 0.08); }
.cb-resolve-card--enemy { border-color: var(--red-bright); }
.cb-resolve-card--ability { border-color: var(--purple); background: rgba(142, 68, 173, 0.1); }
.cb-resolve-card__title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.cb-resolve-card__title--hit  { color: var(--green-bright); }
.cb-resolve-card__title--miss { color: var(--red-bright); }
.cb-resolve-card__text { color: var(--text); font-size: 0.95rem; }
.cb-resolve-dmg {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-dim);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cb-resolve-dmg__final {
  font-size: 1.1rem;
  color: var(--gold-light);
  font-weight: 700;
  margin-top: 0.3rem;
}
.cb-adjust-row {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.cb-adjust-row label { display: flex; gap: 0.3rem; align-items: center; color: var(--text-muted); }
.cb-adjust-row input {
  width: 80px;
  padding: 0.25rem 0.4rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--gold-light);
  font-weight: 700;
  text-align: center;
}

/* =========================================================================
   CAST / USE LIST (spell / ability / consumable)
   ========================================================================= */
.cb-cast-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 420px; overflow-y: auto; }
.cb-cast-item {
  padding: 0.5rem 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.cb-cast-item:hover { border-color: var(--gold); background: var(--bg-card); }
.cb-cast-item__name { font-family: 'Cinzel', serif; font-weight: 700; color: var(--gold-light); }
.cb-cast-item__tier {
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.cb-cast-item__desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* =========================================================================
   END MODAL (victory/defeat/manual)
   ========================================================================= */
.cb-end-hero {
  text-align: center;
  padding: 0.8rem;
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  color: var(--text);
}
.cb-end-hero--defeat { background: rgba(139, 26, 26, 0.12); border-color: var(--red); }
.cb-rewards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.cb-reward-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}
.cb-reward-row--empty { color: var(--text-muted); }
.cb-reward-row b { color: var(--gold-light); }
.cb-rewards--penalty .cb-reward-row b { color: var(--red-bright); }
.cb-loss { color: var(--red-bright); }
.cb-reward-items { padding: 0.5rem 0.7rem; background: var(--bg-card2); border: 1px solid var(--border-dim); border-radius: var(--radius); }
.cb-reward-items__title { font-weight: 700; color: var(--gold); margin-bottom: 0.3rem; }
.cb-reward-items ul { margin: 0; padding-left: 1.2rem; color: var(--text); }

.cb-end-warn {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid var(--red-bright);
  border-radius: var(--radius);
  color: #e8a49a;
  font-size: 0.9rem;
}

.cb-end-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cb-end-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.cb-end-summary b { color: var(--gold-light); }

.cb-end-choices { display: flex; flex-direction: column; gap: 0.6rem; }
.cb-end-choice {
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  font-family: 'Crimson Text', serif;
}
.cb-end-choice:hover { border-color: var(--gold); background: var(--bg-card); transform: translateY(-1px); }
.cb-end-choice--leave-apply { border-color: var(--gold-light); }
.cb-end-choice--leave-apply:hover { background: rgba(201, 162, 39, 0.08); }
.cb-end-choice__title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
}
.cb-end-choice__desc { font-size: 0.85rem; color: var(--text-muted); }

/* =========================================================================
   DETAIL PANEL (enemy detail in modal)
   ========================================================================= */
.cb-detail-race {
  --race-color: var(--border-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--race-color);
  margin-bottom: 0.5rem;
}
.cb-detail-desc {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.8rem;
}
.cb-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.cb-detail-stats b { color: var(--gold-light); }
.cb-detail-abilities, .cb-detail-effects { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.cb-detail-ability {
  padding: 0.5rem 0.7rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
}
.cb-detail-ability__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.cb-detail-ability__trig {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
}
.cb-detail-ability__desc { font-size: 0.88rem; color: var(--text-muted); }
.cb-detail-effect {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  align-items: center;
}
.cb-detail-effect__dur { font-size: 0.75rem; color: var(--text-muted); }
.cb-detail-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: rgba(201, 162, 39, 0.05);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}
.cb-detail-rewards b { color: var(--gold-light); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 900px) {
  .cb-page { padding: 1rem; }
  .cb-ribbon {
    grid-template-columns: 1fr 1fr;
  }
  .cb-ribbon__actions { grid-column: 1 / -1; justify-content: center; }
  .cb-enemies-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 600px) {
  .cb-ribbon { padding: 0.7rem; gap: 0.8rem; }
  .cb-ribbon__group { min-width: 60px; }
  .cb-ribbon__value { font-size: 1.4rem; }
  .cb-enemy-card__stats { grid-template-columns: repeat(3, 1fr); }
  .cb-hero-card__stats  { grid-template-columns: repeat(2, 1fr); }
  .cb-editor-row { grid-template-columns: 1fr; }
}

/* =========================================================================
   INLINE DICE DISPLAY (v modálech útoku / kouzla)
   ========================================================================= */
.cb-dice-display {
  margin: 0.6rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.cb-dice-faces {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.cb-die {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.6rem;
  color: var(--gold-light);
  transition: all 0.15s;
}
.cb-die--rolling {
  animation: cbDieSpin 0.4s ease-out;
  background: rgba(201,162,39,0.08);
  border-color: var(--gold-light);
  color: transparent;
}
.cb-die--revealed {
  background: rgba(201,162,39,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(201,162,39,0.3);
}
@keyframes cbDieSpin {
  0%  { transform: rotateY(0deg)   scale(0.7); opacity: 0.4; }
  50% { transform: rotateY(90deg)  scale(1.1); opacity: 0.9; }
  100%{ transform: rotateY(0deg)   scale(1);   opacity: 1;   }
}
.cb-dice-total {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-muted);
  min-height: 1.4rem;
}
.cb-dice-total--revealed {
  color: var(--gold-light);
  font-weight: 700;
}

/* =========================================================================
   KOUZLA — meta + cooldown
   ========================================================================= */
.cb-spell-info {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.cb-spell-cd {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  background: rgba(139,26,26,0.25);
  border: 1px solid rgba(231,76,60,0.35);
  border-radius: var(--radius);
  color: var(--red-bright, #e07070);
  margin-left: 0.4rem;
}
.cb-spell-cd--free {
  background: rgba(26,100,60,0.25);
  border-color: rgba(60,180,100,0.35);
  color: var(--green-bright, #70c080);
}
.cb-spell-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.cb-cast-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.cb-resolve-card--spell {
  border-color: rgba(142,68,173,0.5);
  background: rgba(142,68,173,0.08);
}
.cb-resolve-card__title--hit   { color: var(--green-bright); }
.cb-resolve-card__title--miss  { color: var(--red-bright, #e74c3c); }

/* =========================================================================
   ENEMY ACTION CHOICE
   ========================================================================= */
.cb-action-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0.75rem;
}
.cb-enemy-action-choice {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cb-enemy-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  text-align: left;
}
.cb-enemy-action-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cb-enemy-action-btn__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-weight: 400;
}
.cb-enemy-action-btn__cd {
  font-size: 0.78rem;
  color: var(--red-bright, #e07070);
  margin-left: 0.5rem;
}

/* =========================================================================
   DISABLED ACTION BAR BUTTONS
   ========================================================================= */
.cb-btn--disabled,
button.cb-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
