/* 游戏页内充值模块 - 移动端优先，支持后台配置布局 */
#agg-game-toolbar {
  position: fixed;
  z-index: 2147483000;
  display: none;
  gap: 6px;
  pointer-events: none;
  --agg-native-icon-color: #edc6ac;
}

#agg-game-toolbar > * {
  pointer-events: auto;
}

/* 手机 - 右下角 */
#agg-game-toolbar.agg-layout-bottom-right {
  right: 10px;
  bottom: 70px;
  left: auto;
  top: auto;
  flex-direction: column;
  align-items: stretch;
  max-width: calc(100vw - 20px);
}

/* 手机 - 左下角 */
#agg-game-toolbar.agg-layout-bottom-left {
  left: 10px;
  bottom: 70px;
  right: auto;
  top: auto;
  flex-direction: column;
  align-items: stretch;
}

/* 手机 - 底部横排 */
#agg-game-toolbar.agg-layout-bottom-bar {
  left: 50%;
  bottom: 12px;
  right: auto;
  top: auto;
  transform: translateX(-50%);
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 16px);
}

/* 顶部导航栏内 - 与 VIP 系统图标同排、同尺寸 */
#agg-game-toolbar.agg-layout-top-bar-inline {
  top: var(--agg-toolbar-top, 28px);
  right: var(--agg-toolbar-right, 380px);
  left: auto;
  bottom: auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--agg-native-icon-gap, 8px);
  max-width: none;
  height: var(--agg-native-icon-size, 46px);
  line-height: 0;
  box-sizing: border-box;
  --agg-native-icon-size: 46px;
  --agg-native-icon-gap: 8px;
}

#agg-game-toolbar.agg-in-game {
  position: absolute;
  z-index: 1000;
}

body > #agg-game-toolbar.agg-layout-top-bar-inline {
  position: fixed;
}

#agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn {
  min-width: var(--agg-native-icon-size, 46px);
  width: var(--agg-native-icon-size, 46px);
  height: var(--agg-native-icon-size, 46px);
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  gap: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  line-height: 0;
}

#agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
  width: 100%;
  height: 100%;
  max-width: var(--agg-native-icon-size, 46px);
  max-height: var(--agg-native-icon-size, 46px);
  border-radius: 0;
  object-fit: contain;
  display: block;
}

#agg-game-toolbar .agg-btn-icon-mask,
#agg-deposit-panel .agg-btn-icon-mask {
  background-color: var(--agg-native-icon-color, #edc6ac);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

#agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn .agg-btn-label {
  display: none;
}

#agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

#agg-game-toolbar.agg-layout-top-bar-inline #agg-deposit-btn.agg-icon-btn {
  box-shadow: none;
  border: none;
  filter: none;
  background: transparent;
  width: calc(var(--agg-native-icon-size, 46px) * 1.45);
  min-width: calc(var(--agg-native-icon-size, 46px) * 1.45);
}

#agg-game-toolbar.agg-layout-top-bar-inline #agg-deposit-btn.agg-icon-btn .agg-btn-icon {
  width: 100%;
  max-width: none;
}

#agg-game-toolbar.agg-layout-top-bar-inline #agg-deposit-btn.agg-icon-btn .agg-btn-icon-mask {
  mask-size: contain;
  -webkit-mask-size: contain;
}

#agg-game-toolbar.agg-layout-top-bar-inline #agg-home-btn.agg-icon-btn {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 手机/PC - 顶部右侧（旧版浮动） */
#agg-game-toolbar.agg-layout-top-right {
  top: var(--agg-toolbar-top, 8px);
  right: var(--agg-toolbar-right, 8px);
  left: auto;
  bottom: auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: calc(100vw - 16px);
}

/* 顶部左侧 */
#agg-game-toolbar.agg-layout-top-left {
  top: var(--agg-toolbar-top, 8px);
  left: 10px;
  right: auto;
  bottom: auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.agg-toolbar-btn {
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: #fff;
  line-height: 1.2;
}

.agg-toolbar-btn.agg-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.agg-toolbar-btn.agg-icon-btn .agg-btn-label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

#agg-game-toolbar.agg-toolbar-synced {
  z-index: 100001;
}

.agg-toolbar-btn.agg-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.agg-btn-unconfigured {
  opacity: 0.58;
  filter: grayscale(0.4);
}

