* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #eee3ca;
  color: #192731;
  font-family: "Yu Mincho", "MS Mincho", Georgia, serif;
  -webkit-user-select: none;
  user-select: none;
}
canvas#world {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
header {
  position: fixed;
  left: 20px;
  right: 20px;
  top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
  z-index: 10;
}
.left-hud-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}
.objective-card {
  background: rgba(244, 232, 199, 0.92);
  border: 1px solid rgba(25, 39, 49, 0.38);
  border-left: 4px solid #b53e28;
  border-radius: 3px;
  padding: 6px 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
  pointer-events: auto;
  max-width: 450px;
}
.obj-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.obj-counters {
  font-size: 11px;
  color: #2b4251;
  font-weight: 600;
  white-space: nowrap;
}
.obj-title {
  font-size: 12px;
  font-weight: bold;
  color: #192731;
}
.obj-meta {
  font-size: 10px;
  color: #5b4938;
  margin-top: 2px;
}

.form-controls-pill {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(25, 39, 49, 0.84);
  color: #f4e8c7;
  border: 1px solid rgba(194, 157, 91, 0.65);
  border-radius: 14px;
  padding: 4px 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 15;
}

.pilgrimage-drawer {
  position: fixed;
  top: 64px;
  right: 20px;
  width: min(540px, calc(100vw - 40px));
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  background: rgba(244, 232, 199, 0.96);
  border: 2px solid #2b4251;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 45;
  pointer-events: auto;
}
.pilgrimage-drawer.hidden {
  display: none !important;
}
.pilgrimage-drawer .drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.pilgrimage-drawer .brand {
  flex: 1;
  padding: 8px 12px;
}
.pilgrimage-drawer .hud-actions {
  flex-wrap: wrap;
  margin-top: 0;
}
.pilgrimage-drawer aside#caption,
.pilgrimage-drawer .wayfinder-pill,
.pilgrimage-drawer footer {
  position: static;
  transform: none;
  max-width: none;
  left: auto;
  right: auto;
  bottom: auto;
}

.brand {
  background: rgba(238, 227, 202, 0.92);
  padding: 10px 16px;
  border: 1px solid rgba(25, 39, 49, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.24em;
  font-weight: 500;
}
.brand .sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin-top: 4px;
}
.lantern-badge {
  display: inline-block;
  margin-top: 6px;
  background: #2b4251;
  color: #fdf6e2;
  padding: 3px 8px;
  border: 1px solid #c29d5b;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.lantern-badge span {
  font-weight: bold;
  color: #ffd175;
}
.charms-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.charms-badge {
  margin-top: 0;
  background: #402b1f;
  border-color: #f4b938;
  color: #fdf6e2;
}
.combo-badge {
  display: inline-block;
  padding: 3px 9px;
  background: #b53e28;
  color: #ffd175;
  border: 1px solid #ffd175;
  border-radius: 2px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
}
.combo-badge.hidden {
  display: none !important;
}
.interaction-prompt {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  background: rgba(43, 66, 81, 0.94);
  color: #fdf6e2;
  border: 2px solid #ffd175;
  border-radius: 4px;
  padding: 10px 22px;
  font-size: 14px;
  letter-spacing: 0.10em;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.interaction-prompt.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.interaction-prompt strong {
  color: #ffd175;
}
.nav-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}
nav.modes, nav.vpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(238, 227, 202, 0.92);
  border: 1px solid rgba(25, 39, 49, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
button {
  padding: 7px 12px;
  border: 1px solid transparent;
  color: #192731;
  font: 12px "Yu Mincho", Georgia, serif;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
nav.modes button {
  padding: 4px 8px;
  font-size: 11px;
}
button:hover {
  background: rgba(43, 66, 81, 0.12);
  border-color: rgba(43, 66, 81, 0.3);
}
button.active {
  background: #2b4251;
  color: #f4e8c7;
  border-color: #192731;
}
button.ref-btn {
  font-size: 11px;
  padding: 5px 9px;
}
button.ref-btn:hover {
  background: #a46240;
  color: #fef5d8;
}
aside#caption {
  position: fixed;
  left: 20px;
  bottom: 56px;
  background: rgba(238, 227, 202, 0.90);
  padding: 10px 18px;
  border: 1px solid rgba(25, 39, 49, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 10;
  max-width: 540px;
}
aside#caption b {
  display: block;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #192731;
}
aside#caption span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6a5742;
  margin-top: 4px;
}
footer {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: rgba(238, 227, 202, 0.92);
  padding: 6px 16px;
  border: 1px solid rgba(25, 39, 49, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}
.wayfinder-pill {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(25, 39, 49, 0.90);
  color: #fdf6e2;
  border: 1px solid #c29d5b;
  border-radius: 16px;
  padding: 4px 16px;
  font-size: 11px;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  white-space: nowrap;
  z-index: 15;
}
.wayfinder-pill .wayfinder-sep {
  opacity: 0.45;
  color: #ffd175;
}
.wayfinder-pill.pulse-active {
  border-color: #ffd175;
  box-shadow: 0 0 14px rgba(230, 138, 46, 0.55);
}
.rally-pill {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(181, 62, 40, 0.92);
  color: #fdf6e2;
  border: 1px solid #ffd175;
  border-radius: 14px;
  padding: 4px 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 16;
}
.rally-pill.hidden {
  display: none !important;
}
#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #eee3ca;
  color: #192731;
  font-size: 22px;
  letter-spacing: 0.18em;
  z-index: 100;
}
.hidden-ui header, .hidden-ui aside, .hidden-ui footer {
  display: none;
}

