:root {
  --ink: #24304f;
  --night: #263568;
  --blue: #65b7ff;
  --mint: #8ee8d2;
  --pink: #ff9dc6;
  --sun: #ffd873;
  --paper: #fff5d9;
  --white: #fffaf0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: radial-gradient(circle at 18% 14%, #ffe7a1 0 9%, transparent 10%),
    radial-gradient(circle at 83% 20%, #82def1 0 8%, transparent 9%),
    linear-gradient(145deg, #5969bf 0%, #6ab6d7 42%, #ffe391 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.cover-screen {
  min-height: 100vh;
  padding: 7vh 18px 32px;
  display: grid;
  place-items: center;
  align-content: center;
  position: relative;
}

.sky-decor span {
  position: absolute;
  display: block;
}

.star {
  width: 18px;
  height: 18px;
  background: var(--sun);
  clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 57%, 80% 94%, 50% 70%, 20% 94%, 32% 57%, 2% 36%, 39% 36%);
  animation: twinkle 2.6s infinite ease-in-out;
}

.star-a { left: 13%; top: 14%; }
.star-b { right: 12%; top: 32%; transform: scale(.8); animation-delay: .7s; }
.star-c { left: 75%; bottom: 14%; transform: scale(1.2); animation-delay: 1.4s; }

.planet {
  border: 5px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: #ff9dc6;
  box-shadow: 0 12px 0 rgba(36, 48, 79, .1);
}

.planet-a { width: 76px; height: 76px; left: 8%; bottom: 16%; }
.planet-b { width: 44px; height: 44px; right: 8%; top: 12%; background: var(--mint); }

.orbit {
  width: 86vw;
  height: 48vh;
  left: 7vw;
  top: 22vh;
  border: 2px dashed rgba(255, 255, 255, .54);
  border-radius: 50%;
  transform: rotate(-13deg);
}

.cover-frame {
  width: min(72vw, 340px);
  aspect-ratio: 3 / 4;
  padding: 12px;
  border-radius: 28px;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 12px 14px 0 rgba(36, 48, 79, .24);
  transform: rotate(-2deg);
  z-index: 2;
  position: relative;
  overflow: hidden;
}

.cover-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  background: url("./assets/cover/cover.jpg") center / cover;
  filter: blur(12px) saturate(1.12);
  transform: scale(1.08);
  opacity: .78;
}

.cover-frame img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  border: 3px solid #fff;
  background: rgba(255, 250, 240, .48);
}

.cover-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-top: 24px;
  color: var(--white);
  text-shadow: 0 2px 0 rgba(36, 48, 79, .25);
}

.cover-copy p,
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fff7bf;
  font-weight: 700;
}

.cover-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 10vw, 54px);
  letter-spacing: 0;
}

.primary-btn,
.music-box button,
.memory-controls button,
.message-row button,
.admin-page button,
.import-label {
  border: 3px solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 5px 0 rgba(36, 48, 79, .28);
  cursor: pointer;
}

.character,
.sticker {
  position: absolute;
  z-index: 1;
}

.sticker {
  width: 150px;
  pointer-events: none;
  animation: floatSticker 3.8s infinite ease-in-out;
}

.sticker-emi {
  left: 2vw;
  top: 18vh;
  transform: rotate(-8deg);
}

.sticker-idea {
  right: 3vw;
  bottom: 28vh;
  width: 132px;
  animation-delay: .8s;
}

.character-left {
  left: 6vw;
  top: 20vh;
  width: 64px;
  height: 112px;
}

.character-right {
  right: 7vw;
  bottom: 28vh;
  width: 72px;
  height: 100px;
}

.face,
.spark-head {
  width: 52px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #ffe0aa;
}

.hat {
  width: 58px;
  height: 24px;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 20px 20px 8px 8px;
  margin: -64px 0 42px -3px;
}

.body,
.spark-body {
  width: 48px;
  height: 58px;
  margin-left: 2px;
  background: var(--mint);
  border: 3px solid var(--ink);
  border-radius: 22px 22px 12px 12px;
}

