:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2129; --muted: #86909c; --line: #e5e6eb;
  --primary: #3370ff; --primary-d: #245bdb; --danger: #f53f3f; --gold: #ff9a2e; --ok: #00b42a;
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
.wrap { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 8px 4px 16px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: 2px; color: var(--primary); }
.brand-sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border-radius: var(--r); padding: 20px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h2 { margin: 0 0 6px; font-size: 22px; }
.card h3 { margin: 4px 0 10px; font-size: 18px; }
.hero { background: linear-gradient(135deg, #3370ff, #6e8bff); color: #fff; }
.hero-t { margin: 0; font-size: 17px; font-weight: 600; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: #d25f00; }
.draft { font-size: 20px; color: var(--gold); font-weight: 700; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.big-emoji { font-size: 56px; line-height: 1.2; margin: 6px 0; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.field { display: block; margin: 10px 0; }
.field > span, .label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input[type=tel], input[type=text], input[type=password], input:not([type]) {
  width: 100%; font-size: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; outline: none;
}
input:focus { border-color: var(--primary); background: #fff; }
input.pin { text-align: center; letter-spacing: 16px; font-size: 28px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #4e5969; margin: 12px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check a { color: var(--primary); text-decoration: none; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-size: 17px; font-weight: 600; cursor: pointer; text-decoration: none; background: #f2f3f5; color: var(--text); -webkit-tap-highlight-color: transparent; }
.btn.block { display: flex; width: 100%; margin-top: 8px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-d); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.danger { background: #fff; border-color: #fbd0d0; color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { opacity: .6; }
.msg { min-height: 1.4em; margin: 8px 0 0; color: var(--danger); font-size: 14px; }
.msg.ok { color: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item:first-child { border-top: 0; }
.item-main { flex: 1; min-width: 140px; }
.item-act { display: flex; gap: 6px; flex-wrap: wrap; }
.child-av { font-size: 36px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: #f2f3f5; border-radius: 50%; }
.tag { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 10px; background: #e8f3ff; color: var(--primary); }
.tag.gold { background: #fff3e8; color: var(--gold); }
.invite { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.qr { display: block; width: 240px; height: 240px; max-width: 80vw; max-height: 80vw; margin: 12px auto; image-rendering: pixelated; background: #fff; border-radius: 12px; }
.qr.dim { opacity: .2; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin: 12px 0; }
.kid { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 2px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; font: inherit; color: inherit; }
.kid.on { border-color: var(--primary); background: #e8f3ff; }
.kid-av { font-size: 52px; line-height: 1.1; }
.kid-name { font-weight: 600; font-size: 17px; }
.kid-note { font-size: 12px; color: var(--gold); }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 8px; }
.av { font-size: 26px; padding: 6px 0; border-radius: 10px; border: 2px solid transparent; background: #f7f8fa; cursor: pointer; }
.av.on { border-color: var(--primary); background: #e8f3ff; }
dialog { border: 0; border-radius: var(--r); padding: 0; width: min(92vw, 460px); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.dlg { padding: 20px; }
.dlg h3 { margin-top: 0; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 16px 0; }
.foot a { color: var(--muted); }
@media (min-width: 768px) { .wrap { padding-top: 32px; } .card { padding: 24px; } }
