:root {
  color-scheme: dark;
  --ink: #fff8e9;
  --muted-ink: #efe5d1;
  --canvas: #082d35;
  --canvas-deep: #05242b;
  --accent: #dc5a4c;
  --accent-hover: #ed6c5d;
  --line: rgba(255, 248, 233, 0.82);
  --font-display: "Noto Serif TC", "Songti TC", "STSong", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body);
}

.picker {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(4rem, 13vh, 8.5rem) clamp(1.5rem, 7vw, 4rem) clamp(2.25rem, 7vh, 4.5rem);
  isolation: isolate;
}

.picker::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 12%, rgba(255, 248, 233, 0.12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 68%, rgba(255, 248, 233, 0.09) 0 1px, transparent 1.5px);
  background-size: 23px 27px, 31px 37px;
  pointer-events: none;
}

.intro {
  text-align: center;
}

h1,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 13vw, 5.25rem);
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.08;
}

.intro p {
  margin-top: 1.6rem;
  color: var(--muted-ink);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.7vw, 1.55rem);
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.draw-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 0 2rem;
}

.restaurant-name {
  display: grid;
  min-height: clamp(10rem, 30vw, 13.75rem);
  place-items: center;
  padding: 1.5rem;
  border: 2px solid var(--line);
  border-radius: 1.5rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 9.8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}

.restaurant-name.is-spinning {
  border-color: rgba(255, 248, 233, 0.52);
}

.restaurant-name.is-stepping {
  animation: slot-step 150ms cubic-bezier(0.2, 0.75, 0.35, 1);
}

.restaurant-name.is-result {
  animation: result-land 280ms cubic-bezier(0.18, 0.82, 0.32, 1.2);
}

.actions {
  display: grid;
  gap: 1.1rem;
  margin: clamp(2.25rem, 7vh, 4rem) auto 0;
  width: min(100%, 31rem);
}

.button {
  min-height: 4.45rem;
  border: 2px solid transparent;
  border-radius: 1rem;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 6.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:focus-visible {
  outline: 3px solid #ffe3a6;
  outline-offset: 4px;
}

.button:active {
  transform: translateY(2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.button-primary {
  color: #fff8e9;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.button-secondary:hover {
  background: rgba(255, 248, 233, 0.1);
}

@keyframes slot-step {
  from {
    opacity: 0.28;
    filter: blur(1.2px);
    transform: translateY(1.1rem) scale(0.98);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes result-land {
  0% {
    opacity: 0.35;
    transform: translateY(0.75rem) scale(0.98);
  }

  68% {
    transform: translateY(-0.2rem) scale(1.015);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 640px) {
  .picker {
    max-width: 860px;
    margin: 0 auto;
  }

  .draw-area {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }
}

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