/* =========================================================================
   Karta postavy – Character Sheet Styles (V2)
   ========================================================================= */

/* ---- Layout ---- */
.cs-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.cs-header__title {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.8rem;
  margin: 0;
}

.cs-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Combat link button (prominent on charsheet → combat) ---- */
.btn--combat,
.cs-combat-link {
  background: linear-gradient(135deg, #8b1a1a 0%, #c0392b 55%, #8b1a1a 100%);
  color: #fff3d4;
  border: 1px solid #d4a84f;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.4) inset, 0 3px 10px rgba(139, 26, 26, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}
.btn--combat:hover,
.cs-combat-link:hover {
  background: linear-gradient(135deg, #a0211f 0%, #e74c3c 55%, #a0211f 100%);
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px rgba(240, 208, 92, 0.6) inset, 0 4px 18px rgba(231, 76, 60, 0.55);
  transform: translateY(-1px);
}
.cs-combat-link__icon {
  font-size: 1.1rem;
  color: var(--gold-light);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
}
.cs-combat-link__label {
  font-weight: 700;
}

/* ---- Empty State ---- */
.cs-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
}

.cs-empty__icon { font-size: 4rem; margin-bottom: 1rem; }
.cs-empty__title {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.cs-empty__text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.cs-empty__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Sections ---- */
.cs-section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1rem;
  scroll-margin-top: 75px;
}

.cs-section__title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
}

/* ================================================================
   IDENTITY – Portrait left + name/badges right + level/xp/gold below
   ================================================================ */
.cs-identity {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Hlavní oblast: portrét vlevo, pravá strana sloupcově */
.cs-identity__main {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

/* Pravá strana: jméno + badges */
.cs-identity__right {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  justify-content: space-between;
}

/* Jméno — přes celou šířku */
.cs-identity__name {
  flex: 1;
}

.cs-identity__name label {
  display: block;
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.cs-identity__name input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--gold-light);
  padding: 0.55rem 0.75rem;
  font-size: 1.25rem;
  font-family: 'Cinzel', serif;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.cs-identity__name input:focus {
  outline: none;
  border-color: var(--gold);
}

/* Badges: rasa / povolání / božstvo */
.cs-identity__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.cs-identity__badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  min-width: 130px;
  flex: 1;
  max-width: 260px;
  transition: border-color var(--transition);
}

.cs-identity__badge.cs-clickable:hover {
  border-color: rgba(201,162,39,0.4);
}

.cs-identity__badge label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.cs-identity__badge span {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-identity__img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-dim);
  background: var(--bg-card);
  flex-shrink: 0;
}

/* Řádek 3: level / xp / gold */
.cs-identity__row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: stretch;
  padding-top: 0.6rem;
  margin-top: 0.2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}

.cs-info-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.5rem 1.2rem;
  min-width: 160px;
  flex: 1;
  max-width: 260px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cs-info-tile:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.1);
}

.cs-info-tile label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.cs-info-tile__value-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cs-info-tile__value {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
  min-width: 1.8rem;
  text-align: center;
  line-height: 1.2;
}

.cs-pm-btn--tile {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-pm-btn--tile:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cs-input-num.cs-input-num--tile,
.cs-input-num--tile {
  width: 130px;
  max-width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--gold-light);
  padding: 0.3rem 0.4rem;
  font-size: 1.1rem;
  font-family: 'Cinzel', serif;
  text-align: center;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}

.cs-input-num--tile::-webkit-outer-spin-button,
.cs-input-num--tile::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cs-input-num--tile:focus {
  outline: none;
  border-color: var(--gold);
}

/* ================================================================
   UNIVERSAL +/− CONTROLS   (.cs-pm-ctrl / .cs-pm-btn / .cs-pm-val)
   ================================================================ */
.cs-pm-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cs-pm-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-pm-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cs-pm-val {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold-light);
  min-width: 1.5rem;
  text-align: center;
  background: none;
  border: none;
  padding: 0 0.3rem;
}

/* Large variant (HP current) */
.cs-pm-ctrl--lg .cs-pm-btn {
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
}

/* Tiny variant (bonus rows) */
.cs-pm-ctrl--tiny {
  gap: 0.15rem;
}

.cs-pm-ctrl--tiny .cs-pm-btn,
.cs-pm-btn--xs {
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: var(--bg-card);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-pm-btn--xs:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cs-pm-val--xs {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold-light);
  min-width: 1.2rem;
  text-align: center;
}

/* ---- Input Numbers ---- */
.cs-input-num {
  width: 60px;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
  font-family: 'Crimson Text', serif;
  text-align: center;
  transition: border-color var(--transition);
}

.cs-input-num:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-input-num--wide { width: 90px; }
.cs-input-num--lg {
  width: 70px;
  font-size: 1.4rem;
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  padding: 0.4rem;
}
.cs-input-num--sm {
  width: 50px;
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
}

/* Hide number input spinners */
.cs-input-num::-webkit-outer-spin-button,
.cs-input-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cs-input-num { -moz-appearance: textfield; }

/* ================================================================
   VITALS — subsection inside cs-combat
   ================================================================ */
.cs-vitals {
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border-dim);
}
.cs-vitals__title {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0 0 .65rem 0;
}

/* ================================================================
   VITALS GRID  –  HP / AC / DR / Perception
   ================================================================ */
.cs-vitals-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.cs-vitals-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.cs-vital-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.8rem 0.6rem;
  text-align: center;
  cursor: default;            /* card itself not clickable; zones are */
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cs-vital-card:hover {
  border-color: rgba(201, 162, 39, 0.25);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.06);
}

/* Title zone (h3) — opens rules explanation */
.cs-vital-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.4rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: opacity var(--transition);
}
.cs-vital-card h3:hover { opacity: 0.75; }

/* Value zone — opens calculation detail */
.cs-vital-main.cs-clickable {
  border-radius: 4px;
  transition: background var(--transition);
  padding: 0.15rem 0.25rem;
  margin: 0 -0.25rem 0.35rem;
}
.cs-vital-main.cs-clickable:hover {
  background: rgba(201, 162, 39, 0.06);
  color: inherit !important;
}

.cs-vital-card--hp h3   { color: #c0392b; }
.cs-vital-card--ac h3   { color: #2980b9; }
.cs-vital-card--dr h3   { color: #27ae60; }
.cs-vital-card--perc h3 { color: #e67e22; }
.cs-vital-card--dmg h3  { color: #9b59b6; }

/* Main big value area */
.cs-vital-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.cs-vital-big {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold-light);
  line-height: 1.2;
  min-width: 1.5rem;
}

.cs-vital-big--dim {
  color: var(--text-dim);
  font-size: 1.4rem;
}

.cs-vital-sep {
  font-size: 1.4rem;
  color: var(--text-dim);
}

/* Centered bonus control (used everywhere) */
.cs-bonus-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.cs-bonus-centered--row {
  /* Inline row variant for tables */
  display: inline-flex;
}

.cs-bonus-centered__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.4rem;
}

.cs-bonus-centered__label {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1;
}

.cs-bonus-centered__val {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold-light);
  min-width: 1.2rem;
  text-align: center;
  line-height: 1.2;
}

/* Vital bonus row */
.cs-vital-bonus-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
}

.cs-vital-sub__equip {
  font-size: 0.65rem;
  color: #27ae60;
  margin-left: 0.2rem;
}

/* ---- Damage section inside defense card ---- */
.cs-dmg-section {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cs-dmg-section__title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #9b59b6;
}

.cs-combat-table--damage .cs-combat-val {
  color: #c39bd3;
}

/* Combat table bonus cell alignment */
.cs-combat-bonus-cell {
  text-align: center;
}

/* ================================================================
   COMBAT GRID  –  Attack + Defense (2 columns)
   ================================================================ */
.cs-combat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cs-combat-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.8rem;
}