.agg-btn-unconfigured:hover {
  opacity: 0.72;
}

#agg-deposit-btn.agg-icon-btn {
  border-color: transparent;
  box-shadow: none;
}

#agg-deposit-mask {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

#agg-deposit-panel {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px;
  background: #121212;
  color: #f5f5f5;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

#agg-deposit-panel .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#agg-deposit-panel .hd h3 {
  margin: 0;
  font-size: 18px;
}

#agg-deposit-panel .close-btn {
  border: none;
  background: transparent;
  color: #bbb;
  font-size: 24px;
  cursor: pointer;
}

#agg-deposit-panel .bd {
  padding: 18px;
}

.agg-step-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: #d4af37;
}

.agg-channel-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.agg-channel-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.agg-channel-item.active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
}

.agg-channel-item.agg-channel-disabled {
  opacity: 0.62;
}

.agg-channel-tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #888;
}

.agg-channel-name {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.agg-pay-brand {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}

.agg-amount-block {
  margin-bottom: 14px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.agg-pay-inline {
  margin-bottom: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.agg-proof-block {
  margin-bottom: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.agg-proof-tip {
  margin: -6px 0 12px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.agg-proof-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.agg-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.agg-upload-btn {
  border: 1px dashed rgba(212, 175, 55, 0.55);
  border-radius: 10px;
  padding: 10px 16px;
  background: rgba(212, 175, 55, 0.1);
  color: #ffd86b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.agg-upload-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.agg-proof-status {
  font-size: 12px;
  color: #888;
}

.agg-proof-status.is-done {
  color: #7dd87d;
}

.agg-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#agg-deposit-tip.agg-tip {
  margin-top: 10px;
}

.agg-amount-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #ccc;
}

.agg-preset-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.agg-preset-unit {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #999;
}

.agg-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
}

.agg-option-icon.wechat {
  background: #07c160;
}

.agg-option-icon.alipay {
  background: #1677ff;
}

.agg-option-icon.usdt {
  background: #26a17b;
}

.agg-option-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  margin-right: 10px;
  vertical-align: middle;
}

.agg-option-placeholder {
  opacity: 0.85;
}

.agg-channel-item span {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.agg-channel-item img.agg-channel-img {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.agg-channel-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.agg-channel-icon.wechat {
  background: #07c160;
}

.agg-channel-icon.alipay {
  background: #1677ff;
}

.agg-channel-icon.usdt {
  background: #26a17b;
}

.agg-channel-empty {
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #aaa;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.agg-preset-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.agg-preset-item {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #eee;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.agg-preset-item.active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.16);
  color: #ffd86b;
}

.agg-option-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.agg-option-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #eee;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

.agg-option-item.active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.14);
  color: #ffd86b;
}

.agg-option-name {
  display: block;
  line-height: 1.4;
  margin-top: 8px;
  font-size: 12px;
}

.agg-option-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}

.agg-service-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.agg-service-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #eee;
  cursor: pointer;
}

.agg-service-btn .agg-btn-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

.agg-service-btn .agg-btn-icon-mask {
  width: 42px;
  height: 42px;
}

.agg-service-btn .agg-btn-label {
  font-size: 12px;
  font-weight: 600;
}

.agg-service-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.agg-service-row button:disabled,
.agg-toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.agg-limit-tip {
  margin: -6px 0 14px;
  font-size: 12px;
  color: #888;
}

.agg-field {
  margin-bottom: 14px;
}

.agg-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #ccc;
}

.agg-field input,
.agg-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: #0d0d0d;
  color: #fff;
  font-size: 15px;
}

.agg-primary-btn,
.agg-secondary-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
}

.agg-primary-btn {
  background: linear-gradient(135deg, #d4af37, #b8860b);
  color: #1a1200;
  font-weight: 700;
}

.agg-secondary-btn {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.agg-pay-box {
  text-align: center;
}

.agg-pay-box img.qr {
  width: 220px;
  max-width: 100%;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.agg-pay-meta {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.7;
  color: #ddd;
  word-break: break-all;
}

.agg-address-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.agg-address-row input {
  flex: 1;
  font-size: 12px;
}

.agg-copy-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #d4af37;
  color: #1a1200;
  font-size: 12px;
  cursor: pointer;
}

.agg-proof-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 10px;
  background: #000;
}

.agg-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #999;
  line-height: 1.6;
}

