:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #706f68;
  --paper: #f7f3ea;
  --red: #d93a2f;
  --yellow: #f3bd30;
  --green: #176b51;
  --line: rgba(23, 23, 20, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  min-height: 68px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-size: 12px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.icon-button,
.dialog-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
}

.hero {
  min-height: calc(100vh - 160px);
  padding: 7vh 7vw 6vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
  align-items: center;
  gap: 5vw;
}

.hero-copy,
.stage {
  min-width: 0;
  max-width: 100%;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 700px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.08;
  font-weight: 700;
}

.intro {
  max-width: 540px;
  margin: 26px 0 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.prize-strip {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prize-strip span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  font-size: 13px;
}

.prize-strip b {
  color: var(--red);
}

.stage {
  display: grid;
  justify-items: center;
}

.wheel-wrap {
  position: relative;
  width: min(39vw, 520px);
  min-width: 380px;
  aspect-ratio: 1;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 14px 16px 0 var(--ink);
}

.pointer {
  position: absolute;
  z-index: 4;
  top: -19px;
  left: 50%;
  width: 42px;
  height: 58px;
  transform: translateX(-50%);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(
    var(--red) 0deg 45deg,
    var(--yellow) 45deg 90deg,
    #f6e7c4 90deg 135deg,
    var(--green) 135deg 180deg,
    var(--red) 180deg 225deg,
    var(--yellow) 225deg 270deg,
    #f6e7c4 270deg 315deg,
    var(--green) 315deg 360deg
  );
  transition: transform 5.2s cubic-bezier(0.12, 0.67, 0.08, 1);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 17%;
  border: 2px solid rgba(23, 23, 20, 0.24);
  border-radius: 50%;
}

.wheel-label {
  position: absolute;
  z-index: 1;
  width: 46px;
  text-align: center;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.l1 { top: 13%; left: 68%; }
.l2 { top: 31%; left: 87%; }
.l3 { top: 69%; left: 87%; }
.l4 { top: 87%; left: 68%; color: white; }
.l5 { top: 87%; left: 32%; color: white; }
.l6 { top: 69%; left: 13%; }
.l7 { top: 31%; left: 13%; }
.l8 { top: 13%; left: 32%; color: white; }

.draw-button {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-content: center;
  line-height: 1;
}

.draw-button span {
  font-size: 26px;
  font-weight: 900;
}

.draw-button small {
  margin-top: 6px;
  font-weight: 700;
}

.draw-button:disabled {
  cursor: not-allowed;
  color: #929088;
}

.stage-hint {
  min-height: 24px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.activities {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.activity {
  min-height: 126px;
  padding: 26px 5vw;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  border-right: 1px solid var(--line);
  color: #8a8880;
}

.activity.active {
  background: var(--ink);
  color: white;
}

.activity-number {
  font-family: Georgia, serif;
  font-size: 34px;
}

.activity h2 {
  margin: 2px 0 8px;
  font-size: 17px;
}

.activity p {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
}

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 10px 12px 0 var(--ink);
}

dialog::backdrop {
  background: rgba(23, 23, 20, 0.64);
}

#loginForm,
.result-card {
  position: relative;
  padding: 36px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
}

dialog h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
}

.form-note {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: white;
  outline: none;
}

input:focus {
  box-shadow: 0 0 0 3px rgba(217, 58, 47, 0.18);
}

.primary-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.error {
  min-height: 20px;
  margin: 12px 0;
  color: var(--red);
  font-size: 13px;
}

.result-card {
  text-align: center;
}

.result-card h2 strong {
  color: var(--red);
}

.code-row {
  margin: 22px 0 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--ink);
  background: white;
}

.code-row code {
  min-width: 0;
  padding: 15px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.copy-button {
  border: 0;
  border-left: 1px solid var(--ink);
  padding: 0 16px;
  background: var(--yellow);
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 54px;
  }

  h1 {
    font-size: 52px;
  }

  .stage {
    padding: 18px 0 38px;
  }

  .wheel-wrap {
    width: min(82vw, 470px, calc(100% - 20px));
    min-width: 0;
  }

  .activities {
    grid-template-columns: 1fr;
  }

  .activity {
    min-height: 104px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 18px;
  }

  .brand span:last-child {
    font-size: 14px;
  }

  .hero {
    padding: 42px 20px 30px;
  }

  h1 {
    font-size: 43px;
  }

  .intro {
    font-size: 15px;
  }

  .wheel-wrap {
    box-shadow: 8px 10px 0 var(--ink);
  }

  .wheel-label {
    font-size: 16px;
  }

  .draw-button {
    width: 92px;
    height: 92px;
  }

  .draw-button span {
    font-size: 22px;
  }

  #loginForm,
  .result-card {
    padding: 30px 24px;
  }
}
