:root {
  --safe-top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 44px);
  --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  /* 糖果紫罗兰背景 + 奶油字，配合猫抓老鼠的可爱配色 */
  background: #63529f;
  color: #fff6ea;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Arial Rounded MT Bold", sans-serif;
}
#cv {
  display: block;
  width: 100vw;
  /* Chrome 61 基线：100vh；增强：JS 维护的 --app-height（动态视口 / 软键盘下更准） */
  height: 100vh;
  height: var(--app-height, 100vh);
  touch-action: none;
  outline: none;
}

.redeem-overlay {
  position: fixed;
  /* Chrome 61 基线：物理属性（inset 简写为 Chrome 87+，旧内核会被整条丢弃） */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  background: rgba(48, 36, 86, 0.82);
  -webkit-user-select: text;
  user-select: text;
}
.redeem-overlay[hidden] {
  display: none !important;
}
.redeem-card {
  /* Chrome 61 基线：百分比 + max-width（min() 为 Chrome 79+） */
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: #fff6ea;
  color: #3d2b52;
  box-shadow: 0 12px 0 #2c2350;
  border: 2px solid #c9b8ee;
}
.redeem-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.redeem-steps {
  margin: 0 0 14px;
  padding-left: 1.25em;
  font-size: 14px;
  line-height: 1.55;
  color: #5f4f7e;
}
.redeem-steps strong {
  color: #3d2b52;
}
#redeem-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 2px solid #b3a2dd;
  border-radius: 12px;
  font-size: 17px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #fff;
  color: #3d2b52;
  -webkit-user-select: text;
  user-select: text;
}
#redeem-input:focus {
  outline: none;
  border-color: #62cfa7;
  box-shadow: 0 0 0 3px rgba(168, 240, 198, 0.5);
}
.redeem-msg {
  min-height: 1.25em;
  margin: 0 0 12px;
  font-size: 13px;
  text-align: center;
  color: #7f72a3;
}
.redeem-msg.ok { color: #4f8f6e; }
.redeem-msg.err { color: #d95f6b; }
.redeem-actions {
  display: flex;
}
/* 基线：子项单边 margin（Flex gap 为 Chrome 84+） */
.redeem-actions > * + * {
  margin-left: 10px;
}
/* 增强：JS 实测 Flex gap 生效后才启用，并清除基线 margin */
.supports-flex-gap .redeem-actions {
  column-gap: 10px;
}
.supports-flex-gap .redeem-actions > * + * {
  margin-left: 0;
}
.redeem-actions button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 13px 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
}
.redeem-primary {
  background: #ffd35e;
  color: #3a2a52;
  box-shadow: 0 4px 0 #b5713a;
}
.redeem-secondary {
  background: #7b68bd;
  color: #fff6ea;
  box-shadow: 0 4px 0 #3a2a52;
}
