/* S.T.A.L.K.E.R. d20 — Premium Colorized A4 Tactical Dossier Print Stylesheet */

/* SCREEN PREVIEW CONTAINER */
.print-preview-wrapper {
  display: none;
  background: #090d0a;
  border: 2px solid #2b3e30;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.print-preview-wrapper.active {
  display: block;
}

.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2b3e30;
}

.preview-canvas-page {
  background: #fbfbf9;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  margin: 0 auto 30px auto;
  width: 210mm;
  min-height: 285mm;
  padding: 8mm 10mm;
  color: #1a1e1b;
  border-radius: 2px;
  border: 1px solid #c2c9c4;
}

@media screen {
  body:not(.printing-now) > .print-page {
    display: none !important;
  }
}

/* =======================================================
   PRINT RULES (@media print)
   ======================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 5mm 7mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    box-sizing: border-box !important;
  }

  html, body {
    background: #fcfcfb !important;
    color: #141a16 !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
    font-size: 8pt;
    line-height: 1.25;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide screen GUI */
  .pda-statusbar,
  .pda-nav-wrapper,
  .pda-main,
  .pda-controls,
  .dice-tray,
  .no-print,
  .btn,
  header,
  footer,
  .print-preview-wrapper {
    display: none !important;
  }

  .print-page {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    page-break-after: always;
    page-break-inside: avoid;
    height: 284mm;
    max-height: 284mm;
    padding: 2mm 0;
    background: #fcfcfb !important;
  }

  .print-page:last-child {
    page-break-after: avoid;
  }
}

/* =======================================================
   SHARED DOSSIER STYLES (Print & On-Screen Preview)
   ======================================================= */

/* HAZARD STRIPE BANNER */
.p-hazard-stripe {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #141a16,
    #141a16 12px,
    #d97706 12px,
    #d97706 24px
  ) !important;
  margin-bottom: 5px;
  border-radius: 2px;
}

/* TOP MILITARY DOSSIER BANNER */
.p-dossier-header {
  border: 2px solid #1a2920;
  background: #eef3ef !important;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 4px;
  margin-bottom: 6px;
  position: relative;
}

.p-dossier-titles h2 {
  font-size: 13pt;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #111a14;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-dossier-titles span {
  font-size: 7pt;
  font-family: monospace;
  font-weight: bold;
  color: #3f5546;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 1px;
}

.p-stamps-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-stamp-red {
  border: 2px solid #b91c1c;
  color: #b91c1c;
  font-size: 8pt;
  font-weight: 900;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transform: rotate(-3deg);
  border-radius: 3px;
  background: rgba(185, 28, 28, 0.08) !important;
  font-family: monospace;
}

.p-stamp-green {
  border: 1.5px solid #15803d;
  color: #15803d;
  font-size: 7pt;
  font-weight: 900;
  padding: 2px 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  background: rgba(22, 163, 74, 0.08) !important;
}

/* IDENTITY STRIP (TOP INFO) */
.p-identity-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.6fr 1.6fr 1fr;
  gap: 4px;
  margin-bottom: 6px;
}

.p-id-box {
  border: 1px solid #283a2e;
  background: #f8faf8 !important;
  padding: 3px 6px;
  border-radius: 3px;
}

.p-lbl {
  font-size: 6pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #4b6352;
  margin-bottom: 1px;
  letter-spacing: 0.5px;
}

.p-val {
  font-size: 9pt;
  font-weight: 800;
  color: #0f1612;
  min-height: 14px;
}

/* MAIN BODY: 2 COLUMNS */
.p-combat-grid {
  display: grid;
  grid-template-columns: 58mm 1fr;
  gap: 6px;
  flex: 1;
  margin-bottom: 6px;
}

/* LEFT COLUMN: 6 D&D STATS & SKILLS */
.p-left-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-stat-row {
  border: 1.5px solid #26382c;
  background: #edf3ee !important;
  border-radius: 4px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.p-stat-text {
  text-align: left;
}

.p-stat-title {
  font-size: 7.5pt;
  font-weight: 900;
  text-transform: uppercase;
  color: #1a2920;
}

.p-stat-desc {
  font-size: 5.5pt;
  color: #556b5c;
  line-height: 1.1;
}

.p-stat-values {
  display: flex;
  align-items: center;
  gap: 5px;
}

.p-stat-modifier {
  font-size: 11pt;
  font-weight: 900;
  font-family: monospace;
  color: #166534;
  background: #dcfce7 !important;
  border: 1px solid #16a34a;
  padding: 2px 5px;
  border-radius: 3px;
  min-width: 28px;
  text-align: center;
}

.p-stat-score-box {
  font-size: 8.5pt;
  font-weight: 800;
  font-family: monospace;
  color: #1c2720;
  border: 1px solid #8ba392;
  background: #fff !important;
  padding: 2px 4px;
  border-radius: 3px;
  min-width: 22px;
  text-align: center;
}

/* SKILLS MATRIX */
.p-skills-panel {
  border: 1px solid #27382d;
  background: #f7faf7 !important;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 6.5pt;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.p-skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5px 0;
  border-bottom: 1px dotted rgba(0,0,0,0.1);
}

.p-skill-tag {
  color: #556b5c;
  font-size: 5.5pt;
  margin-left: 2px;
}

.p-dot-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.p-dot {
  width: 7px;
  height: 7px;
  border: 1px solid #1b2920;
  border-radius: 50%;
  display: inline-block;
}

/* RIGHT COLUMN: COMBAT VITALS, RADIATION, ARMOR, WEAPONS */
.p-right-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* VITALS BAR */
.p-vitals-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.3fr 1fr;
  gap: 5px;
}

.p-vital-card {
  border: 1.5px solid #223327;
  background: #edf3ee !important;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
}