.cs-combat-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cs-combat-card--attack h3  { color: #c0392b; }
.cs-combat-card--defense h3 { color: #2980b9; }

.cs-combat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cs-combat-table th {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--border-dim);
}

.cs-combat-table th:first-child { text-align: left; }

.cs-combat-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cs-combat-table tr:last-child td { border-bottom: none; }

.cs-combat-label {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.cs-combat-val {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--gold);
}

/* Magie — span přes oba útočné sloupce, subtilní odlišení */
.cs-combat-val--magic {
  color: #9b59b6;
  font-style: italic;
}

/* ================================================================
   STATS GRID  –  DnD-styled attribute cards
   ================================================================ */
.cs-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* Subgrid row alignment — 4 shared rows: header, body, edit, bonus */
  grid-template-rows: auto auto auto auto;
  column-gap: 0.6rem;
  row-gap: 0;
  align-items: stretch;
}

.cs-stat-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg, 8px);
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  /* Subgrid: each card spans all 4 row tracks of the parent */
  grid-row: span 4;
  display: grid;
  grid-template-rows: subgrid;
}

.cs-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse at top center, rgba(201, 162, 39, 0.04) 0%, transparent 70%);
}

.cs-stat-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.15);
}

.cs-stat-card--hybrid {
  border-color: rgba(201, 162, 39, 0.5);
  box-shadow: inset 0 0 12px rgba(201, 162, 39, 0.05);
}

.cs-stat-card__header {
  padding: 0.45rem 0.3rem;
  border-bottom: 2px solid rgba(201, 162, 39, 0.12);
  background: rgba(201, 162, 39, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cs-stat-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cs-stat-card__hybrid {
  font-size: 0.58rem;
  color: var(--gold);
  margin-top: 0.1rem;
}

.cs-stat-card__body {
  padding: 0.6rem 0.3rem;
}

.cs-stat-card__value {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1.2;
  text-shadow: 0 0 8px rgba(201, 162, 39, 0.2);
}

.cs-stat-card__roll {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.cs-stat-card__bonus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
  padding: 0.35rem 0.2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.cs-stat-card__bonus label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cs-stat-card__deity-badge {
  font-size: 0.65rem;
  color: #6fa8dc;
  margin-top: 0.2rem;
}

.cs-stat-card__edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3rem 0.2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.1);
  background: rgba(201, 162, 39, 0.03);
}

/* ================================================================
   SKILLS GRID
   ================================================================ */
.cs-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
}

.cs-skill-group-header {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.4rem 0.15rem;
  margin-top: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cs-skill-group-header:first-child { margin-top: 0; }

.cs-skill-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cs-skill-row:last-child { border-bottom: none; }

.cs-skill-row--hybrid {
  background: rgba(201, 162, 39, 0.03);
  border-left: 2px solid rgba(201, 162, 39, 0.3);
  padding-left: calc(0.4rem - 2px);
}

.cs-skill__name {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-skill__tier {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.72rem;
  text-align: right;
  min-width: 65px;
}

.cs-skill__dice {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 44px;
  text-align: right;
}

.cs-skill__tier-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(201, 162, 39, 0.05);
  border-radius: 3px;
  padding: 0.1rem 0.2rem;
}

.cs-skill__tier-val {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--gold-light);
  min-width: 1rem;
  text-align: center;
}

.cs-skill__bonus-input { width: 40px; }

/* ================================================================
   ABILITIES
   ================================================================ */
.cs-abilities-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cs-ability-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  position: relative;
}

.cs-ability-card--innate { border-color: rgba(93, 187, 122, 0.3); }
.cs-ability-card--level  { border-color: rgba(201, 162, 39, 0.3); }

.cs-ability-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.cs-ability-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold-light);
}

.cs-ability-card--innate .cs-ability-card__name { color: #5dbb7a; }

.cs-ability-card__source {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.cs-ability-card__desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.cs-ability-card__remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(192, 57, 43, 0.3);
  background: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-ability-card__remove:hover {
  border-color: #c0392b;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.1);
}

/* ================================================================
   SPELLS
   ================================================================ */
.cs-spells-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cs-spell-card {
  background: var(--bg-deep);
  border: 1px solid rgba(140, 90, 200, 0.25);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  position: relative;
}

.cs-spell-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.cs-spell-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: #b080e0;
}

.cs-spell-card__tier {
  font-size: 0.6rem;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  background: rgba(140, 90, 200, 0.15);
  color: rgba(176, 128, 224, 0.8);
}

.cs-spell-card__desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.cs-spell-card__meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cs-spell-card__remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(140, 90, 200, 0.3);
  background: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-spell-card__remove:hover {
  border-color: #8e44ad;
  color: #8e44ad;
  background: rgba(142, 68, 173, 0.1);
}

/* Spell slot info */
.cs-spell-slots {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.6rem;
  background: rgba(140, 90, 200, 0.06);
  border: 1px solid rgba(140, 90, 200, 0.15);
  border-radius: var(--radius);
}

.cs-spell-slots strong {
  color: #b080e0;
}

/* Section header with budget subtitle */
.cs-section__header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0;
}

.cs-section__header .cs-section__title {
  margin-bottom: 0;
}

.cs-budget-subtitle {
  font-size: 0.75rem;
  font-family: var(--ff-body);
  letter-spacing: 0.02em;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.cs-budget-subtitle:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ================================================================
   QUESTS
   ================================================================ */
.cs-quests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cs-quest-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  position: relative;
}

.cs-quest-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
}

.cs-quest-card__name input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-dim);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  transition: border-color var(--transition);
}

.cs-quest-card__name input:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-quest-card__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.cs-quest-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cs-quest-field--wide { grid-column: 1 / -1; }

.cs-quest-field label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-quest-field input,
.cs-quest-field textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  transition: border-color var(--transition);
}

.cs-quest-field textarea {
  resize: vertical;
  min-height: 40px;
}

.cs-quest-field input:focus,
.cs-quest-field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-quest-card__remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(192, 57, 43, 0.3);
  background: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-quest-card__remove:hover {
  border-color: #c0392b;
  color: #c0392b;
}

/* ================================================================
   INVENTORY / PAPERDOLL
   ================================================================ */
