/*
 * 正式站无中断切换用的桌面覆盖层。
 *
 * 当前生产进程仍可能带有旧版 768px+ 宽屏规则；这份文件让全部玩家页面
 * 在电脑浏览器中复用 600px 宽的手机/PWA单列布局。
 * 选择独立样式文件是为了通过 Nginx 热重载上线，不重启正在处理游戏回调的应用。
 */
@media (min-width: 768px) {
  body.mobile-peach-theme:not(.du78-mobile-preview) {
    max-width: 600px !important;
  }

  body.du78-mobile-preview {
    max-width: none !important;
  }

  body.mobile-peach-theme .mobile-rail-fixed {
    left: max(0px, calc(50% - 300px)) !important;
    width: min(100%, 600px) !important;
  }

  body.mobile-peach-theme .mobile-rail-fab {
    right: max(0.75rem, calc(50% - 288px)) !important;
  }

  body.mobile-peach-theme main.flex > .max-w-sm,
  body.mobile-peach-theme .auth-panel {
    max-width: 480px !important;
  }

  body.mobile-peach-theme .app-header nav[aria-label='Menu principal'],
  body.mobile-peach-theme .app-header a[aria-label='Minha conta'] {
    display: none !important;
  }

  body.mobile-peach-theme .bottom-nav,
  body.mobile-peach-theme .bottom-nav-spacer,
  body.mobile-peach-theme div:has(+ .bottom-nav) {
    display: block !important;
  }

  body.du78-mobile-preview .mobile-stage {
    width: min(100%, 600px);
    padding: 66px 9px 82px;
  }

  body.du78-mobile-preview .mobile-header {
    width: min(100%, 600px);
    height: 58px;
    grid-template-columns: 1.55fr 0.7fr 0.68fr 1.07fr;
    justify-content: normal;
    padding: 7px 8px;
  }

  body.du78-mobile-preview .mobile-header--guest {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.72fr) minmax(0, 1.08fr);
    gap: 3px;
  }

  body.du78-mobile-preview .mobile-header--authenticated {
    grid-template-columns: minmax(0, 1fr);
  }

  body.du78-mobile-preview .mobile-header .header-link,
  body.du78-mobile-preview .mobile-header--authenticated .header-user {
    display: none;
  }

  body.du78-mobile-preview .mobile-header--authenticated .brand {
    width: min(58vw, 216px);
  }

  body.du78-mobile-preview .mobile-header--authenticated .brand img {
    width: 100%;
    height: 100%;
  }

  body.du78-mobile-preview .brand {
    height: 44px;
  }

  body.du78-mobile-preview .header-action {
    font-size: 9.5px;
  }

  body.du78-mobile-preview .mobile-stage > main {
    display: block;
  }

  body.du78-mobile-preview .mobile-stage > main > .sr-only,
  body.du78-mobile-preview .mobile-stage > main > .preview-error,
  body.du78-mobile-preview .hero-live,
  body.du78-mobile-preview .wallet-card,
  body.du78-mobile-preview .shortcut-rail,
  body.du78-mobile-preview .mobile-notices,
  body.du78-mobile-preview .games-panel,
  body.du78-mobile-preview .mobile-recent-games,
  body.du78-mobile-preview .mobile-catalog-notice,
  body.du78-mobile-preview .full-hall,
  body.du78-mobile-preview .mobile-sports-entry {
    grid-column: auto;
    grid-row: auto;
  }

  body.du78-mobile-preview .hero-live {
    min-height: 294px;
  }

  body.du78-mobile-preview .hero-copy {
    top: 24px;
    left: 18px;
  }

  body.du78-mobile-preview .hero-copy > p {
    font-size: 9px;
  }

  body.du78-mobile-preview .hero-copy h1 {
    margin: 5px 0 8px;
    font-size: 28px;
  }

  body.du78-mobile-preview .hero-copy > span {
    max-width: 136px;
    font-size: 9.5px;
  }

  body.du78-mobile-preview .contact-button {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 8px;
  }

  body.du78-mobile-preview .hero-mystery {
    bottom: 2px;
    left: 15px;
    width: 158px;
    height: 88px;
  }

  body.du78-mobile-preview .hero-mystery img {
    width: 90px;
    height: 84px;
  }

  body.du78-mobile-preview .mystery-hint {
    top: 22px;
    left: 91px;
    width: 66px;
  }

  body.du78-mobile-preview .mystery-hint strong {
    font-size: 8.5px;
  }

  body.du78-mobile-preview .mystery-hint small {
    font-size: 6.5px;
  }

  body.du78-mobile-preview .hero-vip {
    right: 9px;
    bottom: 10px;
    width: 112px;
    min-height: 102px;
  }

  body.du78-mobile-preview .hero-vip > span {
    font-size: 11px;
  }

  body.du78-mobile-preview .hero-vip > small {
    font-size: 7px;
  }

  body.du78-mobile-preview .wallet-card {
    margin-top: 9px;
  }

  body.du78-mobile-preview .shortcut-rail {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 9px;
  }

  body.du78-mobile-preview .mobile-notices {
    margin-top: 11px;
  }

  body.du78-mobile-preview .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.du78-mobile-preview .mobile-app-footer {
    margin-inline: 0;
  }

  body.du78-mobile-preview .mobile-bottom {
    width: min(100%, 600px);
    display: grid;
  }

  body.du78-mobile-preview .mobile-rail-fab {
    right: max(0.75rem, calc(50% - 288px)) !important;
  }
}

