:root {
  color-scheme: light;
  --paper: #f6f7ef;
  --ink: #222a23;
  --muted: #535e50;
  --green: #386241;
  --line: #dbe1d3;
  --lime: #d5f65e;
  --mono: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.07em; text-decoration: none; }
.header-label { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font: 700 12px/1 var(--mono); letter-spacing: .08em; }
.header-label span { width: 7px; height: 7px; border-radius: 50%; background: #5f865a; }

.layout { display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); align-items: start; gap: 34px clamp(35px, 6.6vw, 92px); padding-top: clamp(44px, 6vw, 82px); }
.intro { padding-top: 14px; }
.eyebrow, .ticket-kicker, .art-caption { font: 700 12px/1.4 var(--mono); letter-spacing: .12em; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--green); }
.eyebrow span { width: 16px; height: 2px; background: var(--green); }
h1 { margin-top: 16px; font-size: clamp(46px, 5.7vw, 77px); font-weight: 800; letter-spacing: -.105em; line-height: 1.1; word-break: keep-all; }
h1 em { color: var(--green); font-style: normal; }
.intro-copy { margin-top: 22px; color: var(--muted); font-size: clamp(15px, 1.35vw, 18px); font-weight: 600; letter-spacing: -.04em; line-height: 1.8; word-break: keep-all; }

.illustration {
  position: relative;
  isolation: isolate;
  width: min(350px, 100%);
  height: 206px;
  overflow: hidden;
  margin-top: 35px;
  border: 1px solid #d8e3d0;
  border-radius: 18px;
  background: radial-gradient(circle, #768f7042 1px, transparent 1px) 0 0 / 14px 14px, #e9f0df;
}
.orbit { position: absolute; top: 48%; left: 50%; width: 76%; height: 43%; border: 1px solid #9fb39a; border-radius: 50%; }
.orbit-one { transform: translate(-50%, -50%) rotate(-18deg); }
.orbit-two { transform: translate(-50%, -50%) rotate(21deg); }
.art-ball { position: absolute; display: grid; place-items: center; border-radius: 50%; font-family: var(--mono); font-weight: 800; letter-spacing: -.1em; }
.art-ball-main { top: 15%; left: 32%; width: 115px; height: 115px; padding-right: 5px; background: radial-gradient(circle at 30% 24%, #ecff9c, #c5e749 61%, #9fbd34); color: #2c3c1e; font-size: 51px; transform: rotate(-13deg); box-shadow: 7px 13px 20px #4a632e35, inset -5px -8px 14px #6a852336; }
.art-ball-small { top: 53%; left: 66%; width: 54px; height: 54px; padding-right: 3px; background: radial-gradient(circle at 28% 25%, #ffeeb8, #ffc36a 68%, #e5a14a); color: #593912; font-size: 26px; transform: rotate(14deg); box-shadow: 3px 8px 13px #5d61302d; }
.spark { position: absolute; color: #3e6745; }
.spark-one { top: 25%; left: 75%; font-size: 22px; }
.spark-two { top: 61%; left: 15%; font-size: 17px; }
.art-caption { position: absolute; bottom: 12px; left: 13px; color: var(--green); font-size: 10px; }

.ticket { min-width: 0; padding: clamp(22px, 3vw, 38px); border: 1px solid #dce1d6; border-radius: 25px; background: #fffefa; box-shadow: 0 15px 35px #34452b0d, 0 2px 4px #34452b08; }
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ticket-kicker { color: var(--green); font-size: 11px; }
h2 { margin-top: 6px; font-size: clamp(27px, 3.1vw, 37px); font-weight: 800; letter-spacing: -.09em; line-height: 1.16; }
.ticket-mark { flex: none; color: var(--green); stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.ticket-mark rect { fill: #eef4e7; stroke: #d4e1ce; }
.game-count { min-width: 0; margin: 29px 0 20px; padding: 0; border: 0; }
.game-count legend { margin-bottom: 10px; padding: 0; font-size: 14px; font-weight: 800; }
.game-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.game-options label { position: relative; min-width: 0; cursor: pointer; }
.game-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.game-options span { display: grid; place-items: center; min-height: 41px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.game-options label:hover span { border-color: #7f9f77; }
.game-options input:checked + span { border-color: #304c34; background: #304c34; color: white; }
.game-options input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 3px; }

.result-panel { padding: 17px; border: 1px solid #e0e5d8; border-radius: 14px; background: #f4f6ed; }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; }
.result-header h3 { font-size: 14px; font-weight: 800; }
.result-count { border-radius: 5px; background: #e4eddd; color: #39583b; padding: 4px 7px; font-size: 11px; font-weight: 800; }
.results { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.result-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px; align-items: center; padding: 9px 0; }
.result-row + .result-row { border-top: 1px solid #e0e5d8; }
.game-label { color: var(--green); font: 700 11px/1.4 var(--mono); }
.balls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, 1vw, 10px); }
.ball { display: grid; place-items: center; justify-self: center; width: min(100%, 53px); aspect-ratio: 1; border: 1px solid #20282012; border-radius: 50%; color: #273026; font-family: var(--mono); font-size: clamp(14px, 1.8vw, 23px); font-weight: 800; line-height: 1; box-shadow: inset 0 -4px 0 #2028200b; }
.ball-1 { background: #ffe092; }
.ball-2 { background: #b9ddff; }
.ball-3 { background: #ffc0b5; }
.ball-4 { background: #e0d4f8; }
.ball-5 { background: #d3eeac; }
.result-row[aria-hidden="true"] .ball { color: #596350; filter: saturate(.65); }
.result-row:not([aria-hidden]) .ball { animation: reveal .26s ease-out var(--reveal-delay, 0ms) both; }

.actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 17px; }
.actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 51px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.actions button:disabled { cursor: default; }
.actions svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.actions .draw-button { background: var(--lime); color: #253016; font-size: 16px; }
.draw-button:hover:not(:disabled) { background: #c6ec43; }
.actions .copy-button { border-color: var(--line); background: #fffefa; color: var(--green); }
.copy-button:hover:not(:disabled) { background: #f0f4e8; border-color: #a2b49a; }
.actions .copy-button:disabled, .actions .draw-button:disabled { background: #edf0e8; color: #677165; }
.status { min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.footer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-block: 17px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.footer a { color: var(--green); font-weight: 700; text-underline-offset: 3px; }

@keyframes reveal {
  from { opacity: .4; transform: translateY(5px) scale(.91); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 850px) {
  .shell { width: calc(100% - 44px); }
  .layout { column-gap: 26px; grid-template-columns: minmax(0, .74fr) minmax(0, 1.26fr); }
  .illustration { margin-top: 23px; }
}

@media (max-width: 690px) {
  .header-inner { min-height: 60px; }
  .layout { grid-template-columns: 1fr; row-gap: 24px; padding-top: 34px; }
  .intro { padding-top: 0; }
  h1 { margin-top: 10px; }
  .intro-copy { margin-top: 11px; }
  .illustration { display: none; }
  .ticket { border-radius: 19px; }
  .game-count { margin-top: 20px; margin-bottom: 14px; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 30px); }
  .ticket { padding: 17px; }
  .result-panel { padding: 12px; }
  .actions button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .result-row:not([aria-hidden]) .ball { animation: none; }
}
