/* The prize wheel: a warm wooden wheel on a white page, the slices in the colours of a trattoria. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #2b211c;
  --muted: #8a7d74;
  --button: #2b211c;        /* the Spin button */
  --d: min(340px, calc(100vw - 48px));   /* the wheel's width */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Fredoka Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px 16px;
}

.game {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.game__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- the wheel */
.wheel {
  position: relative;
  width: var(--d);
  height: var(--d);
  margin-top: 26px;
}

.wheel__disc {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 18px 22px rgba(43, 33, 28, 0.22));
}

.wheel__disc.is-held {
  cursor: grabbing;
}

.wheel__disc text {
  font-family: 'Fredoka Variable', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}

/* the flapper hangs from its pin above the wheel and its tip reaches in among the pegs */
.wheel__flap {
  position: absolute;
  top: calc(var(--d) * 0.035 - 45px);
  left: calc(50% - 15px);
  width: 30px;
  height: 55px;
  overflow: visible;
  transform-origin: 50% 11.36%;
  filter: drop-shadow(0 3px 3px rgba(43, 33, 28, 0.3));
  pointer-events: none;
}

/* ---------------------------------------------------------------- Spin */
.spin {
  padding: 13px 34px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: #ffffff;
  font: 600 17px 'Fredoka Variable', system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s;
}

.spin span {
  display: inline-block;
}

.spin[aria-disabled='true'] {
  opacity: 0.4;
  cursor: default;
}

.spin:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

html[data-using='pointer'] .spin:focus-visible {
  outline: none;
}

/* ---------------------------------------------------------------- what came out */
.result {
  min-height: 64px;
  text-align: center;
}

.result__say {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.result__prize {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

/* the paper that flies out for a prize */
.paper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.paper span {
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 13px;
  border-radius: 1.5px;
}