.cs-inventory-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cs-paperdoll {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.cs-paperdoll__figure {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.cs-slot {
  background: var(--bg-card);
  border: 1px dashed var(--border-dim);
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.cs-slot:hover {
  border-color: var(--gold);
  border-style: solid;
  background: rgba(201, 162, 39, 0.05);
}

.cs-slot--filled {
  border-style: solid;
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.03);
}

.cs-slot__icon { font-size: 1.1rem; }
.cs-slot__label {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cs-slot__name {
  font-size: 0.65rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.cs-slot--filled .cs-slot__name { color: var(--gold-light); }

/* Paperdoll grid placement - see 3-col grid below */

/* Ring slots: compact */
.cs-slot--ring {
  min-height: 45px;
  padding: 0.3rem;
}

/* Paperdoll grid placement (3-col for 6 ring slots) */
.cs-slot--helmet    { grid-column: 1 / -1; }
.cs-slot--necklace  { grid-column: 1 / -1; }
.cs-slot--armor     { grid-column: 1 / -1; }
.cs-slot--weapon1   { grid-column: 1 / 2; }
.cs-slot--weapon2   { grid-column: 2 / 4; }
.cs-slot--secondary { grid-column: 1 / -1; }

/* Inventory list */
.cs-inventory-list { min-height: 200px; }

.cs-inventory-list h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-dim);
}

.cs-item-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
  position: relative;
}

.cs-item-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.cs-item-card__type {
  font-size: 0.6rem;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.1);
  color: var(--gold);
}

.cs-item-card__name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  margin-right: 0.5rem;
  transition: border-color var(--transition);
}

.cs-item-card__name-input:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-item-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.cs-item-stat {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.cs-item-stat label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cs-item-stat input {
  width: 50px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.15rem 0.3rem;
  text-align: center;
}

.cs-item-stat input:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-item-stat select {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.15rem 0.3rem;
}

.cs-item-stat select:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-item-stat--wide {
  flex-basis: 100%;
}

/* Weapon/armor/shield category picker — compact inline */
.cs-item-stat--weapontype,
.cs-item-stat--cat {
  gap: 0.3rem;
}
.cs-item-stat--weapontype .hoe-select,
.cs-item-stat--cat .hoe-select {
  flex: 0 0 auto;
  width: 140px;
  max-width: 140px;
}

.cs-item-stat--missing select,
.cs-item-stat--missing .hoe-select__trigger {
  border-color: #e07070;
  background: rgba(224, 112, 112, 0.08);
}

.cs-item-stat--missing label {
  color: #e07070;
}

.cs-item-card__effect { margin-top: 0.3rem; }

.cs-item-card__effect textarea,
.cs-item-card__note textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  resize: vertical;
  min-height: 30px;
}

.cs-item-card__effect textarea:focus,
.cs-item-card__note textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.cs-item-card__note { margin-top: 0.4rem; }

/* -----------------------------------------------------------------------
   Item card — new layout
   Topbar: [Typ] ...................................... [Effect pills] [+ Přidat efekt]
   Stats:  numeric inputs (OČ, bonusy, očarování...)
   Note:   free-form flavor textarea
----------------------------------------------------------------------- */
.cs-item-card--equipped {
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.12), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.cs-item-card__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.2rem 0 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.14);
  flex-wrap: wrap;
}

.cs-item-card__topbar-spacer { flex: 0 0 auto; }

.cs-item-card__effects-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.cs-item-effects-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.cs-item-effect-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem 0.2rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: 'Crimson Text', serif;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(20, 14, 6, 0.6);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  max-width: 100%;
  user-select: none;
}

.cs-item-effect-pill:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cs-item-effect-pill:active { transform: translateY(1px); }

.cs-item-effect-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.cs-item-effect-pill__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.cs-item-effect-pill__text b {
  color: #fff4d0;
  font-weight: 600;
}

.cs-item-effect-pill__remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 50%;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.cs-item-effect-pill__remove:hover {
  color: #f3b5ad;
  background: rgba(192, 57, 43, 0.2);
}

/* Variants */
.cs-item-effect-pill--buff {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(76, 175, 80, 0.1);
}
.cs-item-effect-pill--buff:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.18);
}
.cs-item-effect-pill--buff .cs-item-effect-pill__text b { color: #b7e7b7; }

.cs-item-effect-pill--debuff {
  border-color: rgba(224, 122, 60, 0.4);
  background: rgba(224, 122, 60, 0.1);
}
.cs-item-effect-pill--debuff:hover {
  border-color: #e07a3c;
  background: rgba(224, 122, 60, 0.18);
}
.cs-item-effect-pill--debuff .cs-item-effect-pill__text b { color: #ffd2b8; }

.cs-item-effect-pill--custom {
  border-color: rgba(142, 68, 173, 0.45);
  background: rgba(142, 68, 173, 0.1);
}
.cs-item-effect-pill--custom:hover {
  border-color: #b97dd8;
  background: rgba(142, 68, 173, 0.2);
}

/* "Přidat efekt" button */
.cs-item-card__effect-add {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: 1px dashed rgba(212, 175, 55, 0.4);
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  line-height: 1;
}

.cs-item-card__effect-add:hover {
  background: rgba(201, 162, 39, 0.12);
  border-color: var(--gold);
  border-style: solid;
  color: #fff4d0;
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.18);
}

.cs-item-card__effect-add:active { transform: translateY(1px); }

.cs-item-card__effect-add-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* Effect form help text (shown only when picker is item-scoped) */
.cs-effect-form-help {
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-left: 3px solid var(--gold);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: 'Crimson Text', serif;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.cs-item-card__equip {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.cs-item-card__equip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cs-item-card__equip--active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cs-item-card__remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(192, 57, 43, 0.3);
  background: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-item-card__remove:hover {
  border-color: #c0392b;
  color: #c0392b;
}

.cs-item-card__actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.cs-inventory-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

.cs-select {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.3rem 0.5rem;
  font-family: 'Crimson Text', serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.cs-select:focus {
  outline: none;
  border-color: var(--gold);
}

/* ================================================================
   EFFECTS (Buffs / Debuffs)
   ================================================================ */
.cs-effects-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cs-effects-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.6rem 0.4rem;
  text-align: center;
}

.cs-effect-card {
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.7rem;
  align-items: center;
  border: 1px solid var(--border-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cs-effect-card:hover {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.cs-effect-card--buff {
  border-color: rgba(39, 174, 96, 0.45);
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.06), var(--bg-deep) 60%);
}

.cs-effect-card--debuff {
  border-color: rgba(192, 57, 43, 0.45);
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.06), var(--bg-deep) 60%);
}

.cs-effect-card--custom {
  border-color: rgba(212, 175, 55, 0.45);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.06), var(--bg-deep) 60%);
}

.cs-effect-card__icon {
  font-size: 1.4rem;
  width: 2rem;
  text-align: center;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.cs-effect-card__main {
  min-width: 0;
}

.cs-effect-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cs-effect-card__name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 0.95rem;
}

.cs-effect-card__sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.cs-effect-card__dur {
  color: var(--text-muted);
}

.cs-effect-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  border: 1px solid;
}

.cs-effect-badge--buff {
  color: #5dd49a;
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.4);
}

.cs-effect-badge--debuff {
  color: #f08074;
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.4);
}

.cs-effect-badge--custom {
  color: #e6c66a;
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.45);
}

.cs-effect-card__edit,
.cs-effect-card__remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-effect-card__edit:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cs-effect-card__remove:hover {
  border-color: #c0392b;
  color: #c0392b;
}

/* ========== Effect picker modal ========== */
.cs-effect-picker-help {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.4rem 0 0.9rem;
  padding: 0.5rem 0.7rem;
  background: rgba(201, 162, 39, 0.05);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}

.cs-effect-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.4rem;
}

.cs-effect-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.cs-effect-picker-item:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
}

.cs-effect-picker-item__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.cs-effect-picker-item__name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 0.82rem;
}

.cs-effect-picker-item__sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  font-style: italic;
}