/* =========================================================================
 * Phase 2 & 3: Goshuincho Stamp Book, World Map & Discovery UI
 * ========================================================================= */
.hud-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.hud-pill {
  padding: 4px 8px;
  background: #fdf6e2;
  border: 1px solid rgba(25, 39, 49, 0.4);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #192731;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-pill:hover {
  background: #2b4251;
  color: #fdf6e2;
  border-color: #ffd175;
}

/* Discovery Banner Notification — positioned cleanly below top nav bar */
.discovery-banner {
  position: fixed;
  top: 148px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(248, 244, 232, 0.96);
  border: 2px solid #b33927;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 50;
  transition: all 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.discovery-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-35px);
  pointer-events: none;
}
.banner-icon {
  font-size: 28px;
}
.banner-text strong {
  display: block;
  font-size: 15px;
  color: #b33927;
  letter-spacing: 0.08em;
}
.banner-text span {
  display: block;
  font-size: 12px;
  color: #485b68;
  margin-top: 2px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 26, 32, 0.65);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.stamp-book-card, .world-map-card {
  background: #f7f1e1;
  background-image: radial-gradient(#ece3cb 1px, transparent 1px);
  background-size: 16px 16px;
  border: 3px double #3a2a1d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 820px;
  max-height: 88vh;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #c9b48c;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.modal-title-group h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.14em;
  color: #192731;
  font-weight: 600;
}
.modal-sub {
  font-size: 12px;
  color: #6a5742;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.modal-close {
  background: transparent;
  border: 1px solid #9c8465;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #3a2a1d;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: #b33927;
  color: #fff;
  border-color: #b33927;
}

/* Stamp Progress Bar */
.stamp-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2d5bc;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #b8a688;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b33927, #e25b38);
  transition: width 0.3s ease;
}
.stamp-status-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 6px;
  margin-bottom: 18px;
  color: #4c3f33;
}
.stamp-status-text span:first-child {
  font-weight: bold;
  color: #b33927;
}

