:root {
  --bg-deep: #5a0610;
  --bg-mid: #9a1020;
  --gold: #ffd978;
  --gold-deep: #d4a017;
  --amount-red: #d4192f;
  --btn-text: #e85a12;
  --cream: #fff4df;
  --card-shadow: rgba(80, 0, 20, 0.45);
  --panel: rgba(255, 248, 238, 0.96);
  --ink: #4a1520;
  --muted: #8a5560;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: #4a1520;
  background: #f7ebe0;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: #f7ebe0;
}

.bg-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.bg-main {
  position: absolute;
  inset: 0;
  background:
    #f7ebe0 url("/assets/bg-tet-hd.jpg") center top / cover no-repeat;
  image-rendering: -webkit-optimize-contrast;
}

.bg-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(36vh, 360px);
  background:
    #f8e4d2 url("/assets/bg-cartoon-hd.jpg") center bottom / cover no-repeat;
  opacity: 1;
  image-rendering: auto;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
}

.bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 40% at 50% 40%, rgba(255, 252, 248, 0.42), transparent 72%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.18) 0%, transparent 20%, transparent 62%, rgba(255, 240, 230, 0.22) 100%);
}

.confetti {
  position: absolute;
  inset: 0;
}

.confetti span {
  position: absolute;
  top: -12px;
  width: var(--w);
  height: var(--h);
  background: var(--c);
  border-radius: 2px;
  opacity: 0.75;
  animation: confetti-fall var(--dur) linear var(--delay) infinite;
}

.brand {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 20px 8px;
  animation: title-in 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.brand h1 {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  color: #d4192f;
  text-shadow:
    0 1px 0 #fff,
    0 3px 0 rgba(184, 20, 40, 0.18),
    0 10px 24px rgba(160, 40, 40, 0.18);
}

.brand p {
  margin-top: 6px;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: #8a3040;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.shell {
  position: relative;
  z-index: 2;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 12px 16px 36px;
  display: grid;
  place-items: center;
}

.panel {
  display: none;
  width: 100%;
  justify-items: center;
  animation: panel-in 0.45s ease both;
}

.panel.is-active {
  display: grid;
}

.panel-card {
  width: min(100%, 460px);
  padding: 28px 24px 26px;
  border-radius: 28px;
  background:
    linear-gradient(165deg, rgba(255, 250, 242, 0.98), rgba(255, 236, 214, 0.96));
  color: var(--ink);
  box-shadow:
    0 22px 50px rgba(50, 0, 10, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-top: 18px;
  border: 1px solid rgba(210, 70, 90, 0.14);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 120, 140, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.96) 0%, rgba(255, 236, 220, 0.94) 100%);
  box-shadow:
    0 24px 50px rgba(120, 30, 40, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(8px);
}

.login-hero {
  position: relative;
  display: grid;
  place-items: center;
  height: 112px;
  margin: 0 auto 8px;
}

.login-hero-glow {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.55), transparent 68%);
  filter: blur(6px);
  animation: hero-glow 2.4s ease-in-out infinite;
}

.login-mini-env {
  position: relative;
  width: 92px;
  height: 120px;
  z-index: 1;
  filter: drop-shadow(0 12px 16px rgba(120, 0, 30, 0.28));
  animation: envelope-bob 2.6s ease-in-out infinite;
}

.lixi-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b0122c;
  background: rgba(255, 90, 110, 0.14);
}

.panel-card h2 {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  line-height: 1.15;
  color: #b0122c;
}

.login-card h2 {
  margin: 0 auto;
}

