:root {
  color-scheme: light;
  --paper: #fbf9f5;
  --ink: #201936;
  --purple: #6137ce;
  --muted: #696175;
  --line: #e9e3ee;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(100% - 64px, 1056px); margin-inline: auto; }
.top { border-bottom: 1px solid #ece6e1; }
.top-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 850; font-size: 20px; letter-spacing: -.05em; }
.brand-icon { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 11px; background: var(--purple); color: white; font-size: 21px; }
.badge, .ticket-tag { border-radius: 30px; padding: 8px 13px; background: #eee7fb; color: #5830b7; font-size: 12px; font-weight: 800; }
.badge { letter-spacing: .12em; }
.hero { min-height: 346px; display: flex; align-items: center; position: relative; isolation: isolate; }
.hero-copy { padding-block: 40px; }
.eyebrow { margin: 0; color: var(--purple); font-size: 12px; font-weight: 850; letter-spacing: .15em; }
.hero .eyebrow { letter-spacing: .045em; font-size: 14px; }
.hero .eyebrow span { margin-right: 4px; }
h1 { font-size: clamp(42px, 6vw, 75px); line-height: 1.08; letter-spacing: -.09em; margin: 17px 0 20px; font-weight: 900; }
h1 em { color: var(--purple); font-style: normal; }
.intro { margin: 0; color: var(--muted); line-height: 1.75; font-size: 16px; }
.art { position: absolute; z-index: -1; width: 440px; height: 300px; right: 16px; top: 20px; background: radial-gradient(ellipse, #eee4ff 0, transparent 69%); }
.orbit { position: absolute; width: 350px; height: 142px; top: 83px; left: 46px; border: 1px solid #d9c6f6; border-radius: 50%; transform: rotate(-24deg); }
.orbit-two { transform: rotate(23deg); height: 115px; top: 100px; border-style: dashed; }
.sphere { display: grid; place-items: center; position: absolute; border-radius: 50%; aspect-ratio: 1; font-weight: 900; box-shadow: 5px 15px 24px #43276e38, inset -4px -5px 11px #29105035; }
.sphere span { background: #fff8f5; border-radius: 50%; width: 56%; aspect-ratio: 1; display: grid; place-items: center; box-shadow: inset 0 0 8px #56357235; }
.purple { width: 158px; left: 108px; top: 54px; transform: rotate(-14deg); color: #4c209b; font-size: 63px; background: radial-gradient(circle at 30% 23%, #be9aff, #7946e5 44%, #5020ad 85%); }
.gold { width: 112px; left: 248px; top: 122px; transform: rotate(15deg); color: #8b470c; font-size: 34px; background: radial-gradient(circle at 30% 23%, #fff2a5, #ffbf58 45%, #dd841f 87%); }
.lilac { width: 75px; left: 304px; top: 34px; transform: rotate(19deg); color: #693797; font-size: 23px; background: radial-gradient(circle at 30% 23%, #f2d9ff, #bd8af0 45%, #8c5ac5 85%); }
.spark { position: absolute; color: #a679de; font-size: 26px; }
.s1 { left: 57px; top: 60px; color: #8155d3; }
.s2 { right: 18px; top: 111px; }
.s3 { left: 95px; bottom: 49px; color: #c68525; }
.s4 { right: 72px; bottom: 34px; font-size: 18px; }
.ticket { position: relative; background: white; border: 1px solid var(--line); border-radius: 25px; box-shadow: 0 12px 35px #32124b0b; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 25px 32px 0; }
h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.055em; }
.ticket-tag { white-space: nowrap; }
.numbers { display: flex; justify-content: center; gap: clamp(5px, 2.5vw, 27px); padding: 27px 15px 29px; }
.ball { display: grid; place-items: center; width: clamp(32px, 10vw, 73px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 32% 25%, var(--light), var(--base) 64%, var(--shade)); color: #251832; font-size: clamp(16px, 4vw, 30px); font-weight: 900; box-shadow: inset 0 -2px 3px #39284a24, 0 5px 9px #2c18361c; }
.range-0 { --light: #fff1ab; --base: #f6cb65; --shade: #e1a545; }
.range-1 { --light: #d2ebff; --base: #9bcdf8; --shade: #72a9e4; }
.range-2 { --light: #ffd7db; --base: #f4a1ac; --shade: #df7a89; }
.range-3 { --light: #ecdefa; --base: #cbb1ec; --shade: #ab8ad8; }
.range-4 { --light: #e2f8d4; --base: #addb9d; --shade: #85ba79; }
.ticket-actions { display: flex; justify-content: center; gap: 12px; border-top: 1px dashed #e3dbed; padding: 22px 18px 25px; }
button { border: 1px solid transparent; border-radius: 13px; min-height: 49px; padding: 0 22px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; display: inline-flex; gap: 9px; align-items: center; justify-content: center; }
.primary { background: var(--purple); color: white; min-width: 190px; }
.primary span { font-size: 22px; line-height: 1; }
.primary:hover { background: #5128b6; }
.secondary { color: #5d398e; border-color: #e5daef; background: #faf7fe; }
.secondary:hover { background: #efe7fb; }
.copy-icon { width: 11px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; margin-left: 4px; }
.copy-icon::before { content: ''; position: absolute; inset: -4px 2px 2px -4px; border-top: 1.5px solid; border-left: 1.5px solid; border-radius: 2px; }
:focus-visible { outline: 3px solid #8753de; outline-offset: 4px; }
.status { position: absolute; inset: auto 12px 2px; margin: 0; text-align: center; color: #5830b7; font-size: 12px; }
.history { margin-top: 30px; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.history-head h2 { font-size: 20px; }
.history-head span, .empty, footer { color: var(--muted); font-size: 13px; }
.empty { margin: 0; padding: 18px; border: 1px dashed #e3dbed; border-radius: 13px; text-align: center; }
ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history-row { display: flex; justify-content: space-between; align-items: center; background: white; padding: 10px 16px; border-radius: 13px; border: 1px solid var(--line); }
.history-row > span { font-size: 13px; color: var(--muted); }
.history-balls { display: flex; gap: 6px; }
.history-balls .ball { width: 30px; font-size: 13px; box-shadow: none; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; padding-block: 12px; border-top: 1px solid #ece6e1; }
footer span { font-weight: 800; }
@media (max-width: 740px) {
  .wrap { width: calc(100% - 32px); }
  .hero { min-height: 0; display: block; }
  .hero-copy { padding-block: 32px 0; }
  .art { position: relative; width: min(440px, 100%); right: auto; top: auto; margin: -9px auto -13px; height: 203px; overflow: hidden; }
  .orbit { width: 78%; left: 11%; top: 55px; height: 87px; }
  .orbit-two { top: 61px; height: 78px; }
  .purple { width: 106px; font-size: 40px; left: 30%; top: 40px; }
  .gold { width: 75px; font-size: 24px; left: 57%; top: 85px; }
  .lilac { width: 53px; font-size: 16px; left: 69%; top: 23px; }
  .s1 { left: 16%; top: 43px; }
  .s3 { left: 22%; bottom: 30px; }
  .ticket-head { padding-inline: 19px; }
  .primary { min-width: 0; }
  button { padding-inline: 15px; }
}
.top-actions { display: flex; align-items: center; gap: 10px; }
#theme-toggle { width: 44px; min-height: 44px; padding: 0; background: #faf7fe; color: #5d398e; border-color: var(--line); font-size: 21px; }
#theme-toggle:hover { background: #efe7fb; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #181322;
  --ink: #f5eefb;
  --purple: #c3a5ff;
  --muted: #c0b4cc;
  --line: #3b304a;
}
[data-theme="dark"] :is(.top, footer, .ticket-actions, .empty) { border-color: var(--line); }
[data-theme="dark"] :is(.ticket, .history-row) { background: #241b32; }
[data-theme="dark"] :is(.badge, .ticket-tag, .secondary, #theme-toggle) { background: #352543; color: #e0caff; border-color: #4a385b; }
[data-theme="dark"] :is(.secondary, #theme-toggle):hover { background: #463158; }
[data-theme="dark"] .primary { color: #201532; }
[data-theme="dark"] .primary:hover { background: #d3bdff; }
[data-theme="dark"] .status { color: #e0caff; }
[data-theme="dark"] .art { background: radial-gradient(ellipse, #3b2455 0, transparent 69%); }
[data-theme="dark"] .orbit { border-color: #69498d; }