/* Stamp Grid */
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  overflow-y: auto;
  padding: 4px;
}
.stamp-card {
  background: #fffdf7;
  border: 2px dashed #bba88d;
  padding: 12px 8px;
  text-align: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.stamp-card.unlocked {
  border: 2px solid #b33927;
  background: #fffbfa;
  box-shadow: 0 4px 10px rgba(179, 57, 39, 0.15);
}
.stamp-seal {
  width: 58px;
  height: 58px;
  border: 2px solid #b33927;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #b33927;
  margin-bottom: 8px;
  background: rgba(179, 57, 39, 0.04);
}
.stamp-card.locked .stamp-seal {
  border-color: #c0b39e;
  color: #b3a48e;
  background: transparent;
}
.stamp-kanji {
  font-size: 24px;
  font-weight: bold;
  font-family: "Yu Mincho", "MS Mincho", serif;
  line-height: 1;
}
.stamp-name {
  font-size: 11px;
  font-weight: bold;
  color: #192731;
  line-height: 1.25;
}
.stamp-card.locked .stamp-name {
  color: #8a7b6b;
}
.stamp-sub {
  font-size: 10px;
  color: #6a5742;
  margin-top: 4px;
}
.stamp-status-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.stamp-card.unlocked .stamp-status-badge {
  background: #b33927;
  color: #fff;
}
.stamp-card.locked .stamp-status-badge {
  background: #dfd5c2;
  color: #6b5d4e;
}

/* World Map Viewport */
.world-map-card {
  max-width: 680px;
  align-items: center;
}
.map-viewport {
  width: 520px;
  height: 520px;
  border: 2px solid #3a2a1d;
  background: #eee3ca;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  overflow: hidden;
  margin: 8px 0;
}
#map-canvas {
  width: 520px;
  height: 520px;
  display: block;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: #4c3f33;
  margin-top: 10px;
  justify-content: center;
}
.map-legend b {
  color: #b33927;
}

/* =========================================================================
 * The 10 Ukiyo-e Reference Prints Gallery ([R])
 * ========================================================================= */
.gallery-card {
  max-width: 1140px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.gallery-tab {
  background: #eee3ca;
  border: 1px solid #bba88d;
  color: #4c3f33;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gallery-tab:hover {
  background: #e2d5bc;
}
.gallery-tab.active {
  background: #b33927;
  color: #fff;
  border-color: #8c2617;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  overflow-y: auto;
  padding: 4px;
  max-height: calc(90vh - 150px);
}

.gallery-item {
  background: #fffdf9;
  border: 2px solid #3a2a1d;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.gallery-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #d4c5ae;
  cursor: pointer;
}
.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-thumb-wrap:hover .gallery-thumb {
  transform: scale(1.03);
}

.gallery-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(179, 57, 39, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.gallery-category-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(34, 53, 76, 0.88);
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
}

.gallery-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gallery-title {
  font-size: 15px;
  font-weight: bold;
  color: #192731;
}
.gallery-sub {
  font-size: 11px;
  color: #6a5742;
  font-style: italic;
}
.gallery-composition {
  font-size: 11px;
  line-height: 1.4;
  color: #3e3328;
  margin-top: 4px;
}

.gallery-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.gallery-palette {
  display: flex;
  gap: 5px;
  align-items: center;
}
.palette-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.palette-label {
  font-size: 10px;
  color: #7a6a57;
  margin-right: 2px;
}

.gallery-motifs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.motif-tag {
  font-size: 10px;
  background: #f0e8d8;
  color: #4c3f33;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid #d9ccb6;
}

.gallery-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #eee4cf;
}
.gallery-btn-jump {
  flex: 1;
  background: #b33927;
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}
.gallery-btn-jump:hover {
  background: #8c2617;
}
.gallery-btn-pip {
  background: #365870;
  color: #fff;
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.gallery-btn-pip:hover {
  background: #233e52;
}
.gallery-btn-zoom {
  background: #827768;
  color: #fff;
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.gallery-btn-zoom:hover {
  background: #625748;
}

/* =========================================================================
 * Corner Picture-in-Picture Reference Comparison Window ([P])
 * ========================================================================= */
.reference-pip {
  position: fixed;
  bottom: 45px;
  left: 20px;
  width: 330px;
  background: #fffcf2;
  border: 2px solid #3a2a1d;
  border-radius: 6px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  z-index: 1200;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.reference-pip.hidden {
  display: none !important;
}
.pip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #22354c;
  color: #fff;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
}
.pip-close {
  background: none;
  border: none;
  color: #ccc;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.pip-close:hover {
  color: #fff;
}
#pip-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.pip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 10px;
  background: #eee3ca;
  color: #4c3f33;
}
.pip-btn {
  background: #b33927;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* =========================================================================
 * Fullscreen Lightbox Modal
 * ========================================================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 18, 24, 0.92);
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.lightbox-overlay.hidden {
  display: none !important;
}
.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border: 3px solid #eee3ca;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
  object-fit: contain;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 14px;
  max-width: 800px;
}
.lightbox-caption h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: #ffd978;
}
.lightbox-caption p {
  font-size: 12px;
  color: #ddd;
  line-height: 1.4;
}

