/**
 * pathfinder.css
 * Headblast Tabletop Plattform — Pathfinder 2e Styling
 * Warmes Abenteurer-Theme: Pergament, Lagerfeuer, Drachen
 */

/* ===================================================================
   PATHFINDER COLOR PALETTE
   =================================================================== */

:root {
  --pf-color-primary: #7c3626;
  --pf-color-accent: #c9a959;
  --pf-color-fire: #e67e22;
  --pf-color-parchment: rgba(201, 169, 89, 0.06);
  --pf-color-dragon: #8b2500;
  --pf-border: rgba(201, 169, 89, 0.2);
  --pf-border-hover: rgba(201, 169, 89, 0.4);
  --pf-radius: 10px;
}

/* ===================================================================
   PATHFINDER PAGE CONTAINER
   =================================================================== */

.pf-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ===================================================================
   KAMPAGNEN-HEADER — mit Background-Image
   =================================================================== */

.pf-campaign-header {
  text-align: center;
  padding: 40px 20px 28px;
  margin-bottom: 24px;
  background:
    linear-gradient(180deg, rgba(26, 18, 8, 0.3) 0%, rgba(26, 18, 8, 0.85) 70%, rgba(26, 18, 8, 1) 100%),
    linear-gradient(135deg, rgba(124, 54, 38, 0.25) 0%, rgba(201, 169, 89, 0.08) 100%);
  background-size: cover;
  background-position: center top;
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

/* If header image is available */
.pf-campaign-header.has-bg {
  background:
    linear-gradient(180deg, rgba(26, 18, 8, 0.2) 0%, rgba(26, 18, 8, 0.8) 60%, rgba(26, 18, 8, 0.98) 100%),
    url('/assets/pathfinder/header-bg.webp') center top / cover no-repeat;
  padding: 50px 20px 32px;
}

.pf-campaign-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--pf-color-fire), var(--pf-color-accent), var(--pf-color-fire), transparent);
}

.pf-campaign-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 89, 0.2), transparent);
}

.pf-campaign-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin: 0 0 6px;
  letter-spacing: 1px;
}

.pf-campaign-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary, #aaa);
}

