/* ==========================================================================
   MODALS, JOURNAL & FINALE (5-SUITCASE PANORAMA + POSTER EXPORT)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(36, 30, 26, 0.48);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-sheet {
  position: relative;
  width: min(640px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: 32px 34px 28px;
  box-shadow: var(--shadow-lift);
  animation: fadeScreen 0.28s var(--ease-spring);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: var(--paper-warm);
  color: var(--ink-primary);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
}

.journal-entry-art {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.journal-entry-art svg {
  width: 100%;
  height: 100%;
}

.journal-entry-body {
  flex: 1;
}

.journal-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.journal-entry-head strong {
  font-family: var(--font-serif);
  font-size: 14.5px;
}

.journal-entry-head span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.journal-entry-quote {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.help-box {
  padding: 13px 14px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
}

.help-box h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--accent-deep);
}

.help-box p {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

/* ---------------- ENDING SCREEN ---------------- */
.screen-ending {
  justify-content: center;
  padding: 36px 24px 64px;
}

.ending-container {
  width: min(1220px, 100%);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.ending-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.ending-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 8px;
}

.ending-archetype {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  margin-bottom: 12px;
}

.ending-reflection {
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink-secondary);
}

/* 5-Suitcase Horizontal Panorama */
.panorama-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: 22px 24px 24px;
  box-shadow: var(--shadow-card);
}

.panorama-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--paper-edge);
}

.panorama-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.mini-case-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px 14px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease;
}

.mini-case-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-paper);
}

.mini-case-age {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.mini-case-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 10px;
  color: var(--ink-secondary);
}

.mini-case-canvas {
  width: 100%;
  aspect-ratio: 7 / 6;
  border-radius: 8px;
  margin-bottom: 10px;
}

.mini-case-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.5;
}

/* Keepsakes & Stats */
.keepsakes-showcase {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}

.keepsakes-left,
.keepsakes-right {
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-paper);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 4px;
}

.keepsakes-left h3,
.keepsakes-right h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  margin-bottom: 16px;
}

.keepsakes-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.keepsake-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-edge);
  border-radius: 9px;
}

.keepsake-item-art {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.keepsake-item-art svg {
  width: 100%;
  height: 100%;
}

.keepsake-item-card strong {
  font-family: var(--font-serif);
  font-size: 14px;
  margin-bottom: 4px;
}

.keepsake-item-card small {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-tile {
  padding: 12px 14px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
}

.stat-tile strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--accent-deep);
}

.stat-tile span {
  font-size: 11.5px;
  color: var(--ink-secondary);
}

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.poster-preview-wrap {
  background: var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-paper);
}

.poster-preview-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

#posterCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-paper);
}

@media (max-width: 980px) {
  .panorama-grid { grid-template-columns: repeat(2, 1fr); }
  .keepsakes-showcase { grid-template-columns: 1fr; }
  .keepsakes-cards { grid-template-columns: 1fr; }
}
