/* Lucky Pool guided flow · lottery machine on Liquid Glass.
   Source of truth: docs/design/2026-09-28-visual-design-handoff.md and docs/design/lucky-pool-hifi.html.
   Accent is locked to --accent. Status uses --ok / --wn only. Radii: pill, 20 card, 14 input, 12/9 segmented, circle. */
:root {
  color-scheme: light;
  --accent: #007aff;
  --accent-soft: rgba(0,122,255,.12);
  --ink: #0b1b33;
  --muted: rgba(11,27,51,.6);
  --faint: rgba(11,27,51,.32);
  --line: rgba(11,27,51,.1);
  --control: rgba(118,118,128,.12);
  --ok: #34c759; --ok-soft: rgba(52,199,89,.16); --ok-ink: #1f8a3d;
  --wn: #ff9500; --wn-soft: rgba(255,149,0,.15); --wn-ink: #b25400;
  --ball-r: #e0342b; --ball-b: #1f6fd1; --ball-g: #19975a;
  --glass: rgba(255,255,255,.5);
  --glass-strong: rgba(255,255,255,.74);
  --edge: rgba(255,255,255,.75);
  --shadow: 0 10px 28px rgba(15,30,60,.08);
  --ease: cubic-bezier(.23,1,.32,1);
  font-family: -apple-system, "SF Pro Text", "PingFang HK", "Noto Sans HK", system-ui, sans-serif;
  color: var(--ink);
  font-size: 15px;
}
* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background:
    radial-gradient(38% 22% at 88% 10%, rgba(224,52,43,.2), transparent 72%),
    radial-gradient(40% 24% at 4% 46%, rgba(31,111,209,.2), transparent 72%),
    radial-gradient(40% 22% at 82% 90%, rgba(25,151,90,.17), transparent 72%),
    linear-gradient(180deg, #eaf1ff 0%, #f5f8fd 55%, #eef2f8 100%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
#app { position: relative; z-index: 2; }
.screen { width: min(100%, 430px); min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 28px; min-width: 0; }
.grow { flex: 1; min-height: 8px; }
.site-foot { padding: 6px 24px 22px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }

/* ---------- nav ---------- */
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 56px; padding: 8px 14px; position: sticky; top: 0; z-index: 5;  background: linear-gradient(180deg, rgba(234,241,255,.86), rgba(234,241,255,.6)); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); }
.nav-l { justify-self: start; } .nav-r { justify-self: end; }
.nav-t { font-weight: 600; font-size: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.gbtn {
  min-height: 38px; min-width: 38px; padding: 0 14px; border-radius: 19px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 15px; font-weight: 500; color: var(--ink);
  background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 4px 12px rgba(15,30,60,.08);
}
.gbtn.round { padding: 0; width: 38px; }
.gbtn.blue { color: var(--accent); font-weight: 600; }
.wordmark { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.wordmark img { display: block; }
.wordmark i { font-style: normal; color: var(--accent); }

/* ---------- type ---------- */
.lt { font-size: 32px; font-weight: 700; letter-spacing: .005em; line-height: 1.1; }
.t2 { font-size: 23px; font-weight: 700; letter-spacing: -.005em; line-height: 1.2; }
.sub { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.foot { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 0 6px; }
.cap { font-size: 12.5px; color: var(--muted); margin: 2px 0 -6px 14px; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big.xl { font-size: 42px; }
.big.accent { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; align-items: center; }
.body.center > .glass, .body.center > .btn { align-self: stretch; }
[data-pop] { justify-content: center; margin: 12px 0 6px; }

/* ---------- glass + rows ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--edge); border-radius: 20px;
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass, .gbtn, .tabbar { background: rgba(255,255,255,.93); } }
.pad { padding: 14px 16px; }
.rows { padding: 0 0 0 16px; display: block; }
.rw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 0; border-bottom: .5px solid var(--line); font-size: 15px; min-height: 48px; }
.rw:last-child { border-bottom: 0; }
.rw .v { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rw b.v { color: var(--ink); }
.rw input:not(.sw), .rw select { border: 0; background: none; text-align: right; min-width: 0; flex: 1; padding: 6px 0; color: var(--ink); outline-offset: 4px; }
.rw input::placeholder { color: var(--faint); }
.rw > .seg { flex: 1; }
.stack-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stack-row > div { min-width: 0; flex: 1; }

/* ---------- controls ---------- */
.btn {
  min-height: 52px; border-radius: 26px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16.5px; font-weight: 600; white-space: nowrap; flex-shrink: 0; transition: transform .12s var(--ease);
  background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(0,122,255,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.full { width: 100%; }
.btn.tint { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.btn.glassy { background: var(--glass-strong); color: var(--accent); border: 1px solid var(--edge); box-shadow: 0 6px 16px rgba(15,30,60,.08); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 17px; box-shadow: none; }
.btn.danger { background: none; color: #d12e2e; box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; min-width: 0; }
.link { color: var(--accent); font-weight: 500; min-height: 32px; }
.text-btn { color: var(--accent); font-weight: 500; font-size: 14px; min-height: 44px; align-self: center; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--control); gap: 2px; }
.seg > button { flex: 1; min-height: 34px; border-radius: 9px; font-size: 13.5px; font-weight: 500; padding: 0 6px; white-space: nowrap; transition: background .15s var(--ease); }
.seg > button.on { background: #fff; font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.1), 0 1px 1px rgba(0,0,0,.04); }
.stp { display: inline-flex; align-items: center; border-radius: 10px; background: var(--control); height: 34px; flex-shrink: 0; }
.stp button { width: 44px; height: 34px; font-size: 19px; }
.stp b { min-width: 40px; text-align: center; font-size: 16px; border-inline: .5px solid var(--line); font-variant-numeric: tabular-nums; }
.sw { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--control); position: relative; flex-shrink: 0; cursor: pointer; margin: 0; transition: background .2s var(--ease); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: left .2s var(--ease); }
.sw:checked { background: var(--ok); }
.sw:checked::after { left: 22px; }
.switch-row { cursor: pointer; }
.switch-row .rw span { font-size: 14px; line-height: 1.4; }
.field-input { background: var(--glass-strong); border: 1px solid var(--edge); border-radius: 14px; padding: 13px 14px; font-size: 16px; width: 100%; color: var(--ink); }
.field-input::placeholder { color: var(--faint); }
textarea.field-input { min-height: 84px; resize: vertical; line-height: 1.45; }
.err { color: #d12e2e; font-size: 12.5px; padding: 0 14px; }
.chk-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; gap: 10px; }
.chk-row .ico { color: var(--accent); visibility: hidden; }
.chk-row.on .ico { visibility: visible; }
.chk-row small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- icons (SF Symbols style, CSS masks) ---------- */
.ico { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-back { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4.5 7.5 12l7.5 7.5'/%3E%3C/svg%3E"); }
.i-chev { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 5l7 7-7 7'/%3E%3C/svg%3E"); }
.i-close { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.i-copy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2.5'/%3E%3Cpath d='M16 8V6.5A2.5 2.5 0 0 0 13.5 4h-7A2.5 2.5 0 0 0 4 6.5v7A2.5 2.5 0 0 0 6.5 16H8'/%3E%3C/svg%3E"); }
.i-share { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14V3M8 7l4-4 4 4M6 11H5v10h14V11h-1'/%3E%3C/svg%3E"); }
.i-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.i-clock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E"); }
.i-warn { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4L12 3.5Z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E"); }
.i-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-bell { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 1 1 12 0v5l1.5 2h-15L6 16Z'/%3E%3Cpath d='M10 20.5a2 2 0 0 0 4 0'/%3E%3C/svg%3E"); }
.i-mail { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E"); }
.i-link { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E"); }
.i-trash { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9.5 7V4.5h5V7M6.5 7l1 13h9l1-13'/%3E%3C/svg%3E"); }

/* ---------- lottery ball ---------- */
.cb {
  --c: var(--ball-r); --s: 34px;
  width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; position: relative; user-select: none;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.95) 0 5%, rgba(255,255,255,0) 21%), radial-gradient(circle at 50% 58%, var(--c) 0 42%, color-mix(in srgb, var(--c) 52%, #000) 80%, #000 102%);
  box-shadow: 0 calc(var(--s) * .14) calc(var(--s) * .26) rgba(0,0,0,.22), inset calc(var(--s) * -.12) calc(var(--s) * -.15) calc(var(--s) * .27) rgba(0,0,0,.26);
}
.cb i { width: 56%; height: 56%; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 800 calc(var(--s) * .32) / 1 -apple-system, system-ui, sans-serif; font-style: normal; color: #111; box-shadow: inset 0 -2px 3px rgba(0,0,0,.14); font-variant-numeric: tabular-nums; }
.cb.r { --c: var(--ball-r); } .cb.b { --c: var(--ball-b); } .cb.g { --c: var(--ball-g); }
.cb.gh { background: rgba(11,27,51,.05); box-shadow: inset 0 0 0 1.5px rgba(11,27,51,.2); }
.cb.gh i { display: none; }
.cb.adm { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--faint), 0 4px 8px rgba(0,0,0,.15); }
.cb.banker { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink), 0 4px 8px rgba(0,0,0,.15); }
.cb.tk { filter: grayscale(1) opacity(.32); }
.cb.me { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--accent), 0 6px 12px rgba(0,0,0,.2); }
.cb.hit { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--accent), 0 0 16px rgba(0,122,255,.55); }
.sz-16 { --s: 16px; } .sz-18 { --s: 18px; } .sz-20 { --s: 20px; } .sz-24 { --s: 24px; } .sz-28 { --s: 28px; } .sz-32 { --s: 32px; } .sz-40 { --s: 40px; } .sz-52 { --s: 52px; }
.balls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.balls.tight { gap: 3px; }
.plus-sep { color: var(--muted); font-size: 14px; }
.tube { min-height: 46px; border-radius: 23px; padding: 6px 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.3) 45%, rgba(255,255,255,.62));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.95), inset 0 -7px 12px rgba(15,30,60,.08), 0 6px 14px rgba(15,30,60,.08); }
.names { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 7px 0; font-size: 10px; color: var(--muted); }
.names span { width: 28px; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cb.roll-in { animation: rollin .45s var(--ease); }
@keyframes rollin { from { transform: translateX(120px) rotate(260deg); } to { transform: none; } }

/* number grid (1–49) */
.grid49 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; justify-items: center; padding: 12px 10px; }
.grid49 button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.grid49 .cb { --s: 36px; transition: transform .12s var(--ease); }
.grid49 button:active:not(:disabled) .cb { transform: scale(.9); }
.grid49 button:disabled { opacity: 1; }
.flyer { position: fixed; z-index: 50; pointer-events: none; }

/* ---------- chips, pills, warn, dots, avatars ---------- */
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--control); }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill.wn { background: var(--wn-soft); color: var(--wn-ink); }
.pill.gray { background: var(--control); color: var(--muted); }
.warn { background: var(--wn-soft); border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.warn .ico { color: var(--wn); margin-top: 1px; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 2px 0 4px; }
.dots i { width: 24px; height: 5px; border-radius: 3px; background: rgba(11,27,51,.12); }
.dots i.on { background: var(--accent); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.av-0 { background: #e0342b; } .av-1 { background: #1f6fd1; } .av-2 { background: #19975a; } .av-3 { background: #b0138f; } .av-4 { background: #ff9500; } .av-5 { background: #0b1b33; }

/* ---------- recap ---------- */
.recap { border-radius: 16px; font-size: 13.5px; }
.recap-hd { width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 14px; text-align: left; min-height: 44px; }
.recap-hd > .ico:first-child { color: var(--ok); width: 17px; height: 17px; }
.recap-hd b { font-weight: 600; }
.recap .caret { margin-left: auto; color: var(--faint); width: 14px; height: 14px; transform: rotate(90deg); transition: transform .2s var(--ease); }
.recap.open .caret { transform: rotate(-90deg); }
.recap-rows { display: none; padding: 0 14px 10px 39px; flex-direction: column; gap: 4px; }
.recap.open .recap-rows { display: flex; }
.recap-rows > div { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }

/* ---------- entries (tickets) ---------- */
.entry { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; }
.entry-hd { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.entry-hd .amt { margin-left: auto; font-variant-numeric: tabular-nums; }
.entry-meta { font-size: 12.5px; color: var(--muted); }
.entry-meta b { color: var(--accent); font-weight: 500; }
.total-bar { display: flex; justify-content: space-between; font-weight: 600; font-size: 15.5px; padding: 0 6px; font-variant-numeric: tabular-nums; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.34); z-index: 20; }
.scrim.enter { animation: fade .2s var(--ease); }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(100%, 430px); transform: translateX(-50%); max-height: 88dvh; overflow: auto; z-index: 21;
  border-radius: 30px 30px 0 0; background: rgba(246,248,252,.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -10px 40px rgba(15,30,60,.18); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto 2px; }
.sheet-hd { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.sheet-hd > :last-child { justify-self: end; }
.sheet-hd b { font-weight: 600; font-size: 16px; }
/* Animate only when the sheet opens, not on every edit inside it. */
.sheet.enter { animation: sheetup .32s var(--ease); }
@keyframes sheetup { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- invitation art (also the OG image look) ---------- */
.invite-art { position: relative; border-radius: 22px; overflow: hidden; min-height: 150px; color: #fff; padding: 16px; flex-shrink: 0;
  background: radial-gradient(90% 120% at 85% 20%, #2c62d6 0%, #0f2a66 45%, #081634 100%); box-shadow: 0 14px 30px rgba(15,42,102,.3); }
.invite-art .k { font-size: 12.5px; opacity: .75; }
.invite-art strong { display: block; font-size: 20px; font-weight: 700; max-width: 60%; line-height: 1.25; margin-top: 2px; }
.invite-art .d { font-size: 12.5px; opacity: .8; margin-top: 2px; }
.invite-art .badge { position: absolute; left: 16px; bottom: 14px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 99px; }
.invite-art .balls { position: absolute; right: 12px; bottom: 12px; gap: 0; }
.invite-art .balls .cb { margin-left: -6px; }
.invite-art.mini { min-height: 84px; padding: 12px; }
.invite-art.mini strong { font-size: 14px; }
.invite-art.mini .badge { position: static; display: inline-block; margin-top: 8px; }

/* ---------- home ---------- */
.stage-host { position: relative; flex-shrink: 0; touch-action: pan-y; }
.stage-host.drum { height: 250px; margin: -4px -16px -8px; cursor: grab; }
.stage-host.drum.hero { height: 320px; }
.stage-host.reveal { height: 290px; margin: -4px -16px 0; cursor: pointer; }
.stage-fallback { position: absolute; inset: 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: center; padding: 30px 60px; transition: opacity .3s var(--ease); }
.stage-host.webgl-on .stage-fallback { opacity: 0; }
.lottery-stage { position: fixed; z-index: 3; pointer-events: none; }
.hero-copy { display: flex; flex-direction: column; gap: 8px; text-align: center; align-items: center; }
.hero-copy .brand { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.hero-copy .hero-logo { display: block; }
.hero-copy .brand i { font-style: normal; color: var(--accent); }
.round-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; min-height: 64px; }
.round-card > div { flex: 1; min-width: 0; }
.round-card b { display: block; font-weight: 600; font-size: 15px; }
.round-card .ico { color: var(--faint); width: 16px; height: 16px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 12px; }
.countdown-card .row { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- picker / status ---------- */
.strip-ball { display: inline-grid; place-items: center; border-radius: 50%; padding: 0; }
.strip-ball:active .cb { transform: scale(.92); }
.ticket-card { display: flex; flex-direction: column; gap: 6px; box-shadow: inset 0 0 0 1.5px transparent, var(--shadow); transition: box-shadow .15s var(--ease); }
.ticket-card.on { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 2px; text-align: left; font-size: 14px; }
.tc-head b { font-weight: 600; }
.ticket-card .tube, .ticket-card .names { gap: 9px; }
.ticket-card .names .me { color: var(--accent); font-weight: 600; }
.balls.ringed { gap: 11px; padding-right: 4px; }
.cb.oth { opacity: .45; }
.first-note { display: flex; gap: 10px; align-items: flex-start; }
.first-note > .ico { color: var(--accent); margin-top: 2px; }
.first-note b { font-weight: 600; }
.pick-label { margin: 10px 0 4px; }
.pick-label + .balls { justify-content: center; }
.balls.tight.pick-groups { gap: 10px; }
.av-empty { background: var(--control); color: var(--muted); }
.status-icon { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; position: relative; align-self: center; margin-top: 18px; }
.status-icon .ico { width: 42px; height: 42px; color: var(--wn); }
.status-icon::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--wn); animation: spin 1.6s linear infinite; }
.ok-badge { width: 62px; height: 62px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 10px 22px rgba(52,199,89,.35); }
.ok-badge .ico { width: 32px; height: 32px; color: #fff; }
.flip-in { animation: flip .6s var(--ease) both; }
.pop-in { animation: pop .5s var(--ease) both; }
.pop-in:nth-child(2) { animation-delay: .11s; } .pop-in:nth-child(3) { animation-delay: .22s; } .pop-in:nth-child(4) { animation-delay: .33s; }
@keyframes flip { from { transform: perspective(900px) rotateY(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.6) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats > div { padding: 10px 6px; text-align: center; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 3px; background: var(--control); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.member { gap: 10px; }
.member > div { flex: 1; min-width: 0; }
.member b { display: block; font-weight: 600; }
.member .balls { margin-top: 3px; }
.member .end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ticket-block { display: flex; flex-direction: column; gap: 6px; }
.ticket-block .head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 0 4px; }
.ticket-block .head b { font-weight: 600; }
.result-card .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: rgba(11,27,51,.9); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 26px rgba(0,0,0,.2); }

.result-card { transition: opacity .45s var(--ease), transform .45s var(--ease); }
.result-card.waiting { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .screen { padding-top: 24px; } }

/* Codename + PIN access (1.2, 1.3, 1.3a, 2.5, 4.1a) */
.pin-input { font-size: 24px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.pin-input::placeholder { letter-spacing: .3em; }
.code-input { font-size: 20px; font-weight: 600; letter-spacing: .04em; }
.code-card { text-align: center; }
.code-card .code-zh { font-size: 28px; font-weight: 800; letter-spacing: .06em; margin: 2px 0; }
.sub.small { font-size: 12px; }
.chev-row { width: 100%; text-align: left; }
.chev-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.chev-row .ico { color: var(--faint); width: 14px; height: 14px; }
.chev-row[disabled] { opacity: .45; cursor: not-allowed; }
.found { display: flex; align-items: center; gap: 12px; }
.found b { display: block; font-weight: 600; }
.member-pick .who { display: flex; align-items: center; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 500; min-height: 34px; padding: 0 4px; }
.temp-pin { letter-spacing: .25em; }

/* 2.1 draw picker */
.draw-opt small span { font-variant-numeric: tabular-nums; }
.stp.draw-no { gap: 0; }
.stp.draw-no .yy { padding-left: 8px; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; border-left: .5px solid var(--line); }
.rw .stp.draw-no input { flex: none; width: 4ch; text-align: left; font-size: 16px; font-weight: 600; padding: 0 6px 0 1px; border-right: .5px solid var(--line); border-radius: 0; font-variant-numeric: tabular-nums; }
.rw.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.day-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding: 2px 16px 2px 0; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chip { flex: none; min-width: 64px; min-height: 58px; padding: 6px 10px; border-radius: 14px; background: var(--control); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); position: relative; }
.day-chip small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.day-chip b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-chip.on { background: var(--accent); color: #fff; }
.day-chip.on small { color: rgba(255,255,255,.85); }
.day-chip.other input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- headline prize incentive ---------- */
.jackpot { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 20px; color: #4a3200;
  background: linear-gradient(135deg, #ffe9a8 0%, #ffd666 55%, #ffc53d 100%); box-shadow: 0 6px 18px rgba(255,197,61,.32), inset 0 1px 0 rgba(255,255,255,.6); }
.jackpot .jp-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; opacity: .8; }
.jackpot .jp-k .ico { width: 14px; height: 14px; }
.jackpot .jp-v { font-size: 28px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.jackpot .jp-s { font-size: 13.5px; font-weight: 600; }
.jackpot .jp-n { font-size: 11.5px; opacity: .7; line-height: 1.4; margin-top: 4px; }
.jackpot.compact { padding: 10px 14px; border-radius: 16px; }
.jackpot.compact .jp-v { font-size: 20px; }
.jp-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 6px 0 10px; }
.jp-hero span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.jp-hero b { font-size: 30px; font-weight: 800; color: #b07a00; letter-spacing: -.01em; }

/* Legal links and the privacy / terms pages */
.site-foot a, .foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal { max-width: 680px; margin: 0 auto; padding: 28px 20px 48px; line-height: 1.7; font-size: 15px; }
.legal h1 { font-size: 26px; margin: 0 0 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; }
.legal p, .legal li { margin: 6px 0; }
.legal ol { padding-left: 22px; }
.legal .meta { color: var(--muted); font-size: 13px; }
.legal .back { display: inline-block; margin-bottom: 18px; color: var(--accent, #007aff); }

/* Round name: typed or rerolled */
.name-field { display: flex; gap: 8px; align-items: center; }
.name-field .field-input { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; }


/* First-open home: jackpot leads, drum above (variant 02 + drum) */
.stage-host.drum.hero { height: 240px; }
.jackpot-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.jackpot-hero .jp-num { font-size: 56px; line-height: 1; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.jackpot-hero .jp-num small { font-size: 26px; font-weight: 800; }
.close-pill { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--wn-soft); color: var(--wn-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.close-pill .ico { width: 14px; height: 14px; background-color: currentColor; }

/* Intro before the first creation */
.intro-steps { display: flex; flex-direction: column; gap: 18px; }
.intro-step { display: flex; gap: 14px; align-items: flex-start; }
.intro-step .num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.intro-step > div { display: flex; flex-direction: column; gap: 2px; }
.intro-step b { font-size: 16px; }
.intro-points { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-points span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); font-size: 13px; font-weight: 600; }
.intro-points .ico { width: 14px; height: 14px; background-color: currentColor; opacity: 1; }

/* Returning home: next close time, one todo, then rounds */
.close-strip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--wn-soft); color: var(--wn-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.close-strip .ico { width: 15px; height: 15px; }
.close-strip .sub { margin-left: auto; font-weight: 500; }
.todo-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 22px; background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.todo-card .k { font-size: 13px; font-weight: 600; opacity: .9; }
.todo-card b { font-size: 22px; line-height: 1.3; }
.todo-card span { font-size: 14px; opacity: .92; line-height: 1.45; }
.todo-card .btn.light { align-self: flex-start; margin-top: 4px; padding: 0 22px; background: #fff; color: var(--accent); }

.intro-skip { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; }
.intro-skip input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Analytics consent: a small bar, opt-in, gone after one tap */
.consent { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 55; width: min(420px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(11,27,51,.92); color: #fff; font-size: 12px; line-height: 1.4; box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.consent p { margin: 0; flex: 1; }
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }
.consent div { display: flex; gap: 6px; flex-shrink: 0; }
.consent button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 7px 12px; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; }
.consent button[data-consent="granted"] { background: #fff; color: #0b1b33; }
