/* ============================================================
   GOOGLE FONTS
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600&display=swap');

/* ============================================================
   ROOT VARIABLES — tuned for dark starry background
============================================================ */
:root {
  --bg:           #0a0e1a;
  --paper:        #e4e8df;
  --paper-mid:    #d4d9cc;
  --paper-dark:   #bfc6b4;
  --ink:          #dde4d8;
  --ink-mid:      #b0bca8;
  --ink-faint:    #7a8a78;
  --sage:         #8aaa7a;
  --sage-light:   #a8c090;
  --slate:        #4a5a6a;
  --slate-light:  #6a7f92;
  --dust:         #8a8070;
  --accent:       #a09070;
  --cream:        #f0ede4;
  --frame-dark:   #0d1220;
  --frame-mid:    #141a2a;
  --frame-border: #2a3a5a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
}

body {
  background-color: #080c18;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 3px,
      rgba(100,140,220,0.06) 3px, rgba(100,140,220,0.06) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 3px,
      rgba(100,140,220,0.04) 3px, rgba(100,140,220,0.04) 4px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23g)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ============================================================
   OUTER FRAME
============================================================ */
.frame-outer {
  position: relative;
  width: clamp(600px, 88vw, 980px);
  height: clamp(420px, 82vh, 640px);
  border-radius: 18px;
  background: var(--frame-dark);
  box-shadow:
    0 0 0 1.5px var(--frame-border),
    0 0 0 4px var(--frame-dark),
    0 0 0 5.5px rgba(60,90,160,0.3),
    0 0 60px rgba(0,0,0,0.8);
  padding: 5px;
}

.frame-outer::before, .frame-outer::after {
  content: '+';
  position: absolute;
  color: var(--slate-light);
  font-size: 0.8rem;
  opacity: 0.4;
  z-index: 2;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
}
.frame-outer::before { top: 10px; left: 14px; }
.frame-outer::after  { bottom: 10px; right: 14px; }

/* ============================================================
   INNER CONTAINER
============================================================ */
.container {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: url('stars.png') center center / cover no-repeat;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   PERFORATED EDGE
============================================================ */
.stamp-edge { display: none; }

/* ============================================================
   HEADER
============================================================ */
header {
  position: absolute;
  top: 22px;
  left: 28px;
  z-index: 10;
}

.header-brand { display: flex; flex-direction: column; }
.header-text { display: flex; flex-direction: column; }

.title {
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  line-height: 1;
}
.subtitle {
  font-size: 0.7rem;
  color: var(--ink-mid);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin-top: 6px;
}

/* ============================================================
   POSTMARK STAMP — left-middle (clickable)
============================================================ */
.header-postmark {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
}

.pm-stamp-body {
  border: 2px solid rgba(168,200,232,0.5);
  border-radius: 4px;
  padding: 14px 12px;
  width: 100px;
  text-align: center;
  position: relative;
  box-shadow:
    0 0 0 5px var(--frame-dark),
    0 0 0 7px rgba(168,200,232,0.3);
  background: rgba(30,50,90,0.4);
  transition: background 0.2s, box-shadow 0.2s;
}
.header-postmark:hover .pm-stamp-body {
  background: rgba(50,80,130,0.5);
  box-shadow:
    0 0 0 5px var(--frame-dark),
    0 0 0 7px rgba(168,200,232,0.55);
}
.pm-stamp-body::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 5px;
  background:
    radial-gradient(circle, rgba(168,200,232,0.45) 1.5px, transparent 1.5px) 0 0 / 8px 8px;
  pointer-events: none;
}

.pm-ring { border: none; width: auto; height: auto; opacity: 1; display: block; }
.header-postmark:hover .pm-ring { opacity: 1; border-color: transparent; }

.pm-inner-text {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: lowercase;
  line-height: 1.5;
  text-align: center;
  display: block;
  transition: color 0.2s;
}
.header-postmark:hover .pm-inner-text { color: var(--sage-light); }
.pm-dashes {
  width: 50px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--ink-faint) 0, var(--ink-faint) 2px, transparent 2px, transparent 5px);
  margin: 4px auto;
}

