:root {
  --bg: #FFF6EC;
  --card: #FFFFFF;
  --ink: #2E2420;
  --muted: #8C7B70;
  --line: #F1E3D6;
  --accent: #FF7A45;
  --accent-ink: #FFFFFF;
  --good: #2E9C6A;
  --bad: #C8553D;
  --shadow: 0 6px 24px rgba(120, 70, 30, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1D1916; --card: #28221E; --ink: #F5EDE6; --muted: #B3A398;
    --line: #3A312B; --shadow: 0 6px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Nunito", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 480px; margin: 0 auto; padding: 0 16px 32px; }

.top { max-width: 480px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; }
.lang { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 4px 12px; font: inherit; font-weight: 800; cursor: pointer; }

.hero { text-align: center; padding: 8px 0 12px; }
.pet-wrap { position: relative; display: inline-block; padding-top: 58px; }
.pet { width: 150px; height: 150px; margin: 0 auto; animation: bob 3s ease-in-out infinite; transform-origin: 50% 90%; }
.pet svg { width: 100%; height: 100%; display: block; }
.pet .eyes-happy, .pet .mouth-sad { display: none; }
.pet.happy .eyes-idle { display: none; }
.pet.happy .eyes-happy { display: inline; }
.pet.happy { animation: hop .6s ease-in-out 3, bob 3s ease-in-out 1.8s infinite; }
.pet.sad .mouth-idle { display: none; }
.pet.sad .mouth-sad { display: inline; }
.pet.sad { animation: bob 5s ease-in-out infinite; filter: saturate(.7); }
.pet .eyes-idle { animation: blink 4.5s infinite; transform-origin: 100px 106px; }
@keyframes bob { 0%,100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-4px) scale(1.02, .98); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(.96, 1.05); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

.bubble {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(320px, 86vw);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 8px 14px; border-radius: 16px; font-weight: 700; font-size: 14px;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px;
  background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.stat { margin: 8px 0 0; font-size: 18px; font-weight: 800; }
.stat b { color: var(--accent); font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.sub b { color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-top: 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.friend { border: 2px solid var(--accent); }
.label { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

button, .x { font: inherit; cursor: pointer; }
.big {
  width: 100%; border: 0; border-radius: 16px; padding: 16px; font-size: 19px; font-weight: 900;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 #D95A28;
  transition: transform .08s, box-shadow .08s;
}
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #D95A28; }
.big:disabled { opacity: .6; cursor: default; }
.big.small { font-size: 16px; padding: 13px; margin-top: 4px; }

.code-row { display: flex; align-items: center; gap: 10px; }
.code {
  flex: 1; font: 900 30px/1.2 "Nunito", ui-monospace, monospace; letter-spacing: .12em;
  background: var(--bg); border: 2px dashed var(--line); border-radius: 12px; padding: 10px 12px; text-align: center;
  user-select: all;
}
.ghost { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 800; }
.steps { margin: 12px 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.two { display: flex; gap: 10px; }
.two > * { flex: 1; text-align: center; }
.ok, .bad { border: 0; border-radius: 12px; padding: 12px; font-weight: 900; color: #fff; }
.ok { background: var(--good); }
.bad { background: var(--bad); }
.x { display: block; text-decoration: none; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 12px; font-weight: 900; }
.win { font-weight: 900; font-size: 18px; margin: 0 0 12px; text-align: center; }

form { display: grid; gap: 10px; margin-top: 12px; }
input {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#giveCode { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
#giveBox { margin-top: 12px; }

.faq ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.faq li + li { margin-top: 4px; }
.follow { text-align: center; margin-top: 18px; }
.follow a { color: var(--ink); text-decoration: none; font-weight: 700; }
.follow b { color: var(--accent); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 800;
  transition: .25s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }
.claim-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--bad); font-weight: 800; font-size: 14px; text-align: center; }

.modal { position: fixed; inset: 0; background: rgba(30, 20, 15, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.sheet { background: var(--card); border-radius: 20px; padding: 14px; width: min(560px, 100%); text-align: center; }
.sheet img { width: 100%; border-radius: 12px; display: block; }
.sheet .hint { margin: 10px 0; }

.badge { margin: 8px 0 0; font-size: 13px; font-weight: 800; }
.badge.on { color: var(--good); }
.badge.off { color: var(--muted); }
.slots { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 700; }

.faq dl { margin: 8px 0 0; font-size: 14px; }
.faq dt { font-weight: 900; margin-top: 12px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 2px 0 0; color: var(--muted); }
code.inline { font: 900 15px "Nunito", ui-monospace, monospace; letter-spacing: .08em; color: var(--accent); background: var(--bg); padding: 1px 6px; border-radius: 6px; user-select: all; }
.more { width: 100%; margin-top: 10px; border: 0; background: none; color: var(--muted); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.qr { width: 220px; height: 220px; margin: 4px auto 0; background: #fff; border-radius: 12px; padding: 10px; }
.qr img, .qr svg { width: 100%; height: 100%; display: block; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-grid .ghost { text-decoration: none; text-align: center; display: block; }
.wide { width: 100%; margin-top: 10px; }
