/* ==== base ==== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0d1d;
  --bg-2: #141833;
  --gold: #e8c37a;
  --gold-soft: #f3dfb6;
  --pink: #f0a6b8;
  --text: #f5f1e8;
  --muted: #b8b3c4;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Lato', 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, #1a1f42 0%, var(--bg) 65%);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

/* ==== starry background ==== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #ffe9c4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 65% 15%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 55%, #ffd9e2 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 80%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 85%, #ffe9c4 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 45%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 10%, #ffd9e2 50%, transparent 51%);
  background-size: 550px 550px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

/* ==== screens & transitions ==== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease, visibility 0s linear .7s;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .7s ease .15s, transform .7s ease .15s, visibility 0s;
}

.screen-inner {
  width: 100%;
  max-width: 430px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* ==== intro ==== */
.intro-date {
  font-family: var(--sans);
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold);
}
.intro-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  font-weight: 600;
  line-height: 1.15;
}
.intro-title .name {
  color: var(--gold);
  font-style: italic;
}
.heart { display: inline-block; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.2); }
  24% { transform: scale(1); }
  36% { transform: scale(1.15); }
}
.intro-sub { color: var(--muted); font-size: 1.05rem; font-weight: 300; }

/* ==== buttons ==== */
.btn {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #3a2c10;
  box-shadow: 0 6px 24px rgba(232, 195, 122, .35);
}
.btn-gold:not(:disabled):hover { box-shadow: 0 8px 30px rgba(232, 195, 122, .55); }
.btn-ghost {
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid rgba(232, 195, 122, .5);
}

/* ==== story ==== */
.photo-frame {
  width: min(78vw, 330px);
  border-radius: 18px;
  padding: 10px 10px 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(232, 195, 122, .35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  transform: rotate(-1.5deg);
}
#screen-story2 .photo-frame { transform: rotate(1.5deg); }
.photo-frame img {
  width: 100%;
  display: block;
  border-radius: 10px;
}
.story-text {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 4.6vw, 1.35rem);
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  max-width: 40ch;
}

/* ==== globe screen ==== */
.screen-globe { padding: 0; justify-content: flex-start; overflow: hidden; }
.globe-header {
  z-index: 3;
  text-align: center;
  padding: 18px 20px 8px;
}
.globe-header h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold-soft);
}
.globe-header p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

#globe-container {
  flex: 1;
  width: 100%;
  position: relative;
  min-height: 0;
}
/* marcador da cidade escolhida */
.city-marker {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
}
.city-marker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 2px rgba(232, 195, 122, .9);
  animation: marker-glow 1.6s ease-in-out infinite;
}
.city-marker-label {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--gold-soft);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
  white-space: nowrap;
}
@keyframes marker-glow {
  0%, 100% { box-shadow: 0 0 6px 2px rgba(232, 195, 122, .7); transform: scale(1); }
  50% { box-shadow: 0 0 16px 7px rgba(232, 195, 122, .95); transform: scale(1.25); }
}

#globe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
}

.globe-search {
  z-index: 5;
  width: min(92%, 430px);
  margin: 0 auto;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  position: relative;
}
#country-search {
  width: 100%;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .4);
  background: rgba(11, 13, 29, .85);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  outline: none;
}
#country-search::placeholder { color: var(--muted); }
#country-search:focus { border-color: var(--gold); }
#search-results {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  list-style: none;
  background: rgba(20, 24, 51, .97);
  border: 1px solid rgba(232, 195, 122, .35);
  border-radius: 14px;
  max-height: 210px;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .5);
}
#search-results li {
  padding: 12px 18px;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
#search-results li:last-child { border-bottom: none; }
#search-results li:hover, #search-results li:focus { background: rgba(232, 195, 122, .15); }

.selection-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  z-index: 4;
  width: min(92%, 430px);
  background: rgba(20, 24, 51, .96);
  border: 1px solid rgba(232, 195, 122, .5);
  border-radius: 18px;
  padding: 16px 20px 18px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  animation: sheetUp .35s ease;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
@keyframes sheetUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.btn-sheet-back {
  width: 100%;
  padding: 10px 20px;
  margin-bottom: 12px;
  font-size: .88rem;
  font-weight: 400;
}
.sheet-label {
  font-size: .75rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-country {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 4px 0 12px;
}
/* ==== country photo slideshow ==== */
.country-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(232, 195, 122, .35);
  background: rgba(255, 255, 255, .04);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.country-slideshow.is-dragging { cursor: grabbing; }
.country-slideshow .slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .5s ease;
  will-change: transform;
}
.country-slideshow .slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.country-slideshow .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 13, 29, .6);
  color: var(--gold-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}
.slide-nav:hover { background: rgba(11, 13, 29, .85); }
.slide-nav.prev { left: 8px; }
.slide-nav.next { right: 8px; }
.slide-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.slide-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: all .2s;
}
.slide-dots .dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

.sheet-sublabel {
  font-size: .75rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.city-block { margin-bottom: 14px; }
.city-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
}
.city-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232, 195, 122, .35);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-family: var(--sans);
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.city-chip:hover { border-color: var(--gold); }
.city-chip.selected {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #3a2c10;
  border-color: var(--gold);
  font-weight: 700;
}

/* ==== prova de identidade ==== */
.gate-icon { font-size: 3rem; }
.gate-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 6vw, 1.8rem);
  line-height: 1.35;
  color: var(--gold-soft);
}
.gate-question {
  font-size: 1.15rem;
  color: var(--text);
}
.gate-date-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.gate-date-row .gate-date { flex: 1 1 7rem; max-width: 10rem; }
.gate-date {
  padding: 13px 20px;
  border-radius: 14px;
  border: 1px solid rgba(232, 195, 122, .4);
  background: rgba(20, 24, 51, .9);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.05rem;
  outline: none;
  color-scheme: dark;
  text-align: center;
}
.gate-date:focus { border-color: var(--gold); }
.gate-message {
  color: #8ec5ff;
  font-size: .98rem;
  line-height: 1.55;
  max-width: 28rem;
  margin-inline: auto;
}
.shake { animation: shake .45s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(5px); }
}

/* ==== month picker ==== */
.month-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  line-height: 1.3;
}
.gold { color: var(--gold); }
.gold.big { font-family: var(--serif); font-size: 1.9rem; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.month-btn {
  padding: 13px 4px;
  border-radius: 14px;
  border: 1px solid rgba(232, 195, 122, .35);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: var(--sans);
  font-size: .92rem;
  cursor: pointer;
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.month-btn small { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.month-btn.selected {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #3a2c10;
  border-color: var(--gold);
  font-weight: 700;
}
.month-btn.selected small { color: #6d5527; }

/* ==== confirmation ==== */
.confirm-icon { font-size: 3.2rem; animation: fly 2.6s ease-in-out infinite alternate; }
@keyframes fly { from { transform: translate(-8px, 4px) rotate(-4deg); } to { transform: translate(8px, -6px) rotate(4deg); } }
.confirm-title {
  font-family: var(--serif);
  font-size: 2.1rem;
  color: var(--gold-soft);
}
.confirm-text { font-size: 1.25rem; line-height: 1.6; }
.confirm-love {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
}
