.mclotr-letter-popup {
  --mclotr-letter-accent: #2f9d58;
  --mclotr-letter-gold: #d9b66a;
  --mclotr-letter-ink: #2b2116;
  --mclotr-letter-parchment: #f2dfb6;
  --mclotr-letter-parchment-light: #fff0ca;
  --mclotr-letter-wood: #3a2416;
  --mclotr-letter-stone: #1d211b;
  --mclotr-letter-shadow: rgba(8, 6, 3, 0.52);
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  font-family: inherit;
}

body.mclotr-letter-popup-lock {
  overflow: hidden;
}

.mclotr-letter-popup *,
.mclotr-letter-popup *::before,
.mclotr-letter-popup *::after {
  box-sizing: border-box;
}

.mclotr-letter-popup__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(217, 182, 106, 0.24), transparent 26rem),
    radial-gradient(circle at 75% 16%, rgba(47, 157, 88, 0.20), transparent 28rem),
    rgba(9, 10, 7, 0.72);
  backdrop-filter: blur(8px) saturate(1.08);
  transition: opacity 0.28s ease;
}

.mclotr-letter-popup__backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 44%, black, transparent 72%);
}

.mclotr-letter-popup__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -47%) scale(0.96);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mclotr-letter-popup.is-visible .mclotr-letter-popup__backdrop,
.mclotr-letter-popup.is-visible .mclotr-letter-popup__dialog {
  opacity: 1;
  pointer-events: auto;
}

.mclotr-letter-popup.is-visible .mclotr-letter-popup__dialog {
  transform: translate(-50%, -50%) scale(1);
}

.mclotr-letter-popup__close {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217, 182, 106, 0.48);
  border-radius: 9px;
  color: #ffe8ad;
  background:
    linear-gradient(180deg, rgba(73, 46, 25, 0.95), rgba(35, 23, 14, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 177, 0.22),
    0 10px 26px rgba(0, 0, 0, 0.32);
  font-size: 28px;
  line-height: 38px;
  font-weight: 400;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.mclotr-letter-popup__close:hover,
.mclotr-letter-popup__close:focus {
  color: #fff6d8;
  filter: brightness(1.1);
  transform: translateY(-1px);
  outline: none;
}

.mclotr-letter-popup__scene {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  border: 2px solid rgba(217, 182, 106, 0.58);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 236, 174, 0.08), rgba(255, 236, 174, 0) 30%),
    radial-gradient(circle at 22% 48%, rgba(217, 182, 106, 0.13), transparent 18rem),
    radial-gradient(circle at 16% 8%, rgba(217, 182, 106, 0.22), transparent 20rem),
    radial-gradient(circle at 82% 15%, rgba(47, 157, 88, 0.20), transparent 22rem),
    linear-gradient(135deg, rgba(26, 31, 24, 0.98), rgba(13, 15, 11, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 177, 0.12),
    inset 0 -90px 120px rgba(0, 0, 0, 0.26),
    0 30px 90px rgba(0, 0, 0, 0.48);
  perspective: 1100px;
}

.mclotr-letter-popup__scene::before,
.mclotr-letter-popup__scene::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mclotr-letter-popup__scene::before {
  inset: 0;
  opacity: 0.18;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 18px 18px;
  image-rendering: pixelated;
}

.mclotr-letter-popup__scene::after {
  left: 26px;
  right: 26px;
  bottom: 24px;
  height: 92px;
  opacity: 0.9;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(98, 68, 36, 0.78) 7% 11%, transparent 11% 14%, rgba(42, 52, 38, 0.82) 14% 19%, transparent 19% 100%),
    linear-gradient(180deg, rgba(41, 56, 35, 0.95), rgba(18, 21, 15, 0.86));
  clip-path: polygon(0 72%, 7% 56%, 12% 64%, 18% 42%, 28% 66%, 36% 38%, 46% 66%, 56% 46%, 68% 72%, 78% 46%, 90% 66%, 100% 52%, 100% 100%, 0 100%);
  filter: drop-shadow(0 -8px 18px rgba(0, 0, 0, 0.34));
}