.p-vital-card.ac { border-color: #15803d; background: #f0fdf4 !important; }
.p-vital-card.hp { border-color: #b91c1c; background: #fef2f2 !important; }
.p-vital-card.psi { border-color: #0284c7; background: #f0f9ff !important; }
.p-vital-card.init { border-color: #b45309; background: #fffbeb !important; }

.p-vital-label {
  font-size: 6pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #374151;
  margin-bottom: 2px;
}

.p-vital-number {
  font-size: 11pt;
  font-weight: 900;
  font-family: monospace;
  color: #111;
}

/* COLOR-CODED RADIATION GAUGE */
.p-radiation-gauge {
  border: 1.5px solid #92400e;
  background: #fffbeb !important;
  padding: 4px 8px;
  border-radius: 4px;
}

.p-rad-top {
  display: flex;
  justify-content: space-between;
  font-size: 6.5pt;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.p-rad-track {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
}

.p-rad-cell {
  height: 12px;
  border: 1px solid #78350f;
  border-radius: 2px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5pt;
  font-weight: bold;
  color: #92400e;
}

.p-rad-cell.warn { background: #fef3c7 !important; border-color: #d97706; }
.p-rad-cell.danger { background: #fee2e2 !important; border-color: #b91c1c; color: #b91c1c; }

/* CONDITIONS STRIP */
.p-conditions-strip {
  display: flex;
  justify-content: space-between;
  font-size: 6pt;
  font-weight: bold;
  background: #eef2ed !important;
  border: 1px solid #2b3e30;
  padding: 2px 6px;
  border-radius: 3px;
}

.p-cond-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.p-chk-box {
  width: 8px;
  height: 8px;
  border: 1px solid #1c2720;
  display: inline-block;
  background: #fff;
}

/* ARMOR & RESISTANCES MATRIX */
.p-armor-panel {
  border: 1.5px solid #27382d;
  background: #f7faf7 !important;
  padding: 5px 8px;
  border-radius: 4px;
}

.p-box-title {
  font-size: 7pt;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #111813;
  border-bottom: 1px solid #27382d;
  padding-bottom: 2px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.p-resists-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  text-align: center;
  margin-top: 4px;
}

.p-res-cell {
  border: 1px solid #94a3b8;
  background: #fff !important;
  border-radius: 3px;
  padding: 2px;
}

.p-res-lbl {
  font-size: 5pt;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
}

.p-res-val {
  font-size: 7.5pt;
  font-weight: 900;
  font-family: monospace;
  color: #0f172a;
}

/* WEAPONS TACTICAL TABLE */
.p-weapons-panel {
  border: 1.5px solid #27382d;
  background: #f7faf7 !important;
  padding: 5px 8px;
  border-radius: 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.p-weap-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 7pt;
  margin-top: 3px;
}

.p-weap-tbl th {
  background: #25382b !important;
  color: #fff !important;
  font-size: 5.5pt;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 4px;
  border: 1px solid #1c2720;
  text-align: left;
}

.p-weap-tbl td {
  border: 1px solid #cbd5e1;
  padding: 4px;
  background: #fff;
  vertical-align: middle;
}

.p-weap-tbl tr:nth-child(even) td {
  background: #f8fafc;
}

/* =======================================================
   PAGE 2: ARTIFACT BELT, INVENTORY, PERKS & NOTES
   ======================================================= */
.p-artifacts-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.p-artifact-pod {
  border: 1.5px solid #0284c7;
  background: #f0f9ff !important;
  border-radius: 4px;
  padding: 4px 6px;
  min-height: 46px;
}

.p-pod-header {
  font-size: 5.5pt;
  font-weight: 800;
  color: #0369a1;
  text-transform: uppercase;
  border-bottom: 1px solid #bae6fd;
  padding-bottom: 1px;
  margin-bottom: 2px;
}

.p-pod-name {
  font-size: 7.5pt;
  font-weight: 800;
  color: #0c4a6e;
}

.p-pod-desc {
  font-size: 5.5pt;
  color: #0284c7;
  line-height: 1.15;
}

/* INVENTORY & SUPPLIES */
.p-inv-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.p-backpack-box {
  border: 1.5px solid #27382d;
  background: #f7faf7 !important;
  padding: 6px;
  border-radius: 4px;
  min-height: 135px;
}

.p-backpack-lines {
  min-height: 110px;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 15px,
    #cbd5e1 16px
  ) !important;
  line-height: 16px;
  font-size: 7.5pt;
  white-space: pre-line;
}

.p-supplies-panel {
  border: 1.5px solid #27382d;
  background: #f7faf7 !important;
  padding: 6px;
  border-radius: 4px;
  font-size: 6.5pt;
}

.p-supply-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-bottom: 1px dotted #cbd5e1;
}

.p-chk-boxes {
  display: flex;
  gap: 2px;
}

.p-mini-sq {
  width: 8px;
  height: 8px;
  border: 1px solid #334155;
  border-radius: 1px;
  display: inline-block;
}

/* PERKS & FIELD NOTES */
.p-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
  margin-bottom: 4px;
}

.p-features-panel {
  border: 1.5px solid #27382d;
  background: #f7faf7 !important;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}

.p-ruled-notes {
  flex: 1;
  min-height: 80px;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 15px,
    #cbd5e1 16px
  ) !important;
  line-height: 16px;
  font-size: 7.5pt;
  white-space: pre-line;
}

/* FOOTER BAR */
.p-footer-strip {
  display: flex;
  justify-content: space-between;
  font-size: 6pt;
  font-family: monospace;
  font-weight: bold;
  color: #64748b;
  border-top: 1px solid #cbd5e1;
  padding-top: 3px;
}
