/* The wheel uses the same restaurant palette and display fonts as the rest of the website. */
.wheel-page {
  color-scheme: dark;
  --wheel-ground: var(--brand-950);
  --wheel-panel: var(--brand-900);
  --wheel-ink: var(--on-brand);
  --wheel-muted: color-mix(in srgb, var(--on-brand) 76%, var(--brand-950));
  --wheel-emphasis: var(--accent-200);
  --wheel-line: color-mix(in srgb, var(--accent-200) 26%, transparent);
  --wheel-button: var(--accent);
  --wheel-button-hover: color-mix(in srgb, var(--accent) 88%, var(--on-accent));
  --wheel-on-button: var(--on-accent);
  --wheel-focus: var(--accent-200);
  min-block-size: 100svh;
  color: var(--wheel-ink);
  background: var(--wheel-ground);
}

.wheel-page[data-wheel-design="signature"] {
  color-scheme: light;
  --wheel-ground: var(--cream);
  --wheel-panel: var(--white);
  --wheel-ink: var(--ink);
  --wheel-muted: var(--sig-ink-soft);
  --wheel-emphasis: var(--sig-deep);
  --wheel-line: color-mix(in srgb, var(--sig-deep) 23%, transparent);
  --wheel-button: var(--sig-deep);
  --wheel-button-hover: var(--brand-900);
  --wheel-on-button: var(--white);
  --wheel-focus: var(--sig-deep);
  background:
    radial-gradient(ellipse at 18% 0%, var(--paper), transparent 48%),
    var(--wheel-ground);
}

.wheel-page :is(a, button, input):focus-visible {
  outline: 2px solid var(--wheel-focus);
  outline-offset: 3px;
}

.wheel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1.5rem;
  inline-size: min(74rem, 100% - 2 * var(--gut));
  min-block-size: 5.25rem;
  margin-inline: auto;
  padding-block: .7rem;
  border-block-end: 1px solid var(--wheel-line);
}

.wheel-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-inline-size: 0;
  max-inline-size: 100%;
  color: var(--wheel-ink);
  font: 700 clamp(1.05rem, 2.2vw, 1.5rem)/1.25 var(--f-display);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.wheel-brand__logo,
.wheel-brand .mono {
  flex: 0 0 2.9rem;
  inline-size: 2.9rem;
  block-size: 2.9rem;
  border-radius: .75rem;
}

.wheel-brand__logo {
  padding: .22rem;
  background: var(--cream);
  object-fit: contain;
}

.wheel-nav .lang {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
}

.wheel-nav .lang__btn {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding: .35rem .65rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  background: transparent;
  color: var(--wheel-muted);
  font-weight: 600;
  text-decoration: none;
}

.wheel-nav .lang__btn:is(:hover, [aria-current]) {
  color: var(--wheel-emphasis);
  background: var(--wheel-panel);
  border-color: var(--wheel-line);
}

.wheel-main {
  display: grid;
  grid-template:
    "stage heading" 1fr
    "stage actions" 1fr
    / minmax(0, 1.16fr) minmax(0, .84fr);
  align-items: start;
  gap: clamp(.75rem, 2vw, 1.5rem) clamp(1.75rem, 5vw, 5rem);
  inline-size: min(74rem, 100% - 2 * var(--gut));
  min-block-size: min(44rem, calc(100svh - 6rem));
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 5rem) max(clamp(2rem, 5vw, 5rem), env(safe-area-inset-bottom));
}

.wheel-heading {
  grid-area: heading;
  align-self: end;
  min-inline-size: 0;
}

.wheel-heading h1 {
  color: var(--wheel-emphasis);
  font: 700 clamp(2.65rem, 6vw, 5.45rem)/1.12 var(--f-display);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

@media (min-width: 761px) {
  .wheel-page:lang(ka) .wheel-heading h1 {
    font-size: clamp(2.55rem, 3.85vw, 3.7rem);
  }
}
.wheel-intro {
  margin-block-start: .75rem;
  color: var(--wheel-muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.wheel-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  align-self: center;
  grid-area: stage;
  place-items: center;
  min-inline-size: 0;
  padding: clamp(1.7rem, 4.2vw, 3.5rem);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 28% 5%, color-mix(in srgb, var(--brand-700) 82%, var(--accent)), transparent 67%),
    linear-gradient(150deg, var(--brand-900), var(--brand-950) 75%);
  border: 1px solid color-mix(in srgb, var(--accent-200) 42%, var(--brand-950));
  border-radius: clamp(1.4rem, 4vw, 3.4rem);
  box-shadow: 0 2rem 3.5rem -2.6rem var(--brand-950);
}

.wheel-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--accent-200);
  opacity: .1;
  mask-image: var(--pattern);
  mask-size: 2.4rem 2.4rem;
}

.wheel-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: clamp(.55rem, 1.1vw, 1rem);
  border: 1px solid color-mix(in srgb, var(--accent-200) 22%, transparent);
  border-radius: clamp(1.05rem, 3.35vw, 2.75rem);
  pointer-events: none;
}

.wheel-dial {
  --wheel-segment-light: var(--accent-200);
  --wheel-segment-dark: var(--brand-800);
  --wheel-segment-light-ink: var(--ink);
  --wheel-segment-dark-ink: var(--on-brand);
  --wheel-rim-bright: var(--paper);
  --wheel-rim-mid: var(--accent);
  --wheel-rim-dark: var(--accent-700);
  --wheel-divider: var(--brand-950);
  --wheel-hub: var(--brand-950);
  --wheel-hub-mark: var(--accent-200);
  --wheel-canvas-font: var(--f-body);

  position: relative;
  direction: ltr;
  inline-size: min(100%, 30rem);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 1.45rem 2.35rem -.55rem var(--brand-950);
}