.spark-head {
  background: var(--sun);
  clip-path: polygon(50% 0, 62% 26%, 92% 18%, 75% 46%, 100% 62%, 68% 66%, 70% 100%, 50% 74%, 30% 100%, 32% 66%, 0 62%, 25% 46%, 8% 18%, 38% 26%);
}

.spark-body {
  background: #fff0f4;
}

.main-screen {
  min-height: 100vh;
  padding: 16px 16px 104px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #263568;
  text-shadow: none;
}

.topbar h2,
.admin-header h1 {
  margin: 0;
  font-size: 28px;
  color: #24304f;
  text-shadow: 0 2px 0 rgba(255, 250, 240, .78), 0 0 14px rgba(255, 247, 191, .78);
}

.topbar .eyebrow {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 250, 240, .74);
  color: #3b4880;
  text-shadow: none;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.wide-icon {
  width: auto;
  min-width: 58px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
}

.icon-btn.active {
  background: #ffd9e8;
  box-shadow: 0 0 0 4px rgba(255, 250, 240, .28), 0 5px 0 rgba(36, 48, 79, .2);
}

.map-stage {
  position: relative;
  height: clamp(480px, 68vh, 680px);
  min-height: 480px;
  margin-top: 16px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background:
    radial-gradient(circle at 42% 40%, rgba(116, 180, 255, .35), transparent 26%),
    linear-gradient(160deg, #29366f 0%, #6f63b9 42%, #4fa9c2 100%);
  overflow: hidden;
  box-shadow: 0 12px 0 rgba(36, 48, 79, .22);
}

.map-stage.is-picking {
  cursor: crosshair;
}

.map-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  height: min(92%, 620px);
  aspect-ratio: 1 / 1;
  width: auto;
  transform: translate(-50%, -50%);
}

.map-lines,
.map-lines svg,
.map-lines img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-lines img {
  object-fit: contain;
  filter: drop-shadow(0 10px 0 rgba(36, 48, 79, .18));
}

#cityPins {
  position: absolute;
  inset: 0;
}

.map-lines path {
  fill: none;
  stroke: rgba(255, 250, 240, .42);
  stroke-width: .8;
  stroke-dasharray: 3 2;
}

.map-lines .province {
  fill: rgba(255, 250, 240, .12);
  stroke: rgba(255, 250, 240, .34);
  stroke-width: .14;
  stroke-dasharray: none;
}

.map-lines .country-outline {
  fill: none;
  stroke: rgba(255, 250, 240, .95);
  stroke-width: .72;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: none;
}

.map-lines .china-shape {
  fill: rgba(255, 250, 240, .18);
  stroke: rgba(255, 250, 240, .92);
  stroke-width: 1.05;
  stroke-dasharray: none;
  filter: drop-shadow(0 10px 0 rgba(36, 48, 79, .18));
}

.map-lines .dream-route {
  stroke: rgba(255, 216, 115, .86);
  stroke-width: .72;
}

.city-pin {
  position: absolute;
  z-index: 5;
  transform: translate(-6px, -6px);
  border: 0;
  background: transparent;
  color: #fffaf0;
  padding: 0;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(18, 26, 56, .75);
  cursor: pointer;
  white-space: nowrap;
  width: auto;
  height: 18px;
  min-width: 24px;
  overflow: visible;
}

.map-stage.is-editing .city-pin {
  cursor: grab;
}

.city-pin.selected .pin-dot {
  background: var(--sun);
  box-shadow: 0 0 0 3px rgba(255, 250, 240, .45), 0 0 18px rgba(255, 216, 115, .95);
}

.city-pin::before {
  display: none;
}

.pin-dot {
  position: absolute;
  left: 4px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8fb7;
  border: 2px solid #fffaf0;
  box-shadow: 0 0 0 2px rgba(255, 143, 183, .26), 0 0 14px rgba(255, 216, 115, .75);
}

.pin-label {
  position: absolute;
  left: 14px;
  top: 0;
  transform: translate(var(--label-x), var(--label-y));
  font-size: 11px;
  line-height: 1;
  pointer-events: auto;
  padding: 3px 4px;
  border-radius: 7px;
  background: rgba(36, 48, 79, .34);
  color: #fffaf0;
  box-shadow: 0 0 0 1px rgba(255, 250, 240, .18);
}