.pf-campaign-subtitle span {
  margin: 0 8px;
  color: var(--text-muted, #666);
}

/* ===================================================================
   NAVIGATION TABS (innerhalb der Pathfinder-Seite)
   =================================================================== */

.pf-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-secondary, #242424);
  border-radius: 12px;
  border: 1px solid var(--border-color, #444);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-nav-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 9px;
  color: var(--text-muted, #888);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pf-nav-tab:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary, #e0e0e0);
}

.pf-nav-tab.active {
  background: linear-gradient(135deg, rgba(124, 54, 38, 0.2), rgba(124, 54, 38, 0.08));
  border-color: var(--pf-color-accent);
  color: var(--pf-color-accent);
  box-shadow: 0 0 12px rgba(124, 54, 38, 0.2);
}

.pf-nav-icon {
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  .pf-nav-tab {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .pf-nav-label {
    display: none;
  }
  .pf-nav-icon {
    font-size: 1.3rem;
  }
}

/* ===================================================================
   SECTIONS
   =================================================================== */

.pf-section {
  display: none;
}

.pf-section.active {
  display: block;
}

/* ===================================================================
   CARDS (allgemein)
   =================================================================== */

.pf-card {
  background: var(--bg-card, #1a1208);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.pf-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--pf-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-card-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin: 0;
  flex: 1;
}

.pf-card-header-icon {
  font-size: 1.3rem;
}

.pf-card-body {
  padding: 18px;
}

/* ===================================================================
   GRUPPENKASSE
   =================================================================== */

.pf-treasury-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .pf-treasury-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pf-currency-box {
  background: var(--pf-color-parchment);
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.pf-currency-box:hover {
  border-color: var(--pf-border-hover);
}

.pf-currency-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.pf-currency-value {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pf-color-accent);
}

.pf-currency-value input {
  background: transparent;
  border: none;
  border-bottom: 2px dashed rgba(201, 169, 89, 0.3);
  color: var(--pf-color-accent);
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  width: 100px;
  padding: 4px 0;
  outline: none;
}

.pf-currency-value input:focus {
  border-bottom-color: var(--pf-color-accent);
  border-bottom-style: solid;
}

.pf-currency-label {
  font-size: 0.78rem;
  color: var(--text-muted, #888);
  margin-top: 2px;
}

.pf-treasury-total {
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(201, 169, 89, 0.08), rgba(201, 169, 89, 0.03));
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  margin-bottom: 20px;
}

.pf-treasury-total-value {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pf-color-accent);
}

.pf-treasury-total-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===================================================================
   TRANSAKTIONS-LOG
   =================================================================== */

.pf-tx-list {
  max-height: 300px;
  overflow-y: auto;
}

.pf-tx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}

.pf-tx-item:last-child {
  border-bottom: none;
}

.pf-tx-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pf-tx-desc {
  flex: 1;
  color: var(--text-secondary, #b0b0b0);
}

.pf-tx-amount {
  font-weight: 600;
  white-space: nowrap;
}

.pf-tx-amount.earn {
  color: #4ade80;
}

.pf-tx-amount.spend {
  color: #f87171;
}

.pf-tx-date {
  font-size: 0.75rem;
  color: var(--text-muted, #666);
  white-space: nowrap;
}

.pf-tx-by {
  font-size: 0.72rem;
  color: var(--text-muted, #666);
}

/* ===================================================================
   CHARAKTER-GRID
   =================================================================== */

.pf-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.pf-char-card {
  background: var(--bg-card, #1a1208);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.pf-char-card:hover {
  border-color: var(--pf-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.pf-char-card.is-mine {
  border-color: rgba(124, 54, 38, 0.4);
}

.pf-char-portrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pf-color-parchment);
  border: 2px solid var(--pf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 12px;
  overflow: hidden;
}

.pf-char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-char-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin-bottom: 4px;
}

.pf-char-meta {
  font-size: 0.82rem;
  color: var(--text-secondary, #aaa);
  margin-bottom: 6px;
}

.pf-char-player {
  font-size: 0.78rem;
  color: var(--text-muted, #666);
}

.pf-char-stats-mini {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}

.pf-char-stat-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  color: var(--text-secondary, #aaa);
}

.pf-char-stat-pill strong {
  color: var(--pf-color-accent);
}

/* ===================================================================
   GRUPPENWERTE-TABELLE
   =================================================================== */

.pf-stats-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 600px;
}

.pf-stats-table th {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--pf-color-accent);
  padding: 10px 8px;
  text-align: center;
  border-bottom: 2px solid var(--pf-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card, #1a1208);
  z-index: 1;
}

.pf-stats-table th:first-child {
  text-align: left;
  min-width: 140px;
}

.pf-stats-table td {
  padding: 7px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary, #b0b0b0);
}

.pf-stats-table td:first-child {
  text-align: left;
  color: var(--text-primary, #e0e0e0);
  font-weight: 500;
}

.pf-stats-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.pf-stats-section-row td {
  padding-top: 16px !important;
  font-weight: 700;
  color: var(--pf-color-accent) !important;
  border-bottom: 1px solid var(--pf-border) !important;
  font-size: 0.85rem;
}

/* ===================================================================
   CHRONIK
   =================================================================== */

.pf-chronicle-entry {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.pf-chronicle-entry:hover {
  background: rgba(255,255,255,0.02);
}

.pf-chronicle-entry:last-child {
  border-bottom: none;
}

.pf-chronicle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pf-chronicle-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--pf-color-accent);
  font-size: 1rem;
  flex: 1;
}

.pf-chronicle-date {
  font-size: 0.78rem;
  color: var(--text-muted, #666);
  white-space: nowrap;
}

.pf-chronicle-summary {
  font-size: 0.88rem;
  color: var(--text-secondary, #b0b0b0);
  line-height: 1.6;
  white-space: pre-wrap;
}

.pf-chronicle-meta {
  font-size: 0.72rem;
  color: var(--text-muted, #555);
  margin-top: 6px;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.pf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(124, 54, 38, 0.2);
  border: 1px solid rgba(124, 54, 38, 0.4);
  border-radius: 8px;
  color: var(--pf-color-accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-btn:hover {
  background: rgba(124, 54, 38, 0.35);
  border-color: var(--pf-color-accent);
}

.pf-btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.pf-btn-success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.pf-btn-success:hover {
  background: rgba(74, 222, 128, 0.2);
}

/* ===================================================================
   EMPTY STATES
   =================================================================== */

.pf-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #666);
}

.pf-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.pf-empty h3 {
  font-family: 'Cinzel', serif;
  color: var(--text-secondary, #aaa);
  margin: 0 0 8px;
}

.pf-empty p {
  font-size: 0.88rem;
  margin: 0 0 16px;
}

/* ===================================================================
   MODALS / FORMULARE
   =================================================================== */

.pf-form-group {
  margin-bottom: 14px;
}

.pf-form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary, #aaa);
  margin-bottom: 4px;
  font-weight: 600;
}

.pf-input, .pf-select, .pf-textarea {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  color: var(--text-primary, #e0e0e0);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.pf-input:focus, .pf-select:focus, .pf-textarea:focus {
  border-color: var(--pf-color-accent);
}

.pf-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.pf-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .pf-form-row {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   DASHBOARD MINI-VIEW
   =================================================================== */

.pf-dash-mini {
  padding: 0 16px;
}

.pf-dash-header {
  text-align: center;
  padding: 24px 20px 16px;
  margin-bottom: 20px;
}

.pf-dash-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--pf-color-accent);
  margin: 0 0 4px;
}

.pf-dash-header p {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin: 0;
}

.pf-dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pf-dash-link {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 24px;
}

.pf-dash-link a {
  color: var(--pf-color-accent);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
}

.pf-dash-link a:hover {
  text-decoration: underline;
}

/* ===================================================================
   TOAST (Feedback)
   =================================================================== */

.pf-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: rgba(26, 18, 8, 0.95);
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  color: var(--pf-color-accent);
  font-size: 0.85rem;
  z-index: 60000;
  animation: pfFadeIn 0.3s ease;
  pointer-events: none;
}

@keyframes pfFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===================================================================
   KAMPAGNEN-FORTSCHRITT PROGRESSBAR
   =================================================================== */

.pf-progress-bar {
  margin-top: 16px;
}

.pf-progress-track {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}

.pf-progress-segment {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  position: relative;
  transition: background 0.3s;
}

.pf-progress-segment.completed {
  background: linear-gradient(90deg, var(--pf-color-fire), var(--pf-color-accent));
}

.pf-progress-segment.current {
  background: linear-gradient(90deg, var(--pf-color-accent), rgba(201, 169, 89, 0.4));
  animation: pfPulse 2s ease-in-out infinite;
}

@keyframes pfPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pf-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted, #666);
}

.pf-progress-current {
  font-size: 0.82rem;
  color: var(--pf-color-accent);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
}

.pf-progress-book-label {
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-muted, #666);
  margin-top: 2px;
}

/* GM Progress Controls */
.pf-progress-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.pf-progress-btn {
  padding: 4px 12px;
  background: rgba(201, 169, 89, 0.08);
  border: 1px solid rgba(201, 169, 89, 0.2);
  border-radius: 6px;
  color: var(--pf-color-accent);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-progress-btn:hover {
  background: rgba(201, 169, 89, 0.2);
  border-color: var(--pf-color-accent);
}

/* ===================================================================
   HERO POINTS
   =================================================================== */

.pf-hero-points {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.pf-hero-point-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(230, 126, 34, 0.4);
  background: transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.pf-hero-point-dot.filled {
  background: radial-gradient(circle, #e67e22, #c0392b);
  border-color: #e67e22;
  box-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
}

.pf-hero-point-dot:hover {
  border-color: #e67e22;
  transform: scale(1.15);
}

.pf-hero-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

/* ===================================================================
   CHARACTER DETAIL VIEW (inline stats)
   =================================================================== */

.pf-char-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pf-stat-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.pf-stat-box-label {
  font-size: 0.65rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pf-stat-box-value {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pf-color-accent);
}

.pf-stat-box.editable {
  cursor: pointer;
  transition: border-color 0.2s;
}

.pf-stat-box.editable:hover {
  border-color: rgba(201, 169, 89, 0.3);
}

/* ===================================================================
   INVENTORY TABS (inside Treasury)
   =================================================================== */

.pf-inv-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(0,0,0,0.2);
  border-radius: 9px;
  margin: 20px 0 16px;
}

.pf-inv-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted, #888);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.pf-inv-tab:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary, #e0e0e0);
}

.pf-inv-tab.active {
  background: rgba(124, 54, 38, 0.2);
  color: var(--pf-color-accent);
}

.pf-inv-tab .pf-inv-count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
  font-size: 0.7rem;
  margin-left: 4px;
}

.pf-inv-section {
  display: none;
}

.pf-inv-section.active {
  display: block;
}

/* Inventory Table */
.pf-inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pf-inv-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-muted, #888);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--pf-border);
  white-space: nowrap;
}

.pf-inv-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary, #b0b0b0);
  vertical-align: top;
}

.pf-inv-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.pf-inv-table .pf-inv-name {
  font-weight: 600;
  color: var(--pf-color-accent);
}

.pf-inv-table .pf-inv-type-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(201, 169, 89, 0.08);
  border: 1px solid rgba(201, 169, 89, 0.15);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pf-inv-actions {
  display: flex;
  gap: 4px;
}

.pf-inv-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===================================================================
   CHARACTER DETAIL VIEW (full page, replaces grid)
   =================================================================== */

.pf-char-detail {
  animation: pfFadeIn 0.3s ease;
}

.pf-char-detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  background: linear-gradient(135deg, rgba(124, 54, 38, 0.12), rgba(201, 169, 89, 0.04));
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .pf-char-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.pf-char-detail-portrait {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--pf-color-parchment);
  border: 3px solid var(--pf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pf-char-detail-portrait:hover {
  border-color: var(--pf-color-accent);
}

.pf-char-detail-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-char-detail-info {
  flex: 1;
}

.pf-char-detail-name {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin: 0 0 4px;
}

.pf-char-detail-class {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pf-char-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Character Detail Sections */
.pf-char-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .pf-char-sections {
    grid-template-columns: 1fr;
  }
}

.pf-char-section-full {
  grid-column: 1 / -1;
}

/* Backstory */
.pf-backstory {
  white-space: pre-wrap;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 14px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.pf-backstory:empty::after {
  content: 'Noch keine Hintergrundgeschichte.';
  font-style: italic;
  color: var(--text-muted);
}

/* Notes */
.pf-notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.pf-notes-textarea:focus {
  border-color: var(--pf-color-accent);
}

/* ===================================================================
   GOLARION-KALENDER (FEAT-PF06)
   =================================================================== */

/* Kalender-Karte mit Header-Bild */
.pf-cal-header {
  position: relative;
  padding: 24px 20px 18px;
  background:
    linear-gradient(180deg, rgba(26,18,8,0.3) 0%, rgba(26,18,8,0.92) 100%),
    url('/assets/pathfinder/calendar/calendar-header.webp') center / cover no-repeat;
  border-bottom: 1px solid var(--pf-border);
  text-align: center;
  min-height: 80px;
}

.pf-cal-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,89,0.3), transparent);
}

.pf-cal-date-display {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin-bottom: 4px;
}

.pf-cal-season-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
}

.pf-cal-weekday {
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
  margin-top: 2px;
}

/* Monats-Ansicht */
.pf-cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.pf-cal-month-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-cal-month-deity {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  font-family: inherit;
  font-weight: 400;
}

.pf-cal-month-btn {
  background: rgba(201,169,89,0.08);
  border: 1px solid rgba(201,169,89,0.2);
  border-radius: 8px;
  color: var(--pf-color-accent);
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-cal-month-btn:hover {
  background: rgba(201,169,89,0.2);
  border-color: var(--pf-color-accent);
}

/* Kalender-Grid */
.pf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 12px 12px;
}

.pf-cal-dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pf-cal-dow.sunday {
  color: rgba(251,191,36,0.6);
}

.pf-cal-day {
  position: relative;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
  cursor: default;
  transition: all 0.15s;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.pf-cal-day.empty {
  opacity: 0;
}

.pf-cal-day:not(.empty):hover {
  background: rgba(255,255,255,0.04);
}

.pf-cal-day.today {
  background: linear-gradient(135deg, rgba(201,169,89,0.2), rgba(124,54,38,0.2));
  border: 2px solid var(--pf-color-accent);
  color: var(--pf-color-accent);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(201,169,89,0.15);
}

.pf-cal-day.holiday {
  color: #fbbf24;
  font-weight: 600;
}

.pf-cal-day.holiday::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbbf24;
  display: block;
}

.pf-cal-day.past {
  opacity: 0.4;
}

.pf-cal-day.sunday-col {
  color: rgba(251,191,36,0.5);
}

/* Tooltip f\u00fcr Feiertage */
.pf-cal-day[data-tooltip] {
  cursor: help;
}

.pf-cal-day[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,18,8,0.95);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-primary, #e0e0e0);
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  text-align: left;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  line-height: 1.4;
}

/* GM Controls */
.pf-cal-controls {
  display: flex;
  gap: 6px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
  align-items: center;
}

.pf-cal-advance-btn {
  padding: 7px 14px;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 8px;
  color: #4ade80;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-cal-advance-btn:hover {
  background: rgba(74,222,128,0.18);
  border-color: #4ade80;
}

.pf-cal-advance-btn.custom {
  background: rgba(201,169,89,0.08);
  border-color: rgba(201,169,89,0.25);
  color: var(--pf-color-accent);
}

.pf-cal-advance-btn.custom:hover {
  background: rgba(201,169,89,0.18);
  border-color: var(--pf-color-accent);
}

.pf-cal-advance-btn.set-date {
  background: rgba(147,197,253,0.08);
  border-color: rgba(147,197,253,0.25);
  color: #93c5fd;
}

.pf-cal-advance-btn.set-date:hover {
  background: rgba(147,197,253,0.18);
}

/* Feiertags-Leiste */
.pf-cal-holiday-bar {
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(251,191,36,0.02));
  border-top: 1px solid rgba(251,191,36,0.12);
  font-size: 0.82rem;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-cal-holiday-bar .holiday-name {
  font-weight: 700;
  font-family: 'Cinzel', serif;
}

.pf-cal-holiday-bar .holiday-desc {
  color: var(--text-secondary, #aaa);
  font-size: 0.78rem;
}

/* Zeitverlaufs-Log */
.pf-cal-log {
  max-height: 250px;
  overflow-y: auto;
}

.pf-cal-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.82rem;
}

.pf-cal-log-entry:last-child {
  border-bottom: none;
}

.pf-cal-log-days {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.15);
  color: #4ade80;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  flex-shrink: 0;
}

.pf-cal-log-info {
  flex: 1;
}

.pf-cal-log-note {
  color: var(--text-primary, #e0e0e0);
  font-weight: 500;
}

.pf-cal-log-date {
  font-size: 0.75rem;
  color: var(--text-muted, #666);
  margin-top: 2px;
}

/* Season Banner */
.pf-cal-season-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 12px;
  opacity: 0.7;
  border: 1px solid var(--pf-border);
}

@media (max-width: 600px) {
  .pf-cal-date-display {
    font-size: 1.2rem;
  }
  .pf-cal-day {
    padding: 6px 2px;
    font-size: 0.78rem;
    min-height: 30px;
  }
  .pf-cal-controls {
    justify-content: center;
  }
  .pf-cal-day[data-tooltip]:hover::before {
    max-width: 160px;
    font-size: 0.7rem;
  }
  /* Session + Calendar banner stacking */
  #pf-session-banner > div {
    grid-template-columns: 1fr !important;
  }
}

/* ===================================================================
   ZITADELLE ALTAEREIN (FEAT-PF02)
   =================================================================== */

.pf-cit-header {
  padding: 20px 20px 14px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(26,18,8,0.15) 0%, rgba(26,18,8,0.75) 70%, rgba(26,18,8,0.95) 100%),
    rgba(26,18,8,0.85);
  border-bottom: 1px solid var(--pf-border);
  position: relative;
  min-height: 60px;
}

.pf-cit-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  margin: 0 0 4px;
}

.pf-cit-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
}

