:root {
  color-scheme: dark;
  --bg: #050b15;
  --surface: rgba(10, 24, 43, .82);
  --surface-strong: #0c1d33;
  --line: rgba(124, 178, 255, .18);
  --line-bright: rgba(104, 205, 255, .55);
  --text: #eff7ff;
  --muted: #8fa6bf;
  --blue: #48a8ff;
  --cyan: #58e6e9;
  --violet: #a68cff;
  --gold: #ffc861;
  --danger: #ff687a;
  --success: #55e3ae;
  --shadow: 0 30px 90px rgba(0, 0, 0, .38);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 12%, rgba(30, 102, 164, .28), transparent 28rem),
    radial-gradient(circle at 12% 48%, rgba(73, 52, 164, .12), transparent 34rem),
    linear-gradient(180deg, #071323 0%, var(--bg) 46%, #07101c 100%);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(73,187,255,.6) 0 1px, transparent 1.4px);
  background-position: 0 0, 57px 33px;
  background-size: 110px 110px, 170px 170px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.topbar {
  width: min(1280px, calc(100% - 40px));
  height: 84px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-weight: 900; font-size: 24px; font-style: italic;
  border: 1px solid var(--line-bright);
  background: linear-gradient(135deg, rgba(72,168,255,.2), rgba(88,230,233,.06));
  box-shadow: inset 0 0 22px rgba(72,168,255,.18);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.anniversary-chip, .live-dot, .rule-badge, .stock-chip {
  border: 1px solid var(--line);
  background: rgba(17, 40, 68, .62);
  color: #bddcf8;
  border-radius: 999px;
}
.anniversary-chip { padding: 9px 14px; font-size: 11px; letter-spacing: .14em; }

.hero {
  min-height: 690px;
  padding: 84px 0 74px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(460px, 1.1fr);
  align-items: center;
  gap: 72px;
  position: relative;
}
.hero::after {
  content: "01";
  position: absolute;
  left: -24px; bottom: 25px;
  color: rgba(145, 193, 239, .04);
  font-size: 180px; font-weight: 900; line-height: 1;
  pointer-events: none;
}
.eyebrow { margin: 0 0 16px; color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .28em; }
.hero h1 { margin: 0; font-size: clamp(46px, 5.6vw, 76px); line-height: 1.1; letter-spacing: -.05em; }
.hero h1 span { color: transparent; -webkit-text-stroke: 1px rgba(120, 209, 255, .76); }
.hero-lead { max-width: 510px; margin: 26px 0 32px; color: #a9bfd4; font-size: 16px; line-height: 1.9; }

.glass-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(14, 34, 58, .83), rgba(5, 15, 28, .91));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(16px);
}
.code-card { padding: 22px; max-width: 540px; position: relative; }
.code-card::before, .lottery-panel::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 62px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.code-card label { display: block; margin-bottom: 11px; color: #d8eaff; font-size: 13px; font-weight: 700; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, select, textarea {
  width: 100%; border: 1px solid rgba(118, 168, 211, .25); border-radius: 3px;
  background: rgba(3, 12, 23, .78); color: var(--text); outline: none;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(72,168,255,.1); }
input::placeholder, textarea::placeholder { color: #58708a; }
.button {
  border: 0; border-radius: 3px; min-height: 43px; padding: 0 18px;
  cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .18s, opacity .18s, border-color .18s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: linear-gradient(135deg, var(--blue), #277be9); color: white; box-shadow: 0 10px 32px rgba(35, 123, 233, .3); }
.button.secondary { border: 1px solid rgba(72,168,255,.38); background: rgba(32, 100, 160, .15); color: #bfe3ff; }
.button.danger { border: 1px solid rgba(255,104,122,.38); background: rgba(255,104,122,.12); color: #ffabb5; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.form-hint { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.form-hint.success { color: var(--success); }
.participant-card {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #afc4d8; font-size: 13px;
}
.participant-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.participant-card strong { color: var(--gold); }
.trust-row { display: flex; flex-wrap: wrap; gap: 19px; margin-top: 21px; color: #6f8ba4; font-size: 11px; }
.trust-row span::before { content: "◇"; margin-right: 7px; color: var(--cyan); }

.lottery-panel { padding: 25px; position: relative; }
.panel-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.panel-heading { margin-bottom: 20px; }
.panel-heading small { color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.panel-heading h2, .section-heading h2 { margin: 4px 0 0; font-size: 24px; }
.live-dot { padding: 6px 9px; color: var(--success); border-color: rgba(85,227,174,.25); font-size: 9px; letter-spacing: .12em; }
.live-dot::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 9px var(--success); }
.lottery-grid {
  aspect-ratio: 1.17;
  padding: 10px;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 9px;
  background: rgba(1, 8, 17, .68);
  border: 1px solid rgba(111, 173, 227, .17);
}
.lottery-tile {
  min-width: 0; padding: 9px 6px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid rgba(117, 171, 218, .18); background: rgba(13, 31, 52, .8);
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}
.lottery-tile::after { content: ""; position: absolute; inset: auto 10% 0; height: 1px; background: currentColor; opacity: .35; }
.lottery-tile img, .result-icon img { width: 54px; height: 54px; object-fit: contain; }
.lottery-tile small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; color: #c6d7e8; font-size: 11px; }
.lottery-tile.active { z-index: 2; transform: scale(1.045); border-color: var(--gold); background: rgba(113, 75, 17, .35); box-shadow: 0 0 0 2px rgba(255,200,97,.18), 0 0 30px rgba(255,200,97,.4), inset 0 0 25px rgba(255,200,97,.13); }
.lottery-tile.muted { opacity: .5; }
.ring-pos-1 { grid-area: 1 / 1; }.ring-pos-2 { grid-area: 1 / 2; }.ring-pos-3 { grid-area: 1 / 3; }
.ring-pos-4 { grid-area: 2 / 3; }.ring-pos-5 { grid-area: 3 / 3; }.ring-pos-6 { grid-area: 3 / 2; }
.ring-pos-7 { grid-area: 3 / 1; }.ring-pos-8 { grid-area: 2 / 1; }
.prize-symbol { color: var(--blue); font-size: 33px; font-weight: 900; line-height: 1; text-shadow: 0 0 20px currentColor; }
.prize-symbol.large { font-size: 52px; }
.tone-cyan .prize-symbol { color: var(--cyan); }.tone-violet .prize-symbol { color: var(--violet); }.tone-gold .prize-symbol { color: var(--gold); }
.draw-button {
  grid-area: 2 / 2; border: 1px solid rgba(79, 184, 255, .67); border-radius: 0;
  background: radial-gradient(circle at 50% 25%, rgba(72,168,255,.3), transparent 65%), linear-gradient(145deg, #174f80, #0b2542);
  cursor: pointer; box-shadow: inset 0 0 20px rgba(96, 208, 255, .14), 0 0 24px rgba(24,122,206,.18);
}
.draw-button span, .draw-button small { display: block; }
.draw-button span { font-weight: 900; font-size: 16px; letter-spacing: .06em; }
.draw-button small { margin-top: 6px; color: #8ecbf5; font-size: 10px; }
.draw-button:hover:not(:disabled) { filter: brightness(1.12); }
.draw-button:disabled { cursor: not-allowed; filter: grayscale(.4); opacity: .5; }
.draw-button.drawing span { animation: pulse 1s infinite; }
.grid-loading { grid-area: 1 / 1 / 4 / 4; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.grid-loading.error { color: var(--danger); }
.draw-status { margin: 14px 0 0; text-align: center; color: #708ca7; font-size: 11px; letter-spacing: .08em; }

.winner-strip { border-block: 1px solid var(--line); background: rgba(7, 20, 36, .82); }
.winner-inner { min-height: 56px; display: flex; align-items: center; gap: 22px; overflow: hidden; }
.winner-label { flex: none; color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.winner-marquee { min-width: 0; flex: 1; white-space: nowrap; color: #8ca5bd; font-size: 12px; overflow: hidden; }
.winner-marquee-track { display: flex; width: max-content; will-change: transform; animation: winner-marquee-scroll var(--marquee-duration, 36s) linear infinite; }
.winner-marquee-track:hover { animation-play-state: paused; }
.winner-marquee-group { display: flex; flex: none; align-items: center; gap: 21px; padding-right: 21px; }
.winner-marquee strong { color: #d7eaff; }.winner-marquee i { color: #3e6e97; font-style: normal; }
@keyframes winner-marquee-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .winner-marquee-track { animation: none; } }

.section { padding: 92px 0; }
.section-heading { margin-bottom: 28px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.prize-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.prize-card {
  min-height: 196px; padding: 18px; border: 1px solid var(--line); background: rgba(10, 25, 43, .65);
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; position: relative; overflow: hidden;
}
.prize-card::before { content: ""; position: absolute; width: 120px; height: 120px; top: -60px; right: -60px; border: 1px solid currentColor; border-radius: 50%; opacity: .11; }
.prize-card:hover { border-color: rgba(105, 190, 255, .42); background: rgba(12, 34, 57, .78); }
.prize-rank { color: #4e6c88; font: 800 10px/1 monospace; }
.prize-art { grid-column: 1 / 3; min-height: 78px; display: grid; place-items: center; }
.prize-art img { width: 78px; height: 78px; object-fit: contain; }
.prize-card h3 { margin: 0 0 5px; font-size: 14px; }.prize-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.prize-meta { align-self: end; display: flex; align-items: center; gap: 6px; }
.stock-chip { align-self: end; padding: 5px 7px; font-size: 9px; }
.empty-card { grid-column: 1 / -1; padding: 40px; text-align: center; border: 1px dashed var(--line); color: var(--muted); }

.rules-section { padding-top: 10px; }
.rules-card { padding: 35px; }
.section-heading.compact { align-items: center; }
.rule-badge { padding: 8px 12px; font-size: 10px; }
.rules-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.rules-list li { min-height: 115px; padding: 24px; display: flex; gap: 18px; background: rgba(5, 16, 29, .95); }
.rules-list li > span { color: var(--cyan); font: 700 11px/1.6 monospace; }.rules-list p { margin: 0; color: #8da5bc; font-size: 12px; line-height: 1.8; }
.rules-list strong { display: block; margin-bottom: 4px; color: #d8e9fa; font-size: 13px; }
.rules-note { margin: 20px 0 0; color: #58748f; font-size: 11px; text-align: center; }
.footer { height: 92px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #4e6b86; font-size: 10px; letter-spacing: .12em; }
.footer a:hover { color: var(--blue); }

.result-dialog {
  width: min(430px, calc(100% - 32px)); padding: 44px 34px 34px; border: 1px solid var(--line-bright); border-radius: 2px;
  background: linear-gradient(150deg, #102b49, #07111f 70%); color: var(--text); text-align: center; box-shadow: 0 40px 120px #000;
  overflow: hidden;
}
.result-dialog::backdrop { background: rgba(0, 5, 11, .79); backdrop-filter: blur(7px); }
.result-dialog .result-glow { position: absolute; width: 300px; height: 300px; top: -210px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: var(--gold); filter: blur(90px); opacity: .32; }
.result-dialog.lose .result-glow { background: var(--blue); opacity: .17; }
.dialog-x { position: absolute; top: 10px; right: 12px; width: 35px; height: 35px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }
.result-icon { min-height: 86px; display: grid; place-items: center; margin: 12px 0; }
.result-icon img { width: 88px; height: 88px; }.result-dialog h2 { margin: 0 0 11px; font-size: 28px; }.result-dialog > p:not(.eyebrow):not(.result-remaining) { color: #c3d7e9; }
.result-remaining { color: var(--muted); font-size: 12px; }.result-dialog .button { min-width: 160px; margin-top: 8px; }
.history-dialog {
  width: min(620px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 40px)); padding: 31px; border: 1px solid var(--line-bright); border-radius: 2px;
  background: linear-gradient(150deg, #102b49, #07111f 70%); color: var(--text); box-shadow: 0 40px 120px #000;
}
.history-dialog::backdrop { background: rgba(0, 5, 11, .79); backdrop-filter: blur(7px); }
.history-heading { padding-right: 28px; }
.history-heading h2 { margin: 0 0 8px; font-size: 26px; }
.history-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.history-heading > p strong { color: var(--gold); }
.history-list { display: grid; gap: 9px; max-height: 470px; margin: 24px 0; overflow: auto; scrollbar-color: #315d82 transparent; }
.history-item { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); background: rgba(3, 13, 25, .62); }
.history-visual { width: 50px; height: 50px; display: grid; place-items: center; background: rgba(20, 51, 81, .45); border: 1px solid rgba(112, 180, 235, .15); }
.history-visual img { width: 40px; height: 40px; object-fit: contain; }
.history-visual .prize-symbol { font-size: 24px; }
.history-copy { min-width: 0; }
.history-copy strong, .history-copy small { display: block; }
.history-copy strong { overflow: hidden; color: #dceeff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-copy small { margin-top: 6px; color: #6986a1; font-size: 10px; }
.history-status { padding: 5px 8px; border: 1px solid rgba(85,227,174,.25); color: var(--success); font-size: 10px; white-space: nowrap; }
.history-lose .history-status { border-color: rgba(143,166,191,.18); color: var(--muted); }
.history-empty { min-height: 190px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.history-empty > span { color: var(--cyan); font-size: 27px; }
.history-empty strong { color: #bed5e9; font-size: 14px; }
.history-empty small { font-size: 11px; }
.history-dialog > .button { width: 100%; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 17px; border: 1px solid rgba(85,227,174,.35); background: #0b2a27; color: #b9f5df; box-shadow: var(--shadow); font-size: 12px; }
.toast.error { border-color: rgba(255,104,122,.42); background: #32151d; color: #ffc2ca; }

@keyframes pulse { 50% { opacity: .48; } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 50px; padding-top: 60px; }
  .hero-copy { max-width: 680px; }
  .lottery-panel { max-width: 680px; width: 100%; margin-inline: auto; }
  .prize-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .wrap, .topbar { width: min(100% - 24px, 1160px); }
  .topbar { height: 70px; }.anniversary-chip { display: none; }
  .hero { padding: 48px 0; gap: 35px; }.hero h1 { font-size: 44px; }.hero-lead { font-size: 14px; }
  .code-card, .lottery-panel { padding: 15px; }.code-row { grid-template-columns: 1fr; }.participant-card { align-items: stretch; flex-direction: column; gap: 12px; }.participant-card .button { width: 100%; }
  .lottery-grid { gap: 5px; padding: 6px; aspect-ratio: 1; }.lottery-tile { gap: 4px; padding: 5px 3px; }.lottery-tile img { width: 38px; height: 38px; }.lottery-tile small { font-size: 9px; }.prize-symbol { font-size: 25px; }.draw-button span { font-size: 13px; }
  .section { padding: 66px 0; }.prize-list { grid-template-columns: repeat(2, 1fr); }.prize-card { min-height: 175px; padding: 13px; }.prize-card p { display: none; }
  .rules-card { padding: 20px 14px; }.rules-list { grid-template-columns: 1fr; }.section-heading.compact { align-items: flex-start; }.rule-badge { display: none; }
  .winner-inner { gap: 14px; }.winner-label { font-size: 9px; }
  .history-dialog { padding: 25px 15px 18px; }.history-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }.history-visual { width: 44px; height: 44px; }.history-status { padding-inline: 6px; }
}
