:root {
  --bg-start: #e6fff7;
  --bg-end: #d7f4ff;
  --primary: #ff9f1c;
  --text-main: #15324a;
  --text-sub: #2b556f;
}

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

html,
body {
  min-height: 100%;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 196, 72, 0.5) 0, transparent 36%),
    radial-gradient(circle at 85% 82%, rgba(53, 228, 208, 0.44) 0, transparent 42%),
    linear-gradient(155deg, var(--bg-start) 0%, #c6f7ff 45%, var(--bg-end) 100%);
  display: flex;
  justify-content: center;
}

.page {
  width: min(100%, 500px);
  min-height: 100vh;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero,
.box-section {
  position: relative;
}

.hero {
  text-align: center;
  margin-top: 6px;
}

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #fffdf8;
  background: linear-gradient(90deg, #ff9f1c, #ffbf4d, #ff8f3f);
  box-shadow: 0 4px 10px rgba(255, 166, 38, 0.36);
}

.title-main {
  font-size: clamp(58px, 16vw, 94px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 4px;
  color: #ff8f2f;
  -webkit-text-stroke: 2px #10425b;
  text-shadow: 4px 4px 0 #2de1d2, 0 5px 0 #0f4562, 0 0 12px rgba(255, 166, 62, 0.45);
  transform: skewX(-8deg);
}

.title-sub {
  margin-top: 2px;
  font-size: clamp(52px, 13.5vw, 78px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 3px;
  color: #124a67;
  -webkit-text-stroke: 1.6px #0f364d;
  text-shadow: 4px 4px 0 #44e8da, 0 0 10px rgba(68, 232, 218, 0.3);
  transform: skewX(-7deg);
}

.title-desc {
  margin-top: 8px;
  font-size: clamp(16px, 4.2vw, 24px);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #1589a9;
}

.desc {
  margin: 10px auto 0;
  max-width: 26em;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-sub);
}

.box-section {
  min-height: 54vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
}

.box-section::before {
  content: "";
  position: absolute;
  inset: 6% 4%;
  border-radius: 26px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 177, 59, 0.35) 0, transparent 46%),
    radial-gradient(circle at 74% 70%, rgba(61, 233, 210, 0.32) 0, transparent 42%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), 0 18px 34px rgba(18, 88, 112, 0.18);
  pointer-events: none;
}

.cube-scene {
  width: 100%;
  display: flex;
  justify-content: center;
}

.blind-box {
  width: min(62vw, 260px);
  aspect-ratio: 0.95 / 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.blind-box:active {
  transform: scale(0.985);
}

.cube {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  animation: floatFlat 3s ease-in-out infinite;
}

.cube::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 56%;
  width: 118%;
  height: 118%;
  border-radius: 32px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 183, 63, 0.5) 0, rgba(255, 183, 63, 0.12) 40%, transparent 68%),
    radial-gradient(circle at 70% 70%, rgba(61, 233, 210, 0.38) 0, transparent 52%);
  filter: blur(8px);
  animation: glowBlink 1.8s ease-in-out infinite;
  z-index: 0;
}

.box-face {
  position: absolute;
  border-radius: 20px;
  border: 2px solid rgba(255, 214, 136, 0.7);
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(255, 247, 216, 0.28), 0 12px 22px rgba(17, 86, 112, 0.2);
  z-index: 1;
}

.box-top {
  display: none;
}

.box-front {
  left: 6%;
  top: 8%;
  width: 88%;
  height: 84%;
  display: grid;
  place-items: center;
  font-size: clamp(16px, 4.3vw, 22px);
  font-weight: 700;
  letter-spacing: 1px;
  color: #fffef8;
  text-shadow: 0 2px 0 rgba(104, 68, 20, 0.34);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.32) 0 18%, transparent 19%),
    linear-gradient(145deg, #ffb347 0%, #ff9a2f 56%, #ffb545 100%);
  transform: none;
}

.box-right {
  display: none;
}

.box-top::before,
.box-front::before,
.box-right::before {
  content: "";
  position: absolute;
  inset: 0;
}

.box-front::before {
  background: linear-gradient(
      0deg,
      transparent 0 28%,
      rgba(114, 79, 26, 0.24) 28% 31%,
      transparent 22% 100%
    ),
    linear-gradient(0deg, transparent 0 62%, rgba(114, 79, 26, 0.28) 62% 65%, transparent 50% 100%);
}

.box-top::before {
  background: linear-gradient(
      90deg,
      transparent 0 40%,
      #ffe4ef 40% 52%,
      #ffd2e1 52% 56%,
      transparent 58% 100%
    ),
    linear-gradient(0deg, transparent 0 40%, #ffe4ef 40% 52%, #ffd2e1 52% 56%, transparent 58% 100%);
}

.box-right::before {
  background: linear-gradient(
    90deg,
    transparent 0 18%,
    #ffd4e2 18% 34%,
    #ffc5d8 34% 42%,
    transparent 42% 100%
  );
}

.box-top::after {
  content: none;
}

.box-front::after {
  content: none;
}

.blind-box.opening .box-front {
  transform: translateY(-6px) scale(1.03);
}

.blind-box.shake .cube {
  animation: box-pop-flat 0.32s ease;
}

.tap-glow {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(77, 234, 214, 0.08));
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.blind-box.flash .tap-glow {
  animation: glowPing 0.68s ease-out;
}

.tips {
  font-size: 14px;
  color: #166785;
  font-weight: 700;
}

@keyframes floatFlat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes box-pop-flat {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes glowBlink {
  0%,
  100% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.92;
  }
}

@keyframes glowPing {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

@media (max-width: 500px) {
  .blind-box,
  .cube {
    width: 170px;
    height: 180px;
  }
}