.cs-effect-picker-custom {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: rgba(212, 175, 55, 0.04);
  border: 1px dashed rgba(212, 175, 55, 0.45);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 0.9rem;
}

.cs-effect-picker-custom:hover {
  background: rgba(212, 175, 55, 0.08);
  border-style: solid;
}

.cs-effect-picker-custom .cs-effect-picker-item__icon {
  font-size: 1.5rem;
}

/* "Předgenerované" section label above preset groups */
.cs-effect-picker-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.2rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
}

/* Colored dot used as icon for stat catalog entries in the picker */
.cs-stat-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 6px -1px currentColor;
  vertical-align: middle;
}
.cs-effect-picker-item .cs-stat-dot {
  width: 16px;
  height: 16px;
}
.cs-effect-form-header .cs-stat-dot {
  width: 20px;
  height: 20px;
}
.cs-effect-card__icon .cs-stat-dot {
  width: 18px;
  height: 18px;
}

/* Inline icons used in sheet vital cards & combat table labels */
.cs-vital-icon {
  margin-right: 0.3rem;
  display: inline-block;
  transform: translateY(-1px);
}
.cs-combat-icon {
  display: inline-block;
  width: 1.2em;
  margin-right: 0.35rem;
  text-align: center;
  opacity: 0.9;
}

/* Effect form (after picking a catalog entry) */
.cs-effect-form-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  background: rgba(201, 162, 39, 0.07);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  margin-bottom: 0.8rem;
}

.cs-effect-form-header__icon {
  font-size: 1.6rem;
}

.cs-effect-form-header__name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1rem;
}

.cs-effect-form-header__group {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cs-effect-form-warn {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: #e6c66a;
  margin-bottom: 0.8rem;
}

.cs-effect-value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cs-effect-value-row input {
  flex: 0 0 100px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  -moz-appearance: textfield;
}

.cs-effect-value-row input::-webkit-outer-spin-button,
.cs-effect-value-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cs-effect-value-preview {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
}

.cs-effect-value-preview--buff {
  color: #5dd49a;
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.4);
}

.cs-effect-value-preview--debuff {
  color: #f08074;
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.4);
}

.cs-effect-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ================================================================
   LEVEL UP PANEL
   ================================================================ */
.cs-levelup-info {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1rem;
  animation: cs-glow 2s infinite alternate;
}

.cs-levelup-info h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

@keyframes cs-glow {
  from { box-shadow: 0 0 8px rgba(201, 162, 39, 0.2); }
  to   { box-shadow: 0 0 20px rgba(201, 162, 39, 0.4); }
}

.cs-levelup-item {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cs-levelup-item:last-child { border-bottom: none; }

.cs-levelup-item__label {
  color: var(--gold);
  font-weight: 600;
}

/* ---- Add Button ---- */
.cs-add-btn { margin-top: 0.75rem; }

/* ================================================================
   MODAL
   ================================================================ */
.cs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cs-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.cs-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--transition);
  padding: 0;
  line-height: 1;
}

.cs-modal__close:hover { color: var(--gold); }

.cs-modal h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.cs-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 50vh;
  overflow-y: auto;
}

.cs-modal-item {
  padding: 0.5rem 0.7rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.cs-modal-item:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.05);
}

.cs-modal-item__name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 0.85rem;
}

.cs-modal-item__desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

/* Level-based grouping in modals */
.cs-modal-level-group {
  margin-bottom: 0.8rem;
}

.cs-modal-level-group--locked {
  opacity: 0.7;
}

.cs-modal-level-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
}

.cs-modal-level-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold-light);
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.cs-modal-level-warn {
  font-size: 0.7rem;
  color: #e07070;
  background: rgba(224, 112, 112, 0.1);
  border: 1px solid rgba(224, 112, 112, 0.3);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  animation: cs-glow-warn 2s infinite alternate;
}

@keyframes cs-glow-warn {
  from { box-shadow: 0 0 4px rgba(224, 112, 112, 0.2); }
  to   { box-shadow: 0 0 12px rgba(224, 112, 112, 0.4); }
}

.cs-modal-level-count {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.cs-modal-item--overlevel {
  border-color: rgba(224, 112, 112, 0.3) !important;
  background: rgba(224, 112, 112, 0.03) !important;
}

.cs-overlevel-badge {
  font-size: 0.6rem;
  color: #e07070;
  background: rgba(224, 112, 112, 0.15);
  border: 1px solid rgba(224, 112, 112, 0.3);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.3rem;
}

/* Ability/spell cards with overlevel warning */
.cs-ability-card--overlevel {
  border-color: rgba(224, 112, 112, 0.4) !important;
  background: rgba(224, 112, 112, 0.04) !important;
}

/* Custom Ability / Spell Form in modal */
.cs-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cs-modal-form label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-modal-form input,
.cs-modal-form textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}

.cs-modal-form textarea {
  resize: vertical;
  min-height: 60px;
}

.cs-modal-form input:focus,
.cs-modal-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .cs-vitals-grid,
  .cs-vitals-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cs-layout { padding: 1rem; }

  .cs-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cs-header__title { font-size: 1.3rem; }

  .cs-identity__row1 { flex-direction: column; }
  .cs-identity__row2 { flex-direction: column; }

  .cs-identity__badge {
    width: 100%;
  }

  .cs-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    /* Reset subgrid — karty se zalomí, subgrid by kollidoval s wrap */
    grid-template-rows: unset;
  }
  .cs-stats-grid .cs-stat-card {
    grid-row: unset;
    grid-template-rows: unset;
    display: block;
  }

  .cs-combat-grid {
    grid-template-columns: 1fr;
  }

  .cs-vitals-grid,
  .cs-vitals-grid--4 {
    grid-template-columns: 1fr 1fr;
  }

  .cs-info-tile {
    min-width: 80px;
    padding: 0.4rem 0.6rem;
  }

  .cs-inventory-layout {
    grid-template-columns: 1fr;
  }

  .cs-skills-grid {
    grid-template-columns: 1fr;
  }

  .cs-effect-card {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

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

@media (max-width: 480px) {
  .cs-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: unset;
  }
  .cs-stats-grid .cs-stat-card {
    grid-row: unset;
    grid-template-rows: unset;
    display: block;
  }

  .cs-vitals-grid {
    grid-template-columns: 1fr;
  }

  .cs-info-item { width: 100%; }

  .cs-vital-big { font-size: 1.4rem; }
  .cs-vital-big--dim { font-size: 1.1rem; }
}

/* ---- Clickable elements ---- */
.cs-clickable {
  cursor: pointer;
  transition: color var(--transition);
}

.cs-clickable:hover {
  color: var(--gold-light) !important;
}

.cs-identity__badge.cs-clickable:hover,
.cs-identity__badge:hover {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.15);
}

.cs-ability-card.cs-clickable:hover,
.cs-spell-card.cs-clickable:hover {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.1);
}

/* ================================================================
   CHARACTER PORTRAIT
   ================================================================ */

.cs-portrait {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 2px solid var(--border-dim);
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.cs-portrait:hover {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.25);
}

