:root {
  --ink: #252526;
  --muted: #8b8987;
  --line: #ece9e5;
  --coral: #f64f49;
  --coral-dark: #dd3c39;
  --orange: #ff9229;
  --cream: #fff6ec;
  --card: #ffffff;
}

* { box-sizing: border-box; }
html { background: #f1efec; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: #f1efec;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid rgba(246, 79, 73, .3); outline-offset: 2px; }
[hidden] { display: none !important; }

.h5-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 20px 65px rgba(64, 50, 35, .14);
}

.primary-cta,
.sheet-confirm {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ff5a53 0%, #f14540 100%);
  box-shadow: 0 7px 15px rgba(226, 58, 54, .22), inset 0 1px rgba(255,255,255,.3);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.primary-cta:active,
.sheet-confirm:active { transform: translateY(2px); box-shadow: 0 3px 9px rgba(226, 58, 54, .2); }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(calc(100% - 64px), 360px);
  min-height: 66px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  color: #fff;
  background: rgba(40, 39, 37, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  border: 8px solid transparent;
  border-top-color: rgba(40, 39, 37, .94);
  border-bottom: 0;
  transform: translateX(-50%);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast > span {
  flex: 0 0 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: #5bb96c;
  font-size: 13px;
  font-weight: 800;
}
.toast p { margin: 0; font-size: 13px; line-height: 1.55; }

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: rgba(31, 29, 27, .52);
  backdrop-filter: blur(3px);
}
.rule-sheet {
  width: min(100%, 430px);
  padding: 9px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 25px 25px 0 0;
  background: #fff;
  animation: sheet-up .24s ease-out;
}
.sheet-handle { display: block; width: 38px; height: 4px; margin: 0 auto 17px; border-radius: 10px; background: #dedad5; }
.sheet-title-row { display: flex; align-items: center; justify-content: space-between; }
.sheet-title-row h2 { margin: 0; font-size: 21px; }
.sheet-title-row button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #77726c; background: #f2f0ed; font-size: 21px; cursor: pointer; }
.rule-sheet ol { margin: 15px 0 21px; padding: 0; list-style: none; }
.rule-sheet li { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rule-sheet li:last-child { border-bottom: 0; }
.rule-sheet li b { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--coral); background: #fff0ee; font-size: 11px; }
.rule-sheet li p { margin: 2px 0 0; color: #5f5b57; font-size: 13px; line-height: 1.5; }
.sheet-confirm { min-height: 48px; font-size: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 500px) {
  .h5-shell { width: 100%; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
