:root {
  --ink: #241631;
  --ink-soft: #624c68;
  --cream: #fff7e9;
  --paper: #fffdf8;
  --coral: #ef735c;
  --coral-deep: #d95649;
  --peach: #ffd8b8;
  --mint: #b8ddc7;
  --sun: #ffc857;
  --line: rgba(36, 22, 49, 0.14);
  --shadow: 0 18px 45px rgba(55, 26, 51, 0.14);
  --display: Georgia, "Songti SC", "STSong", serif;
  --body: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--cream); }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 200, 87, 0.2), transparent 34rem),
    var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 19rem;
  height: 19rem;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.5;
}

.ambient-left {
  top: 10rem;
  left: -14rem;
  border: 1px solid rgba(239, 115, 92, 0.4);
  box-shadow: 0 0 0 2rem rgba(239, 115, 92, 0.04), 0 0 0 4rem rgba(239, 115, 92, 0.035);
}

.ambient-right {
  top: 3rem;
  right: -14rem;
  background: var(--mint);
  opacity: 0.32;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 36px, 1050px);
  margin: 0 auto;
  padding: 24px 0 35px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; }
.brand small { margin-top: 2px; color: var(--ink-soft); font-size: 0.68rem; letter-spacing: 0.23em; }

.brand-mark {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: rotate(-15deg);
}

.brand-mark::before, .brand-mark::after, .brand-mark i { content: ""; position: absolute; display: block; background: var(--coral); }
.brand-mark::before { width: 13px; height: 5px; top: 7px; left: 8px; transform: rotate(28deg); }
.brand-mark::after { width: 5px; height: 13px; top: 14px; left: 19px; transform: rotate(28deg); background: var(--sun); }
.brand-mark i:nth-child(1) { width: 6px; height: 6px; top: 20px; left: 7px; border-radius: 50%; background: var(--mint); }
.brand-mark i:nth-child(2) { width: 4px; height: 4px; top: 9px; left: 22px; border-radius: 50%; background: var(--coral); }
.brand-mark i:nth-child(3) { display: none; }

.header-note {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.intro {
  max-width: 570px;
  margin: 70px auto 48px;
  text-align: center;
}

.eyebrow, .step-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-deep);
}

.eyebrow span { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }

h1 {
  margin: 15px 0 12px;
  font-family: var(--display);
  font-size: clamp(3.05rem, 7vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.98;
}

h1 em { position: relative; color: var(--coral); font-style: normal; }
h1 em::after { content: ""; position: absolute; right: -0.04em; bottom: -0.11em; left: 0.04em; height: 0.12em; background: var(--sun); transform: rotate(-2deg); z-index: -1; }
.intro-copy { margin: 0; color: var(--ink-soft); font-size: 0.92rem; letter-spacing: 0.04em; }

.game-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 48px) 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 253, 248, 0.62);
  box-shadow: var(--shadow);
}

.panel-heading, .result-heading { display: flex; align-items: center; justify-content: space-between; }
.step-label { color: var(--ink-soft); }
.question-mark { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--cream); font-family: var(--display); font-size: 0.86rem; }

.choice-group { padding: 0; margin: 13px 0 0; border: 0; }
.mode-group { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.choice-card { display: block; min-width: 0; }
.choice-card input, .level-option input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
.choice-face { display: flex; align-items: center; min-height: 94px; gap: 13px; padding: 15px 16px; border: 1.5px solid var(--line); border-radius: 3px; background: rgba(255,255,255,0.42); transition: border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.choice-card:hover .choice-face { transform: translateY(-2px); border-color: var(--coral); }
.choice-card input:focus-visible + .choice-face, .level-option input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 3px; }
.choice-card input:checked + .choice-face { border-color: var(--ink); background: var(--peach); box-shadow: 4px 4px 0 var(--ink); }
.choice-dare input:checked + .choice-face { background: var(--mint); }
.choice-icon { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--cream); color: var(--coral-deep); font-family: var(--display); font-size: 1.5rem; }
.choice-dare .choice-icon { color: var(--ink); }
.choice-text { min-width: 0; }
.choice-text strong { display: block; font-family: var(--display); font-size: 1.13rem; }
.choice-text small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 0.68rem; white-space: nowrap; }
.choice-check { display: grid; flex: 0 0 20px; width: 20px; height: 20px; margin-left: auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: transparent; font-size: 0.7rem; }
.choice-card input:checked + .choice-face .choice-check { border-color: var(--ink); background: var(--ink); color: var(--cream); }