.city-pin:nth-child(3n + 1) .pin-label {
  top: 0;
  left: 14px;
}

.city-pin:nth-child(3n + 2) .pin-label {
  top: 0;
  left: 14px;
}

.city-pin:nth-child(3n) .pin-label {
  top: 0;
  left: 14px;
}

.add-city-button {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 6;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: rgba(255, 250, 240, .94);
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(36, 48, 79, .24);
  cursor: pointer;
}

.map-pick-hint,
.map-edit-panel {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 7;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 250, 240, .92);
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(36, 48, 79, .22);
  font-weight: 900;
}

.map-pick-hint {
  padding: 10px 16px;
}

.map-edit-panel {
  width: min(88%, 560px);
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  background: rgba(255, 245, 217, .94);
}

.map-edit-panel span {
  font-size: 13px;
  color: #4d5c88;
}

.map-edit-panel button {
  border: 0;
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  padding: 7px 12px;
  font-weight: 900;
  cursor: pointer;
}

.gift-button {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 8;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  border: 4px solid #fffaf0;
  background: linear-gradient(145deg, #ff8fbd, #ffc1d5);
  font-size: 28px;
  box-shadow: 0 8px 0 rgba(36, 48, 79, .26), 0 0 24px rgba(255, 143, 189, .65);
  animation: giftBounce 1.8s infinite ease-in-out;
}

.music-box {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 8;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.music-box button {
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, #8ee8d2, #fff7bf);
  font-size: 28px;
  animation: pulseMusic 2.4s infinite ease-in-out;
}

.home-widget-launchers {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 8;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.widget-launch {
  width: 62px;
  height: 62px;
  border: 4px solid var(--ink);
  border-radius: 22px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 7px 0 rgba(36, 48, 79, .24);
  cursor: pointer;
  animation: pulseMusic 2.8s infinite ease-in-out;
}

.feed-launch {
  background: linear-gradient(145deg, #ffd9e8, #fff0c8);
}

.soon-launch {
  background: linear-gradient(145deg, #dff8ed, #fff7bf);
  animation-delay: .5s;
}

.feed-dialog,
.soon-dialog {
  width: min(92vw, 440px);
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.feed-dialog::backdrop,
.soon-dialog::backdrop {
  background: rgba(36, 48, 79, .42);
}

.feed-card,
.soon-card {
  position: relative;
  min-height: 280px;
  border: 4px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 250, 240, .82);
  color: var(--ink);
  box-shadow: 0 10px 0 rgba(36, 48, 79, .18);
  overflow: hidden;
}

.feed-card {
  padding: 24px 22px 18px;
}

.soon-card {
  padding: 24px 110px 24px 22px;
  background: linear-gradient(145deg, rgba(255, 245, 217, .86), rgba(223, 248, 237, .82));
}

.feed-card h3,
.soon-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.soon-card p {
  margin: 0;
  line-height: 1.6;
}

.widget-character {
  position: absolute;
  pointer-events: none;
  animation: floatSticker 4.2s infinite ease-in-out;
  z-index: 0;
}

.feed-card > :not(.widget-character),
.soon-card > :not(.widget-character) {
  position: relative;
  z-index: 1;
}

.widget-emi {
  right: -2px;
  bottom: -14px;
  width: 72px;
  opacity: .34;
}

.widget-idea {
  right: 16px;
  bottom: -8px;
  width: 82px;
  opacity: .9;
  animation-delay: .6s;
}

.feed-input-row {
  display: flex;
  gap: 8px;
}

.feed-input-row input {
  min-width: 0;
  flex: 1;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--ink);
}

.feed-input-row button,
.feed-known button,
.feed-item button {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.feed-input-row button {
  padding: 8px 14px;
}

.feed-known {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.feed-known button {
  padding: 6px 11px;
  background: #ffd9e8;
}

.feed-list {
  max-height: 168px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(142, 232, 210, .28);
  border: 2px solid rgba(36, 48, 79, .18);
}

.feed-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.feed-item span {
  font-weight: 900;
  min-width: 0;
  word-break: break-word;
}

.feed-item button {
  padding: 5px 10px;
  background: #fff0c8;
}

.feed-item button.danger-lite {
  background: #ffe1e7;
}

.feed-item.done {
  background: rgba(255, 216, 115, .28);
}

.feed-item em {
  font-style: normal;
  font-weight: 900;
  color: #5b4a15;
}

.feed-celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(36, 48, 79, .12);
}

.feed-celebration div {
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 18px 28px;
  background: linear-gradient(145deg, #ffd873, #ffd9e8);
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 12px 0 rgba(36, 48, 79, .24);
}

.feed-celebration.pop div {
  animation: feedPop 1.2s ease both;
}

.music-glyph {
  display: inline-block;
  transform: rotate(-10deg);
}

.floating-message {
  position: absolute;
  left: 100%;
  top: var(--top);
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, .86);
  border: 2px solid rgba(36, 48, 79, .42);
  color: var(--ink);
  animation: drift var(--time) linear forwards;
  z-index: 7;
}

.memory-dialog {
  width: min(94vw, 760px);
  max-height: 94vh;
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 0 rgba(36, 48, 79, .3);
}

.memory-dialog::backdrop {
  background: rgba(36, 48, 79, .46);
}

.close-btn,
.close-gift {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 8;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.close-btn {
  width: 38px;
  height: 38px;
}

.memory-media {
  height: min(52vh, 470px);
  min-height: 260px;
  background: #263568;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.memory-media:active {
  cursor: grabbing;
}

.carousel-track {
  height: 100%;
  display: flex;
  will-change: transform;
}

.carousel-slide {
  position: relative;
  height: 100%;
  min-width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.media-blur {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(18px) saturate(1.1);
  transform: scale(1.08);
  opacity: .7;
}

.carousel-slide img,
.carousel-slide video {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  display: block;
  z-index: 2;
  border-radius: 10px;
}

.empty-media {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-weight: 900;
  color: var(--white);
  position: relative;
  z-index: 2;
}

.memory-content {
  padding: 12px 14px 14px;
  max-height: 31vh;
  overflow: auto;
}

.memory-content .eyebrow {
  color: #6d64b8;
}

.memory-content h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.memory-content p {
  margin: 0 0 8px;
  line-height: 1.55;
}

.memory-short-text {
  max-height: 3.3em;
  overflow: auto;
}

.memory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.memory-controls,
.message-row,
.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.message-row input,
.admin-page input,
.admin-page textarea,
.admin-page select {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 12px;
  background: #fffaf0;
  color: var(--ink);
}

.message-row input {
  flex: 1 1 180px;
  min-width: 0;
}

.upload-inline {
  display: inline-block;
  margin-top: 10px;
  border: 3px solid var(--ink);
  background: #fff0c8;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(36, 48, 79, .2);
}

.upload-compact {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 9px 12px;
  white-space: nowrap;
  background: #ffd9e8;
}

.upload-inline input {
  display: none;
}

.city-floating-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.player-dialog {
  width: min(88vw, 430px);
  border: 4px solid var(--ink);
  border-radius: 26px;
  padding: 26px 18px 20px;
  background: linear-gradient(160deg, #fffaf0, #dff8ed);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 14px 0 rgba(36, 48, 79, .28);
}

.city-dialog {
  width: min(90vw, 420px);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 24px 18px 18px;
  background: linear-gradient(160deg, #fffaf0, #e7f8ff);
  color: var(--ink);
  box-shadow: 0 14px 0 rgba(36, 48, 79, .28);
}

.city-dialog::backdrop {
  background: rgba(36, 48, 79, .48);
}

.city-dialog h3 {
  margin: 0 0 12px;
  font-size: 28px;
}

.city-dialog label {
  display: block;
  margin: 12px 0;
  font-weight: 900;
}

.city-dialog input {
  width: 100%;
  margin-top: 6px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fffaf0;
  color: var(--ink);
}

.city-dialog button:not(.close-btn) {
  width: 100%;
  margin-top: 8px;
  border: 3px solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(36, 48, 79, .24);
}

.player-dialog::backdrop {
  background: rgba(36, 48, 79, .48);
}

.player-dialog h3 {
  margin: 0 0 8px;
  font-size: 28px;
}

.player-dialog p {
  line-height: 1.6;
}

.player-disc {
  width: 132px;
  height: 132px;
  margin: 4px auto 16px;
  border: 8px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #fffaf0 0 12%, #ff8fbd 13% 28%, #263568 29% 43%, #8ee8d2 44% 100%);
  box-shadow: 0 8px 0 rgba(36, 48, 79, .2);
  animation: spinDisc 8s linear infinite;
}

.player-disc span {
  color: var(--white);
  font-size: 42px;
}

.player-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.map-decor {
  position: absolute;
  z-index: 1;
  width: 112px;
  opacity: .92;
  pointer-events: none;
  animation: floatSticker 4.2s infinite ease-in-out;
}

.mini-emi {
  left: 2%;
  bottom: 2%;
}

.mini-idea {
  left: 12%;
  top: 8%;
  width: 72px;
  animation-delay: .6s;
}

.photo-dialog {
  width: min(96vw, 980px);
  height: min(92vh, 760px);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  background: rgba(20, 28, 58, .92);
  box-shadow: 0 18px 0 rgba(36, 48, 79, .3);
}

.photo-dialog::backdrop {
  background: rgba(12, 18, 40, .62);
}

.photo-full-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
}

.photo-full-wrap img,
.photo-full-wrap video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.gift-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
}

.close-gift {
  left: 50%;
  right: auto;
  top: 22px;
  transform: translateX(-50%);
  padding: 11px 22px;
  border-radius: 999px;
  border: 3px solid rgba(255, 250, 240, .95);
  background: rgba(255, 240, 200, .92);
  color: #2a2440;
  box-shadow: 0 6px 0 rgba(36, 48, 79, .26), 0 0 22px rgba(255, 250, 240, .45);
  letter-spacing: 0;
}

.gift-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(36,48,79,.18), rgba(36,48,79,.48)), url("./assets/gift/gift-bg.jpg") center / cover;
  filter: saturate(1.08);
}

.letter {
  position: relative;
  width: min(90vw, 640px);
  max-height: min(86vh, 760px);
  padding: 28px 24px 24px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  background: #fff0c8;
  color: #2a2440;
  box-shadow: 12px 14px 0 rgba(36, 48, 79, .3);
  animation: unfold .8s ease both;
  overflow: hidden;
}

.letter .eyebrow {
  color: #7b5f2c;
}

.letter h2 {
  margin: 0 0 14px;
  font-size: 34px;
  text-align: center;
}

.letter-paper {
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 18px 18px 20px;
  border: 2px solid rgba(36, 48, 79, .16);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 240, 200, .82), rgba(255, 240, 200, .82)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 33px,
      rgba(36, 48, 79, .16) 34px
    );
}

.letter-paper p {
  margin: 0 0 14px;
  line-height: 1.9;
  font-size: 17px;
  text-indent: 2em;
}

.letter-paper .letter-salutation {
  text-indent: 0;
  font-weight: 900;
  margin-bottom: 16px;
}

.letter-paper .letter-signoff {
  text-indent: 0;
  text-align: right;
  font-weight: 900;
  margin: 18px 6px 0 0;
}

.admin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login,
.admin-panel {
  width: min(92vw, 680px);
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: rgba(255,250,240,.94);
  padding: 22px;
  box-shadow: 0 12px 0 rgba(36, 48, 79, .24);
}

.admin-login h1,
.admin-login p {
  margin-top: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-header .eyebrow {
  color: #6d64b8;
}

.admin-header a {
  color: var(--ink);
  font-weight: 900;
}

.admin-panel label {
  display: block;
  margin: 14px 0;
  font-weight: 900;
}

.admin-map-editor {
  border: 4px solid var(--ink);
  border-radius: 22px;
  background:
    radial-gradient(circle at 42% 40%, rgba(116, 180, 255, .25), transparent 26%),
    linear-gradient(160deg, #29366f 0%, #6f63b9 42%, #4fa9c2 100%);
  box-shadow: 0 10px 0 rgba(36, 48, 79, .2);
  overflow: hidden;
  margin-bottom: 18px;
}

.admin-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 250, 240, .9);
}

.admin-map-toolbar span {
  font-size: 13px;
  color: #52608a;
}

.admin-map-canvas {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  touch-action: none;
}

.admin-map-canvas > img,
#adminCityPins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.admin-map-canvas > img {
  object-fit: contain;
  filter: drop-shadow(0 10px 0 rgba(36, 48, 79, .18));
}

#adminCityPins {
  position: absolute;
}

#adminCityPins .city-pin {
  cursor: grab;
}

