@font-face {
  font-family: "Lora";
  src: url("/fonts/lora-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #060709;
  --panel: #101216;
  --text: #d1d2d6;
  --muted: #999ca5;
  --line: #30333b;
  --blue: #548dff;
  --red: #e46262;
  font:
    16px/1.55 Arial,
    Helvetica,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-width: 280px;
  min-height: 100dvh;
  overflow-wrap: break-word;
}
body:has(dialog[open]) { overflow: hidden; }
[hidden] {
  display: none !important;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}
.masthead {
  height: 96px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wordmark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
}
.period {
  color: var(--blue);
}
nav {
  display: flex;
  gap: 22px;
}
.text-button {
  background: none;
  border: 0;
  padding: 9px 0;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  min-height: 44px;
}
.text-button:hover {
  text-decoration-color: currentColor;
}
.muted {
  color: var(--muted);
}
.intro {
  text-align: left;
  margin: 25px auto 0;
  position: relative;
  z-index: 1;
  max-width: 1080px;
  padding: 0 6vw;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--muted);
}
h1,
h2 {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -1.8px;
}
h1 {
  font-size: clamp(40px, 5vw, 70px);
  margin: 18px 0;
}
h2 {
  font-size: 40px;
  margin: 18px 0 25px;
}
h3 {
  font-size: 17px;
  font-weight: 500;
  margin-top: 30px;
}
p {
  color: var(--muted);
}
.intro p {
  margin: 0;
  font-size: 16px;
}
.intro-copy > .primary { margin-top: 26px; min-width: 200px; }
.intro .intro-note { margin-top: 12px; font-size: 12px; }
.sample-postcard { margin: 12px auto; text-align: center; }
#sample-card {
  width: 190px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  border: 1px solid #343947;
  border-radius: 10px;
  transform: rotate(3deg);
  box-shadow: 0 18px 60px #0008;
}
.sample-postcard figcaption { font-size: 11px; color: var(--muted); max-width: 230px; }
#map-wrap {
  position: relative;
  width: 100%;
  height: clamp(280px, 42vw, 520px);
  margin: 0 auto;
  max-width: 1500px;
}
#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
}
#map.zoomed {
  cursor: grab;
}
#map.zoomed:active {
  cursor: grabbing;
}
.coast {
  fill: #0b0e13;
  stroke: #444956;
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
}
.light-mark {
  cursor: pointer;
}
.light-mark:focus-visible .light-hit {
  stroke: var(--text);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}
