:root {
  --ink: #151019;
  --panel: #fff8d7;
  --panel-deep: #ffe06b;
  --pink: #ff4e9a;
  --red: #ff3d47;
  --orange: #ff9c1a;
  --green: #1fc486;
  --cyan: #19b8ff;
  --blue: #306cff;
  --violet: #7e4cff;
  --shadow: 0 18px 0 #151019;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.92) 0 3px, transparent 4px),
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.72) 0 4px, transparent 5px),
    linear-gradient(135deg, #fff36d 0%, #ff5b8f 32%, #45d6ff 68%, #65f28a 100%);
  background-size: 72px 72px, 96px 96px, 100% 100%;
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 6px 0 var(--ink);
  cursor: pointer;
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.18);
}

button:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.task-setup,
.arcade {
  border: 5px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.task-setup {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-content: start;
  padding: 0 22px 28px;
}

.marquee {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 0 -22px 10px;
  padding: 14px;
  background: var(--ink);
}

.marquee span,
.bulb {
  aspect-ratio: 1;
  border-radius: 999px;
  background: #fff55c;
  box-shadow: 0 0 14px 5px rgba(255, 245, 92, 0.82);
  animation: blink 900ms steps(2, end) infinite;
}

.marquee span:nth-child(2n),
.bulb:nth-child(2n) {
  background: #43e9ff;
  box-shadow: 0 0 14px 5px rgba(67, 233, 255, 0.76);
  animation-delay: 450ms;
}

.setup-copy {
  max-width: 760px;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 12px;
}

.intro {
  max-width: 620px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.task-form {
  display: grid;
  gap: 8px;
}

.task-form label {
  font-weight: 900;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 180px);
  gap: 10px;
}

input {
  min-height: 52px;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  box-shadow: inset 0 4px 0 rgba(21, 16, 25, 0.12);
  font-weight: 700;
}

.input-row button,
.start-button,
#completeTaskButton {
  background: var(--green);
}

.setup-list,
.ticket-card,
.current-task-panel,
.scoreboard,
.claw-card,
.wheel-card,
.win-panel {
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
}

.setup-list {
  min-height: 160px;
  padding: 16px;
}

.setup-list ul,
.arcade-task-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-deep);
  font-weight: 900;
}

.task-ticket.done {
  background: #c9ffd8;
  text-decoration: line-through;
}

.task-ticket.current {
  background: #ffb1d3;
  animation: ticketPulse 850ms ease-in-out infinite alternate;
}

.remove-task {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: var(--red);
  box-shadow: 0 4px 0 var(--ink);
}

.start-button {
  width: min(280px, 100%);
  justify-self: end;
  padding: 0 18px;
  font-size: 1.1rem;
}

.arcade {
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 50%, transparent 50%) 0 0 / 28px 28px,
    var(--panel);
}

.scoreboard {
  display: grid;
  grid-template-columns: 130px 160px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--ink);
  color: #ffffff;
}

.scoreboard strong {
  font-size: 2rem;
  line-height: 1;
}

.progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
}

.progress-track {
  height: 28px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #fff55c, var(--pink));
  transition: width 450ms ease;
}

.current-task-panel {
  margin: 16px 0;
  padding: 18px;
  background: #fff7a8;
}

.current-task-panel h2 {
  min-height: 2.6em;
  margin-bottom: 14px;
  font-size: clamp(1.3rem, 3vw, 2.1rem);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-actions button,
.machine-controls button,
.wheel-card button,
.win-panel button {
  padding: 0 16px;
}

#skipTaskButton {
  background: #ffffff;
}