.mclotr-letter-popup__aura {
  position: absolute;
  left: 50%;
  bottom: 138px;
  width: 460px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  opacity: 0.86;
  background:
    radial-gradient(circle, rgba(255, 231, 151, 0.38), rgba(217, 182, 106, 0.14) 34%, transparent 70%);
  filter: blur(8px);
  transition: transform 0.7s ease, opacity 0.45s ease;
}

.mclotr-letter-popup__open-burst,
.mclotr-letter-popup__rune-sparks {
  position: absolute;
  left: 50%;
  pointer-events: none;
  opacity: 0;
}

.mclotr-letter-popup__open-burst {
  bottom: 210px;
  z-index: 13;
  width: min(620px, 78vw);
  height: 310px;
  transform: translateX(-50%) scale(0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 246, 184, 0.72), rgba(217, 182, 106, 0.22) 22%, transparent 52%),
    conic-gradient(from 18deg, transparent 0 7%, rgba(217, 182, 106, 0.62) 8% 10%, transparent 11% 22%, rgba(47, 157, 88, 0.48) 23% 25%, transparent 26% 40%, rgba(255, 238, 154, 0.55) 41% 43%, transparent 44% 100%);
  filter: blur(0.2px) drop-shadow(0 0 22px rgba(217, 182, 106, 0.32));
  mix-blend-mode: screen;
}

.mclotr-letter-popup__open-burst::before,
.mclotr-letter-popup__open-burst::after,
.mclotr-letter-popup__rune-sparks::before,
.mclotr-letter-popup__rune-sparks::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mclotr-letter-popup__open-burst::before {
  inset: 70px 96px;
  border: 2px solid rgba(255, 225, 126, 0.72);
  border-radius: 50%;
  box-shadow:
    inset 0 0 18px rgba(255, 243, 171, 0.32),
    0 0 0 8px rgba(47, 157, 88, 0.08),
    0 0 40px rgba(217, 182, 106, 0.42);
}

.mclotr-letter-popup__open-burst::after {
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #fff1a6;
  box-shadow:
    -232px -48px 0 rgba(47, 157, 88, 0.72),
    -196px 42px 0 rgba(255, 235, 142, 0.84),
    -146px -86px 0 rgba(47, 157, 88, 0.64),
    -92px 70px 0 rgba(217, 182, 106, 0.86),
    -36px -110px 0 rgba(255, 247, 188, 0.78),
    42px 94px 0 rgba(47, 157, 88, 0.74),
    96px -72px 0 rgba(255, 235, 142, 0.86),
    154px 36px 0 rgba(47, 157, 88, 0.66),
    204px -34px 0 rgba(255, 247, 188, 0.78),
    238px 68px 0 rgba(217, 182, 106, 0.82);
}

.mclotr-letter-popup__rune-sparks {
  bottom: 330px;
  z-index: 15;
  width: min(520px, 72vw);
  height: 92px;
  transform: translateX(-50%) translateY(24px);
  background:
    linear-gradient(90deg, transparent, rgba(255, 232, 145, 0.42), transparent),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(47, 157, 88, 0.42) 18px 26px, transparent 26px 44px);
  background-size: 100% 2px, 100% 28px;
  background-position: center 50%, center 36px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 12px rgba(47, 157, 88, 0.48));
}

.mclotr-letter-popup__rune-sparks::before {
  left: 50%;
  top: 38px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: rgba(47, 157, 88, 0.88);
  transform: rotate(45deg);
  box-shadow:
    -180px -6px 0 rgba(255, 226, 126, 0.74),
    -132px 8px 0 rgba(47, 157, 88, 0.78),
    -74px -12px 0 rgba(255, 245, 183, 0.72),
    72px 9px 0 rgba(47, 157, 88, 0.76),
    128px -10px 0 rgba(255, 226, 126, 0.78),
    184px 5px 0 rgba(47, 157, 88, 0.72);
}