/* ============================================================
   DRAG HINT — top center
============================================================ */
.drag-hint-top {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--ink-mid);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 10;
  white-space: nowrap;
}

/* ============================================================
   UPSIDE DOWN — top right
============================================================ */
.upside-down-wrap {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 180px;
  text-align: right;
  z-index: 10;
}

.upside-down-q {
  font-size: 0.65rem;
  color: var(--ink-mid);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  border-bottom: none;
  cursor: default;
  padding-bottom: 0;
  display: block;
  transition: color 0.2s;
  line-height: 1.5;
}
.upside-down-wrap:hover .upside-down-q { color: var(--sage-light); }

.upside-down-explanation {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease;
  margin-top: 0;
  width: 100%;
  text-align: right;
}
.upside-down-wrap:hover .upside-down-explanation {
  max-height: 500px;
  opacity: 1;
  margin-top: 8px;
}

.upside-down-explanation p {
  font-size: 0.54rem;
  color: var(--ink-mid);
  line-height: 1.7;
  letter-spacing: 0.02em;
  margin-bottom: 5px;
  font-family: 'Times New Roman', Times, serif;
}
.upside-down-explanation p:last-child {
  margin-bottom: 0;
  color: var(--sage-light);
  font-size: 0.52rem;
}

/* ============================================================
   GLOBE — dead center
============================================================ */
.globe-section {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.globe-wrapper {
  position: relative;
  flex-shrink: 0;
  pointer-events: all;
}

.drag-hint-inline { display: none; }

/* ============================================================
   BOTTOM BAR
============================================================ */
.bottom-bar {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}
.bottom-bar > * { pointer-events: all; }

.bottom-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--ink-mid);
  letter-spacing: 0.14em;
  text-transform: lowercase;
  white-space: nowrap;
}

.bottom-bar .garden-link {
  margin-left: auto;
  font-size: 0.6rem;
}

/* ============================================================
   ADDRESS MODAL
============================================================ */
.addr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,14,8,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}
.addr-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.addr-modal {
  background: var(--cream);
  border-radius: 6px;
  padding: 28px 30px 24px;
  width: min(380px, 90vw);
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(74,90,66,0.2);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.2,0.8,0.3,1);
}
.addr-modal-overlay.open .addr-modal {
  transform: translateY(0) scale(1);
}
.addr-modal::before {
  content: '';
  position: absolute; inset: 0; border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}
