/* GM switch for the private mobile build. */
.stage .overlay {
  z-index: 6;
}

/* 奶蛙2048 的结算遮罩 z-index 是 20，GM 按钮要能盖在它上面去救人 */
body[data-game="nai2048"] .gm-chip {
  z-index: 25;
}

.gm-chip {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 10px 0 9px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  color: #f5ffe9;
  background: rgba(47, 60, 42, .62);
  box-shadow: 0 4px 14px rgba(44, 58, 36, .2);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gm-chip:active {
  transform: scale(.95);
}

.gm-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c8b79f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
  transition: background .2s ease, box-shadow .2s ease;
}

.gm-chip.on {
  border-color: rgba(206, 255, 165, .65);
  background: rgba(65, 112, 43, .82);
  box-shadow: 0 5px 18px rgba(64, 112, 40, .3);
}

.gm-chip.on .gm-chip-dot {
  background: #bcff7f;
  box-shadow: 0 0 8px rgba(188, 255, 127, .85);
}

.gm-modal .modal-card {
  width: min(360px, 100%);
}

.gm-card {
  gap: 0;
}

.gm-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 243, 224, .92);
  box-shadow: inset 0 0 0 1px rgba(214, 160, 96, .24);
  text-align: left;
}

.gm-status strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.gm-status small {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.gm-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
}

.gm-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.gm-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8c7b4;
  box-shadow: inset 0 1px 4px rgba(92, 63, 36, .15);
  transition: background .2s ease;
}

.gm-switch-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 2px 6px rgba(96, 63, 33, .22);
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}

.gm-switch input:checked + .gm-switch-track {
  background: #79c451;
}

.gm-switch input:checked + .gm-switch-track::after {
  transform: translateX(22px);
}

.gm-switch input:focus-visible + .gm-switch-track {
  outline: 3px solid rgba(255, 107, 107, .32);
  outline-offset: 2px;
}

.gm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gm-grid .btn {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  font-size: 12.5px;
}

.gm-grid .btn-wide {
  grid-column: 1 / -1;
}

.gm-note {
  margin: 12px 2px 2px;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: #a1846c;
}

@media (max-width: 860px) {
  .gm-chip {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 26px;
    font-size: 9px;
  }

  .gm-modal {
    padding: 12px;
  }

  .gm-modal .modal-card {
    width: min(340px, 100%);
    padding: 15px;
  }

  .gm-grid .btn {
    min-height: 47px;
    font-size: 13px;
  }
}