.agg-hidden {
  display: none !important;
}

.game-container {
  overflow: visible !important;
}

.game-container #agg-game-toolbar {
  pointer-events: none;
}

.game-container #agg-game-toolbar > * {
  pointer-events: auto;
}

@media (min-width: 1024px) {
  #agg-game-toolbar.agg-layout-top-bar-inline,
  .game-container #agg-game-toolbar.agg-layout-top-bar-inline {
    top: var(--agg-toolbar-top, 28px);
    right: var(--agg-toolbar-right, 380px);
    gap: var(--agg-native-icon-gap, 8px);
    height: var(--agg-native-icon-size, 52px);
    --agg-native-icon-size: 52px;
    --agg-native-icon-gap: 10px;
  }

  #agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn {
    min-width: var(--agg-native-icon-size, 52px);
    width: var(--agg-native-icon-size, 52px);
    height: var(--agg-native-icon-size, 52px);
  }

  #agg-game-toolbar.agg-layout-top-bar-inline .agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
    max-width: var(--agg-native-icon-size, 52px);
    max-height: var(--agg-native-icon-size, 52px);
  }

  #agg-game-toolbar.agg-layout-top-right {
    top: var(--agg-toolbar-top, 54px);
    right: var(--agg-toolbar-right, 210px);
    flex-wrap: nowrap;
    max-width: none;
    gap: 8px;
  }

  #agg-game-toolbar.agg-layout-top-left {
    top: var(--agg-toolbar-top, 54px);
  }

  #agg-game-toolbar.agg-layout-bottom-left {
    left: 24px;
    bottom: 24px;
    top: auto;
    right: auto;
    flex-direction: column;
  }

  .agg-toolbar-btn.agg-icon-btn {
    min-width: 58px;
    padding: 8px 10px;
  }

  .agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
    width: 36px;
    height: 36px;
  }

  .agg-toolbar-btn.agg-icon-btn .agg-btn-label {
    font-size: 11px;
  }
}

@media (max-width: 1023px) {
  #agg-game-toolbar.agg-layout-mobile-bottom-nav {
    --agg-native-icon-size: 24px;
    --agg-mobile-nav-height: 52px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 0;
    min-height: 0;
    overflow: visible;
    padding-bottom: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    z-index: 2147483000;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav .agg-toolbar-btn.agg-icon-btn {
    position: absolute;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    pointer-events: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: 0;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav #agg-home-btn {
    left: 30%;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav #agg-deposit-btn {
    left: 70%;
    width: auto;
    min-width: 0;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav .agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
    width: var(--agg-native-icon-size, 24px);
    height: var(--agg-native-icon-size, 24px);
    max-width: var(--agg-native-icon-size, 24px);
    max-height: var(--agg-native-icon-size, 24px);
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav #agg-deposit-btn.agg-icon-btn {
    width: auto;
    min-width: 0;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav #agg-deposit-btn.agg-icon-btn .agg-btn-icon {
    display: none;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav #agg-deposit-btn.agg-icon-btn .agg-btn-label {
    font-size: 13px;
    font-weight: 600;
  }

  #agg-game-toolbar.agg-layout-mobile-bottom-nav .agg-toolbar-btn.agg-icon-btn .agg-btn-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--agg-native-icon-color, #edc6ac);
    white-space: nowrap;
  }

  #agg-game-toolbar.agg-layout-top-bar-inline {
    --agg-native-icon-size: 46px;
    --agg-native-icon-gap: 8px;
  }

  #agg-game-toolbar.agg-layout-top-right {
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 420px) {
  #agg-game-toolbar:not(.agg-layout-mobile-bottom-nav) .agg-toolbar-btn.agg-icon-btn {
    min-width: 48px;
    padding: 5px 6px;
  }

  #agg-game-toolbar:not(.agg-layout-mobile-bottom-nav) .agg-toolbar-btn.agg-icon-btn .agg-btn-icon {
    width: 30px;
    height: 30px;
  }

  #agg-game-toolbar:not(.agg-layout-mobile-bottom-nav) .agg-toolbar-btn.agg-icon-btn .agg-btn-label {
    font-size: 9px;
  }
}