.cs-portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.cs-portrait__placeholder {
  font-size: 1.4rem;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.cs-portrait:hover .cs-portrait__placeholder {
  opacity: 0.6;
}

/* Velký portrét v identity sekci — přes oba horní řádky */
.cs-portrait--large {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  flex-shrink: 0;
  align-self: stretch; /* roztáhne se na výšku rodičovského flex kontejneru */
}

.cs-portrait--large .cs-portrait__placeholder {
  font-size: 2.4rem;
}

/* Upload overlay hint */
.cs-portrait--large::after {
  content: '✎';
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 0.75rem;
  color: rgba(201,162,39,0.55);
  transition: color 0.15s;
}
.cs-portrait--large:hover::after { color: var(--gold); }

/* ================================================================
   HP RESET BUTTON
   ================================================================ */

.cs-hp-reset-btn {
  background: none;
  border: 1px solid rgba(76, 175, 80, 0.25);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 1rem;
  color: rgba(76, 175, 80, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.5rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cs-hp-reset-btn:hover {
  color: #4caf50;
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.2);
  transform: rotate(-180deg);
}

.cs-hp-reset-btn:active {
  transform: rotate(-360deg);
}

/* ================================================================
   DRAG & DROP INVENTORY
   ================================================================ */

.cs-item-card__drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 0.9rem;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s;
  user-select: none;
  flex-shrink: 0;
  padding: 0 0.2rem;
  line-height: 1;
}

.cs-item-card:hover .cs-item-card__drag-handle {
  opacity: 0.7;
}

.cs-item-card__drag-handle:hover {
  opacity: 1 !important;
  color: var(--gold);
  cursor: grab;
}

.cs-item-card--dragging {
  opacity: 0.4;
  border-style: dashed;
  transform: rotate(1deg);
}

.cs-item-card--dragover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.3), inset 0 0 0 1px rgba(201, 162, 39, 0.15);
}

/* Smooth reflow animation */
.cs-item-card {
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

/* ================================================================
   DICE ROLLER
   ================================================================ */

.cs-dice-section {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.cs-dice-roller {
  background: linear-gradient(135deg, rgba(18, 11, 5, 0.95), rgba(30, 20, 8, 0.9));
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  position: relative;
  overflow: hidden;
}

/* Subtle gold accent line on top */
.cs-dice-roller::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

.cs-dice-roller__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cs-dice-roller__title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.cs-dice-icon {
  font-size: 1rem;
  margin-right: 0.2rem;
}

/* Quick-pick buttons (1k ... 6k) */
.cs-dice-roller__quick-pick {
  display: flex;
  gap: 0.25rem;
}

.cs-dice-quick-btn {
  background: rgba(201, 162, 39, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 32px;
  text-align: center;
}

.cs-dice-quick-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 39, 0.12);
}

.cs-dice-quick-btn--active {
  border-color: var(--gold);
  color: #fff4d0;
  background: rgba(201, 162, 39, 0.2);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.25);
}

/* Roll button */
.cs-dice-roll-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.08));
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}

.cs-dice-roll-btn:hover {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.35), rgba(201, 162, 39, 0.15));
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.3);
  color: #fff4d0;
}

.cs-dice-roll-btn:active { transform: scale(0.97); }

.cs-dice-roll-btn__icon {
  font-size: 1.1rem;
  transition: transform 0.3s;
}

.cs-dice-roll-btn--rolling .cs-dice-roll-btn__icon {
  animation: dice-spin 0.4s ease-in-out;
}

@keyframes dice-spin {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(120deg) scale(1.2); }
  50%  { transform: rotate(240deg) scale(1); }
  75%  { transform: rotate(330deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Context bar (shown when rolling for a specific thing) */
.cs-dice-roller__context {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: rgba(201, 162, 39, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  font-size: 0.78rem;
}

.cs-dice-roller__context.cs-dice-context--active {
  display: flex;
}

.cs-dice-context-label {
  color: var(--text);
  font-family: 'Crimson Text', serif;
}

.cs-dice-context-bonus {
  color: var(--gold);
  font-weight: 700;
  font-family: 'Cinzel', serif;
}

.cs-dice-context-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  margin-left: auto;
  transition: color 0.12s;
}

.cs-dice-context-clear:hover { color: #e07070; }

/* Result area */
.cs-dice-roller__result {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.cs-dice-individual {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.5rem;
  min-height: 44px;
}

/* Individual die */
.cs-die {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 2px solid rgba(212, 175, 55, 0.35);
  background: rgba(18, 11, 5, 0.9);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text);
  user-select: none;
}

.cs-die--rolling {
  animation: die-tumble 0.6s ease-in-out infinite;
  color: transparent;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(18, 11, 5, 0.9));
}

.cs-die--revealed {
  animation: die-pop 0.25s ease-out forwards;
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.2);
}

/* Color-code high/low */
.cs-die--revealed[data-val="1"] { color: #e07070; border-color: rgba(224, 112, 112, 0.5); box-shadow: 0 0 8px rgba(224, 112, 112, 0.15); }
.cs-die--revealed[data-val="6"] { color: #b7e7b7; border-color: rgba(76, 175, 80, 0.5); box-shadow: 0 0 12px rgba(76, 175, 80, 0.2); }

@keyframes die-tumble {
  0%   { transform: rotate(0deg)   scale(0.9); opacity: 0.4; }
  25%  { transform: rotate(90deg)  scale(1);   opacity: 0.7; }
  50%  { transform: rotate(180deg) scale(0.9); opacity: 0.4; }
  75%  { transform: rotate(270deg) scale(1);   opacity: 0.7; }
  100% { transform: rotate(360deg) scale(0.9); opacity: 0.4; }
}

@keyframes die-pop {
  0%   { transform: scale(0.5) rotate(20deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Total row */
.cs-dice-total-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cs-dice-total-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.cs-dice-total-val {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(4px);
}

.cs-dice-total-val--revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Small dice roll button in detail panels */
.cs-dice-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(201, 162, 39, 0.08);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
  margin-left: 0.3rem;
  padding: 0;
  line-height: 1;
}

.cs-dice-detail-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.2);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
  transform: scale(1.1);
}

.cs-dice-detail-btn:active { transform: scale(0.95); }

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ================================================================
   INVENTORY HEADER & SORT TOOLBAR
   ================================================================ */
.cs-inventory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-dim);
  flex-wrap: wrap;
}

.cs-inventory-header h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 0.85rem;
  margin: 0;
  padding: 0;
  border: none;
  flex-shrink: 0;
}

/* Override the generic h3 rule inside cs-inventory-list since header now owns the title */
.cs-inventory-list > h3 { display: none; }

.cs-inventory-sort {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.cs-inventory-sort__label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  margin-right: 0.1rem;
}

.cs-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-dim);
  background: var(--bg-deep);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.cs-sort-btn:hover {
  border-color: rgba(201, 162, 39, 0.5);
  color: var(--gold);
  background: rgba(201, 162, 39, 0.07);
}

.cs-sort-btn--active {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.2);
}

/* ================================================================
   INVENTORY ITEM META ROW (price + order number)
   ================================================================ */
.cs-item-card__meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.cs-item-meta-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cs-item-meta-field label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cs-item-meta-field input {
  width: 52px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 0.1rem 0.3rem;
  text-align: center;
  font-family: 'Crimson Text', serif;
  transition: border-color 0.15s, color 0.15s;
}

.cs-item-meta-field input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--text);
}

.cs-item-meta-field--price input {
  width: 70px;
}

/* ================================================================
   PAPERDOLL SLOT — DROP TARGET HIGHLIGHT
   ================================================================ */