.machine-grid {
  display: grid;
  grid-template-columns: minmax(310px, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.claw-card,
.wheel-card,
.ticket-card,
.win-panel {
  padding: 16px;
}

.claw-card {
  position: relative;
  background:
    linear-gradient(90deg, rgba(21, 16, 25, 0.25), transparent 10%, transparent 90%, rgba(21, 16, 25, 0.28)),
    linear-gradient(#ff77a8, #ff3d82);
  box-shadow: inset 12px 0 0 rgba(255, 255, 255, 0.3), inset -14px 0 0 rgba(21, 16, 25, 0.18), 0 12px 0 var(--ink);
}

.cabinet-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: -6px 0 12px;
  padding: 10px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
}

.claw-window {
  position: relative;
  height: 360px;
  border: 5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  perspective: 820px;
  background:
    linear-gradient(92deg, rgba(255, 255, 255, 0.58) 0 9px, transparent 9px 54px),
    radial-gradient(circle at 50% 82%, rgba(255, 245, 92, 0.75), transparent 36%),
    linear-gradient(#72dfff 0%, #eefcff 54%, #e5be35 54%, #f4d655 100%);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.26), inset 0 -30px 35px rgba(21, 16, 25, 0.2);
}

.claw-window::before,
.claw-window::after {
  content: "";
  position: absolute;
  z-index: 1;
}

.claw-window::before {
  left: -28px;
  bottom: 0;
  width: 72px;
  height: 100%;
  background: linear-gradient(90deg, rgba(21, 16, 25, 0.22), rgba(255, 255, 255, 0.16));
  transform: skewY(-16deg);
}

.claw-window::after {
  right: -28px;
  bottom: 0;
  width: 72px;
  height: 100%;
  background: linear-gradient(270deg, rgba(21, 16, 25, 0.24), rgba(255, 255, 255, 0.12));
  transform: skewY(16deg);
}

.glass-shine {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, 0.62) 19% 25%, transparent 26% 52%, rgba(255, 255, 255, 0.3) 53% 58%, transparent 59%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.65), transparent 10%);
  mix-blend-mode: screen;
}

.back-panel {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 84px;
  height: 155px;
  border: 4px solid rgba(21, 16, 25, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 50%, transparent 50%) 0 0 / 32px 32px,
    linear-gradient(#ffec7d, #ff9fd0);
  transform: rotateX(12deg) translateZ(-38px);
  box-shadow: 0 18px 24px rgba(21, 16, 25, 0.28);
}

.rail {
  position: absolute;
  top: 26px;
  left: 24px;
  right: 24px;
  height: 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(#ffffff, #9aa4b8 58%, #515b70);
  box-shadow: 0 7px 0 rgba(21, 16, 25, 0.2);
  z-index: 4;
}

.claw {
  --claw-x: 46%;
  position: absolute;
  top: 38px;
  left: var(--claw-x);
  width: 70px;
  height: 118px;
  transform: translateX(-50%);
  transition: left 300ms ease;
  filter: drop-shadow(9px 14px 0 rgba(21, 16, 25, 0.22));
  z-index: 6;
}

.claw::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  width: 10px;
  height: 68px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #aeb7c7, #677084);
}

.claw::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 54px;
  width: 36px;
  height: 24px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: linear-gradient(#ffffff, #9aa4b8);
}

.claw span {
  position: absolute;
  top: 62px;
  width: 25px;
  height: 52px;
  border: 6px solid var(--ink);
  border-top: 0;
  background: linear-gradient(90deg, #f7fbff, #8f99ab);
}

.claw span:nth-child(1) {
  left: 1px;
  border-right: 0;
  transform: rotate(24deg);
}

.claw span:nth-child(2) {
  left: 23px;
  width: 24px;
  height: 45px;
  border-left: 0;
  border-right: 0;
}

.claw span:nth-child(3) {
  right: 1px;
  border-left: 0;
  transform: rotate(-24deg);
}

.claw.drop {
  animation: clawDrop 1250ms ease-in-out;
}

.prizes {
  position: absolute;
  inset: auto 0 0;
  height: 185px;
  z-index: 3;
  transform: rotateX(10deg);
  transform-origin: bottom center;
}

.prize {
  --tilt: 0deg;
  position: absolute;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  width: 76px;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 16px 16px 12px 12px;
  background: #ffffff;
  box-shadow: inset 8px 8px 0 rgba(255, 255, 255, 0.35), inset -8px -10px 0 rgba(21, 16, 25, 0.16), 0 12px 0 rgba(21, 16, 25, 0.8), 12px 18px 16px rgba(21, 16, 25, 0.26);
  padding: 6px;
  text-align: center;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-50%) rotate(var(--tilt));
  transition: transform 350ms ease, opacity 350ms ease;
}

.prize::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -15px;
  height: 10px;
  border-radius: 999px;
  background: rgba(21, 16, 25, 0.22);
  filter: blur(2px);
}

