/* Mobile-first landing: 360–430px, gold/casino CTA, minimal paint cost */

:root {
  --mm-bg-deep: #140810;
  --mm-gold: #e8b923;
  --mm-gold-mid: #c99512;
  --mm-gold-dark: #7c5a0a;
  --mm-text: #fffaf0;
  --mm-text-soft: #f5e6c8;
  --top-bar-h: 52px;
  --bottom-bar-h: 92px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --cta-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Pyidaungsu", system-ui, sans-serif;
  color: var(--mm-text);
  background: var(--mm-bg-deep);
  -webkit-text-size-adjust: 100%;
}

body.page-mm {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-bar-h) + var(--safe-bottom) + 8px);
  position: relative;
  overflow-x: hidden;
}

.mm-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #1f0c14 0%, var(--mm-bg-deep) 55%, #0a0406 100%);
}

body.page-mm > header,
body.page-mm > main,
body.page-mm > footer {
  position: relative;
  z-index: 1;
}

/* —— 顶栏 —— */
.mm-top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--top-bar-h);
  padding: 6px 10px 6px 12px;
  background: linear-gradient(92deg, #7f1235 0%, #b91c1c 35%, #c2410c 70%, #b45309 100%);
  border-bottom: 2px solid rgba(232, 185, 35, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mm-hot {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 4px 8px;
  color: #5c1f0a;
  background: linear-gradient(180deg, #fff8dc 0%, var(--mm-gold) 100%);
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.mm-top .banner-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: clamp(0.8rem, 2.8vw, 1.02rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fffef8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.mm-top-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.12s ease, transform 0.12s ease;
}

.mm-close:active {
  transform: scale(0.94);
  background: rgba(0, 0, 0, 0.32);
}

/* —— 主图：contain 顶对齐，避免拉伸与白边 —— */
.mm-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: calc(100dvh - var(--top-bar-h) - var(--bottom-bar-h) - var(--safe-bottom));
}

.mm-hero {
  margin: 0;
  padding: 0 0 6px;
  background: transparent;
}

.hero-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 0;
}

.hero-hit--static {
  pointer-events: none;
  cursor: default;
}

.mm-hero .poster-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--top-bar-h) - var(--bottom-bar-h) - var(--safe-bottom) - 12px);
  object-fit: contain;
  object-position: top center;
  user-select: none;
  pointer-events: none;
}

/* —— 统一 CTA（底栏 + 弹窗 + 顶栏） —— */
.btn-cta {
  position: relative;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: #2a1504;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, #fff6c2 0%, var(--mm-gold) 42%, var(--mm-gold-mid) 100%);
  box-shadow:
    var(--cta-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

.btn-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -3px 0 rgba(124, 90, 10, 0.35);
  pointer-events: none;
}

.btn-cta:hover {
  filter: brightness(1.04);
}

.btn-cta:active,
.btn-cta.is-pressing {
  transform: scale(0.97);
  filter: brightness(0.98);
}

.btn-cta--compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: clamp(0.72rem, 2.4vw, 0.82rem);
  white-space: nowrap;
}

.btn-cta--bottom {
  min-width: 132px;
  min-height: 48px;
  padding: 0 16px;
  font-size: clamp(0.82rem, 2.6vw, 0.95rem);
}

.btn-cta--modal {
  min-width: 220px;
  min-height: 50px;
  padding: 0 24px;
  font-size: clamp(0.95rem, 3vw, 1.06rem);
}

.mm-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(8px + var(--safe-bottom));
  width: min(430px, calc(100% - 14px));
  z-index: 90;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(36, 18, 22, 0.96) 0%, rgba(16, 8, 10, 0.98) 100%);
  border: 1px solid rgba(232, 185, 35, 0.45);
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mm-bottom .bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bottom-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.bottom-logo {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: contain;
  border: 1px solid rgba(232, 185, 35, 0.5);
  flex-shrink: 0;
}

.bottom-text strong {
  color: #fff6d6;
  font-size: clamp(0.88rem, 3vw, 1.05rem);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-text span {
  color: var(--mm-text-soft);
  font-size: clamp(0.72rem, 2.4vw, 0.86rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-btn-wrap {
  position: relative;
  flex-shrink: 0;
}

.bottom-btn-gift {
  position: absolute;
  top: -9px;
  right: -4px;
  z-index: 2;
  font-size: 1.25rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

/* —— 弹窗 —— */
.mm-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 2, 4, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.mm-modal-bg.show {
  display: flex;
}

.modal-card--mm {
  position: relative;
  width: min(380px, 100%);
  padding: 26px 16px 20px;
  text-align: center;
  border-radius: 18px;
  border: 2px solid rgba(232, 185, 35, 0.75);
  background:
    radial-gradient(ellipse 95% 45% at 50% 0%, rgba(255, 236, 180, 0.18) 0%, transparent 52%),
    linear-gradient(165deg, #c53030 0%, #7f1d1d 48%, #3f0d12 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.mm-modal-ribbon {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 12px;
  font-size: clamp(0.74rem, 2.4vw, 0.9rem);
  font-weight: 800;
  color: #4a3208;
  background: linear-gradient(180deg, #fffbeb 0%, var(--mm-gold) 100%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.modal-card--mm h3 {
  margin: 0;
  padding: 0 22px;
  color: #fffdf5;
  font-size: clamp(1.02rem, 3.3vw, 1.28rem);
  font-weight: 900;
  line-height: 1.32;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.modal-card--mm p {
  margin: 10px 0 0;
  color: #ffe8d4;
  font-size: clamp(0.86rem, 2.7vw, 1rem);
  line-height: 1.52;
}

.mm-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.12s ease;
}

.mm-x:active {
  background: rgba(0, 0, 0, 0.42);
}

.modal-cta-wrap {
  position: relative;
  display: inline-block;
  margin-top: 16px;
}

.modal-cta-hongbao {
  position: absolute;
  top: -7px;
  right: -4px;
  z-index: 2;
  font-size: 1.2rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.hongbao-rain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.hongbao-drop {
  position: absolute;
  top: -12vh;
  left: 0;
  line-height: 1;
  user-select: none;
  will-change: transform;
  animation-name: hongbao-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  opacity: 0.88;
}

@keyframes hongbao-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift, 0px), 120vh, 0) rotate(var(--spin, 540deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hongbao-rain {
    display: none !important;
  }

  .bottom-btn-gift,
  .modal-cta-hongbao {
    animation: none !important;
  }
}

@media (min-width: 431px) {
  .mm-page {
    max-width: 430px;
  }
}

@media (max-width: 380px) {
  :root {
    --top-bar-h: 50px;
    --bottom-bar-h: 88px;
  }

  .btn-cta--bottom {
    min-width: 120px;
    min-height: 46px;
  }

  .btn-cta--modal {
    min-width: 190px;
    min-height: 48px;
  }
}