/* Phasen-Anzeige */
.pf-cit-phases {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pf-cit-phase {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted, #888);
  transition: all 0.2s;
}

.pf-cit-phase.active {
  background: linear-gradient(135deg, rgba(201,169,89,0.15), rgba(124,54,38,0.1));
  border-color: var(--pf-color-accent);
  color: var(--pf-color-accent);
  box-shadow: 0 0 12px rgba(201,169,89,0.1);
}

.pf-cit-phase.done {
  background: rgba(74,222,128,0.08);
  border-color: rgba(74,222,128,0.25);
  color: #4ade80;
}

.pf-cit-phase-arrow {
  color: var(--text-muted, #666);
  font-size: 0.7rem;
}

/* Fortschrittsbalken */
.pf-cit-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.pf-cit-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--pf-color-fire), var(--pf-color-accent));
  transition: width 0.4s ease;
}

.pf-cit-bar-fill.upgrade {
  background: linear-gradient(90deg, #8b5cf6, #c084fc);
}

.pf-cit-bar-fill.complete {
  background: linear-gradient(90deg, #4ade80, #22c55e) !important;
}

/* Projekt-Karten */
.pf-cit-project {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.pf-cit-project:last-child {
  border-bottom: none;
}

.pf-cit-project:hover {
  background: rgba(255,255,255,0.02);
}

.pf-cit-project.locked {
  opacity: 0.4;
}

.pf-cit-project.complete {
  opacity: 0.6;
}

.pf-cit-project-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pf-cit-project-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.pf-cit-project-info {
  flex: 1;
  min-width: 0;
}

.pf-cit-project-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--pf-color-accent);
  font-size: 0.92rem;
}

.pf-cit-project-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-top: 2px;
}