.addr-modal-close {
  position: absolute;
  top: 10px; right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-faint);
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  transition: color 0.2s;
  line-height: 1;
  z-index: 1;
}
.addr-modal-close:hover { color: #654321; }

.addr-modal-title {
  font-size: 0.85rem;
  color: #;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.addr-modal-sub {
  font-size: 0.54rem;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin-bottom: 18px;
  border-bottom: 1px dashed rgba(74,90,66,0.25);
  padding-bottom: 14px;
  position: relative;
  z-index: 1;
}

.addr-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.addr-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.addr-label {
  font-size: 0.48rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.addr-input {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(74,90,66,0.3);
  padding: 5px 0;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.addr-input:focus { border-bottom-color: var(--sage); }
.addr-input::placeholder { color: var(--ink-faint); opacity: 0.5; }

.addr-submit {
  margin-top: 6px;
  background: none;
  border: 1px solid rgba(74,90,66,0.4);
  border-radius: 3px;
  padding: 8px 16px;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  font-size: 0.65rem;
  color: var(--ink-mid);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.addr-submit:hover {
  background: var(--sage);
  color: var(--cream);
  border-color: var(--sage);
}

.addr-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  position: relative;
  z-index: 1;
  text-align: center;
}
.addr-success.show { display: flex; }
.addr-success-icon {
  font-size: 1.4rem;
  opacity: 0.6;
}
.addr-success-text {
  font-size: 0.7rem;
  color: var(--ink-mid);
  letter-spacing: 0.1em;
  line-height: 1.6;
}
.addr-saved-list {
  margin-top: 6px;
  font-size: 0.6rem;
  color: var(--sage);
  letter-spacing: 0.06em;
  line-height: 1.7;
}
.addr-add-another {
  font-size: 0.54rem;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-decoration: none;
  border-bottom: 1px dashed rgba(74,90,66,0.4);
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  margin-top: 4px;
  transition: color 0.2s;
}
.addr-add-another:hover { color: var(--sage); }

/* Return to garden link */
.garden-link {
  font-size: 0.58rem;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: lowercase;
  text-decoration: none;
  border-bottom: 1px dashed rgba(138,170,122,0.4);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.garden-link:hover { color: var(--sage-light); border-color: var(--sage-light); }

/* ============================================================
   GLOBE CANVAS & PINS CONTAINER
============================================================ */
#globeCanvas {
  display: block;
  border-radius: 50%;
  cursor: grab;
  box-shadow:
    0 0 0 1.5px rgba(107,122,94,0.3),
    0 0 50px rgba(15,20,12,0.45),
    0 10px 40px rgba(10,15,8,0.35);
}
#globeCanvas:active { cursor: grabbing; }

#pinsContainer {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}

/* ============================================================
   PINS
============================================================ */
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: all;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, filter 0.2s;
  z-index: 10;
}
.pin:hover {
  transform: translate(-50%, -108%) scale(1.3);
  filter: drop-shadow(0 0 7px rgba(107,122,94,0.9));
}
.pin-head {
  width: 10px; height: 10px;
  background: var(--sage-light);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1px solid rgba(60,75,50,0.5);
}
.pin-pulse { display: none; }
.pin-stem {
  width: 1.5px; height: 8px;
  background: var(--sage);
  margin-top: -1px;
}

/* ============================================================
   POSTCARD MODAL OVERLAY
============================================================ */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20,25,18,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(2px);
  border-radius: 12px;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px; height: 30px;
  background: var(--paper);
  border: 1.5px solid rgba(74,90,66,0.4);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--ink-mid);
  line-height: 1;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
}
.close-btn:hover { background: var(--ink); color: var(--paper); }

/* ============================================================
   NAV ARROWS
============================================================ */
.postcard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-btn {
  background: rgba(232,236,224,0.15);
  border: 1px solid rgba(232,236,224,0.3);
  color: var(--paper);
  border-radius: 3px;
  width: 28px; height: 28px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  opacity: 0; pointer-events: none;
  font-family: 'Pixelify Sans', 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
}
.nav-btn.visible { opacity: 1; pointer-events: all; }
.nav-btn:hover { background: rgba(232,236,224,0.28); }
.nav-counter {
  font-size: 0.65rem;
  color: rgba(220,225,215,0.75);
  letter-spacing: 0.1em;
  min-width: 100px;
  text-align: center;
  opacity: 0;
}
.nav-counter.visible { opacity: 1; }

/* ============================================================
   POSTCARD
============================================================ */
.postcard-scene {
  perspective: 1100px;
  width: min(400px, 72vw);
}

.postcard {
  width: 100%;
  aspect-ratio: 3/2;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.35,0.1,0.2,1);
  cursor: pointer;
  animation: none;
}
.postcard:hover { animation-play-state: paused; }
.postcard.flipped { transform: rotateY(180deg); }
@keyframes cardFloat {
  0%,100% { transform: translateY(0) rotate(-0.4deg); }
  50%      { transform: translateY(-6px) rotate(0.3deg); }
}
.postcard.flipped { animation: none; }

.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
}

/* ============================================================
   CARD FRONT
============================================================ */
.card-front {
  background: var(--cream);
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 3px 4px 20px rgba(10,14,8,0.4), 0 0 0 1px rgba(74,90,66,0.2);
}