.danger-action {
  background: #ffd9e8 !important;
}

.import-label {
  display: inline-block !important;
  margin: 0 !important;
}

.import-label input {
  display: none;
}

.admin-note {
  line-height: 1.7;
  color: #4e5a7f;
}

@keyframes twinkle {
  50% { transform: scale(1.25) rotate(12deg); }
}

@keyframes drift {
  to { transform: translateX(-130vw); }
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(24px) scale(.94) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes pulseMusic {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.07) rotate(5deg); }
}

@keyframes feedPop {
  0% { opacity: 0; transform: translateY(18px) scale(.72) rotate(-5deg); }
  42% { opacity: 1; transform: translateY(0) scale(1.08) rotate(3deg); }
  75% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translateY(-18px) scale(.92); }
}

@keyframes spinDisc {
  to { transform: rotate(360deg); }
}

@keyframes floatSticker {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@media (max-width: 560px) {
  .cover-screen {
    padding-top: 5vh;
  }

  .sticker {
    width: 106px;
  }

  .sticker-emi {
    left: 0;
    top: 15vh;
  }

  .sticker-idea {
    right: -2vw;
    bottom: 36vh;
    width: 92px;
  }

  .map-decor {
    width: 68px;
  }

  .map-stage {
    height: clamp(430px, 62vh, 560px);
    min-height: 430px;
  }

  .map-canvas {
    height: min(92%, 500px);
    width: auto;
  }

  .city-pin {
    font-size: 13px;
  }

  .top-actions {
    gap: 6px;
  }

  .wide-icon {
    min-width: 48px;
    padding: 0 8px;
    font-size: 12px;
  }

  .map-edit-panel {
    width: calc(100% - 24px);
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .home-widgets {
    grid-template-columns: 1fr;
    margin: 18px 0 96px;
  }

  .feed-card {
    padding-left: 92px;
  }

  .soon-card {
    padding-right: 92px;
  }

  .widget-emi,
  .widget-idea {
    width: 78px;
  }

  .memory-media {
    min-height: 230px;
    height: 43vh;
  }

  .memory-content {
    padding: 10px 12px 12px;
    max-height: 35vh;
  }

  .memory-content h3 {
    font-size: 20px;
    margin-bottom: 5px;
  }

  .memory-content p {
    font-size: 14px;
    line-height: 1.45;
  }

  .memory-short-text {
    max-height: 2.9em;
  }

  .upload-compact {
    padding: 7px 10px;
    font-size: 14px;
  }

  .message-row {
    gap: 8px;
  }

  .message-row input {
    flex-basis: 150px;
    padding: 10px;
    font-size: 14px;
    border-radius: 14px;
  }

  .message-row button {
    padding: 10px 13px;
    font-size: 14px;
    border-radius: 18px;
  }

  .letter {
    width: calc(100vw - 36px);
    max-height: 82vh;
    padding: 20px 14px 16px;
  }

  .letter h2 {
    font-size: 28px;
    margin-bottom: 12px;
  }

  .letter-paper {
    max-height: 58vh;
    padding: 14px 13px 16px;
    background:
      linear-gradient(rgba(255, 240, 200, .82), rgba(255, 240, 200, .82)),
      repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 28px,
        rgba(36, 48, 79, .16) 29px
      );
  }

  .letter-paper p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
  }

  .mini-idea {
    left: 13%;
    top: 8%;
    width: 58px;
  }
}

.memory-dialog .carousel-slide > img,
.memory-dialog .carousel-slide > video {
  position: absolute !important;
  inset: 7% !important;
  width: 86% !important;
  height: 86% !important;
  max-width: 86% !important;
  max-height: 86% !important;
  object-fit: contain !important;
}
