.shell {
  position: relative;
  display: grid;
  min-height: var(--app-viewport-height, 100dvh);
  place-items: center;
  padding:
    calc(var(--app-safe-top, 0px) + clamp(24px, 7vw, 40px))
    calc(var(--app-safe-right, 0px) + clamp(18px, 5.5vw, 30px))
    calc(var(--app-safe-bottom, 0px) + clamp(24px, 7vw, 40px))
    calc(var(--app-safe-left, 0px) + clamp(18px, 5.5vw, 30px));
  overflow: hidden auto;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 183, 120, 0.28), transparent 30%),
    radial-gradient(circle at 87% 77%, rgba(244, 111, 151, 0.17), transparent 31%),
    #fff7f0;
  color: #2b1a1e;
  isolation: isolate;
}

.coverWash,
.glowOne,
.glowTwo {
  position: absolute;
  pointer-events: none;
}

.coverWash {
  inset: 0 0 auto;
  z-index: -3;
  height: min(47vh, 420px);
  background:
    linear-gradient(180deg, rgba(255, 247, 240, 0.48), #fff7f0 96%),
    var(--tip-success-cover) center 16% / cover no-repeat;
  filter: saturate(0.82);
  opacity: 0.32;
}

.glowOne,
.glowTwo {
  z-index: -2;
  border-radius: 999px;
  filter: blur(18px);
}

.glowOne {
  top: 16%;
  right: -90px;
  width: 210px;
  height: 210px;
  background: rgba(255, 126, 157, 0.17);
}

.glowTwo {
  bottom: 8%;
  left: -110px;
  width: 250px;
  height: 250px;
  background: rgba(255, 188, 119, 0.2);
}

.card {
  width: min(100%, 420px);
  box-sizing: border-box;
  padding: clamp(30px, 8vw, 44px) clamp(22px, 7vw, 36px) clamp(24px, 7vw, 36px);
  border: 1px solid rgba(88, 50, 55, 0.08);
  border-radius: clamp(28px, 8vw, 36px);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 28px 74px rgba(101, 61, 61, 0.14);
  text-align: center;
  backdrop-filter: blur(20px);
}

.visual {
  position: relative;
  width: 164px;
  height: 140px;
  margin: 0 auto 16px;
}

.avatarFrame {
  position: absolute;
  top: 0;
  left: 13px;
  width: 112px;
  height: 112px;
  border: 4px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
  background: #f4d4c4;
  box-shadow: 0 17px 36px rgba(102, 54, 57, 0.18);
  overflow: hidden;
}

.coffeeFrame {
  position: absolute;
  right: 3px;
  bottom: 1px;
  width: 76px;
  height: 76px;
  border: 4px solid #ffffff;
  border-radius: 24px;
  background: #c69c80;
  box-shadow: 0 13px 28px rgba(86, 47, 42, 0.2);
  overflow: hidden;
  transform: rotate(3deg);
}

.coffeeImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sparkleOne,
.sparkleTwo {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ef4f87;
}

.sparkleOne {
  top: 5px;
  right: 6px;
}

.sparkleTwo {
  bottom: 7px;
  left: 0;
  color: #f78a68;
}

.eyebrow {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff0f4;
  color: #c74470;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.title {
  max-width: 340px;
  margin: 18px auto 0;
  color: #2b1a1e;
  font-family: var(--font-athelas), Georgia, serif;
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.04;
  outline: none;
}

.copy {
  display: grid;
  gap: 8px;
  max-width: 330px;
  margin: 16px auto 0;
  color: #756065;
  font-size: clamp(14px, 3.7vw, 17px);
  font-weight: 610;
  line-height: 1.55;
  white-space: pre-line;
}

.copy p {
  margin: 0;
}

.messageRetry {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-top: 15px;
  color: #8a6870;
  font-size: 12px;
  font-weight: 650;
}

.messageRetry p {
  margin: 0;
}

.retryAction {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(199, 68, 112, 0.18);
  border-radius: 999px;
  background: #fff0f4;
  color: #bd3d69;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.retryAction:disabled {
  cursor: wait;
  opacity: 0.62;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: clamp(24px, 7vw, 34px);
}

.primaryAction,
.secondaryAction {
  display: inline-flex;
  min-height: 54px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primaryAction {
  border: 0;
  background: #2b1a1e;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(58, 29, 35, 0.2);
  cursor: pointer;
}

.secondaryAction {
  border: 1px solid rgba(67, 40, 45, 0.1);
  background: #faf6f4;
  color: #594349;
}

.primaryAction:focus-visible,
.secondaryAction:focus-visible {
  outline: 3px solid rgba(239, 79, 135, 0.28);
  outline-offset: 3px;
}

@media (hover: hover) {
  .primaryAction:hover,
  .secondaryAction:hover {
    transform: translateY(-1px);
  }

  .primaryAction:hover {
    box-shadow: 0 17px 34px rgba(58, 29, 35, 0.24);
  }

  .secondaryAction:hover {
    background: #ffffff;
  }
}

.primaryAction:active,
.secondaryAction:active {
  transform: translateY(1px) scale(0.99);
}

@media (max-width: 350px) {
  .shell {
    padding-right: calc(var(--app-safe-right, 0px) + 14px);
    padding-left: calc(var(--app-safe-left, 0px) + 14px);
  }

  .card {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: cardReveal 0.46s cubic-bezier(0.22, 0.8, 0.32, 1) both;
  }

  .avatarFrame {
    animation: avatarReveal 0.52s 0.08s cubic-bezier(0.2, 0.9, 0.28, 1.15) both;
  }

  .coffeeFrame {
    animation: coffeeReveal 0.54s 0.16s cubic-bezier(0.2, 0.9, 0.28, 1.15) both;
  }

  .sparkleOne,
  .sparkleTwo {
    animation: sparkleReveal 0.5s 0.34s ease both;
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes avatarReveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coffeeReveal {
  from {
    opacity: 0;
    transform: translate(9px, 8px) rotate(8deg) scale(0.76);
  }

  to {
    opacity: 1;
    transform: translate(0, 0) rotate(3deg) scale(1);
  }
}

@keyframes sparkleReveal {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-10deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