.prize-icon {
  display: block;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(1px);
}

.prize-label {
  display: block;
  width: 100%;
  border: 2px solid rgba(21, 16, 25, 0.8);
  border-radius: 999px;
  padding: 3px 5px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.64rem;
}

.prize.won {
  transform: translateX(-50%) translateY(-185px) rotate(12deg) scale(0.72);
  opacity: 0;
}

.prize-chute {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 132px;
  height: 58px;
  border: 5px solid var(--ink);
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(#4e5568, #151019);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.18), 0 8px 0 rgba(21, 16, 25, 0.28);
  font-size: 0.72rem;
  font-weight: 900;
}

.machine-controls {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.claw-controls {
  display: grid;
  grid-template-columns: 56px minmax(120px, 1fr) 56px;
  gap: 10px;
  padding: 12px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background:
    radial-gradient(circle at 26px 22px, #ffffff 0 5px, transparent 6px),
    linear-gradient(#ffe06b, #ff9c1a);
  box-shadow: inset 0 -8px 0 rgba(21, 16, 25, 0.14);
}

.machine-controls button {
  background: var(--cyan);
}

#moveLeftButton,
#moveRightButton {
  min-height: 56px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(#ffffff, #19b8ff);
}

#dropClawButton {
  background: linear-gradient(#ffef77, var(--orange));
}

.machine-controls p,
.wheel-card p {
  min-height: 2.8em;
  margin: 0;
  font-weight: 900;
  line-height: 1.35;
}

.wheel-card {
  background: #8fffb2;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0 auto 16px;
}

.wheel {
  width: 100%;
  height: 100%;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(
    var(--pink) 0deg 45deg,
    #fff55c 45deg 90deg,
    var(--cyan) 90deg 135deg,
    var(--green) 135deg 180deg,
    var(--orange) 180deg 225deg,
    var(--violet) 225deg 270deg,
    #ffffff 270deg 315deg,
    var(--red) 315deg 360deg
  );
  box-shadow: 0 12px 0 var(--ink);
  transition: transform 3s cubic-bezier(.12, .78, .08, 1);
}

.wheel-center {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  font-weight: 900;
}

.pointer {
  position: absolute;
  top: -2px;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 42px solid var(--ink);
}

.wheel-card button {
  width: 100%;
  background: var(--orange);
}

.ticket-card {
  grid-column: 2;
  background: #fff7a8;
}

.arcade-task-list {
  max-height: 342px;
  overflow: auto;
  padding-right: 4px;
}

.win-panel {
  margin-top: 18px;
  text-align: center;
  background: #ffffff;
}

.win-panel h2 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.win-panel button {
  background: var(--pink);
}

@keyframes blink {
  50% {
    opacity: 0.38;
    transform: scale(0.88);
  }
}

@keyframes ticketPulse {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(4px);
  }
}

@keyframes clawDrop {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  45%, 68% {
    transform: translate(-50%, 158px) scale(1.06);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 680px);
    padding-top: 10px;
  }

  .input-row,
  .scoreboard,
  .machine-grid {
    grid-template-columns: 1fr;
  }

  .ticket-card {
    grid-column: auto;
  }

  .scoreboard {
    gap: 12px;
  }

  .progress-wrap {
    grid-template-columns: 1fr 64px;
  }

  .claw-window {
    height: 315px;
  }

  .task-setup {
    padding-inline: 14px;
  }

  .marquee {
    margin-inline: -14px;
  }
}

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