.cs-slot--drop-target {
  border-color: var(--gold) !important;
  border-style: solid !important;
  background: rgba(201, 162, 39, 0.1) !important;
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.35), inset 0 0 0 1px rgba(201, 162, 39, 0.2) !important;
  transform: scale(1.03);
  transition: all 0.12s !important;
}

.cs-slot--drop-incompatible {
  border-color: rgba(192, 57, 43, 0.5) !important;
  background: rgba(192, 57, 43, 0.06) !important;
}

/* ================================================================
   INVENTORY CARD — REDESIGN
   Nová struktura:
     .cs-item-card
       .cs-item-card__header   ← grip | badge | name | actions
       .cs-item-card__body
         .cs-item-stats-row    ← category + numeric fields
         .cs-item-meta-row     ← Č. + Cena (+ Počet)
         .cs-item-effects-row  ← efekty / add button
         .cs-item-note         ← textarea
   ================================================================ */

/* Přepsání starých pravidel cs-item-card__header aby seděla s novým kódem */
.cs-item-card__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cs-item-grip {
  color: var(--text-dim);
  font-size: 1rem;
  cursor: grab;
  opacity: 0.35;
  flex-shrink: 0;
  user-select: none;
  padding: 0 0.15rem;
  transition: opacity 0.12s, color 0.12s;
}
.cs-item-card:hover .cs-item-grip { opacity: 0.65; }
.cs-item-grip:hover { opacity: 1 !important; color: var(--gold); }
.cs-item-grip:active { cursor: grabbing; }

/* Type badge */
.cs-item-badge {
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}
/* Type badge colors — každý typ má unikátní barvu.
   Zbroj / štít / helma: různé odstíny modré.
   Zbraň: teplá bronzová (ne červená — červená vypadá jako chyba).
   Náhrdelník / prsten: zlatá, ale různé tóny.
   Spotřebitelné: zelená. Ostatní: šedá. */
.cs-item-badge--weapon    { color: #c49a3c; border-color: rgba(196,154,60,0.45); background: rgba(196,154,60,0.09); }
.cs-item-badge--armor     { color: #5b9ed9; border-color: rgba(91,158,217,0.45); background: rgba(91,158,217,0.09); }
.cs-item-badge--shield    { color: #5ec4c4; border-color: rgba(94,196,196,0.4);  background: rgba(94,196,196,0.08); }
.cs-item-badge--helmet    { color: #8db3cc; border-color: rgba(141,179,204,0.4); background: rgba(141,179,204,0.07); }
.cs-item-badge--necklace  { color: #c9a227; border-color: rgba(201,162,39,0.45); background: rgba(201,162,39,0.08); }
.cs-item-badge--ring      { color: #b07830; border-color: rgba(176,120,48,0.4);  background: rgba(176,120,48,0.07); }
.cs-item-badge--consumable{ color: #72c497; border-color: rgba(114,196,151,0.45); background: rgba(114,196,151,0.08); }
.cs-item-badge--other     { color: var(--text-muted); border-color: var(--border-dim); background: transparent; }

/* Name input */
.cs-item-name-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.95rem;
  padding: 0.1rem 0.2rem;
  transition: border-color 0.15s;
}
.cs-item-name-input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.5);
}
.cs-item-name-input::placeholder { color: var(--text-dim); font-style: italic; }

/* Action buttons in header */
.cs-item-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.cs-item-equip-btn {
  font-size: 0.62rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cs-item-equip-btn:hover { border-color: var(--gold); color: var(--gold); }
.cs-item-equip-btn--active {
  border-color: rgba(201,162,39,0.6);
  color: var(--gold);
  background: rgba(201,162,39,0.1);
}

.cs-item-qty {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: #72c497;
  letter-spacing: 0.04em;
}

.cs-item-use-btn {
  font-size: 0.62rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(114,196,151,0.5);
  background: rgba(114,196,151,0.08);
  color: #72c497;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cs-item-use-btn:hover {
  border-color: #72c497;
  background: rgba(114,196,151,0.18);
  color: #a3e4ba;
}

.cs-item-remove-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(192,57,43,0.3);
  background: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  padding: 0;
}
.cs-item-remove-btn:hover { border-color: #c0392b; color: #c0392b; background: rgba(192,57,43,0.08); }

/* Body */
.cs-item-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.35rem;
}

/* Stats row (category + numeric fields) */
.cs-item-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

/* Meta row */
.cs-item-meta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Meta field */
.cs-item-meta-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.cs-item-meta-field label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cs-item-meta-field input {
  width: 52px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 0.1rem 0.3rem;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}
.cs-item-meta-field input:focus { outline: none; border-color: rgba(201,162,39,0.4); color: var(--text); }
.cs-item-meta-field--price input { width: 68px; }
.cs-item-meta-unit { font-size: 0.65rem; color: var(--text-dim); }

/* Effects row */
.cs-item-effects-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
}
.cs-item-effects-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #72c497;
  font-family: 'Cinzel', serif;
  white-space: nowrap;
}
.cs-item-effects-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

/* Effect add button */
.cs-item-effect-add-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: 1px dashed rgba(201,162,39,0.35);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.15s;
}
.cs-item-effect-add-btn:hover {
  border-color: var(--gold);
  border-style: solid;
  background: rgba(201,162,39,0.08);
  color: #fff4d0;
}

/* Note textarea */
.cs-item-note textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: 'Crimson Text', serif;
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  resize: vertical;
  min-height: 28px;
  transition: border-color 0.15s, color 0.15s;
}
.cs-item-note textarea:focus { outline: none; border-color: rgba(201,162,39,0.3); color: var(--text); }
.cs-item-note textarea::placeholder { color: var(--text-dim); opacity: 0.6; }