.pf-cit-project-counter {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .pf-cit-phases {
    gap: 4px;
  }
  .pf-cit-phase {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .pf-cit-phase-arrow {
    display: none;
  }
  .pf-cit-project-icon {
    font-size: 1.1rem;
  }
}

/* ===================================================================
   ENCOUNTER / LIVE-KAMPF (FEAT-PF03)
   =================================================================== */

.pf-enc-card {
  background: var(--bg-card, #1a1208);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: opacity 0.3s;
}

.pf-enc-card.dead {
  opacity: 0.35;
}

.pf-enc-card.down {
  border-color: rgba(248,113,113,0.4);
}

.pf-enc-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.pf-enc-card-body {
  padding: 14px 16px;
}

/* HP Bar */
.pf-enc-hp-bar {
  flex: 1;
  height: 14px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
}

.pf-enc-hp-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.4s ease, background 0.3s;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15);
}

/* Damage Input */
.pf-enc-dmg-input {
  width: 70px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.pf-enc-dmg-input:focus {
  border-color: var(--pf-color-accent);
  box-shadow: 0 0 8px rgba(201,169,89,0.2);
}

.pf-enc-dmg-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.15s;
  min-width: 44px;
}

.pf-enc-dmg-btn.damage {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.35);
  color: #f87171;
}