.card-photo-full {
  position: absolute;
  inset: 8px;
  background: #8aaa8a;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-real-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-img-label {
  position: absolute;
  font-size: 0.75rem;
  color: rgba(30,35,26,0.55);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 4px 8px;
  pointer-events: none;
}

.card-caption {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 0.85rem;
  color: #2a5a9a;
  letter-spacing: 0.04em;
  z-index: 5;
  text-align: right;
  line-height: 1.3;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(255,255,255,0.6);
  font-family: 'Times New Roman', Times, serif;
}

.card-split-info {
  display: none;
  position: absolute;
  top: 0; right: 0;
  width: 42%;
  height: 100%;
  background: var(--cream);
  border-left: 1px solid rgba(74,90,66,0.15);
  flex-direction: column;
  padding: 12px 12px 10px 14px;
  gap: 10px;
  z-index: 4;
  overflow: hidden;
}
.card-split-info.active {
  display: flex;
}
.card-split-info.active ~ .card-photo-full,
.card-photo-full:has(~ .card-split-info.active) {
  right: 42%;
}

.split-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.split-postmark {
  width: 52px; height: 52px;
  border: 1.5px solid rgba(30,35,26,0.3);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.split-stamp {
  width: 54px; height: 64px;
  border: 2px solid rgba(30,35,26,0.25);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--cream), 0 0 0 4px rgba(74,90,66,0.3);
  flex-shrink: 0;
}
.split-stamp-img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.split-memory {
  font-size: 0.72rem;
  color: var(--ink);
  line-height: 1.65;
  flex: 1;
  overflow: hidden;
  font-family: 'Times New Roman', Times, serif;
}

.stamp1-img {
  width: 120px;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.header-postmark:hover .stamp1-img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5));
}

/* ============================================================
   CARD BACK
============================================================ */
.card-back {
  background: var(--cream);
  transform: rotateY(180deg);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  box-shadow:
    3px 4px 20px rgba(10,14,8,0.4),
    0 0 0 1px rgba(74,90,66,0.2);
}
.card-back::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: 8px;
}

.back-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(74,90,66,0.18);
  padding-bottom: 7px;
  margin-bottom: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.back-label {
  font-size: 0.58rem;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: lowercase;
  font-style: italic;
  font-family: 'Times New Roman', Times, serif;
}
.back-location-name {
  font-size: 0.75rem;
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
  font-family: 'Times New Roman', Times, serif;
}
.back-stamp {
  width: 36px; height: 42px;
  background: var(--sage);
  border-radius: 2px;
  box-shadow:
    0 0 0 2.5px var(--cream),
    0 0 0 3.5px rgba(74,90,66,0.4),
    1px 2px 4px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.back-stamp::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: #332421;
  opacity: 0.4;
}
.back-stamp-inner {
  width: 20px; height: 26px;
  border: 1px solid rgba(240,237,228,0.45);
  border-radius: 1px;
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.back-stamp-inner::after {
  content: '✦';
  font-size: 0.55rem;
  color: rgba(240,237,228,0.7);
}

.back-body {
  display: flex;
  flex: 1;
  gap: 14px;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.back-message {
  flex: 1;
  border-right: 1.5px solid rgba(74,90,66,0.18);
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.back-msg-label {
  font-size: 0.46rem;
  color: #332421;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: 'Times New Roman', Times, serif;
}
.back-note {
  overflow-y: auto;
  max-height: 100%;
  padding-right: 6px; 
  white-space: pre-line;
  font-size: 0.45rem;
  color: #332421;
  line-height: 1.6;
  flex: 1;
  font-family: 'Times New Roman', Times, serif;
}

.back-note::-webkit-scrollbar {
  width: 6px;
}

.back-note::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}

.back-address {
  width: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.back-postmark {
  width: 50px; height: 50px;
  border: 1.5px solid rgba(74,90,66,0.3);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  align-self: flex-end;
  margin-bottom: 5px;
  opacity: 0.5;
}
.back-pm-text {
  font-size: 0.32rem;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  font-family: 'Times New Roman', Times, serif;
}
.back-pm-dash {
  width: 26px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--ink) 0, var(--ink) 1.5px, transparent 1.5px, transparent 3px);
  margin: 1px 0;
  opacity: 0.5;
}
.addr-lines { display: flex; flex-direction: column; gap: 6px; }
.addr-line {
  height: 1px;
  background: rgba(74,90,66,0.2);
  border-radius: 1px;
}

.flip-hint {
  font-size: 0.62rem;
  color: rgba(176,188,168,0.65);
  letter-spacing: 0.1em;
  text-align: center;
}

/* ============================================================
   AIRPLANE WINDOW ENTRY PAGE
============================================================ */
body.pre-entry .frame-outer { opacity:0; pointer-events:none; transform: scale(.985); }
body.entered .frame-outer { opacity:1; pointer-events:all; transform: scale(1); transition: opacity .9s cubic-bezier(.16,.86,.22,1), transform .9s cubic-bezier(.16,.86,.22,1); }
body.entered .airplane-entry { display:none; }
body.opening .airplane-entry { opacity:0; transform: scale(1.01); filter: blur(5px); pointer-events:none; }

.airplane-entry {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: 'Times New Roman', Times, serif;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: opacity .98s cubic-bezier(.16,.86,.22,1), transform .98s cubic-bezier(.16,.86,.22,1), filter .98s cubic-bezier(.16,.86,.22,1);
  /* warm cabin wall — soft linen feel, no hard pixel grid */
  background-color: #d8d3c8;
  background-image:
    linear-gradient(160deg, rgba(255,255,255,.18) 0%, transparent 55%),
    linear-gradient(340deg, rgba(90,84,76,.10) 0%, transparent 60%);
}

.airplane-card {
  position: relative;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  box-shadow: none;
}

.airplane-card::before {
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.12) 0%, transparent 65%);
  opacity: 1;
}

