:root {
  --bg: #F4F7FB; --surface: #FFFFFF; --ink: #1C2541; --muted: #5B6478; --line: #D9E0EA;
  --ticket: #F2B134; --ticket-ink: #3D2A00; --focus: #2E6FB7; --error: #B42318;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111726; --surface: #1A2234; --ink: #E9EDF5; --muted: #A3ACBF; --line: #2C3650; --focus: #7FB0EE; --error: #F97066; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.55 var(--body); }
.wrap { max-width: 44rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
h1, h2 { font-family: var(--display); line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
.lede { max-width: 34rem; color: var(--muted); margin: 0.75rem 0 2.5rem; }
section { margin-bottom: 3rem; }
.muted { color: var(--muted); }
.error { color: var(--error); margin: 0.75rem 0 0; }

/* Notched ticket shape, shared by the draw ticket and the price stubs */
.notched {
  -webkit-mask: radial-gradient(circle var(--r) at left center, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--r) at right center, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--r) at left center, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--r) at right center, #0000 98%, #000) right / 51% 100% no-repeat;
}

/* The draw: one big ticket */
.big-ticket { --r: 14px; display: grid; grid-template-columns: 1fr auto; background: var(--ticket); color: var(--ticket-ink); border-radius: 12px; }
.bt-main { padding: 1.75rem 1.5rem 1.75rem 2.25rem; }
.bt-title { margin: 0 0 0.35rem; font-weight: 700; }
.bt-prize { font-size: clamp(1.6rem, 5vw, 2.25rem); font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.bt-how { margin: 0.75rem 0 0; max-width: 30rem; }
.bt-stub { display: flex; flex-direction: column; justify-content: center; padding: 1.5rem 2.25rem 1.5rem 1.5rem;
  border-left: 2px dashed color-mix(in srgb, var(--ticket-ink) 40%, transparent); text-align: center; }
.bt-date { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1; margin-top: 0.25rem; }
@media (max-width: 560px) {
  .big-ticket { grid-template-columns: 1fr; }
  .bt-main { padding: 1.75rem 2rem 1.25rem; }
  .bt-stub { border-left: 0; border-top: 2px dashed color-mix(in srgb, var(--ticket-ink) 40%, transparent);
    padding: 1.25rem 2rem 1.5rem; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 0.5rem; text-align: left; }
  .bt-date { font-size: 1.5rem; }
}

/* Item list */
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.item { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1rem 0.5rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:hover:not(:disabled) { background: var(--surface); }
.item:disabled { cursor: default; opacity: 0.55; }
.item-text { display: flex; flex-direction: column; }
.item-name { font-weight: 700; }
.item-desc { color: var(--muted); font-size: 0.95rem; }
.stub { --r: 5px; flex: none; background: var(--ticket); color: var(--ticket-ink); font-weight: 700; white-space: nowrap;
  padding: 0.35rem 1rem; border-radius: 4px; }
.how ol { padding-left: 1.25rem; margin: 0; }
.how li { margin: 0.3rem 0; }

/* Buttons, forms, dialog */
.btn { font: 700 1rem var(--body); padding: 0.75rem 1.25rem; border-radius: 10px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--bg); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.6; cursor: wait; }
:focus-visible, .item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
dialog { border: 0; border-radius: 14px; padding: 1.5rem; width: min(26rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(10 15 30 / 0.5); }
dialog h2 { margin-bottom: 0.25rem; }
dialog .muted { margin: 0 0 0.5rem; }
label { display: block; font-weight: 700; font-size: 0.95rem; margin-top: 0.9rem; }
input, select { display: block; width: 100%; margin-top: 0.35rem; font: 1rem var(--body); padding: 0.65rem 0.75rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: pop 0.16s ease-out; }
  @keyframes pop { from { opacity: 0; transform: translateY(8px); } }
}