.setting-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 10px; color: var(--ink-soft); font-size: 0.72rem; }
.setting-divider::before, .setting-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.level-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-option { min-width: 0; text-align: center; }
.level-option > span { display: block; padding: 11px 6px 10px; border: 1px solid var(--line); border-radius: 2px; background: transparent; transition: background 180ms ease, border-color 180ms ease; }
.level-option:hover > span { border-color: var(--coral); }
.level-option input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.level-option strong, .level-option small { display: block; }
.level-option strong { font-family: var(--display); font-size: 0.95rem; }
.level-option small { margin-top: 3px; color: var(--ink-soft); font-size: 0.62rem; }
.level-option input:checked + span small { color: #dfced9; }

.draw-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px; margin-top: 24px; padding: 0 17px 0 22px; border: 0; border-radius: 2px; background: var(--coral); color: #fffaf1; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.1em; box-shadow: 5px 5px 0 var(--ink); transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.draw-button:hover { background: var(--coral-deep); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.draw-button:focus-visible, .secondary-button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }
.button-arrow { font-size: 1.45rem; font-weight: 400; }
.safe-note { margin: 17px 0 0; color: var(--ink-soft); font-size: 0.7rem; text-align: center; }
.safe-note span { color: var(--coral); }

.result-section { max-width: 720px; margin: 44px auto 0; }
.result-heading { padding: 0 4px 12px; }
.draw-count { color: var(--ink-soft); font-size: 0.68rem; }
.result-ticket { position: relative; overflow: hidden; min-height: 265px; padding: 17px 21px 16px; border: 1px solid rgba(36,22,49,0.12); background: var(--paper); box-shadow: var(--shadow); transition: opacity 200ms ease, transform 200ms ease; }
.result-ticket::before, .result-ticket::after { content: ""; position: absolute; top: 61px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); }
.result-ticket::before { left: -13px; }
.result-ticket::after { right: -13px; }
.result-ticket.is-drawing { opacity: 0.5; transform: rotate(1deg) scale(0.99); }
.ticket-topline, .ticket-bottomline { display: flex; align-items: center; justify-content: space-between; color: var(--coral-deep); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; }
.ticket-dots { color: var(--line); letter-spacing: 0.3em; }
.ticket-body { display: grid; position: relative; min-height: 172px; place-items: center; align-content: center; padding: 18px 35px 10px; text-align: center; }
.ticket-body::before { content: ""; position: absolute; width: 145px; height: 145px; border: 1px solid rgba(239,115,92,0.18); border-radius: 50%; }
.ticket-stamp { position: absolute; top: 9px; right: 12%; display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--coral); border-radius: 50%; color: var(--coral); font-size: 0.57rem; font-weight: 700; transform: rotate(12deg); }
.ticket-body h2 { position: relative; margin: 0; font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.35rem); letter-spacing: -0.04em; line-height: 1.2; }
.ticket-body p { position: relative; margin: 11px 0 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.75; }
.ticket-bottomline { padding-top: 12px; border-top: 1px dashed var(--line); color: var(--ink-soft); font-size: 0.57rem; }
.ticket-bottomline span:last-child { color: var(--coral-deep); }
.result-actions { display: flex; align-items: center; gap: 20px; margin-top: 17px; }
.secondary-button { min-height: 43px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--cream); font-size: 0.82rem; letter-spacing: 0.08em; transition: background 160ms ease; }
.secondary-button:hover { background: var(--coral-deep); border-color: var(--coral-deep); }
.secondary-button span { margin-left: 8px; font-size: 1rem; }
.text-button { padding: 9px 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 0.76rem; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--coral-deep); }
[hidden] { display: none !important; }

.page-footer { display: flex; justify-content: space-between; max-width: 720px; margin: 55px auto 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.63rem; letter-spacing: 0.08em; }
.footer-spark { color: var(--coral); font-size: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 600px) {
  .page-shell { width: min(100% - 28px, 520px); padding-top: 18px; }
  .header-note { font-size: 0.62rem; }
  .intro { margin: 53px auto 34px; }
  h1 { font-size: clamp(2.8rem, 15vw, 4.4rem); }
  .intro-copy { font-size: 0.8rem; }
  .game-panel { padding: 22px 16px 19px; }
  .choice-face { min-height: 108px; flex-direction: column; justify-content: center; gap: 7px; padding: 11px 7px; text-align: center; }
  .choice-icon { flex-basis: 30px; width: 30px; height: 30px; font-size: 1.2rem; }
  .choice-text small { font-size: 0.61rem; }
  .choice-check { display: none; }
  .result-section { margin-top: 35px; }
  .result-ticket { min-height: 250px; }
  .ticket-body { min-height: 157px; padding-right: 15px; padding-left: 15px; }
  .ticket-stamp { right: 4%; }
  .page-footer { margin-top: 42px; font-size: 0.56rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