.airplane-card::after {
  content:'';
  position:absolute;
  inset: 0;
  pointer-events:none;
  box-shadow: inset 0 0 80px rgba(50,45,40,.14);
}

.airplane-window-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(455px, 50vw);
  height: min(720px, 88vh);
  min-width: 330px;
  min-height: 560px;
  z-index: 4;
}

.airplane-window-outer {
  position: absolute;
  inset: 0;
  border-radius: 49% / 36%;
  background: linear-gradient(160deg, #f0ebe0 0%, #ddd6c8 60%, #ccc4b8 100%);
  border: 2px solid #b0a898;
  box-shadow:
    0 0 0 5px #e2dbd0,
    0 0 0 8px #c8c0b4,
    0 24px 48px rgba(38,34,28,.3),
    inset 0 2px 6px rgba(255,255,255,.5),
    inset 0 -2px 4px rgba(80,72,60,.12);
}

.airplane-window-outer::before {
  content:'';
  position:absolute;
  inset: 36px 30px;
  border-radius: 47% / 33%;
  border: 1.5px solid rgba(160,150,136,.5);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.08);
  pointer-events:none;
}

.airplane-window-mid {
  position: absolute;
  inset: 76px 58px 70px;
  border-radius: 44% / 29%;
  background: linear-gradient(160deg, #cdc6bb 0%, #b8b0a4 100%);
  padding: 10px;
  border: 1.5px solid #9a9288;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.3),
    inset 0 -2px 4px rgba(60,54,46,.15),
    0 2px 8px rgba(0,0,0,.12);
}

.airplane-window-glass {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 40% / 25%;
  overflow: hidden;
  background:#080c18;
  border: 2px solid #6f6b67;
  box-shadow:
    inset 0 0 0 5px #111827,
    inset 0 0 0 6px rgba(232,236,224,.16);
}

.airplane-window-glass::before {
  content:'';
  position:absolute;
  inset:0;
  background: url('stars.png') center center / cover no-repeat;
  opacity:.72;
}

.airplane-copy, .airplane-garden-link, .sky-line, .window-city, .entry-plane, .window-text { display:none; }
.entry-mini-globe { display:none; }

#entryGlobeCanvas {
  position:absolute;
  z-index: 4;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  width: min(285px, 73%);
  height: auto;
  border-radius:50%;
  opacity: .97;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,.42));
}