.zoom {
  position: absolute;
  right: 6vw;
  bottom: 30px;
  display: flex;
  gap: 2px;
}
.zoom button {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border: 1px solid var(--line);
  background: #101216;
  border-radius: 4px;
}
#empty-map {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #b2b5bd;
  background: #060709d9;
  padding: 15px 22px;
  border-radius: 4px;
  pointer-events: none;
  font-size: 14px;
  line-height: 1.8;
  width: max-content;
  max-width: 80%;
}
#pick-hint {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  width: min(90%, 480px);
  text-align: center;
  font-size: 14px;
}
#pick-hint button {
  background: none;
  border: 0;
  color: var(--blue);
  margin-left: 12px;
}
.world-actions {
  text-align: center;
  margin: 0 auto 46px;
}
#retry-map { display: block; margin: 0 auto 16px; }
#map-status { max-width: 440px; padding: 0 20px; margin: 0 auto 12px; }
.legend {
  display: flex;
  justify-content: center;
  gap: 25px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 23px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.blue {
  background: var(--blue);
  box-shadow: 0 0 12px #548dff66;
}
.red {
  background: var(--red);
  box-shadow: 0 0 12px #e4626266;
}
.primary,
.secondary {
  border-radius: 28px;
  padding: 13px 25px;
  min-height: 48px;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.primary {
  background: #d1d2d6;
  color: #0b0c0f;
  border: 1px solid #d1d2d6;
}
.primary:hover {
  background: #eeeff1;
}
.secondary {
  border: 1px solid #555965;
  background: none;
}
.secondary:hover {
  border-color: #a0a5b0;
}
.full {
  width: 100%;
  margin-top: 18px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
footer {
  padding: 20px 6vw 28px;
  border-top: 1px solid #1c1e24;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
#dev-status {
  color: #b1b7c3;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px;
  width: calc(100% - 28px);
  max-width: 520px;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
dialog::backdrop {
  background: #020305cc;
  backdrop-filter: blur(5px);
}
.close {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  font-size: 27px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 14px;
  margin: 12px 0 8px;
}
input,
textarea {
  font: inherit;
  color: var(--text);
  background: #090b0f;
  border: 1px solid #434854;
  border-radius: 6px;
  width: 100%;
  padding: 13px;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 3px 0;
  accent-color: var(--blue);
  flex-shrink: 0;
}
input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.feeling-options {
  display: flex;
  gap: 8px;
  padding: 0;
  border: 0;
  margin: 20px 0;
}
.feeling-options label {
  flex: 1;
  position: relative;
  margin: 0;
}
.feeling-options span {
  border: 1px solid var(--line);
  padding: 12px 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  min-height: 48px;
}
.feeling-options input:checked + span {
  border-color: var(--blue);
  background: #548dff0b;
}
.feeling-options input[value="broken"]:checked + span {
  border-color: var(--red);
  background: #e462620b;
}
.feeling-options input:focus-visible + span {
  outline: 2px solid var(--text);
}
.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 23px;
}
#char-count { white-space: nowrap; }
.draft-tools { min-height: 34px; margin: -10px 0 14px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
#draft-status { margin: 0; font-size: 12px; }
#discard-draft { padding: 0; margin: 0; min-height: 32px; font-size: 12px; }
#code {
  font-size: 24px;
  letter-spacing: 0.3em;
  text-align: center;
}
#change-email, #resend-code { display: block; width: 100%; text-align: center; }
#share-url { overflow-wrap: normal; }
.location-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.location-row > span {
  width: 100%;
  font-size: 14px;
}
.location-status {
  margin: 12px 0 0;
  font-size: 13px;
}
.map-fields { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; }
.preview-dialog { max-width: 560px; text-align: center; }
.preview-dialog h2 { font-size: clamp(29px, 7vw, 36px); margin-bottom: 22px; }
#preview-canvas {
  display: block;
  width: min(100%, 265px, 22dvh);
  height: auto;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.preview-actions button { flex: 1 1 140px; }
#preview-privacy { max-width: 360px; margin: 0 auto 18px; }
#preview-dialog .full { margin-top: 12px; }
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 25px 0 12px;
  font-size: 13px;
  color: #a8acb6;
}
.form-error {
  color: #f28c8c;
  font-size: 14px;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.notice {
  font-size: 14px;
  border-left: 2px solid var(--blue);
  padding-left: 15px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
#toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #20242c;
  color: var(--text);
  border: 1px solid #555c6a;
  padding: 12px 20px;
  border-radius: 7px;
  max-width: 90vw;
  z-index: 10;
  font-size: 14px;
}
#personal {
  max-width: 1250px;
  margin: 30px auto 100px;
  padding: 0 6vw;
  min-height: 65vh;
}
.back {
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 5px;
}
.personal-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 4vw;
  margin-top: 20px;
}
.personal-layout article { min-width: 0; }
.heart-stage {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
}
#heart {
  width: 100%;
  height: 100%;
  display: block;
}
#personal h1 {
  font-size: clamp(32px, 4vw, 52px);
}
.confession {
  font:
    400 clamp(23px, 2.7vw, 34px) / 1.45 "Lora", Georgia,
    serif;
  letter-spacing: -0.4px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.detail-actions .text-button {
  width: 100%;
  text-align: left;
}
#owner-actions {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.danger {
  color: var(--red);
}
#report-light {
  font-size: 12px;
  margin-top: 20px;
}
.picking .intro {
  opacity: 0.35;
}
.picking #map {
  cursor: crosshair;
}
@media (max-width: 650px) {
  .masthead {
    min-height: 78px;
    height: auto;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    flex-wrap: wrap;
    gap: 0 16px;
  }
  .wordmark {
    font-size: 12px;
    letter-spacing: 1.4px;
  }
  nav {
    gap: 16px;
    flex-wrap: wrap;
  }
  .intro {
    margin-top: 25px;
    padding: 0 16px;
    display: block;
    text-align: center;
  }
  .intro h1 {
    font-size: clamp(38px, 11vw, 47px);
  }
  .eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
  }
  .intro p {
    font-size: 14px;
  }
  .intro .intro-note { font-size: 12px; }
  .sample-postcard { margin: 30px auto 0; width: fit-content; }
  #sample-card { width: 150px; }
  #map-wrap {
    height: 310px;
    margin-top: 15px;
  }
  .zoom {
    right: 16px;
    bottom: 12px;
  }
  .zoom button {
    width: 44px;
  }
  .world-actions {
    margin: 10px 0 35px;
  }
  .legend {
    font-size: 12px;
    gap: 20px;
  }
  footer {
    padding: 20px 20px max(20px, env(safe-area-inset-bottom));
    font-size: 12px;
  }
  dialog {
    padding: 30px 20px;
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  }
  h2 {
    font-size: 35px;
  }
  .personal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .heart-stage {
    height: 270px;
    aspect-ratio: auto;
  }
  #personal {
    padding: 0 22px;
    margin-top: 15px;
  }
  .personal-layout article {
    margin-top: 5px;
  }
  .confession {
    font-size: 27px;
  }
  .detail-actions button {
    flex: 1 1 130px;
  }
  .detail-actions .text-button {
    flex: 0 0 100%;
  }
  .field-meta {
    font-size: 11px;
  }
  .feeling-options span {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