.pf-enc-dmg-btn.damage:hover {
  background: rgba(248,113,113,0.3);
  transform: scale(1.05);
}

.pf-enc-dmg-btn.heal {
  background: rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.35);
  color: #4ade80;
}

.pf-enc-dmg-btn.heal:hover {
  background: rgba(74,222,128,0.3);
  transform: scale(1.05);
}

.pf-enc-dmg-btn.kill {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.5);
  color: #f87171;
}

.pf-enc-dmg-btn.kill:hover {
  background: rgba(248,113,113,0.4);
}

/* Condition Tags */
.pf-enc-cond-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.05));
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.pf-enc-cond-tag:hover {
  background: rgba(251,191,36,0.22);
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(251,191,36,0.15);
}

.pf-enc-cond-tag:active {
  transform: scale(0.97);
}

.pf-enc-add-cond-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.pf-enc-add-cond-btn:hover {
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.3);
  color: #fbbf24;
}

@media (max-width: 600px) {
  .pf-enc-header {
    padding: 14px;
  }
  .pf-enc-title {
    font-size: 1.1rem;
  }
  .pf-enc-dmg-input {
    width: 60px;
    font-size: 0.9rem;
  }
  .pf-enc-dmg-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ===================================================================
   INITIATIVE-LEISTE — Redesign
   =================================================================== */

.pf-init-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.02), transparent);
  transition: all 0.25s ease;
  position: relative;
  margin-left: 20px;
}