.mclotr-letter-popup__rune-sparks::after {
  left: 12%;
  right: 12%;
  top: 28px;
  height: 34px;
  opacity: 0.56;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(255, 236, 162, 0.52) 10% 12%, transparent 12% 22%, rgba(47, 157, 88, 0.46) 22% 25%, transparent 25% 39%, rgba(255, 236, 162, 0.44) 39% 42%, transparent 42% 55%, rgba(47, 157, 88, 0.42) 55% 58%, transparent 58% 72%, rgba(255, 236, 162, 0.50) 72% 75%, transparent 75%);
}

.mclotr-letter-popup__envelope {
  position: absolute;
  left: 50%;
  bottom: 148px;
  z-index: 9;
  width: min(456px, 84vw);
  height: 292px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateX(-50%) translateY(0) rotateX(0deg);
  transform-origin: 50% 80%;
  filter: drop-shadow(0 34px 28px rgba(0, 0, 0, 0.42));
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s ease;
  image-rendering: pixelated;
  will-change: transform, filter;
}

.mclotr-letter-popup__envelope:hover,
.mclotr-letter-popup__envelope:focus {
  outline: none;
  transform: translateX(-50%) translateY(0) rotateX(0deg);
  filter: drop-shadow(0 38px 30px rgba(0, 0, 0, 0.42)) brightness(1.06);
}

.mclotr-letter-popup__envelope-glow {
  position: absolute;
  inset: 24px 10px -26px;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 157, 88, 0.42), rgba(217, 182, 106, 0.20) 42%, transparent 68%);
  filter: blur(16px);
  animation: mclotr-letter-pulse 2.8s ease-in-out infinite;
}

.mclotr-letter-popup__paper-peek {
  position: absolute;
  left: 44px;
  right: 44px;
  top: 14px;
  height: 145px;
  z-index: 1;
  border: 2px solid rgba(120, 76, 39, 0.62);
  border-bottom: 0;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(90deg, rgba(112, 71, 36, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(112, 71, 36, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #fff1cb, #e6c891);
  background-size: 14px 14px, 14px 14px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.mclotr-letter-popup__paper-peek::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 20px;
  height: 30px;
  border-top: 2px solid rgba(137, 88, 38, 0.22);
  border-bottom: 2px solid rgba(137, 88, 38, 0.18);
  background:
    linear-gradient(90deg, transparent 0 13%, rgba(47, 157, 88, 0.18) 13% 17%, transparent 17% 28%, rgba(217, 182, 106, 0.24) 28% 32%, transparent 32% 44%, rgba(47, 157, 88, 0.16) 44% 49%, transparent 49% 61%, rgba(114, 77, 35, 0.18) 61% 66%, transparent 66% 78%, rgba(47, 157, 88, 0.18) 78% 82%, transparent 82%),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(47, 157, 88, 0.11) 22px 30px, transparent 30px 48px);
  background-size: 100% 100%, 72px 30px;
  opacity: 0.72;
}

.mclotr-letter-popup__envelope-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 205px;
  z-index: 3;
  border: 3px solid rgba(92, 58, 29, 0.78);
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(88, 55, 28, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(88, 55, 28, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 18% 22%, rgba(255, 242, 189, 0.38), transparent 13rem),
    linear-gradient(180deg, #f4daa2, #c89555 62%, #a8743d);
  background-size: 16px 16px, 16px 16px, auto;
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 188, 0.44),
    inset 0 -6px 0 rgba(88, 55, 28, 0.22),
    0 0 0 2px rgba(255, 222, 135, 0.16),
    0 12px 0 rgba(69, 42, 21, 0.24);
}

.mclotr-letter-popup__envelope-body::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 231, 159, 0.34);
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(82, 52, 28, 0.34) 49% 51%, transparent 52%),
    linear-gradient(225deg, transparent 0 48%, rgba(82, 52, 28, 0.30) 49% 51%, transparent 52%);
}

.mclotr-letter-popup__envelope-body::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 19px;
  height: 18px;
  opacity: 0.52;
  background:
    linear-gradient(90deg, var(--mclotr-letter-accent) 0 12px, transparent 12px 20px, var(--mclotr-letter-gold) 20px 32px, transparent 32px 42px);
  background-size: 42px 18px;
  box-shadow: 0 0 18px rgba(47, 157, 88, 0.26);
}