/* 登录后的顶部“成为代理”入口；由 header-agent-runtime.js 增强旧版正式HTML。 */
body.du78-mobile-preview .mobile-header--authenticated {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 6px;
}

body.du78-mobile-preview .mobile-header--authenticated .brand {
  width: min(50vw, 198px);
}

body.du78-mobile-preview .mobile-header--authenticated .header-user.header-agent {
  position: relative;
  display: flex !important;
  width: clamp(112px, 35vw, 148px);
  min-width: 0;
  min-height: 42px;
  grid-column: auto;
  align-items: center;
  align-self: center;
  flex-direction: row;
  justify-content: flex-start;
  justify-self: end;
  gap: 6px;
  padding: 4px 7px 4px 5px;
  overflow: hidden;
  border: 1px solid rgba(180, 105, 10, 0.46);
  border-radius: 13px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(145deg, #ffe494, #f4a62c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 4px 10px rgba(130, 67, 2, 0.18);
  color: #542c00 !important;
}

body.du78-mobile-preview .header-agent::after {
  position: absolute;
  top: -12px;
  left: -32px;
  width: 22px;
  height: 72px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: rotate(18deg);
  animation: header-agent-runtime-shine 6.8s ease-in-out infinite 1.4s;
}

body.du78-mobile-preview .header-agent__emblem {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(117, 57, 0, 0.38);
  border-radius: 10px;
  background: linear-gradient(145deg, #fff0ad, #db7f08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 3px 6px rgba(91, 43, 0, 0.2);
  transform: rotate(-3deg);
  animation: header-agent-runtime-float 6.2s ease-in-out infinite;
}

body.du78-mobile-preview .header-agent__emblem svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

body.du78-mobile-preview .header-agent__emblem i {
  position: absolute;
  top: -7px;
  right: -5px;
  color: #a05200;
  font-size: 12px;
  font-style: normal;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
  transform: rotate(12deg);
}

body.du78-mobile-preview .header-agent__copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  flex-direction: column;
  line-height: 1;
}

body.du78-mobile-preview .header-agent__copy small {
  color: #8a5008;
  font-size: 5.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.du78-mobile-preview .header-agent__copy strong {
  max-width: none;
  margin-top: 2px;
  overflow: visible;
  font-size: 9px;
  font-weight: 950;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

body.du78-mobile-preview .header-agent > b {
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1;
}

@keyframes header-agent-runtime-float {
  0%, 70%, 100% { transform: translateY(0) rotate(-3deg); }
  80% { transform: translateY(-2px) rotate(1deg); }
  88% { transform: translateY(0) rotate(-1deg); }
}

@keyframes header-agent-runtime-shine {
  0%, 64%, 100% { opacity: 0; transform: translateX(0) rotate(18deg); }
  70% { opacity: 0.9; }
  82% { opacity: 0; transform: translateX(190px) rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.du78-mobile-preview .header-agent,
  body.du78-mobile-preview .header-agent::after,
  body.du78-mobile-preview .header-agent__emblem {
    animation: none !important;
  }
}