.pf-init-row.current {
  border-color: var(--pf-color-accent);
  background: linear-gradient(135deg, rgba(201,169,89,0.12), rgba(124,54,38,0.06));
  box-shadow: 0 0 20px rgba(201,169,89,0.15), inset 0 0 30px rgba(201,169,89,0.03);
  transform: scale(1.01);
}

.pf-init-row.current::before {
  content: '\25B6';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pf-color-accent);
  font-size: 0.85rem;
  text-shadow: 0 0 8px rgba(201,169,89,0.5);
}

.pf-init-row.delayed {
  opacity: 0.4;
  border-style: dashed;
  border-color: rgba(147,197,253,0.2);
  transform: scale(0.98);
}

.pf-init-row.dead {
  opacity: 0.2;
  transform: scale(0.97);
}

.pf-init-row.pc {
  border-left: 4px solid rgba(74,222,128,0.6);
}

.pf-init-row.pc.current {
  border-left-color: #4ade80;
  border-left-width: 4px;
}

.pf-init-row.enemy {
  border-left: 4px solid rgba(248,113,113,0.5);
}

.pf-init-row.enemy.hidden-enemy {
  border-left-color: rgba(147,197,253,0.3);
  background: linear-gradient(135deg, rgba(147,197,253,0.03), transparent);
  border-style: dashed;
  border-left-style: solid;
}