@media (max-width: 900px) {
  header { flex-direction: column; gap: 8px; }
  .nav-group { align-items: flex-start; }
  .stamp-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
  .reference-pip { width: 240px; }
  .map-viewport, #map-canvas { width: 340px; height: 340px; }
}

/* =========================================================================
 * Phase 1: Title Screen, NPC Dialogue Box & Quest Journal
 * ========================================================================= */
.title-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(244, 232, 199, 0.88), rgba(25, 39, 49, 0.72));
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  transition: opacity 0.35s ease;
}
.title-overlay.hidden {
  display: none !important;
}
.title-card {
  max-width: 520px;
  width: 90vw;
  background: #f4e8c7;
  border: 3px double #192731;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  padding: 36px 34px 30px;
  text-align: center;
}
.title-kicker {
  font-size: 11px;
  letter-spacing: 0.20em;
  color: #8c2419;
  margin-bottom: 10px;
}
.title-main {
  margin: 0;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: #192731;
}
.title-sub {
  margin-top: 6px;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: #a46240;
}
.title-desc {
  margin: 18px 0 24px;
  font-size: 13px;
  line-height: 1.65;
  color: #36454f;
}
.title-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.title-btn {
  padding: 10px 22px;
  font-size: 13px;
  letter-spacing: 0.12em;
  border: 1px solid #192731;
  cursor: pointer;
}
.title-btn.primary {
  background: #b53e28;
  color: #fdf6e2;
  border-color: #7d2515;
}
.title-btn.primary:hover {
  background: #962f1d;
}
.title-btn.secondary {
  background: #2b4251;
  color: #fdf6e2;
}
.title-btn.secondary:hover {
  background: #1c2c38;
}
.title-btn.hidden {
  display: none !important;
}

.dialogue-box {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 92vw);
  background: rgba(244, 232, 199, 0.97);
  border: 2px solid #192731;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  z-index: 60;
}
.dialogue-box.hidden {
  display: none !important;
}
.dialogue-seal {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 2px solid #b53e28;
  color: #b53e28;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: bold;
  background: rgba(181, 62, 40, 0.08);
}
.dialogue-body {
  flex: 1;
}
.dialogue-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.dialogue-header strong {
  font-size: 15px;
  color: #192731;
}
.dialogue-header span {
  font-size: 11px;
  color: #6a5742;
}
.dialogue-quest-tag {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10px;
  background: #b53e28;
  color: #fdf6e2 !important;
  letter-spacing: 0.06em;
}
.dialogue-body p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #192731;
}
.dialogue-footer {
  font-size: 11px;
  color: #6a5742;
  text-align: right;
}

.journal-card {
  max-width: 720px;
}
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 54vh;
  overflow-y: auto;
  margin-top: 10px;
}
.journal-item {
  background: #fdf6e2;
  border: 1px solid rgba(25, 39, 49, 0.25);
  border-left: 4px solid #c29d5b;
  padding: 10px 14px;
}
.journal-item.active {
  border-left-color: #b53e28;
}
.journal-item.completed {
  border-left-color: #3a7554;
  opacity: 0.88;
}
.journal-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.journal-item-title {
  font-size: 14px;
  font-weight: bold;
  color: #192731;
}
.journal-status {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  background: #e9dec2;
  color: #192731;
  text-transform: uppercase;
}
.journal-item.active .journal-status {
  background: #b53e28;
  color: #fdf6e2;
}
.journal-item.completed .journal-status {
  background: #3a7554;
  color: #fdf6e2;
}
.journal-obj {
  font-size: 12px;
  color: #485b68;
  margin-bottom: 6px;
}
.journal-bar {
  height: 5px;
  background: rgba(25, 39, 49, 0.12);
  overflow: hidden;
}
.journal-bar-fill {
  height: 100%;
  background: #b53e28;
}
.journal-item.completed .journal-bar-fill {
  background: #3a7554;
}
.journal-upgrades {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.upgrade-badge {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid #c29d5b;
  background: rgba(25, 39, 49, 0.08);
  color: #6a5742;
}
.upgrade-badge.unlocked {
  background: #2b4251;
  color: #ffd175;
  border-color: #b53e28;
  font-weight: bold;
}
#map-canvas {
  cursor: pointer;
}

