:root {
  color-scheme: light;
  --ink: #203a2e;
  --muted: #65756a;
  --green: #28593e;
  --line: #dde5db;
  --page: #f4f7f2;
  --surface: #fff;
  --surface-soft: #fbfcf9;
  --accent: #5e7b46;
  --badge-bg: #eaf0df;
  --badge-ink: #44603b;
  --badge-line: #d8e3cc;
  --hover: #eaf0e5;
  --button-hover: #1d472f;
  --button-ink: #fff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5eee7;
  --muted: #a9baae;
  --green: #a9d48e;
  --line: #35483c;
  --page: #121c17;
  --surface: #1c2a22;
  --surface-soft: #18251e;
  --accent: #b6d995;
  --badge-bg: #293d27;
  --badge-ink: #c2dbaa;
  --badge-line: #435b37;
  --hover: #2e4234;
  --button-hover: #bddfa8;
  --button-ink: #18251e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
.page { width: min(100% - 48px, 1080px); margin: 0 auto; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.7px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: var(--button-ink);
  font-size: 22px;
}
.edition { color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.theme-toggle { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.theme-toggle:hover { background: var(--hover); }
main { max-width: 700px; margin: 0 auto; padding: 66px 0 48px; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--badge-line);
  border-radius: 100px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-size: 12px;
  font-weight: 700;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #608144; }
h1 { margin: 22px 0 16px; font-size: clamp(38px, 6vw, 56px); line-height: 1.22; letter-spacing: -2.5px; font-weight: 800; word-break: keep-all; }
h1 span { color: var(--accent); }
.intro { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; word-break: keep-all; }
.ticket {
  margin-top: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 36px #263e2a06;
  text-align: left;
}
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 25px 30px 0; }
.ticket-top h2 { margin: 0; font-size: 14px; font-weight: 700; }
.ticket-label { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); }
.sets { display: grid; gap: 14px; padding: 30px 30px 24px; }
.number-set { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 14px; }
.set-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.numbers { display: flex; justify-content: center; gap: 13px; margin: 0; padding: 0; list-style: none; }
.ball {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #56675b;
  background: #f1f4ee;
  border: 1px solid #e5eae1;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ball[data-color="yellow"] { background: #f8df86; color: #654808; border-color: #ebcd6f; }
.ball[data-color="blue"] { background: #c2e5f5; color: #24546e; border-color: #b0d5e8; }
.ball[data-color="red"] { background: #f8c9bb; color: #853e2e; border-color: #eab7a8; }
.ball[data-color="gray"] { background: #e1e5e9; color: #495461; border-color: #d3d9df; }
.ball[data-color="green"] { background: #d5e8b1; color: #416027; border-color: #c3d99e; }
.ball.reveal { animation: pop 380ms ease-out backwards; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.85); } to { opacity: 1; transform: translateY(0) scale(1); } }
.hint { min-height: 20px; margin: 0 20px 28px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.ticket-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 30px;
  border-top: 1px dashed var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}
.copy { padding: 7px 9px; border: 0; border-radius: 6px; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.copy:hover { background: var(--hover); }
.copy:disabled { opacity: .4; cursor: default; background: transparent; }
.generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  margin-top: 18px;
  padding: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--button-ink);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: background 150ms, transform 150ms;
}
.generate:hover { background: var(--button-hover); transform: translateY(-1px); }
.generate:active { transform: translateY(1px); }
.generate svg { width: 20px; height: 20px; }
button:focus-visible { outline: 3px solid #91ad64; outline-offset: 4px; }
.details { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.details span::before { content: "✓"; margin-right: 6px; color: var(--accent); }
footer { padding: 0 0 28px; text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .page { width: calc(100% - 32px); }
  header { padding: 23px 0; gap: 12px; flex-wrap: wrap; }
  .edition { font-size: 10px; letter-spacing: 1px; }
  main { padding-top: 44px; }
  .intro { font-size: 14px; }
  .ticket { margin-top: 28px; border-radius: 19px; }
  .ticket-top { padding: 22px 20px 0; }
  .sets { gap: 12px; padding: 26px 12px 22px; }
  .number-set { grid-template-columns: 32px 1fr; gap: 4px; }
  .set-label { font-size: 10px; }
  .numbers { gap: clamp(4px, 1.5vw, 9px); }
  .ball { width: clamp(35px, 11.5vw, 60px); height: clamp(35px, 11.5vw, 60px); font-size: clamp(18px, 5vw, 25px); }
  .ticket-bottom { padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
