:root {
  color-scheme: light;
  --red: #b84c52;
  --pale: #ffcccc;
  --ink: #28282e;
  --secondary: #70676b;
  --red-ink: #943b41;
  --line: #efe5e6;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  background: #f7f7f8;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; padding: 24px 16px; min-height: 100dvh; }
button, a { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
img { display: block; flex-shrink: 0; object-fit: contain; }
h1, h2, p { margin: 0; }
h2 { font-size: 14px; font-weight: 500; }
#lottery { width: min(100%, 380px); margin: 0 auto; background: #fff; border-radius: 12px; overflow: hidden; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 24px 18px; min-height: 100px; background: var(--red); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 { font-size: 20px; font-weight: 500; line-height: 1.4; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 12px; padding: 0; display: grid; place-items: center; background: transparent; flex-shrink: 0; }
.icon-button:hover { background: rgb(255 255 255 / 14%); }
.quota-row { display: flex; align-items: baseline; gap: 9px; margin: 0 18px; padding: 20px 0 17px; border-bottom: 1px solid var(--line); }
.quota { display: inline-flex; align-items: baseline; gap: 5px; color: var(--red-ink); }
.quota strong { font-size: 25px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.quota > span, .secondary, .daily { font-size: 12px; color: var(--secondary); }
.daily { margin-left: auto; }
.content { padding: 0 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); aspect-ratio: 1; width: 100%; gap: 9px; }
.prize { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px 3px; transition: transform 150ms ease; }
.prize.tinted { background: var(--pale); border-color: transparent; }
.prize img { width: 46px; height: 46px; }
.prize > span { font-size: 12px; font-weight: 500; white-space: nowrap; }
.prize.active { outline: 2px solid var(--red); outline-offset: -2px; transform: scale(1.015); }
.draw { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; border: 0; border-radius: 12px; padding: 5px; background: var(--red); color: #fff; transition: transform 160ms ease; }
.draw img { width: 27px; height: 27px; }
.draw > span { font-size: 16px; white-space: nowrap; }
.draw:active { transform: scale(.97); }
.draw:disabled { background: #eee8e9; color: #766a6d; }
.draw:disabled img { opacity: .55; }
.draw[data-state="paused"] > span { font-size: 13px; }
.notice { font-size: 12px; color: var(--red-ink); line-height: 1.7; padding: 12px 0 0; overflow-wrap: anywhere; }
.retry { display: block; border: 0; background: transparent; color: var(--red-ink); padding: 10px 0; min-height: 44px; }
.history { padding: 23px 0 0; }
.history-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.empty { text-align: center; font-size: 12px; color: var(--secondary); padding: 24px 0; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record-name { color: var(--red-ink); font-size: 12px; font-weight: 500; }
.record-time { font-size: 11px; color: var(--secondary); margin-top: 3px; }
.record-state { color: var(--secondary); font-size: 12px; white-space: nowrap; }
.record-button { min-height: 44px; border: 0; background: transparent; color: var(--red-ink); font-size: 12px; padding: 8px 0 8px 8px; white-space: nowrap; }
.footer { display: flex; align-items: center; gap: 6px; padding: 18px 18px 20px; color: var(--secondary); font-size: 12px; }
.text-button { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; border: 0; background: transparent; color: var(--red-ink); padding: 6px 0 6px 8px; min-height: 44px; font-size: 12px; }
dialog { width: min(320px, calc(100% - 32px)); max-height: calc(100dvh - 48px); border: 0; border-radius: 12px; padding: 25px 22px 22px; background: #fff; color: var(--ink); text-align: center; overflow: auto; }
dialog::backdrop { background: rgb(47 29 34 / 34%); }
.dialog-icon { margin: 0 auto 13px; }
.dialog-kicker { font-size: 12px; color: var(--secondary); }
#dialog-title { margin: 9px 0 8px; font-size: 20px; font-weight: 500; line-height: 1.4; }
#dialog-body { font-size: 13px; line-height: 1.7; color: var(--secondary); overflow-wrap: anywhere; }
#dialog-body p + p { margin-top: 10px; }
#dialog-body .contact-pending { font-size: 14px; font-weight: 500; color: var(--red-ink); }
.rules { margin: 0; text-align: left; }
.receipt { display: block; font-size: 12px; font-family: ui-monospace, monospace; margin: 8px 0; overflow-wrap: anywhere; }
.copy { min-height: 44px; border: 0; background: transparent; color: var(--red-ink); font-size: 12px; padding: 8px; }
.dialog-button, .claim-button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--red); color: #fff; margin-top: 20px; text-decoration: none; font-weight: 500; }
.claim-button { background: #f8eeee; color: var(--red-ink); margin-top: 14px; }
.claim-button + .dialog-button { margin-top: 10px; }
.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; }
@media (max-width: 380px) {
  body { padding: 12px; }
  .content { padding: 0 15px; }
  .grid { gap: 7px; }
  .prize img { width: 38px; height: 38px; }
  .draw > span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .prize, .draw { transition: none; }
}