/* =========================================================================
 * Phase 4: Woodblock Sketchbook Photo Mode ([P]) & Printed Postcards
 * ========================================================================= */
.photo-overlay {
  position: fixed;
  inset: 18px;
  border: 1px solid rgba(25, 39, 49, 0.35);
  pointer-events: none;
  z-index: 80;
}
.photo-overlay.hidden {
  display: none !important;
}
.photo-crop {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #b53e28;
  border-style: solid;
  border-width: 0;
}
.photo-crop.tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; }
.photo-crop.tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; }
.photo-crop.bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; }
.photo-crop.br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; }

.photo-top-tag {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244, 232, 199, 0.92);
  color: #192731;
  border: 1px solid #192731;
  padding: 4px 16px;
  font-size: 11px;
  letter-spacing: 0.16em;
}
.photo-bottom-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(244, 232, 199, 0.94);
  border: 1px solid #192731;
  padding: 6px 16px;
  font-size: 12px;
  pointer-events: auto;
  white-space: nowrap;
}
.photo-bottom-bar #photo-region-label {
  font-weight: bold;
  color: #b53e28;
}
.photo-print-btn {
  background: #b53e28;
  color: #fdf6e2;
  border: 1px solid #7d2515;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
}
.photo-print-btn:hover {
  background: #942e1c;
}
.photo-exit-hint {
  font-size: 11px;
  color: #485b68;
}
.photo-flash {
  position: fixed;
  inset: 0;
  background: #fdf6e2;
  opacity: 0.85;
  z-index: 300;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.photo-flash.hidden {
  display: none !important;
}
body.photo-mode-active header,
body.photo-mode-active #objective-card,
body.photo-mode-active #form-controls-pill,
body.photo-mode-active #pilgrimage-drawer,
body.photo-mode-active #caption,
body.photo-mode-active #interaction-prompt,
body.photo-mode-active #wayfinder-pill,
body.photo-mode-active #rally-pill,
body.photo-mode-active footer {
  display: none !important;
}

.postcard-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(25, 39, 49, 0.25);
}
.postcard-header {
  font-size: 13px;
  font-weight: bold;
  color: #192731;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.postcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.postcard-card {
  background: #fdf6e2;
  border: 1px solid rgba(25, 39, 49, 0.3);
  padding: 5px;
  text-align: center;
}
.postcard-card img {
  width: 100%;
  display: block;
  border: 1px solid #192731;
}
.postcard-card span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #485b68;
}
.finale-card {
  max-width: 560px;
}
.finale-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.finale-stat {
  background: #fdf6e2;
  border: 1px solid rgba(25, 39, 49, 0.28);
  border-left: 4px solid #b53e28;
  padding: 10px 14px;
}
.finale-stat b {
  display: block;
  font-size: 18px;
  color: #b53e28;
}
.finale-stat span {
  font-size: 11px;
  color: #485b68;
}

/* Clean Presentation & Photographic Capture Mode */
body.hide-all-hud header,
body.hide-all-hud #form-controls-pill,
body.hide-all-hud #pilgrimage-drawer,
body.hide-all-hud #caption,
body.hide-all-hud #interaction-prompt,
body.hide-all-hud #discovery-banner,
body.hide-all-hud #wayfinder-pill,
body.hide-all-hud #rally-pill,
body.hide-all-hud #dialogue-box,
body.hide-all-hud #title-screen,
body.hide-all-hud footer,
body.hide-all-hud .controls-hint,
body.hide-all-hud #pip-overlay {
  display: none !important;
}


/* Locked origami form pills (unlocked physically at Funaya Pier, Coastal Roadhead, and Launch Deck) */
.modes button.locked {
  opacity: 0.56;
  border-style: dashed;
}
.modes button.locked::after {
  content: ' [Locked]';
  font-size: 0.72em;
  opacity: 0.8;
}