.pf-init-row.enemy.current {
  border-left-color: #f87171;
  border-left-width: 4px;
}

/* Initiative-Badge */
.pf-init-value {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--pf-color-accent);
  background: linear-gradient(135deg, rgba(201,169,89,0.12), rgba(201,169,89,0.04));
  border: 1px solid rgba(201,169,89,0.2);
  border-radius: 10px;
  flex-shrink: 0;
}

.pf-init-row.current .pf-init-value {
  background: linear-gradient(135deg, rgba(201,169,89,0.25), rgba(201,169,89,0.1));
  border-color: var(--pf-color-accent);
  box-shadow: 0 0 10px rgba(201,169,89,0.2);
}

.pf-init-main {
  flex: 1;
  min-width: 0;
}

.pf-init-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.pf-init-name {
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
  font-size: 0.95rem;
}

.pf-init-row.current .pf-init-name {
  color: var(--pf-color-accent);
  text-shadow: 0 0 8px rgba(201,169,89,0.2);
}

/* Status-Tags */
.pf-init-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

.pf-init-tag.delayed {
  color: #93c5fd;
  background: rgba(147,197,253,0.1);
  border-color: rgba(147,197,253,0.2);
}

.pf-init-tag.readied {
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.2);
  animation: pfPulse 2s ease-in-out infinite;
}

/* Conditions row */
.pf-init-conds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* Action-Buttons rechts */
.pf-init-acts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.pf-init-ab {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  color: var(--text-muted, #888);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.pf-init-ab:hover {
  background: rgba(201,169,89,0.15);
  border-color: rgba(201,169,89,0.3);
  color: var(--pf-color-accent);
  transform: scale(1.1);
}

/* ===================================================================
   HERO BANNER — Shared base for standalone pages (Encounter, Citadel)
   =================================================================== */

.pf-hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(201,169,89,0.2);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pf-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2;
}

.pf-hero-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  z-index: 1;
}

.pf-hero-content {
  position: relative;
  z-index: 3;
  padding: 60px 28px 24px;
}

.pf-hero-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  text-shadow: 0 2px 16px rgba(0,0,0,0.7), 0 0 30px rgba(201,169,89,0.15);
  letter-spacing: 0.03em;
  margin: 0 0 4px;
}

