:root {
  color-scheme: dark;
  background: #050806;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050806;
}

body,
canvas,
div {
  display: block;
  outline: none;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  cursor: default;
  text-align: center;
  font-family: Inter, "Segoe UI", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
}

#Cocos2dGameContainer {
  position: absolute !important;
  inset: 0;
  margin: auto !important;
  overflow: hidden;
  background: #050806;
}

#GameCanvas,
canvas {
  background: transparent;
}

.pg-jackpot-bar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 50;
  width: 100%;
  min-height: 36px;
  padding-top: env(safe-area-inset-top, 0px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  color: #fff;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 0;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .18s ease;
}

.pg-jackpot-bar > div {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 36px;
  padding: 2px 1px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .18);
}

.pg-jackpot-bar > div:last-child {
  border-right: 0;
}

.pg-jackpot-bar b,
.pg-jackpot-bar strong {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  line-height: 1;
}

.pg-jackpot-bar b {
  color: #f8dc68;
  font-size: clamp(10px, 2.2vw, 12px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92);
}

.pg-jackpot-bar strong {
  margin-top: 1px;
  color: #f7f4ec;
  font-size: clamp(10px, 2.05vw, 12px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .92);
}

.gameplay-ready.pg-jackpot-ready:not(.pg-ui-covered) .pg-jackpot-bar {
  opacity: 1;
}

.pg-jackpot-embedded .pg-jackpot-bar {
  display: none !important;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.pg-brand-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-1.2vh);
}

.pg-pixel-logo {
  display: flex;
  align-items: center;
  column-gap: 10%;
  flex: none;
  width: min(36vw, 24vh);
  pointer-events: none;
}

.pg-pixel-logo img {
  display: block;
  height: auto;
}

.pg-pixel-logo img:first-child {
  width: 44.8%;
}

.pg-pixel-logo img:last-child {
  width: 45.2%;
}

.pg-brand-slogan {
  margin: clamp(28px, 4vh, 86px) 0 0;
  color: #ccc;
  font-family: Roboto, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(11px, min(3.2vw, 1.75vh), 38px);
  font-weight: 400;
  line-height: 1;
  white-space: pre;
}

.game-ready #splash {
  display: none !important;
}

#PGGameFrame {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(100vw, 56.25vh);
  height: min(100vh, 177.7778vw);
  border: 0;
  margin: 0;
  background-color: #050806;
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.82);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.desktop-shell .pg-jackpot-bar {
  width: min(100vw, 56.25vh);
}

.desktop-shell #GameCanvas {
  display: none !important;
}

.desktop-shell body::before,
.desktop-shell body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

.desktop-shell body::before {
  inset: -36px;
  background-image:
    linear-gradient(rgba(2, 6, 4, 0.32), rgba(2, 6, 4, 0.52)),
    var(--pg-cover-image);
  background-position: center;
  background-size: cover;
  filter: blur(12px) saturate(0.9);
  transform: scale(1.04);
}

.desktop-shell body::after {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(1, 4, 3, 0.54), transparent 32%, transparent 68%, rgba(1, 4, 3, 0.54)),
    radial-gradient(ellipse at center, transparent 18%, rgba(1, 4, 3, 0.42) 100%);
  z-index: 1;
}

#Cocos2dGameContainer,
#GameCanvas {
  width: 100% !important;
  height: 100% !important;
}

/* 机台编号：进入游戏后才出现，游戏内弹出画面时自动隐藏。
   做成跟版本号一样的小字，不抢画面；pointer-events:none 保证不挡任何按钮。 */
.pg-machine-badge {
  position: fixed;
  left: calc(7px + env(safe-area-inset-left, 0px));
  bottom: calc(5px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  color: rgba(255, 255, 255, .55);
  font: 400 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
  white-space: nowrap;
  pointer-events: none;
  /* 不做淡入。分页被节流时 transition 会卡在 0 不前进，徽章就永远不出现。 */
  opacity: 0;
}

.gameplay-ready:not(.pg-ui-covered) .pg-machine-badge { opacity: 1; }

.pg-machine-badge[hidden] { display: none; }