/* Effect pills — unified (replaces old cs-item-effect-pill) */
.cs-effect-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-family: 'Crimson Text', serif;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid rgba(201,162,39,0.25);
  background: rgba(18,11,5,0.6);
  color: var(--text);
  transition: all 0.12s;
  user-select: none;
}
.cs-effect-pill:hover { border-color: var(--gold); background: rgba(201,162,39,0.1); }
.cs-effect-pill--buff    { border-color: rgba(76,175,80,0.4); background: rgba(76,175,80,0.08); }
.cs-effect-pill--buff:hover { border-color: #4caf50; background: rgba(76,175,80,0.18); }
.cs-effect-pill--buff .cs-effect-pill-label b { color: #b7e7b7; }
.cs-effect-pill--debuff  { border-color: rgba(224,122,60,0.4); background: rgba(224,122,60,0.08); }
.cs-effect-pill--debuff:hover { border-color: #e07a3c; }
.cs-effect-pill--debuff .cs-effect-pill-label b { color: #ffd2b8; }
.cs-effect-pill--custom  { border-color: rgba(142,68,173,0.4); background: rgba(142,68,173,0.08); }
.cs-effect-pill--custom:hover { border-color: #b97dd8; }
.cs-effect-pill-label b { font-weight: 600; }
.cs-effect-pill-dur {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  border-left: 1px solid rgba(255,255,255,0.12);
  padding-left: 0.3rem;
  margin-left: 0.1rem;
}
.cs-effect-pill-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 0.1rem;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.12s;
}
.cs-effect-pill-remove:hover { color: #f3b5ad; }

/* Equipped glow */
.cs-item-card--equipped {
  border-color: rgba(201,162,39,0.45);
  box-shadow: 0 0 0 1px rgba(201,162,39,0.12), 0 4px 14px rgba(0,0,0,0.25);
}

/* Consumable card accent */
.cs-item-card--consumable {
  border-color: rgba(114,196,151,0.2);
}
.cs-item-card--consumable:hover {
  border-color: rgba(114,196,151,0.4);
}

/* Dragging states */
.cs-item-card--dragging { opacity: 0.4; border-style: dashed; }
.cs-item-card--dragover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 16px rgba(201,162,39,0.3), inset 0 0 0 1px rgba(201,162,39,0.15);
}

/* Empty inventory */
.cs-inv-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

/* ================================================================
   DURATION PICKER (v modálním okně)
   ================================================================ */
.cs-duration-picker {
  margin-top: 0.3rem;
}
.cs-duration-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.cs-duration-type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border-dim);
  background: var(--bg-deep);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.cs-duration-type-btn input[type="radio"] { display: none; }
.cs-duration-type-btn:hover { border-color: rgba(201,162,39,0.4); color: var(--gold); }
.cs-duration-type-btn--active {
  border-color: var(--gold);
  background: rgba(201,162,39,0.12);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(201,162,39,0.15);
}
.cs-duration-value-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cs-duration-value-row input[type="number"] {
  width: 60px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}
.cs-duration-value-row input[type="text"] {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.2rem 0.5rem;
}
.cs-duration-value-row input:focus { outline: none; border-color: var(--gold); }
#csDurUnit { font-size: 0.72rem; color: var(--text-muted); }

/* ================================================================
   EFFECTS SECTION — hlavička + time buttons
   ================================================================ */
.cs-effects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.cs-effects-header .cs-section__title { margin-bottom: 0; }

.cs-effects-time-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cs-time-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.75rem;
  border-radius: 5px;
  border: 1px solid;
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cs-time-btn--round {
  border-color: rgba(127,179,232,0.4);
  color: #7fb3e8;
}
.cs-time-btn--round:hover { background: rgba(127,179,232,0.1); border-color: #7fb3e8; }

.cs-time-btn--combat {
  border-color: rgba(224,136,112,0.4);
  color: #e08870;
}
.cs-time-btn--combat:hover { background: rgba(224,136,112,0.1); border-color: #e08870; }

.cs-time-btn--day {
  border-color: rgba(201,162,39,0.4);
  color: var(--gold);
}
.cs-time-btn--day:hover { background: rgba(201,162,39,0.1); border-color: var(--gold); }

.cs-effects-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.6rem;
  padding: 0.25rem 0.5rem;
  border-left: 2px solid rgba(201,162,39,0.2);
}

/* Duration display in effect cards */
.cs-effect-card { grid-template-columns: auto 1fr auto auto auto; }

.cs-effect-card__dur-col {
  display: flex;
  align-items: center;
}

.cs-effect-dur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid;
}
.cs-dur--rounds   { color: #7fb3e8; border-color: rgba(127,179,232,0.4); background: rgba(127,179,232,0.07); }
.cs-dur--days     { color: var(--gold); border-color: rgba(201,162,39,0.35); background: rgba(201,162,39,0.06); }
.cs-dur--combat   { color: #e08870; border-color: rgba(224,136,112,0.4); background: rgba(224,136,112,0.07); }
.cs-dur--permanent{ color: var(--text-muted); border-color: var(--border-dim); background: transparent; }

/* Badge pro consumable-zdroj efektu */
.cs-effect-badge--source {
  color: #72c497;
  background: rgba(114,196,151,0.1);
  border-color: rgba(114,196,151,0.35);
}

/* ================================================================
   HIDE BUTTON — tlačítko Skrýt / Odkrýt na kartě předmětu
   ================================================================ */
.cs-item-hide-btn {
  font-size: 0.58rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  opacity: 0;            /* Skrytý dokud se nenajeté myší */
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}
.cs-item-card:hover .cs-item-hide-btn { opacity: 1; }
.cs-item-hide-btn:hover { border-color: rgba(142,179,204,0.5); color: #8db3cc; }
.cs-item-hide-btn--active {
  opacity: 1;          /* Vždy viditelný pokud je předmět skrytý */
  border-color: rgba(141,179,204,0.5);
  color: #8db3cc;
  background: rgba(141,179,204,0.08);
}

/* Skrytá karta — zmenšená, poloprůhledná */
.cs-item-card--hidden {
  opacity: 0.45;
  filter: grayscale(0.4);
  border-style: dashed;
}
.cs-item-card--hidden:hover {
  opacity: 0.8;
  filter: none;
}

/* ================================================================
   INVENTORY HEADER — akce (toggle + sort)
   ================================================================ */
.cs-inventory-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cs-inv-hidden-toggle {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.65rem;
  border-radius: 5px;
  border: 1px solid rgba(141,179,204,0.4);
  background: none;
  color: #8db3cc;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cs-inv-hidden-toggle:hover {
  background: rgba(141,179,204,0.1);
  border-color: #8db3cc;
}
.cs-inv-hidden-toggle--active {
  background: rgba(141,179,204,0.12);
  border-color: #8db3cc;
}

/* ================================================================
   INLINE META FIELDS — PČ a Cena v stats řádku
   .cs-item-stat--meta  — stejný vzhled jako .cs-item-stat ale s
   mírně odlišnou barvou etikety pro vizuální odlišení od herních atributů
   ================================================================ */
.cs-item-stat--meta label {
  color: var(--text-dim);
  font-style: italic;
}
.cs-item-stat--price {
  /* Cena má za inputem jednotku (zl.) */
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.cs-item-stat--price input {
  width: 58px;
}

/* ================================================================
   CONTENT LAYOUT — grid se sidebarem vlevo
   ================================================================ */
.cs-content-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0 2rem;
  /* align-items záměrně odstraněno — sidebar se musí roztáhnout na
     celou výšku řádku, jinak position:sticky nefunguje */
}

.cs-content-main {
  min-width: 0; /* zabrání přetečení v gridu */
  align-self: start;
}

/* ================================================================
   LEVÝ SIDEBAR — navigace po sekci (styl jako lore / příběh světa)
   ================================================================ */
.cs-sidebar {
  /* align-self: start záměrně odstraněno — sidebar se táhne na celou
     výšku řádku gridu, takže position:sticky má dostatečný containing block */
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,39,.3) transparent;
}

/* Titulek — stejný styl jako lore-sidebar__title */
.cs-nav__title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  text-align: center;
  position: relative;
}
.cs-nav__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--nav-border-ornament);
  opacity: 0.5;
}

/* Seznam — stejný styl jako lore-nav__list */
.cs-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertikální vodící linka vlevo */
.cs-nav__list::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1px;
  background: linear-gradient(180deg, var(--border-dim), rgba(107,84,0,0.2));
  bottom: calc(0.4rem + 0.6em);
}

.cs-nav__list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-family: 'Crimson Text', serif;
  transition: border-color 0.2s, color 0.2s, background 0.2s, text-shadow 0.2s;
  text-decoration: none;
  cursor: pointer;
}
.cs-nav__list a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,162,39,0.04);
  text-shadow: 0 0 8px rgba(201,162,39,0.15);
}
.cs-nav__list a.active {
  border-color: var(--gold-light);
  color: var(--gold-light);
  background: rgba(201,162,39,0.08);
}