.pf-hero-subtitle {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.pf-hero-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pf-back-link {
  display: inline-block;
  color: var(--pf-color-accent, #c9a959);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 12px;
  padding: 4px 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.pf-back-link:hover {
  opacity: 1;
}

/* === Encounter Hero === */

.pf-hero-encounter {
  background:
    url('/assets/pathfinder/encounter-header.webp') center 35% / cover no-repeat;
  border-color: rgba(139,37,0,0.35);
}

.pf-hero-encounter::before {
  background: linear-gradient(90deg, transparent, #f87171, var(--pf-color-accent), #f87171, transparent);
}

.pf-hero-encounter::after {
  background: linear-gradient(0deg, rgba(26,18,8,0.95) 0%, rgba(26,18,8,0.7) 40%, rgba(26,18,8,0.15) 100%);
}

/* === Citadel Hero === */

.pf-hero-citadel {
  background:
    url('/assets/pathfinder/citadel-header.webp') center 40% / cover no-repeat;
  border-color: rgba(201,169,89,0.25);
  min-height: 200px;
}

.pf-hero-citadel::before {
  background: linear-gradient(90deg, transparent, var(--pf-color-accent), var(--pf-color-fire), var(--pf-color-accent), transparent);
}

.pf-hero-citadel::after {
  background: linear-gradient(0deg, rgba(26,18,8,0.95) 0%, rgba(26,18,8,0.65) 45%, rgba(26,18,8,0.1) 100%);
}

/* Legacy encounter header (for in-encounter view) */
.pf-enc-header {
  padding: 20px 24px;
  background:
    linear-gradient(135deg, rgba(139,37,0,0.18), rgba(201,169,89,0.06)),
    rgba(26,18,8,0.85);
  border: 1px solid rgba(139,37,0,0.35);
  border-radius: 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  min-height: 60px;
}

.pf-enc-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f87171, var(--pf-color-accent), #f87171, transparent);
}

.pf-enc-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pf-color-accent);
  text-shadow: 0 0 20px rgba(201,169,89,0.15);
}

@media (max-width: 600px) {
  .pf-init-row {
    padding: 10px 12px;
    gap: 8px;
    margin-left: 0;
  }
  .pf-init-row.current::before {
    display: none;
  }
  .pf-init-value {
    min-width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  .pf-init-name {
    font-size: 0.85rem;
  }
  .pf-init-acts {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pf-enc-title {
    font-size: 1.15rem;
  }
}

/* ===================================================================
   HERO BANNER — Mobile
   =================================================================== */

@media (max-width: 600px) {
  .pf-hero-banner {
    min-height: 140px;
  }
  .pf-hero-content {
    padding: 40px 16px 18px;
  }
  .pf-hero-title {
    font-size: 1.3rem;
  }
  .pf-hero-subtitle {
    font-size: 0.8rem;
  }
  .pf-hero-actions {
    gap: 4px;
  }
}

/* ===================================================================
   GALERIE (FEAT-PF04)
   =================================================================== */

.pf-gal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(26, 18, 8, 0.5);
  border: 1px solid var(--pf-border);
  border-radius: 10px;
}

.pf-gal-filters {
  display: flex;
  gap: 4px;
}

.pf-gal-filter {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-muted, #888);
  cursor: pointer;
  transition: all 0.2s;
}

.pf-gal-filter:hover {
  background: rgba(201,169,89,0.08);
  border-color: rgba(201,169,89,0.2);
  color: var(--text-secondary);
}

.pf-gal-filter.active {
  background: rgba(201,169,89,0.12);
  border-color: var(--pf-color-accent);
  color: var(--pf-color-accent);
}

/* Gallery Grid */
.pf-gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

@media (max-width: 480px) {
  .pf-gal-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}

/* Gallery Card */
.pf-gal-card {
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(26, 18, 8, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
}

.pf-gal-card:hover {
  border-color: var(--pf-color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 12px rgba(201,169,89,0.08);
}

.pf-gal-card.unrevealed {
  opacity: 0.55;
  border-style: dashed;
}

.pf-gal-card.unrevealed:hover {
  opacity: 0.85;
}

.pf-gal-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
}

.pf-gal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pf-gal-card:hover .pf-gal-img-wrap img {
  transform: scale(1.06);
}

.pf-gal-hidden-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(147,197,253,0.15);
  border: 1px solid rgba(147,197,253,0.3);
  border-radius: 4px;
  color: #93c5fd;
  backdrop-filter: blur(4px);
}

.pf-gal-book-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  background: rgba(0,0,0,0.65);
  border-radius: 4px;
  color: var(--pf-color-accent);
  backdrop-filter: blur(4px);
}

.pf-gal-card-info {
  padding: 10px 12px;
}

.pf-gal-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pf-color-accent);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-gal-card-notes {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lightbox */
.pf-gal-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 60000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pfFadeIn 0.2s ease;
}

.pf-gal-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

.pf-gal-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.pf-gal-lb-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.pf-gal-lb-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--pf-color-accent);
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  text-align: center;
  max-width: 80%;
}