.window-shade {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  /* natural linen/paper texture — warm, soft, no harsh grid */
  background-color: #ece7db;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(210,202,190,.08) 100%),
    repeating-linear-gradient(
      92deg,
      transparent 0px, transparent 18px,
      rgba(160,148,130,.06) 18px, rgba(160,148,130,.06) 19px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0px, transparent 28px,
      rgba(140,130,115,.05) 28px, rgba(140,130,115,.05) 29px
    );
  z-index: 20;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 38px;
  text-align: center;
  color: #31302c;
  transform: translateY(0);
  border-bottom: 1.5px solid #b8b0a2;
  box-shadow:
    0 14px 36px rgba(30,28,24,.22),
    inset 0 1px 0 rgba(255,255,255,.55);
  will-change: transform;
}
.window-shade:active { cursor: grabbing; }

.window-shade:before { display:none; }
.window-shade:after {
  content:'';
  position:absolute;
  left:50%;
  bottom:21px;
  transform:translateX(-50%);
  width:120px;
  height:18px;
  border-radius: 50% 50% 8px 8px / 70% 70% 8px 8px;
  background: linear-gradient(180deg, #f0ebe0, #ddd6c8);
  border: 1.5px solid #b0a898;
  box-shadow: 0 2px 5px rgba(80,72,60,.15);
}

.shade-message {
  position: relative;
  z-index: 2;
  max-width: 285px;
  font-family: 'Times New Roman', Times, serif;
  font-size: clamp(.88rem, 1.1vw, 1.05rem);
  line-height: 1.75;
  letter-spacing: .01em;
  font-weight: 400;
  color: #3e3a34;
  transition: opacity .18s ease, transform .18s ease;
}
.window-shade.is-moving .shade-message { opacity:0; transform: translateY(-8px); }
.shade-drag-note { display:block; margin-top:20px; font-size:.64rem; letter-spacing:.08em; opacity:.55; text-transform:lowercase; font-weight:600; }
.return-airplane-link { position: absolute; left: 28px; bottom: 18px; z-index: 11; font-size: .6rem; color: var(--ink-faint); letter-spacing: .18em; text-transform: lowercase; text-decoration: none; border-bottom: 1px dashed rgba(138,170,122,0.4); padding-bottom: 1px; }
.return-airplane-link:hover { color: var(--sage-light); border-color: var(--sage-light); }

@media (max-width: 720px) {
  .airplane-card { width: 100vw; height: 100vh; }
  .airplane-window-wrap { width: 82vw; height: 82vh; min-width: 0; min-height: 500px; }
  #entryGlobeCanvas { width: min(250px, 70%); }
}

/* ============================================================
   SOLIDARITY HOVER + FLAGS
============================================================ */
.solidarity-wrap {
  position: absolute;
  left: 28px;
  bottom: 42px;
  z-index: 10;
  width: 130px;
  text-align: left;
}

.solidarity-q {
  font-size: 0.58rem;
  color: var(--ink-mid);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  display: block;
  transition: color 0.2s;
  line-height: 1.5;
  cursor: default;
}
.solidarity-wrap:hover .solidarity-q { color: var(--sage-light); }

.solidarity-explanation {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease;
  margin-top: 0;
}
.solidarity-wrap:hover .solidarity-explanation {
  max-height: 200px;
  opacity: 1;
  margin-top: 6px;
}
.solidarity-explanation p {
  font-size: 0.5rem;
  color: var(--ink-mid);
  line-height: 1.7;
  letter-spacing: 0.02em;
  font-family: 'Times New Roman', Times, serif;
}

.solidarity-flags {
  margin-top: 8px;
}

.solidarity-stamp-frame {
  position: relative;
  width: 130px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.solidarity-stamp-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.solidarity-stamp-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
}