.sky-lanterns-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  will-change: opacity;
}

.sky-lanterns-viewport.is-scrolling {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.wish-modal-overlay:not(.is-active),
.wish-modal-overlay[hidden] {
  display: none !important;
}

.sky-lantern {
  position: absolute;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  will-change: transform;
  contain: layout style;
  overflow: visible;
  transform-origin: 50% 90%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  height: max-content;
  -webkit-tap-highlight-color: transparent;
}

.sky-lantern::before {
  content: '';
  position: absolute;
  inset: -18px;
  pointer-events: auto;
}

.sky-lantern:hover {
  transform: scale(1.08);
}

.sky-lantern:active {
  transform: scale(0.96);
}

.sky-lantern svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible !important;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.sky-lantern.tier-far {
  z-index: 4;
}

.sky-lantern.tier-mid {
  z-index: 12;
}

.sky-lantern.tier-near {
  z-index: 24;
}

@keyframes lanternFlicker {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.lantern-flame-core {
  animation: lanternFlicker 2.8s ease-in-out infinite alternate;
  transform-origin: 50% 85%;
}

.sky-lantern--focused {
  z-index: 250 !important;
  contain: none !important;
  overflow: visible !important;
}

.sky-lantern--focused svg {
  filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9));
  animation: lanternFocusPulse 1.4s ease-in-out infinite alternate;
}

@keyframes lanternFocusPulse {
  0% { transform: scale(1.06); }
  100% { transform: scale(1.18); }
}

.sky-lantern--blessed,
.sky-lantern--user {
  z-index: 260 !important;
  contain: none !important;
  overflow: visible !important;
}

.sky-lantern--blessed::after {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 220, 50, 0.45) 0%, rgba(255, 140, 0, 0.22) 40%, rgba(230, 57, 70, 0.08) 60%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: blessedHaloPulse 2s ease-in-out infinite alternate;
}

@keyframes blessedHaloPulse {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.75; }
  100% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
}

.sky-lantern--blessed svg,
.sky-lantern--user svg {
  filter: drop-shadow(0 0 14px rgba(255, 220, 50, 0.85));
  animation: blessedLanternPulse 1.6s ease-in-out infinite alternate;
}

@keyframes blessedLanternPulse {
  0% { transform: scale(1.06); }
  100% { transform: scale(1.18); }
}

.user-wish-ribbon {
  margin-top: -4px;
  background: linear-gradient(180deg, rgba(234, 67, 53, 0.95) 0%, rgba(186, 24, 27, 0.9) 100%);
  border: 1px solid rgba(255, 207, 36, 0.75);
  border-radius: 4px;
  padding: 4px 10px;
  color: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 207, 36, 0.6);
  pointer-events: none;
  animation: ribbonSway 3s ease-in-out infinite alternate;
  transform-origin: 50% 0%;
}

@keyframes ribbonSway {
  0% { transform: rotate(-4deg); }
  100% { transform: rotate(4deg); }
}

.lantern-wish-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(22, 10, 48, 0.92);
  border: 1px solid rgba(255, 207, 36, 0.55);
  color: #fff;
  padding: 6px 12px;
  border-radius: 12px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 207, 36, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
}

.lantern-wish-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(255, 207, 36, 0.6) transparent transparent transparent;
}

.sky-lantern:hover .lantern-wish-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.wish-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wish-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wish-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 25, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.wish-parchment-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 44px 32px 34px;
  text-align: center;
  color: #3b1803;
  z-index: 2;
  transform: translateY(25px) scale(0.94);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  font-family: 'Be Vietnam Pro', sans-serif;
}

.wish-modal-overlay.is-active .wish-parchment-container {
  transform: translateY(0) scale(1);
}

.parchment-svg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.88)) drop-shadow(0 0 35px rgba(218, 165, 32, 0.4));
}

.parchment-body {
  position: relative;
  z-index: 2;
}

.parchment-close {
  position: absolute;
  top: -24px;
  right: 4px;
  width: 30px;
  height: 30px;
  background: rgba(124, 45, 18, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: 50%;
  color: #7c2d12;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.parchment-close:hover {
  background: #ba181b;
  color: #fff;
  border-color: #ba181b;
}

.parchment-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: #4a1500;
  text-transform: uppercase;
  margin-bottom: 5px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.parchment-sub {
  font-size: 12px;
  color: #8c3a14;
  font-style: italic;
  margin-bottom: 22px;
  letter-spacing: 0.3px;
}

.parchment-textarea {
  width: 100%;
  box-sizing: border-box;
  height: 96px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 14px;
  padding: 11px 16px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #2b1300;
  resize: none;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  touch-action: auto !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  pointer-events: auto !important;
}

.parchment-textarea:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #b8860b;
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.2);
}

.parchment-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 20px;
  padding: 9px 16px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #2b1300;
  outline: none;
  margin-bottom: 22px;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  touch-action: auto !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  pointer-events: auto !important;
}

.parchment-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #b8860b;
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.2);
}

.parchment-btn {
  width: 100%;
  background: linear-gradient(135deg, #ba181b 0%, #d90429 45%, #ea580c 100%);
  color: #fff;
  border: 1.5px solid #ffdd80;
  border-radius: 26px;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(186, 24, 27, 0.45), 0 0 15px rgba(255, 221, 128, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
}

.parchment-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(186, 24, 27, 0.6), 0 0 22px rgba(255, 221, 128, 0.6);
}

.parchment-btn:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .wish-parchment-container {
    padding: 40px 24px 30px;
    max-width: 92vw;
  }

  .parchment-title {
    font-size: 18px;
    letter-spacing: 1.8px;
  }

  .parchment-sub {
    font-size: 11.5px;
    margin-bottom: 18px;
  }

  .parchment-textarea {
    height: 85px;
    font-size: 16px !important;
    touch-action: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important;
  }

  .parchment-input {
    font-size: 16px !important;
    touch-action: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important;
  }

  .parchment-btn {
    padding: 11px 20px;
    font-size: 13px;
  }
}
