:root {
  --uv: #3312c4;
  --uv-deep: #230a8f;
  --lemon: #ffe733;
  --ink: #140a3d;
  --paper: #ffffff;
  --lilac: #efebff;
  --line: #cfc7f5;
  --hot: #c4005f;
  --body: "SUIT Variable", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --poster: "Black Han Sans", "SUIT Variable", "Malgun Gothic", sans-serif;
  --digits: "Big Shoulders Display", "SUIT Variable", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.75 var(--body); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--uv); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* 머리글 */
.site-head { background: var(--uv); color: #fff; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 400 24px/1 var(--poster); }
.logo svg { width: 34px; height: 22px; }
.nav { display: flex; gap: 24px; }
.nav a { color: #fff; text-decoration: none; font-weight: 600; padding: 6px 0; border-bottom: 3px solid transparent; }
.nav a:hover { border-color: #fff; }
.nav a[aria-current="page"] { border-color: var(--lemon); color: var(--lemon); }
.menu-btn { display: none; background: none; border: 2px solid #fff; color: #fff; border-radius: 8px; padding: 4px 14px; font-weight: 600; cursor: pointer; }

/* 첫 화면 */
.stage { background: var(--uv); color: #fff; padding: 26px 0 56px; }
.stage h1 { font: 400 clamp(36px, 6vw, 64px)/1.15 var(--poster); }
.stage .lede { margin-top: 10px; max-width: 42em; font-size: 18px; color: #f1eeff; }
.sites { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 18px; }
.sites a { color: #fff; font-weight: 700; text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.sites a:hover { border-color: #fff; }
.sites a[aria-current="true"] { color: var(--lemon); border-color: var(--lemon); }

/* 입장권 */
.ticket { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; background: var(--lemon); color: var(--ink); border-radius: 12px; overflow: hidden; }
.t-main { padding: 28px 36px 30px; min-width: 0; container-type: inline-size; }
.t-label { font-weight: 700; font-size: 18px; }
/* 시계 전체 너비는 글자 크기의 4.76배다. 칸 너비를 나눠 어느 화면에서도 칸에 꼭 맞게 한다. */
.digits { display: flex; font: 800 clamp(48px, 12vw, 150px)/1 var(--digits); font-size: min(164px, calc(100cqw / 4.8)); margin: 8px 0 16px; }
.digits .d { flex: none; display: inline-block; width: .56em; text-align: center; }
.digits .sep { flex: none; display: inline-block; width: .28em; text-align: center; }
.t-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 0; }
.t-facts dt { font-size: 15px; font-weight: 600; }
.t-facts dd { margin: 0; font-size: 19px; font-weight: 800; }
.t-status { margin-top: 14px; font-size: 16px; line-height: 1.6; }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.t-stub { position: relative; padding: 28px 28px 30px; border-left: 4px dashed var(--uv); display: flex; flex-direction: column; gap: 12px; min-width: 0; container-type: inline-size; }
.t-stub::before, .t-stub::after { content: ""; position: absolute; left: -22px; width: 40px; height: 40px; border-radius: 50%; background: var(--uv); }
.t-stub::before { top: -20px; }
.t-stub::after { bottom: -20px; }
.t-stub label.open-time { display: grid; gap: 4px; font-weight: 700; }
.t-stub input[type="time"] { width: 100%; padding: 8px 10px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.left-label { font-weight: 700; margin-top: 6px; }
.left-digits { font-size: 52px; font-size: min(72px, calc(100cqw / 4.8)); margin: 0; }
.ticket.arrived .t-stub { background: var(--hot); color: #fff; border-left-color: #fff; }
.ticket.arrived .sound-line input { accent-color: var(--ink); }
.sound-line { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 16px; }
.sound-line input { width: 20px; height: 20px; accent-color: var(--uv); }

/* 버튼 */
.btn { display: inline-block; background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--uv-deep); border-color: var(--uv-deep); }
.btn.quiet { background: transparent; color: var(--ink); }
.btn.quiet:hover { background: var(--ink); color: #fff; }
.btn.big { padding: 14px 28px; font-size: 19px; }
.btn.off { background: #6e6890; border-color: #6e6890; }

/* 연습 도구 */
.sim-wrap { display: grid; gap: 16px; }
.received { background: var(--lemon); color: var(--ink); padding: 12px 18px; border-radius: 8px; font-weight: 700; }
.steps { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; counter-reset: step; color: #f1eeff; font-weight: 600; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step) ". "; }
.steps li.now { color: var(--lemon); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 3px; }
.sim { background: #fff; color: var(--ink); border-radius: 12px; padding: 30px; min-height: 400px; }
.sim h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.sim-msg { font-size: 16px; min-height: 1.6em; }
.sim-setup, .sim-open, .sim-queue, .sim-captcha, .sim-zones, .sim-seats, .sim-pay, .sim-result { max-width: 620px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: start; }
.sim-open, .sim-queue { justify-items: center; text-align: center; padding-top: 48px; }
.sim-count { font: 800 clamp(48px, 9vw, 84px)/1.05 var(--digits); font-variant-numeric: tabular-nums; }
.sim-bar { width: 100%; height: 14px; background: var(--lilac); border-radius: 4px; overflow: hidden; }
.sim-bar span { display: block; height: 100%; width: 0; background: var(--uv); }
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.choice legend { font-weight: 800; padding: 0; margin-bottom: 4px; }
.choice label, .agree { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.choice input, .agree input { width: 20px; height: 20px; accent-color: var(--uv); }
.sim-captcha canvas { width: min(100%, 420px); height: 110px; border-radius: 8px; }
.sim-captcha label { display: grid; gap: 4px; font-weight: 700; width: min(100%, 420px); }
.sim-captcha input { width: 100%; min-width: 0; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 8px; font-size: 24px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.stage-mark { width: 100%; text-align: center; background: var(--ink); color: #fff; padding: 6px; border-radius: 4px; font-weight: 700; }
.zone-grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.zone { display: grid; gap: 2px; text-align: left; background: var(--lilac); border: 2px solid transparent; border-radius: 8px; padding: 14px 16px; cursor: pointer; font-variant-numeric: tabular-nums; }
.zone:hover:not(:disabled) { border-color: var(--uv); }
.zone:disabled { background: #eeeeee; color: #6b6b6b; cursor: not-allowed; }
.seat-grid { width: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.seat { aspect-ratio: 1; border: 0; border-radius: 4px; background: #e6e4ee; padding: 0; min-width: 0; }
.seat.free { background: var(--uv); cursor: pointer; }
.seat.free:hover { background: var(--hot); }
.seat.free.picked, .seat.free.picked:hover { background: var(--lemon); box-shadow: inset 0 0 0 3px var(--ink); }
.sim-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.result-title { font: 400 clamp(34px, 6vw, 52px)/1.2 var(--poster); color: var(--uv); }
.result-main { font-size: 24px; font-weight: 800; }
.result-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { padding: 8px 0; border-bottom: 2px solid var(--lilac); text-align: left; font-weight: 500; }
.result-table td { text-align: right; font-weight: 800; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share p { width: 100%; font-size: 16px; min-height: 1.6em; }

/* 반응속도 */
.mode-tabs { display: flex; gap: 22px; margin: 18px 0; }
.mode-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 4px 0; color: #fff; font-weight: 700; cursor: pointer; }
.mode-tabs button[aria-selected="true"] { color: var(--lemon); border-color: var(--lemon); }
.pad { width: 100%; min-height: 340px; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 28px; text-align: center; border-radius: 12px; border: 0; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pad[data-state="idle"] { background: #fff; color: var(--ink); }
.pad[data-state="wait"] { background: var(--uv-deep); color: #fff; }
.pad[data-state="go"] { background: var(--lemon); color: var(--ink); }
.pad-title { font: 800 clamp(44px, 9vw, 88px)/1.1 var(--digits); }
.pad-hint { max-width: 32em; font-size: 18px; min-height: 1.75em; }
.reaction-result { background: #fff; color: var(--ink); border-radius: 12px; }
.reaction-result:not(:empty) { margin-top: 16px; padding: 30px; }

/* 순위 */
.rank-form { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; padding: 16px; background: var(--lilac); border-radius: 8px; }
.rank-form label { display: grid; gap: 4px; font-weight: 700; }
.rank-form input { width: 100%; padding: 8px 10px; background: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.rank-form input:disabled { background: #e6e4ee; }
.rank-form .btn { padding: 9px 16px; }
.rank-form .btn:disabled { background: #6e6890; border-color: #6e6890; cursor: default; }
.rank-form p { grid-column: 1 / -1; }
.rank-form [data-rank-note]:empty { display: none; }
.rank-form [data-rank-note] { font-weight: 700; }
.rank-hint { font-size: 15px; line-height: 1.6; }
.board-tabs { flex-wrap: wrap; gap: 4px 20px; }
.period-tabs { margin-top: -6px; }
.rank-board { background: #fff; color: var(--ink); border-radius: 12px; padding: 12px 30px 22px; min-height: 240px; }
.rank-board table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank-board th, .rank-board td { padding: 11px 8px; text-align: left; border-bottom: 2px solid var(--lilac); }
.rank-board th { font-size: 15px; }
.rank-board th:first-child, .rank-board td:first-child { width: 72px; font-weight: 800; }
.rank-board th:last-child, .rank-board td:last-child { text-align: right; font-weight: 800; }
.rank-board tr.first td { background: var(--lemon); font-size: 21px; font-weight: 800; }
.rank-board [data-message] { padding: 28px 0; }

/* 본문 */
.article { padding: 56px 0 64px; }
.prose { max-width: 720px; }
.prose h2 { font-size: 27px; line-height: 1.35; font-weight: 800; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 20px; font-weight: 800; margin: 26px 0 6px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 2px solid var(--lilac); }
.prose thead th { background: var(--lilac); font-weight: 800; }
.faq h3 { margin-top: 20px; }

.others { background: var(--lilac); padding: 44px 0; }
.others h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.others ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 30px; }
.others a { display: block; text-decoration: none; color: var(--ink); }
.others a strong { display: block; color: var(--uv); text-decoration: underline; text-underline-offset: 3px; }
.others a span { font-size: 16px; }

.plain-head { padding: 12px 0 0; }
.plain-stage { padding-bottom: 36px; }
footer { background: var(--ink); color: #e7e3fb; padding: 36px 0; font-size: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
footer a { color: #fff; }

@media (max-width: 940px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .t-stub { border-left: 0; border-top: 4px dashed var(--uv); }
  .ticket.arrived .t-stub { border-top-color: #fff; }
  .t-stub::before, .t-stub::after { top: -22px; bottom: auto; }
  .t-stub::before { left: -20px; }
  .t-stub::after { left: auto; right: -20px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { width: calc(100% - 32px); }
  .menu-btn { display: block; }
  .nav { display: none; flex-direction: column; gap: 2px; width: 100%; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .stage { padding-bottom: 40px; }
  /* 휴대폰 첫 화면에 시계와 카운트다운이 함께 들어오도록 줄인다. 설명은 아래 글에 있다. */
  .clock-stage { padding-top: 8px; }
  .clock-stage h1 { font-size: 30px; }
  .clock-stage .lede { display: none; }
  .clock-stage .sites { gap: 2px 14px; margin: 10px 0 12px; font-size: 16px; }
  .t-main { padding: 16px 16px 18px; }
  .t-label { font-size: 16px; }
  .digits { margin: 4px 0 10px; }
  .t-stub { padding: 18px 16px 22px; gap: 8px; }
  .t-facts { gap: 8px 14px; }
  .t-facts dt { font-size: 14px; }
  .t-facts dd { font-size: 16px; line-height: 1.45; }
  .t-status { margin-top: 8px; font-size: 15px; }
  .t-actions { margin-top: 10px; }
  .t-actions .btn { padding: 6px 12px; font-size: 16px; }
  .left-label { margin-top: 2px; }
  .sim { padding: 20px 16px; }
  .rank-board { padding: 8px 12px 16px; }
  .rank-form { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .rank-form .btn { justify-self: start; }
  .sim-open, .sim-queue { padding-top: 24px; }
  .seat-grid { gap: 3px; }
  .pad { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