.panel-desc {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.login-card .panel-desc {
  max-width: 20em;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  font-weight: 800;
  color: #7a3040;
  text-align: left;
}

.login-card .field {
  width: min(100%, 360px);
  margin-left: auto;
  margin-right: auto;
}

.field input {
  width: 100%;
  height: 52px;
  border: 2px solid rgba(180, 60, 80, 0.18);
  border-radius: 16px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  outline: none;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: #e83a52;
  box-shadow: 0 0 0 4px rgba(232, 58, 82, 0.15);
}

.field-error {
  margin-top: 10px;
  color: #c4102e;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: center;
}

.login-card .primary-btn {
  width: min(100%, 360px);
}

.primary-btn,
.claim-btn,
.toast-close {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  height: 52px;
  border-radius: 999px;
  color: #fff8ea;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #ff5a72, #d41242 70%);
  box-shadow:
    0 8px 0 #9a0d2c,
    0 14px 24px rgba(120, 0, 30, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #9a0d2c,
    0 8px 14px rgba(120, 0, 30, 0.22);
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: #7a2434;
  background: rgba(255, 248, 240, 0.88);
  border: 1px solid rgba(210, 60, 80, 0.16);
  box-shadow: 0 8px 20px rgba(120, 30, 40, 0.12);
  backdrop-filter: blur(6px);
}

.user-chip strong,
.reward-user strong {
  color: #d4192f;
}

.congrats-stage {
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.congrats-chip {
  margin-bottom: 0;
}

.congrats-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  padding: 28px 22px 26px;
  border-radius: 30px;
  color: #fff8ea;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(165deg, #ff7b9b 0%, #ff3f6d 40%, #d41242 78%, #a80e34 100%);
  box-shadow:
    0 24px 50px rgba(120, 20, 40, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: panel-in 0.45s ease both;
}

.congrats-card h2 {
  position: relative;
  z-index: 2;
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: clamp(2rem, 5vw, 2.5rem);
  line-height: 1.1;
  color: #fff6d8;
  text-shadow:
    0 2px 0 #b0122c,
    0 8px 18px rgba(80, 0, 20, 0.35);
}

.congrats-card .panel-desc {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  color: rgba(255, 245, 230, 0.92);
  text-shadow: 0 1px 8px rgba(80, 0, 20, 0.25);
}

.congrats-rays {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 140%;
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.22) 0deg 8deg,
    rgba(255, 180, 200, 0.04) 8deg 16deg
  );
  mask-image: radial-gradient(circle, #000 10%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 62%);
  animation: spin-burst 18s linear infinite;
  pointer-events: none;
}

.congrats-sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.congrats-sparkles i {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
  animation: twinkle 1.8s ease-in-out infinite;
}

.congrats-sparkles i:nth-child(1) { left: 12%; top: 16%; animation-delay: 0s; }
.congrats-sparkles i:nth-child(2) { right: 14%; top: 20%; width: 8px; height: 8px; animation-delay: 0.3s; }
.congrats-sparkles i:nth-child(3) { left: 18%; top: 48%; width: 7px; height: 7px; animation-delay: 0.7s; }
.congrats-sparkles i:nth-child(4) { right: 16%; top: 52%; animation-delay: 1s; }
.congrats-sparkles i:nth-child(5) { left: 28%; top: 10%; width: 6px; height: 6px; animation-delay: 1.3s; }
.congrats-sparkles i:nth-child(6) { right: 26%; top: 12%; width: 9px; height: 9px; animation-delay: 0.5s; }

.account-info {
  position: relative;
  z-index: 2;
  margin: 16px auto 6px;
  width: min(100%, 380px);
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  background: rgba(255, 248, 238, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 24px rgba(90, 0, 20, 0.18);
}

.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(176, 18, 44, 0.08);
  font-size: 0.92rem;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.info-row span {
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.info-row strong {
  color: #b0122c;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

.envelope-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 10px auto 0;
  padding: 8px 0 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.envelope-orbit {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 230px;
  height: 220px;
  translate: -50% -50%;
  pointer-events: none;
}

.orbit-coin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-style: normal;
  font-weight: 900;
  font-size: 13px;
  color: #c47a00;
  background: radial-gradient(circle at 30% 28%, #fff1b0, #f0c84a 45%, #c9961a 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  animation: coin-float-soft 2.6s ease-in-out infinite;
}

.orbit-coin.o1 { left: 50%; top: 4%; translate: -50% 0; animation-delay: 0s; }
.orbit-coin.o2 { right: 2%; top: 42%; animation-delay: 0.35s; }
.orbit-coin.o3 { left: 2%; top: 48%; animation-delay: 0.7s; }

.envelope-visual {
  position: relative;
  width: 168px;
  height: 210px;
  margin: 8px auto 0;
  filter: drop-shadow(0 18px 26px rgba(60, 0, 15, 0.45));
  animation: envelope-bob 2.4s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.lixi-svg-lg {
  position: relative;
  z-index: 1;
}

.envelope-btn:hover .envelope-visual {
  transform: scale(1.05);
}

.env-glow {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 160%;
  height: 70%;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 150, 0.55), transparent 68%);
  filter: blur(10px);
  z-index: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

.env-seal-shape {
  transform-origin: 50px 68px;
  animation: seal-pulse-svg 1.8s ease-in-out infinite;
}

.env-flap-shape {
  transform-origin: 50px 28px;
}

.env-tap {
  position: absolute;
  right: -2px;
  bottom: 22px;
  z-index: 4;
  font-size: 1.4rem;
  animation: tap-bounce 1.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.envelope-hint {
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff4df;
  text-shadow: 0 2px 8px rgba(80, 0, 20, 0.35);
  animation: hint-pulse 1.6s ease-in-out infinite;
}

.envelope-btn.is-opening .env-flap-shape {
  transform-origin: 60px 38px;
  animation: flap-open-svg 0.55s ease forwards;
}

.envelope-btn.is-opening .envelope-visual {
  animation: none;
  transform: scale(1.08);
}

.envelope-btn.is-opening .envelope-orbit,
.envelope-btn.is-opening .env-tap {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.reward-user {
  margin-bottom: 16px;
}

.reward-card {
  position: relative;
  width: min(100%, 360px);
  min-height: 420px;
  border-radius: 30px;
  padding: 22px 18px 84px;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-content: start;
  justify-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(165deg, #ff7a9e 0%, #ff3f6d 35%, #e01444 70%, #b80e36 100%);
  box-shadow:
    0 22px 48px var(--card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -10px 24px rgba(120, 0, 30, 0.22);
  animation: card-pop 0.75s cubic-bezier(0.18, 1.2, 0.32, 1) both;
}

.card-shine {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.32), transparent 40%),
    linear-gradient(120deg, transparent 42%, rgba(255, 255, 255, 0.14) 50%, transparent 58%);
  pointer-events: none;
  z-index: 1;
}

.sunburst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 170%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.42) 0deg 8deg,
    rgba(255, 190, 210, 0.04) 8deg 16deg
  );
  mask-image: radial-gradient(circle, #000 10%, transparent 58%);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 58%);
  animation: spin-burst 18s linear infinite;
  z-index: 0;
}

.stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.stars span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(12px * var(--s));
  height: calc(12px * var(--s));
  background: #fff;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
  animation: twinkle 1.8s ease-in-out var(--d) infinite;
}

.reward-label {
  position: relative;
  z-index: 3;
  margin: 4px 0 10px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff4df;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}

.coin-wrap {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  margin-top: 8px;
}

.coin {
  position: relative;
  width: min(56vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  animation: coin-float 2.8s ease-in-out infinite;
  filter: drop-shadow(0 16px 22px rgba(70, 15, 0, 0.4));
}

.coin-ring,
.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.coin-ring {
  background:
    radial-gradient(circle at 30% 26%, #fff6c8 0%, transparent 26%),
    conic-gradient(from 210deg, #b8860b, #f7d56a, #fff1a8, #d4a017, #8b6914, #f0c84a, #b8860b);
  box-shadow:
    inset 0 0 0 9px rgba(180, 120, 20, 0.32),
    inset 0 0 18px rgba(255, 240, 180, 0.5);
}

.coin-face {
  inset: 10%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8 0%, #f0c84a 40%, #d4a017 78%, #a67c00 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 230, 150, 0.55),
    inset 0 0 0 8px rgba(170, 110, 10, 0.24),
    inset 0 -10px 20px rgba(120, 70, 0, 0.18);
  display: grid;
  place-items: center;
}

.amount {
  text-align: center;
  color: var(--amount-red);
  text-shadow: 0 1px 0 rgba(255, 230, 180, 0.55);
  line-height: 1;
}

.value {
  display: block;
  font-size: clamp(1.85rem, 6.2vw, 2.45rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.reward-base {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 64px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(80, 0, 20, 0.28), transparent 70%);
  filter: blur(2px);
  z-index: 2;
  pointer-events: none;
}

.claim-btn {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  z-index: 5;
  width: min(78%, 240px);
  height: 50px;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--btn-text);
  background: linear-gradient(180deg, #fff8ea 0%, #ffe7c2 55%, #f5d5a0 100%);
  box-shadow:
    0 6px 0 #d9a86a,
    0 10px 18px rgba(90, 20, 0, 0.28),
    inset 0 1px 0 #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.claim-btn:hover {
  transform: translateY(-1px);
}

.claim-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #d9a86a,
    0 6px 12px rgba(90, 20, 0, 0.22),
    inset 0 1px 0 #fff;
}

.toast {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 0, 6, 0.55);
  backdrop-filter: blur(4px);
}

.toast[hidden] {
  display: none;
}

.toast-card {
  width: min(100%, 420px);
  padding: 24px 22px 20px;
  border-radius: 22px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(165deg, #fffaf2, #ffe8cf);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: panel-in 0.3s ease both;
}

.toast-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(180deg, #ff6a4d, #d41242);
}

.toast-card p {
  font-weight: 800;
  line-height: 1.55;
  color: #6a2432;
}

.toast-close {
  margin-top: 16px;
  width: 100%;
  height: 46px;
  border-radius: 999px;
  color: #fff8ea;
  background: linear-gradient(180deg, #ff5a72, #d41242 70%);
}

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

@keyframes spin-burst {
  to { transform: rotate(360deg); }
}

@keyframes coin-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

@keyframes spill {
  0%, 100% { transform: translate(0, 0) rotate(var(--rot)); }
  50% { transform: translate(var(--tx), -6px) rotate(calc(var(--rot) + 8deg)); }
}

@keyframes card-pop {
  from { opacity: 0; transform: translateY(36px) scale(0.86); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.8; }
  100% {
    transform: translate3d(var(--drift), 110vh, 0) rotate(360deg);
    opacity: 0.15;
  }
}

@keyframes float-env {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

@keyframes envelope-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

@keyframes flap-open {
  to { transform: rotateX(180deg); opacity: 0.35; }
}

@keyframes flap-open-svg {
  to {
    transform: translateY(-10px) scaleY(0.12);
    opacity: 0.15;
  }
}

@keyframes seal-pulse-svg {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes coin-float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pattern-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -40px, 0); }
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.06); }
}

@keyframes hero-glow {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes seal-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes tap-bounce {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, -8px); }
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@media (min-width: 900px) {
  .bg-main {
    background-size: cover;
    background-position: center top;
  }

  .bg-bottom {
    height: min(42vh, 460px);
    background-size: cover;
    background-position: center bottom;
    opacity: 1;
  }

  .shell {
    padding: 20px 32px 48px;
  }

  .panel-card {
    width: min(100%, 520px);
    padding: 34px 34px 30px;
  }

  .reward-card {
    width: min(100%, 400px);
  }

  .coin {
    width: 230px;
  }
}

@media (max-width: 480px) {
  .brand {
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .panel-card {
    padding: 24px 18px 22px;
    border-radius: 24px;
  }

  .bg-bottom {
    height: 38vh;
  }
}