.wheel-dial canvas {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.wheel-pin {
  position: absolute;
  z-index: 1;
  inset-block-start: -2.5%;
  inset-inline-start: 50%;
  inline-size: 9%;
  aspect-ratio: .94;
  transform: translateX(-50%);
  background: linear-gradient(140deg, var(--wheel-rim-bright), var(--wheel-rim-mid) 60%, var(--wheel-rim-dark));
  clip-path: polygon(10% 0, 90% 0, 100% 27%, 50% 100%, 0 27%);
}

.wheel-hub-logo {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: 19%;
  block-size: 19%;
  padding: 1.6%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  object-fit: contain;
  pointer-events: none;
}

.wheel-details {
  grid-area: actions;
  min-inline-size: 0;
}

.wheel-spin,
.wheel-code button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-block-size: 3rem;
  padding: .65rem 1.15rem;
  border: 0;
  border-radius: .85rem;
  background: var(--wheel-button);
  color: var(--wheel-on-button);
  font: 750 1rem/1.4 var(--f-body);
  text-align: center;
  cursor: pointer;
}

.wheel-spin {
  min-block-size: 3.35rem;
  min-inline-size: min(100%, 12rem);
  font-size: 1.1rem;
  box-shadow: 0 .8rem 1.15rem -.85rem var(--wheel-button);
}

.wheel-spin:hover,
.wheel-code button:hover { background: var(--wheel-button-hover); }

.wheel-spin:disabled { opacity: .67; cursor: wait; }

.wheel-status,
.wheel-policy {
  margin-block-start: .75rem;
  color: var(--wheel-muted);
  font-size: .91rem;
  line-height: 1.55;
}

.wheel-status { color: var(--wheel-emphasis); font-weight: 700; }
.wheel-status:empty { display: none; }

.wheel-menu {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  margin-block-start: .55rem;
  color: var(--wheel-emphasis);
  font-weight: 700;
  text-underline-offset: .25em;
}

.wheel-prize {
  inline-size: min(100%, 27rem);
  margin-block-start: 1rem;
  padding: clamp(.9rem, 3vw, 1.35rem);
  border: 1px solid var(--wheel-line);
  border-radius: 1.1rem;
  background: var(--wheel-panel);
  text-align: start;
}

.wheel-prize h2 {
  margin-block-end: .65rem;
  color: var(--wheel-emphasis);
  font: 700 clamp(1.55rem, 3vw, 2.45rem)/1.15 var(--f-display);
}

.wheel-prize label,
.wheel-prize p {
  display: block;
  color: var(--wheel-muted);
  font-size: .9rem;
}

.wheel-prize label { margin-block-end: .32rem; }
.wheel-prize p { margin-block-start: .65rem; }

.wheel-code {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .45rem;
}

.wheel-code input {
  flex: 1 1 8rem;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 2.9rem;
  padding: .5rem .7rem;
  border: 1px solid var(--wheel-line);
  border-radius: .65rem;
  background: var(--wheel-ground);
  color: var(--wheel-ink);
  font: 700 1rem/1.35 ui-monospace, monospace;
  letter-spacing: .065em;
  text-align: start;
}

.wheel-code button {
  min-block-size: 2.9rem;
  padding: .55rem .8rem;
  border-radius: .65rem;
  font-size: .88rem;
}

.wheel-page [hidden] { display: none !important; }

.wheel-main--unavailable {
  grid-template: "heading" auto "actions" auto / minmax(0, 1fr);
  align-content: center;
  gap: 0;
  max-inline-size: 38rem;
  text-align: center;
}

@media (max-width: 760px) {
  .wheel-main {
    grid-template: "heading" auto "stage" auto "actions" auto / minmax(0, 1fr);
    min-block-size: 0;
    gap: 1rem;
    padding-block-start: 1.5rem;
  }

  .wheel-heading,
  .wheel-details { text-align: center; }

  .wheel-heading h1 { font-size: clamp(2.35rem, 9vw, 3.95rem); }
  .wheel-intro { margin-block-start: .4rem; }
  .wheel-stage {
    inline-size: min(100%, 27rem);
    margin-inline: auto;
    padding: clamp(1rem, 5vw, 2.25rem);
  }

  .wheel-spin { inline-size: min(100%, 22rem); }
  .wheel-prize { margin-inline: auto; }

  .wheel-main--unavailable { grid-template: "heading" auto "actions" auto / minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .wheel-nav {
    justify-content: center;
    gap: .25rem;
    padding-block: .3rem;
    text-align: center;
  }

  .wheel-main {
    gap: .9rem;
    padding-block-start: 1.15rem;
  }

  .wheel-stage {
    inline-size: min(100%, 20rem);
    padding: clamp(.85rem, 4vw, 1.6rem);
  }

  .wheel-brand {
    justify-content: center;
    inline-size: 100%;
  }

  .wheel-brand__logo,
  .wheel-brand .mono {
    flex-basis: 2.35rem;
    inline-size: 2.35rem;
    block-size: 2.35rem;
  }

  .wheel-nav .lang { justify-content: center; }
  .wheel-nav .lang__btn { justify-content: center; min-inline-size: 2.75rem; padding-inline: .3rem; }
  .wheel-nav .lang__long { display: none; }
  .wheel-nav .lang__short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-page { scroll-behavior: auto; }
}