.mclotr-letter-popup__envelope-left,
.mclotr-letter-popup__envelope-right {
  position: absolute;
  bottom: 3px;
  z-index: 4;
  width: 50%;
  height: 199px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 243, 190, 0.12) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #ddb879, #b78349);
}

.mclotr-letter-popup__envelope-left {
  left: 3px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.mclotr-letter-popup__envelope-right {
  right: 3px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.mclotr-letter-popup__envelope-flap {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 80px;
  z-index: 6;
  height: 154px;
  transform-origin: 50% 0;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background:
    linear-gradient(90deg, rgba(84, 52, 27, 0.15) 1px, transparent 1px),
    linear-gradient(rgba(84, 52, 27, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, #f0d29a, #b9783c);
  background-size: 16px 16px, 16px 16px, auto;
  box-shadow: inset 0 4px 0 rgba(255, 239, 182, 0.42);
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.mclotr-letter-popup__seal {
  position: absolute;
  left: 50%;
  top: 169px;
  z-index: 8;
  width: 92px;
  height: 92px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 5px solid #f1d177;
  border-radius: 50%;
  color: #fff5cc;
  background:
    radial-gradient(circle, rgba(255, 246, 186, 0.28) 0 18%, transparent 19%),
    radial-gradient(circle, #b43b27 0 46%, #7e2019 47% 100%);
  box-shadow:
    inset 0 0 0 4px rgba(72, 19, 15, 0.32),
    inset 0 0 16px rgba(255, 218, 104, 0.28),
    0 0 0 3px rgba(94, 54, 24, 0.66),
    0 0 28px rgba(217, 182, 106, 0.38);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 0 rgba(80, 22, 14, 0.8);
  transition: transform 0.45s ease, opacity 0.35s ease;
}

.mclotr-letter-popup__seal::before,
.mclotr-letter-popup__seal::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.mclotr-letter-popup__seal::before {
  inset: 12px;
  border: 4px solid rgba(255, 226, 117, 0.94);
  box-shadow: 0 0 10px rgba(255, 218, 104, 0.65);
}

.mclotr-letter-popup__seal::after {
  inset: -9px;
  border: 1px dashed rgba(255, 234, 148, 0.56);
  animation: mclotr-letter-ring 9s linear infinite;
}

.mclotr-letter-popup__hint {
  position: absolute;
  left: 50%;
  bottom: -68px;
  z-index: 10;
  min-width: 260px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid rgba(217, 182, 106, 0.68);
  border-radius: 999px;
  color: #ffeec4;
  background:
    linear-gradient(180deg, rgba(41, 30, 17, 0.9), rgba(17, 14, 9, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 184, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(47, 157, 88, 0.15);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.mclotr-letter-popup__hint::before,
.mclotr-letter-popup__hint::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px;
  background: var(--mclotr-letter-accent);
  box-shadow: 0 0 10px rgba(47, 157, 88, 0.72);
  transform: rotate(45deg);
}

.mclotr-letter-popup__sheet {
  position: absolute;
  left: 50%;
  top: 46px;
  z-index: 7;
  width: min(590px, calc(100% - 56px));
  max-height: 486px;
  overflow: auto;
  padding: 34px 38px 30px;
  opacity: 0;
  transform: translateX(-50%) translateY(190px) scale(0.78) rotateX(-10deg);
  transform-origin: 50% 100%;
  border: 2px solid rgba(105, 66, 31, 0.62);
  border-radius: 12px;
  color: var(--mclotr-letter-ink);
  background:
    linear-gradient(90deg, rgba(108, 68, 34, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(108, 68, 34, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(255, 247, 215, 0.84), transparent 18rem),
    linear-gradient(180deg, var(--mclotr-letter-parchment-light), var(--mclotr-letter-parchment));
  background-size: 18px 18px, 18px 18px, auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    inset 0 -10px 0 rgba(122, 76, 34, 0.08),
    0 28px 46px rgba(0, 0, 0, 0.34);
  transition:
    opacity 0.36s ease 0.05s,
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
  clip-path: polygon(
    0 14px, 14px 14px, 14px 0,
    calc(100% - 22px) 0, calc(100% - 22px) 10px, 100% 10px,
    100% calc(100% - 18px), calc(100% - 12px) calc(100% - 18px), calc(100% - 12px) 100%,
    18px 100%, 18px calc(100% - 10px), 0 calc(100% - 10px)
  );
  scrollbar-color: rgba(112, 77, 35, 0.42) rgba(255, 239, 197, 0.18);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mclotr-letter-popup .mclotr-letter-popup__sheet,
.mclotr-letter-popup .mclotr-letter-popup__sheet * {
  font-family: inherit;
}

.mclotr-letter-popup__sheet :where(.mclotr-letter-popup__kicker, h2, .mclotr-letter-popup__content, .mclotr-letter-popup__content *, .mclotr-letter-popup__signature, .mclotr-letter-popup__button) {
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
}

.mclotr-letter-popup__sheet::-webkit-scrollbar {
  width: 8px;
}

.mclotr-letter-popup__sheet::-webkit-scrollbar-track {
  background: rgba(255, 239, 197, 0.22);
  border-radius: 999px;
}

.mclotr-letter-popup__sheet::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(217, 182, 106, 0.88), rgba(112, 77, 35, 0.72));
  border-radius: 999px;
}

.mclotr-letter-popup__sheet::before,
.mclotr-letter-popup__sheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mclotr-letter-popup__sheet::before {
  inset: 14px;
  border: 1px solid rgba(129, 78, 32, 0.24);
  border-radius: 7px;
}

.mclotr-letter-popup__sheet::after {
  right: 25px;
  top: 25px;
  width: 86px;
  height: 86px;
  opacity: 0.12;
  border: 7px solid #8b5b27;
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px #8b5b27;
}

.mclotr-letter-popup__sheet-topline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background:
    linear-gradient(90deg, transparent, rgba(217, 182, 106, 0.95), transparent),
    repeating-linear-gradient(90deg, rgba(47, 157, 88, 0.8) 0 18px, rgba(217, 182, 106, 0.8) 18px 36px);
}

.mclotr-letter-popup__sheet-topline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 18px;
  margin: auto;
  width: min(360px, 70%);
  background:
    linear-gradient(90deg, transparent, rgba(108, 68, 34, 0.20), transparent),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(47, 157, 88, 0.18) 16px 24px, transparent 24px 40px);
  pointer-events: none;
}

.mclotr-letter-popup__kicker {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  color: #5d411d !important;
  -webkit-text-fill-color: #5d411d !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 246, 213, 0.62);
}

.mclotr-letter-popup__sheet h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: #2a1a0d !important;
  -webkit-text-fill-color: #2a1a0d !important;
  font-size: clamp(24px, 3.05vw, 34px);
  line-height: 1.16;
  font-weight: 950;
  letter-spacing: -0.02em;
  background: none !important;
  text-shadow:
    0 1px 0 rgba(255, 248, 222, 0.58),
    0 2px 0 rgba(124, 80, 33, 0.16);
}

.mclotr-letter-popup__content {
  position: relative;
  z-index: 1;
  color: #3f2b17 !important;
  -webkit-text-fill-color: #3f2b17 !important;
  font-size: 16px;
  line-height: 1.86;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.48);
}

.mclotr-letter-popup__content p {
  margin: 0 0 14px;
}

.mclotr-letter-popup__signature {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: #5b3d1d !important;
  -webkit-text-fill-color: #5b3d1d !important;
  font-weight: 900;
  text-align: right;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.52);
}

.mclotr-letter-popup__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.mclotr-letter-popup__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 7px;
  border: 1px solid rgba(90, 58, 26, 0.42);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  -webkit-background-clip: border-box !important;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.mclotr-letter-popup__button:hover,
.mclotr-letter-popup__button:focus {
  transform: translateY(-1px);
  text-decoration: none;
  outline: none;
}

.mclotr-letter-popup__button.is-primary,
.mclotr-letter-popup__button.is-primary:visited {
  color: #fff8d8 !important;
  -webkit-text-fill-color: #fff8d8 !important;
  background: linear-gradient(180deg, #45b86b, #1d6f3f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 10px 18px rgba(21, 102, 55, 0.22);
  text-shadow: 0 1px 1px rgba(13, 54, 31, 0.72);
}

.mclotr-letter-popup__button.is-secondary,
.mclotr-letter-popup__button.is-secondary:visited {
  color: #2f1e0f !important;
  -webkit-text-fill-color: #2f1e0f !important;
  background: linear-gradient(180deg, #ffdf8f, #bd8436);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 18px rgba(116, 75, 27, 0.18);
  text-shadow: 0 1px 0 rgba(255, 241, 187, 0.72);
}

.mclotr-letter-popup__art {
  position: absolute;
  right: -18px;
  top: 58px;
  width: 380px;
  height: 520px;
  z-index: 1;
  opacity: 0.23;
  pointer-events: none;
  background-image: var(--mclotr-letter-art);
  background-size: cover;
  background-position: center;
  border-radius: 18px;
  filter: saturate(1.08) contrast(1.04) brightness(0.78) blur(0.2px);
  mask-image:
    radial-gradient(circle at 50% 45%, black 0 48%, transparent 76%),
    linear-gradient(90deg, transparent, black 15%, black 84%, transparent);
  -webkit-mask-image:
    radial-gradient(circle at 50% 45%, black 0 48%, transparent 76%),
    linear-gradient(90deg, transparent, black 15%, black 84%, transparent);
  mix-blend-mode: screen;
  transform: translateX(72px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.55s ease, filter 0.35s ease;
}

.mclotr-letter-popup__art::before,
.mclotr-letter-popup__art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mclotr-letter-popup__art::before {
  inset: 8px;
  border: 1px solid rgba(217, 182, 106, 0.28);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(47, 157, 88, 0.12),
    0 0 38px rgba(47, 157, 88, 0.18);
}

.mclotr-letter-popup__art::after {
  inset: 0;
  opacity: 0.16;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
}

.mclotr-letter-popup__ring {
  position: absolute;
  right: 48px;
  top: 26px;
  width: 132px;
  height: 132px;
  border: 14px solid var(--mclotr-letter-gold);
  border-radius: 50%;
  box-shadow:
    inset 0 0 16px rgba(255, 249, 198, 0.4),
    0 0 34px rgba(217, 182, 106, 0.68);
  animation: mclotr-letter-float 4s ease-in-out infinite;
  opacity: 0;
}

.mclotr-letter-popup__blocks {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 20px;
  height: 250px;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(70, 78, 62, 0.9) 16% 32%, transparent 32% 44%, rgba(39, 101, 63, 0.86) 44% 58%, transparent 58% 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 12px, transparent 12px 24px);
  clip-path: polygon(0 100%, 0 72%, 15% 72%, 15% 50%, 32% 50%, 32% 68%, 50% 68%, 50% 36%, 68% 36%, 68% 64%, 84% 64%, 84% 44%, 100% 44%, 100% 100%);
  opacity: 0;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__sheet,
.mclotr-letter-popup.is-open .mclotr-letter-popup__sheet {
  z-index: 14;
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1) rotateX(0deg);
  animation: mclotr-letter-sheet-glow 1.18s ease both;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__open-burst,
.mclotr-letter-popup.is-open .mclotr-letter-popup__open-burst {
  animation: mclotr-letter-open-burst 1.15s cubic-bezier(0.18, 0.9, 0.24, 1) both;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__open-burst::before,
.mclotr-letter-popup.is-open .mclotr-letter-popup__open-burst::before {
  animation: mclotr-letter-ring-burst 1.15s ease-out both;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__open-burst::after,
.mclotr-letter-popup.is-open .mclotr-letter-popup__open-burst::after {
  animation: mclotr-letter-particle-burst 1.15s ease-out both;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__rune-sparks,
.mclotr-letter-popup.is-open .mclotr-letter-popup__rune-sparks {
  animation: mclotr-letter-rune-rise 1.35s ease-out both;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__envelope,
.mclotr-letter-popup.is-open .mclotr-letter-popup__envelope {
  z-index: 5;
  pointer-events: none;
  transform: translateX(-50%) translateY(158px) scale(0.66);
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.34));
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__envelope:hover,
.mclotr-letter-popup.is-open .mclotr-letter-popup__envelope:hover {
  transform: translateX(-50%) translateY(158px) scale(0.66);
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__art,
.mclotr-letter-popup.is-open .mclotr-letter-popup__art {
  opacity: 0.14;
  transform: translateX(90px) scale(0.92);
  filter: saturate(1.02) contrast(1.03) brightness(0.66) blur(0.6px);
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__envelope-flap,
.mclotr-letter-popup.is-open .mclotr-letter-popup__envelope-flap {
  transform: rotateX(176deg);
  filter: brightness(0.92);
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__paper-peek,
.mclotr-letter-popup.is-open .mclotr-letter-popup__paper-peek {
  opacity: 0;
  transform: translateY(-48px);
  transition: opacity 0.25s ease, transform 0.45s ease;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__seal,
.mclotr-letter-popup.is-open .mclotr-letter-popup__seal {
  opacity: 0.74;
  transform: translateX(-50%) translateY(18px) scale(0.78);
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__hint,
.mclotr-letter-popup.is-open .mclotr-letter-popup__hint {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

.mclotr-letter-popup__scene.is-open .mclotr-letter-popup__aura,
.mclotr-letter-popup.is-open .mclotr-letter-popup__aura {
  opacity: 1;
  transform: translateX(-50%) translateY(-110px) scale(1.08);
}

.mclotr-letter-popup__reopen {
  position: absolute;
  right: 22px;
  right: max(22px, env(safe-area-inset-right));
  bottom: 104px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border: 1px solid rgba(217, 182, 106, 0.62);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  pointer-events: none;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 42%, rgba(217, 182, 106, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(52, 35, 20, 0.96), rgba(25, 18, 12, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 239, 184, 0.20),
    0 12px 30px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(47, 157, 88, 0.22);
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.18s ease;
}

.mclotr-letter-popup.is-reopen-visible .mclotr-letter-popup__reopen {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mclotr-letter-popup__reopen:hover,
.mclotr-letter-popup__reopen:focus {
  outline: none;
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.02);
}

.mclotr-letter-popup__reopen span {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 18px;
  height: 24px;
  border: 2px solid rgba(90, 58, 26, 0.75);
  border-radius: 4px;
  background: linear-gradient(180deg, #ecd19a, #bf8548);
  box-shadow: inset 0 1px 0 rgba(255, 239, 190, 0.36);
}

.mclotr-letter-popup__reopen span::before,
.mclotr-letter-popup__reopen span::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: rgba(255, 233, 171, 0.22);
}

.mclotr-letter-popup__reopen span::before {
  left: 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.mclotr-letter-popup__reopen span::after {
  right: 0;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

@keyframes mclotr-letter-pulse {
  0%, 100% { opacity: 0.62; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes mclotr-letter-ring {
  to { transform: rotate(360deg); }
}

@keyframes mclotr-letter-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-14px) rotate(5deg); }
}

@keyframes mclotr-letter-open-burst {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.54) rotate(-5deg);
    filter: blur(8px) drop-shadow(0 0 0 rgba(217, 182, 106, 0));
  }
  18% {
    opacity: 0.96;
  }
  58% {
    opacity: 0.58;
    transform: translateX(-50%) scale(1.04) rotate(5deg);
    filter: blur(0.2px) drop-shadow(0 0 28px rgba(217, 182, 106, 0.50));
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.24) rotate(10deg);
    filter: blur(6px) drop-shadow(0 0 10px rgba(47, 157, 88, 0.18));
  }
}

@keyframes mclotr-letter-ring-burst {
  0% {
    opacity: 0;
    transform: scale(0.46) rotate(0deg);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.72) rotate(36deg);
  }
}

@keyframes mclotr-letter-particle-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -88%) scale(1.38);
  }
}

@keyframes mclotr-letter-rune-rise {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(34px) scale(0.92);
  }
  18% {
    opacity: 0.88;
  }
  62% {
    opacity: 0.68;
    transform: translateX(-50%) translateY(-10px) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-44px) scale(1.08);
  }
}

@keyframes mclotr-letter-sheet-glow {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.38),
      inset 0 -10px 0 rgba(122, 76, 34, 0.08),
      0 28px 46px rgba(0, 0, 0, 0.34),
      0 0 0 rgba(217, 182, 106, 0);
  }
  38% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.48),
      inset 0 -10px 0 rgba(122, 76, 34, 0.08),
      0 30px 56px rgba(0, 0, 0, 0.38),
      0 0 46px rgba(217, 182, 106, 0.54),
      0 0 34px rgba(47, 157, 88, 0.20);
  }
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.38),
      inset 0 -10px 0 rgba(122, 76, 34, 0.08),
      0 28px 46px rgba(0, 0, 0, 0.34);
  }
}

@media (max-width: 820px) {
  .mclotr-letter-popup__dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    max-height: calc(100dvh - 18px);
  }

  .mclotr-letter-popup__scene {
    min-height: min(690px, calc(100vh - 18px));
    min-height: min(690px, calc(100dvh - 18px));
    overflow-y: auto;
    border-radius: 14px;
  }

  .mclotr-letter-popup__close {
    right: 10px;
    top: 10px;
  }

  .mclotr-letter-popup__sheet {
    top: 62px;
    width: calc(100% - 22px);
    max-height: calc(100vh - 176px);
    max-height: calc(100dvh - 176px);
    padding: 28px 20px 24px;
  }

  .mclotr-letter-popup__sheet h2 {
    font-size: clamp(22px, 7.4vw, 30px);
    line-height: 1.15;
    margin-bottom: 14px;
  }

  .mclotr-letter-popup__content {
    font-size: 14.5px;
    line-height: 1.78;
  }

  .mclotr-letter-popup__signature {
    text-align: left;
  }

  .mclotr-letter-popup__envelope {
    width: min(330px, 82vw);
    height: 212px;
    bottom: 132px;
  }

  .mclotr-letter-popup__open-burst {
    bottom: 190px;
    width: min(430px, 92vw);
    height: 230px;
  }

  .mclotr-letter-popup__open-burst::before {
    inset: 52px 58px;
  }

  .mclotr-letter-popup__rune-sparks {
    bottom: 270px;
    width: min(350px, 86vw);
    height: 74px;
  }

  .mclotr-letter-popup__envelope-body,
  .mclotr-letter-popup__envelope-left,
  .mclotr-letter-popup__envelope-right {
    height: 150px;
  }

  .mclotr-letter-popup__envelope-flap {
    top: 58px;
    height: 114px;
  }

  .mclotr-letter-popup__seal {
    top: 126px;
    width: 70px;
    height: 70px;
    font-size: 10px;
  }

  .mclotr-letter-popup__hint {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 64px);
    white-space: normal;
  }

  .mclotr-letter-popup__art {
    display: none;
  }

  .mclotr-letter-popup.is-open .mclotr-letter-popup__envelope,
  .mclotr-letter-popup__scene.is-open .mclotr-letter-popup__envelope {
    transform: translateX(-50%) translateY(130px) scale(0.56);
  }

  .mclotr-letter-popup.is-open .mclotr-letter-popup__envelope:hover,
  .mclotr-letter-popup__scene.is-open .mclotr-letter-popup__envelope:hover {
    transform: translateX(-50%) translateY(130px) scale(0.56);
  }

  .mclotr-letter-popup__actions {
    display: grid;
    gap: 10px;
  }

  .mclotr-letter-popup__button {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .mclotr-letter-popup__reopen {
    right: 18px;
    right: max(18px, env(safe-area-inset-right));
    bottom: 96px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mclotr-letter-popup *,
  .mclotr-letter-popup *::before,
  .mclotr-letter-popup *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
