body { overflow-x: hidden; }

.progress {
  position: fixed; inset: 0 0 auto 0;
  height: 3px;
  background: rgba(212, 180, 108, .12);
  z-index: 10;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: var(--gold-gradient);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 22px clamp(16px, 4vw, 48px);
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(var(--bg) 40%, rgba(18, 17, 18, 0));
}
.topbar-logo { height: 42px; width: auto; display: block; pointer-events: auto; }
body.is-welcome .topbar { visibility: hidden; }

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 110px clamp(16px, 6vw, 96px) 110px;
}

.screen {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  animation: rise .55s cubic-bezier(.2, .8, .2, 1) both;
}
.screen.back { animation-name: drop; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }

.loading { margin: auto; }
.spin { width: 64px; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- welcome */
.welcome { text-align: center; }
.welcome-logo { width: min(260px, 60vw); margin: 0 auto 34px; display: block; filter: drop-shadow(0 18px 40px rgba(212, 180, 108, .18)); }
.welcome h1 {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.12;
  margin: 0 0 22px;
}
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
.chips li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink);
  background: rgba(30, 28, 30, .6);
}
.chips svg { color: var(--gold); flex: none; }
.welcome h2 { font-family: var(--font-title); font-weight: 500; font-size: 20px; color: var(--gold); margin: 0 0 8px; }
.welcome p.lead { color: var(--muted); max-width: 520px; margin: 0 auto 32px; }

.hint { margin-top: 14px; font-size: 13px; color: var(--muted); }
.hint kbd { font: inherit; font-weight: 700; color: var(--ink); }

/* ---------- question */
.q-head { display: flex; gap: 14px; align-items: baseline; }
.q-num {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 18px;
}
.q-num svg { width: 14px; height: 14px; }
.q-label {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 32px);
  line-height: 1.3;
  font-weight: 400;
}
.q-label .req { color: var(--gold); margin-left: 4px; }
.q-help { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.q-body { margin: 34px 0 0; }
@media (min-width: 640px) { .q-help, .q-body, .q-actions, .q-error { margin-left: 46px; } }

.q-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  caret-color: var(--gold);
  font: 400 clamp(20px, 3vw, 28px)/1.4 var(--font-body);
  padding: 8px 0 12px;
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
}
.q-input::placeholder { color: rgba(167, 159, 142, .45); }
.q-input:focus { border-bottom-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold); }
textarea.q-input { resize: none; min-height: 120px; }

.choices { display: grid; gap: 10px; max-width: 480px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 12px 16px;
  background: rgba(30, 28, 30, .7);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: 400 18px/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.choice:hover { border-color: rgba(212, 180, 108, .6); background: rgba(212, 180, 108, .07); }
.choice .key {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid rgba(212, 180, 108, .5);
  border-radius: 6px;
  color: var(--gold);
  font-size: 13px; font-weight: 700;
}
.choice .check { margin-left: auto; color: var(--gold); opacity: 0; }
.choice.selected { border-color: var(--gold); background: rgba(212, 180, 108, .12); }
.choice.selected .key { background: var(--gold-gradient); color: #141314; border-color: transparent; }
.choice.selected .check { opacity: 1; }
.choice.blink { animation: blink .32s ease 2; }
@keyframes blink { 50% { background: rgba(212, 180, 108, .25); } }

.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 30px; flex-wrap: wrap; }
.q-actions .hint { margin: 0; }
.q-error {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(226, 130, 111, .12);
  color: var(--danger);
  font-size: 15px;
}
.q-error[hidden] { display: none; }

.stepper {
  position: fixed; right: clamp(16px, 4vw, 48px); bottom: 24px;
  display: flex; gap: 2px;
  z-index: 5;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.stepper button {
  width: 42px; height: 38px;
  display: grid; place-items: center;
  background: rgba(30, 28, 30, .9);
  border: 0;
  color: var(--gold);
  cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: #2a2620; }
.stepper button:disabled { color: #554d3e; cursor: default; }

/* ---------- submitting / done */
.center { text-align: center; }
.center h1 { font-family: var(--font-title); font-weight: 500; font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 12px; }
.center .lead { color: var(--muted); max-width: 520px; margin: 0 auto; }

.mini-ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 34px auto 28px;
  max-width: 520px;
  text-align: left;
  background: var(--card);
  border: 1px solid rgba(212, 180, 108, .55);
  border-radius: 16px;
  overflow: hidden;
}
.mini-ticket .main { padding: 22px 24px; }
.mini-ticket .stub {
  position: relative;
  display: grid; place-items: center;
  padding: 22px 26px;
  border-left: 1px dashed var(--line);
}
.mini-ticket .stub::before, .mini-ticket .stub::after {
  content: ''; position: absolute; left: -11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(212, 180, 108, .55);
}
.mini-ticket .stub::before { top: -11px; }
.mini-ticket .stub::after { bottom: -11px; }
.mini-ticket .stub img { width: 58px; }
.mini-ticket .label { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; margin: 0 0 2px; }
.mini-ticket .name { font-family: var(--font-title); font-size: 21px; margin: 0 0 14px; line-height: 1.2; }
.mini-ticket .code { font-family: var(--font-title); font-size: 16px; margin: 0; letter-spacing: .06em; }
.mini-ticket .event { color: var(--muted); font-size: 14px; margin: 0; }

.notice {
  max-width: 520px;
  margin: 0 auto 26px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.notice strong { color: var(--ink); }
.notice.warn { border-color: rgba(226, 130, 111, .4); color: #e9b3a6; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .stage { align-items: flex-start; padding-top: 104px; }
  body.is-welcome .stage { align-items: center; padding-top: 48px; }
  .topbar-logo { height: 34px; }
  .mini-ticket { grid-template-columns: 1fr; }
  .mini-ticket .stub { border-left: 0; border-top: 1px dashed var(--line); padding: 16px; }
  .mini-ticket .stub::before, .mini-ticket .stub::after { top: -11px; left: auto; bottom: auto; }
  .mini-ticket .stub::before { left: -11px; }
  .mini-ticket .stub::after { right: -11px; }
  .actions .btn { width: 100%; }
}

/* keyboard hints make no sense on touch screens */
@media (hover: none) and (pointer: coarse) { .hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .screen, .spin, .choice.blink { animation: none; }
}