@media (max-width: 900px) {
  .cs-content-layout { grid-template-columns: 1fr; }
  .cs-sidebar { display: none; }
}

/* ================================================================
   ITEM CARD — quantity ± before name
   ================================================================ */
.cs-item-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.cs-item-qty-val {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: var(--text-dim);
  min-width: 1.1rem;
  text-align: center;
  cursor: pointer;
  padding: 0 0.1rem;
  border-radius: 3px;
  transition: color 0.12s, background 0.12s;
}
.cs-item-qty-val:hover { color: var(--gold); background: rgba(201,162,39,0.08); }

.cs-item-qty-input {
  width: 34px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  padding: 0.05rem 0.2rem;
}

/* Second meta row for weapon/armor/shield */
.cs-item-stats-row--meta {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 0.2rem;
  margin-top: 0.05rem;
}

/* Narrower category trigger per type */
.cs-item-stat--cat .hoe-select__trigger {
  overflow: hidden;
}
.cs-item-stat--cat .hoe-select__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-item-stat--cat--weapon .hoe-select,
.cs-item-stat--cat--weapon .hoe-select__trigger { width: 108px; max-width: 108px; }
.cs-item-stat--cat--armor  .hoe-select,
.cs-item-stat--cat--armor  .hoe-select__trigger { width: 100px; max-width: 100px; }
.cs-item-stat--cat--shield .hoe-select,
.cs-item-stat--cat--shield .hoe-select__trigger { width: 82px;  max-width: 82px; }

/* Locked item — subtle indicator */
.cs-item-card--locked .cs-item-card__header {
  background: rgba(201,162,39,0.03);
}

/* ================================================================
   ADD ITEM WIZARD
   ================================================================ */
.cs-wizard {
  padding: 0.25rem 0.5rem 0.5rem;
}

.cs-wizard__title {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.1rem;
  margin: 0 0 0.3rem 0;
}

.cs-wizard__step {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.cs-wizard__substep {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-wizard__no-stats {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 0.5rem 0 1rem;
}

.cs-wizard-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.cs-wizard-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--border-dim);
  background: var(--bg-deep);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cs-wizard-type-btn:hover {
  border-color: rgba(201,162,39,0.4);
  color: var(--gold);
  background: rgba(201,162,39,0.06);
}
.cs-wizard-type-btn--active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,162,39,0.12);
  box-shadow: 0 0 10px rgba(201,162,39,0.15);
}
.cs-wizard-type-btn__icon { font-size: 1.4rem; }
.cs-wizard-type-btn__label { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; }

.cs-wizard-subtypes__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cs-wizard-subtype-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  border: 1px solid var(--border-dim);
  background: var(--bg-deep);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-wizard-subtype-btn:hover { border-color: rgba(201,162,39,0.4); color: var(--gold); }
.cs-wizard-subtype-btn--active { border-color: var(--gold); color: var(--gold); background: rgba(201,162,39,0.1); }

.cs-wizard-name-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}
.cs-wizard-name-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cs-wizard-name-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  padding: 0.35rem 0.6rem;
  transition: border-color 0.15s;
}
.cs-wizard-name-input:focus { outline: none; border-color: var(--gold); }

.cs-wizard-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}
.cs-wizard-reset-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.cs-wizard-reset-btn:hover { color: var(--gold); border-color: rgba(201,162,39,0.4); }

.cs-wizard-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.cs-wizard-field {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.cs-wizard-field label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-wizard-field input {
  width: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 0.18rem 0.3rem;
  text-align: center;
  transition: border-color 0.15s;
}
.cs-wizard-field input:focus { outline: none; border-color: var(--gold); }

.cs-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-dim);
}

/* ================================================================
   COMPACT EQUIP STRIP — nahrazuje paperdoll
   ================================================================ */
/* Sticky during drag — stays visible while user scrolls inventory */
.cs-equip-strip--dragging {
  position: sticky;
  top: 70px;
  z-index: 40;
  box-shadow: 0 4px 24px rgba(0,0,0,0.55);
  border-color: rgba(201,162,39,0.4);
}
.cs-equip-strip {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.75rem 0.6rem;
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

/* Horizontální řádek slotů */
.cs-equip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem 1rem;
}

/* Oddělovač mezi řádky */
.cs-equip-row + .cs-equip-row {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cs-equip-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-equip-group__label {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.1rem;
}

.cs-equip-group__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Compact slot override (strip variant) */
.cs-slot--compact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: unset;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.1);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-direction: row;
  text-align: left;
  min-width: 90px;
  max-width: 150px;
}

.cs-slot--compact:hover {
  border-color: var(--gold);
  border-style: solid;
  background: rgba(201,162,39,0.07);
}

.cs-slot--compact.cs-slot--filled {
  border-style: solid;
  border-color: rgba(201,162,39,0.5);
  background: rgba(201,162,39,0.06);
}

.cs-slot--compact .cs-slot__icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.cs-slot--compact .cs-slot__label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  flex-shrink: 0;
}

.cs-slot--compact .cs-slot__name {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  line-height: 1;
}

.cs-slot--compact.cs-slot--filled .cs-slot__name {
  color: var(--gold-light);
}

/* Ring group: slightly smaller slots */
.cs-equip-group--rings .cs-slot--compact {
  min-width: 72px;
  max-width: 110px;
}

/* Inventory section header with add + hidden toggle */
.cs-inventory-section .cs-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
}

.cs-inventory-section .cs-section__title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ================================================================
   POINTER DRAG GHOST
   ================================================================ */
.cs-drag-ghost {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem 0.3rem 0.45rem;
  background: rgba(15, 12, 24, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.7);
  border-radius: 6px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.7);
  font-size: 0.78rem;
  color: var(--gold-light);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(4px);
}

.cs-drag-ghost__badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cs-drag-ghost__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grip cursor — jen na grip handle */
.cs-item-grip {
  cursor: grab;
  touch-action: none; /* nutné pro pointer capture na touch */
}
.cs-item-grip:active { cursor: grabbing; }

/* Během dragu — zakáž text selection na celé stránce */
body.cs-dragging { user-select: none; }

/* ================================================================
   EQUIP SLOT PICKER MODAL (cs-epick)
   ================================================================ */
.cs-epick {
  padding: 0.25rem 0;
}

.cs-epick__title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-dim);
}

.cs-epick__title em {
  font-style: normal;
  color: var(--gold-light);
}

.cs-epick__rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.cs-epick-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-dim);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.cs-epick-row:hover:not(.cs-epick-row--disabled):not(.cs-epick-row--current) {
  background: rgba(201,162,39,0.07);
  border-color: rgba(201,162,39,0.35);
}

.cs-epick-row--current {
  border-color: rgba(201,162,39,0.5);
  background: rgba(201,162,39,0.06);
  cursor: default;
}

.cs-epick-row--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}

.cs-epick-label {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--text);
  min-width: 110px;
  flex-shrink: 0;
}

.cs-epick-status {
  font-size: 0.7rem;
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-epick-status--current {
  color: var(--gold);
  font-style: italic;
}

.cs-epick-status--reason {
  color: rgba(192,57,43,0.8);
  font-size: 0.67rem;
  white-space: normal;
  line-height: 1.3;
}

.cs-epick-btn {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.68rem !important;
  padding: 0.2rem 0.6rem !important;
  pointer-events: none; /* row click handles it */
}

.cs-epick__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-dim);
}
