* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}

html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation
}

#pg-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff
}

#pg-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  height: auto;
  padding: 0 12px;
  padding-top: var(--pg-safe-top, env(safe-area-inset-top, 0));
  background: #f3f3f3;
  border-bottom: 1px solid #e0e0e0;
  z-index: 10
}

#pg-top-bar.collapsed {
  display: none
}

.pg-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1
}

.pg-btn-back {
  border: none;
  background: transparent url("./pg_btn_back.png") no-repeat center center;
  background-size: contain;
  width: 24px;
  height: 24px;
  padding: 0;
  flex-shrink: 0;
  color: transparent;
  font-size: 0;
  line-height: 0
}

.pg-title {
  font-size: 15px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.pg-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0
}

.pg-btn-recharge {
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffd98a 0%, #f5b84c 100%);
  color: #5a3b00;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px
}

.pg-btn-toggle {
  border: none;
  background: transparent url("./pg_btn_toggle.png") no-repeat center center;
  background-size: contain;
  width: 24px;
  height: 24px;
  padding: 0;
  flex-shrink: 0;
  color: transparent;
  font-size: 0;
  line-height: 0
}

#pg-collapsed-tab {
  position: absolute;
  top: var(--pg-safe-top, env(safe-area-inset-top, 0));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 32px;
  padding: 0;
  background: transparent url("./pg-side-toggle.png") no-repeat center center;
  background-size: 100% 100%;
  color: transparent;
  font-size: 0;
  line-height: 0;
  z-index: 20
}

#pg-collapsed-tab.show {
  display: flex
}

#pg-game-frame-wrap {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch
}

#pg-game-frame {
  position: absolute;
  left: 0;
  top: 0;
  border: none;
  display: block;
  background: #000;
  width: 100%;
  height: 100%;
  overflow: hidden
}
