/* =============================================================================
   print-sheet.css — Printable character sheet styles
   All classes use `ps-` prefix. @media print hides toolbar + site chrome.
   ============================================================================= */

/* --- Root & Reset --- */

.ps-root {
  background: #fff;
  color: #111;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 13px;
  line-height: 1.4;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* --- Toolbar (Back + Print buttons) --- */

.ps-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* --- System title --- */

.ps-system-title {
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid #111;
  margin: 0 0 0.75rem;
  padding-bottom: 0.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* --- Sections --- */

.ps-section {
  margin-bottom: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
}

.ps-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid #ccc;
  margin: 0 0 0.4rem;
  padding-bottom: 0.2rem;
}

/* --- Field primitives --- */

.ps-fields-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.4rem;
}

.ps-field {
  display: flex;
  flex-direction: column;
  min-width: 80px;
}

.ps-field-lg {
  min-width: 160px;
}

.ps-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
}

.ps-value {
  font-size: 0.9rem;
  border-bottom: 1px solid #aaa;
  min-width: 60px;
  padding-bottom: 1px;
}

.ps-big-val {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.ps-sub-label {
  font-size: 0.7rem;
  color: #555;
}

.ps-hint {
  font-size: 0.65rem;
  color: #888;
  font-style: italic;
}

.ps-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #444;
  margin-bottom: 2px;
}

.ps-badge {
  display: inline-block;
  background: #ddd;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 2px;
}

.ps-empty {
  color: #888;
  font-style: italic;
  font-size: 0.8rem;
  margin: 0;
}

/* --- Stat table (Mausritter stats) --- */

.ps-stat-table {
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ps-stat-table th,
.ps-stat-table td {
  border: 1px solid #ccc;
  padding: 3px 8px;
  text-align: center;
}

.ps-stat-table th {
  background: #f4f4f4;
  font-weight: 700;
}

.ps-stat-name {
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
}

.ps-stat-val {
  min-width: 36px;
}

/* =============================================================================
   Mausritter
   ============================================================================= */

.ps-maus-identity {
  background: #fafafa;
}

.ps-maus-stats-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.ps-maus-pips {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  min-width: 80px;
}

.ps-maus-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.ps-maus-slot {
  border: 1px solid #bbb;
  border-radius: 2px;
  padding: 4px 6px;
  min-height: 28px;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

.ps-maus-slot-empty {
  color: #ccc;
}

.ps-maus-slot-name {
  font-weight: 500;
}

.ps-maus-status {
  background: #fafafa;
}

.ps-maus-status-cols {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ps-maus-status-block {
  text-align: center;
  min-width: 80px;
}

/* =============================================================================
   Cairn 2E
   ============================================================================= */

.ps-cairn-header {
  background: #fafafa;
}

.ps-cairn-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.75rem;
}

.ps-cairn-left,
.ps-cairn-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ps-cairn-trait {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px solid #eee;
}

.ps-cairn-trait .ps-label {
  min-width: 60px;
}

.ps-cairn-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.ps-cairn-stat-card {
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 4px 6px;
  text-align: center;
}

.ps-cairn-stat-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid #eee;
  margin-bottom: 3px;
}

.ps-cairn-stat-vals {
  display: flex;
  justify-content: space-around;
  align-items: baseline;
}

.ps-cairn-stat-vals .ps-label {
  font-size: 0.6rem;
  margin-right: 2px;
}

.ps-cairn-stat-vals .ps-value {
  font-size: 1rem;
  font-weight: 700;
  border: none;
  padding: 0;
  min-width: auto;
}

.ps-cairn-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ps-cairn-equip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ps-cairn-equip-table th,
.ps-cairn-equip-table td {
  border: 1px solid #ccc;
  padding: 3px 6px;
  text-align: left;
}

.ps-cairn-equip-table th {
  background: #f0f0f0;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* =============================================================================
   D6 family (SWD6 1E + D6 Adventure/Space/Fantasy)
   ============================================================================= */

.ps-d6-header {
  background: #fafafa;
}

.ps-d6-skills-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ps-d6-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ps-d6-attr-group {
  border-left: 3px solid #888;
  padding-left: 0.4rem;
  margin-bottom: 0.3rem;
}

.ps-d6-attr-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.ps-d6-attr-name {
  font-size: 0.82rem;
}

.ps-d6-attr-die {
  font-size: 0.82rem;
  font-family: "JetBrains Mono", monospace;
  background: #f0f0f0;
  padding: 0 4px;
  border-radius: 2px;
}

.ps-d6-skill-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.76rem;
  padding: 1px 0 1px 0.5rem;
  border-bottom: 1px dotted #ddd;
}

.ps-d6-skill-name {
  color: #222;
}

.ps-d6-skill-die {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  background: #e8e8e8;
  padding: 0 3px;
  border-radius: 2px;
}

.ps-d6-wound-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ps-d6-wound-box {
  border: 1px solid #999;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.75rem;
  text-align: center;
  min-width: 80px;
}

.ps-d6-wound-box.ps-active {
  background: #333;
  color: #fff;
  border-color: #333;
  font-weight: 700;
}

.ps-d6-force-row {
  display: flex;
  gap: 0.75rem;
}

.ps-d6-force-box {
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 0.4rem 0.75rem;
  text-align: center;
  min-width: 80px;
}

.ps-d6-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ps-d6-equip-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.ps-d6-equip-item {
  font-size: 0.8rem;
  padding: 2px 4px;
  border-bottom: 1px dotted #ddd;
}

.ps-d6-adsa-cols {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ps-d6-adsa-col {
  flex: 1;
  min-width: 120px;
}

.ps-d6-adsa-item {
  font-size: 0.78rem;
  padding: 2px 0;
  border-bottom: 1px dotted #ddd;
}

/* =============================================================================
   Print media — hide chrome, reset to paper
   ============================================================================= */

@media print {
  .ps-no-print {
    display: none !important;
  }

  .ps-root {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  body > *:not(#app) {
    display: none;
  }

  /* Prevent page breaks inside sections */
  .ps-section,
  .ps-maus-slot,
  .ps-cairn-stat-card,
  .ps-d6-attr-group {
    break-inside: avoid;
  }
}
