/* ————— spin.noahcamacho.com — hangout wheel ————— */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --accent:      #4E93F0;
  --accent-deep: #2F6BD1;
  --accent-dark: #22427E;
  --accent-soft: #B4D2FF;
  --peri:        #6C7BF0;
  --mint:        #7BD1B0;
  --ink:         #2C3A63;
  --ink-soft:    #6A76A0;
  --kicker:      #8FA0EE;
  --cream:       #F5F9FF;
  --card:        #FFFFFF;
  --shadow:      rgba(47, 107, 209, .18);
}

html, body { height: 100%; }

body {
  font-family: 'Quicksand', -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 85% -10%, #DCE7FF 0%, transparent 55%),
    radial-gradient(900px 700px at -10% 30%, #D6F2E6 0%, transparent 60%),
    radial-gradient(800px 600px at 60% 110%, #E7DEFF 0%, transparent 55%),
    linear-gradient(180deg, #EEF4FF 0%, #E9F1FF 45%, #F1ECFF 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ————— layout ————— */

.page {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 56px) 20px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

.hero { text-align: center; }

.hero-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1.1;
  background: linear-gradient(100deg, var(--accent-deep) 10%, var(--peri) 55%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: riseIn .7s cubic-bezier(.2,.9,.3,1) both;
}
.hero-sub {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.45;
  animation: riseIn .7s .12s cubic-bezier(.2,.9,.3,1) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ————— the wheel ————— */

.wheel-zone {
  margin-top: clamp(18px, 4vh, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: riseIn .8s .2s cubic-bezier(.2,.9,.3,1) both;
}

.wheel-wrap {
  position: relative;
  width: min(88vw, 400px);
  aspect-ratio: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wheel-glow {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78,147,240,.26) 30%, rgba(108,123,240,.13) 62%, transparent 72%);
  animation: breathe 4.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: .8; }
  50%      { transform: scale(1.04); opacity: 1;  }
}

.wheel-svg {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  filter: drop-shadow(0 14px 30px var(--shadow));
}
.wheel-svg.grabbing { cursor: grabbing; }

.wheel-svg .rotor.idle { animation: sway 3.6s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-2.2deg); }
  50%      { transform: rotate(2.2deg); }
}

.pointer {
  position: absolute;
  top: -4.5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(47,107,209,.35));
  transform-origin: 50% 18%;
}
.pointer.flap { animation: flap .12s ease-out; }
@keyframes flap {
  0%   { transform: translateX(-50%) rotate(0deg); }
  40%  { transform: translateX(-50%) rotate(-9deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

.hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: linear-gradient(160deg, #FFFFFF 0%, #EAF1FF 100%);
  box-shadow:
    0 4px 14px rgba(47, 107, 209, .25),
    inset 0 -3px 8px rgba(180, 210, 255, .55),
    0 0 0 5px rgba(255,255,255,.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  z-index: 4;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.hub:active { transform: translate(-50%, -50%) scale(.93); }
.hub-emoji { font-size: clamp(18px, 5.4vw, 26px); line-height: 1; }
.hub-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(11px, 3.2vw, 14px);
  line-height: 1.05;
  color: var(--accent-deep);
  text-align: center;
}

/* ————— option pills ————— */

.options {
  margin-top: 22px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.opt-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: .02em;
  animation: hintBob 2.4s ease-in-out infinite;
}
@keyframes hintBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.opt-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.opt-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border: 2px solid var(--pill, #CFE0FF);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill, #E9F1FF) 34%, #fff);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  cursor: pointer;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease;
}
.opt-pill:hover { box-shadow: 0 6px 16px rgba(47,107,209,.16); }
.opt-pill:active { transform: scale(.94); }
.opt-emoji { font-size: 19px; line-height: 1; }

.spin-random {
  margin-top: 16px;
  font-size: 15.5px;
  padding: 13px 24px;
}

/* ————— sheets / modals ————— */

.backdrop[hidden], .success[hidden] { display: none; }

.backdrop {
  position: fixed; inset: 0;
  z-index: 20;
  background: rgba(44, 58, 99, .32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .28s ease;
}
.backdrop.show { opacity: 1; }
@media (min-width: 560px) {
  .backdrop { align-items: center; }
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 30px 30px 0 0;
  padding: 34px 26px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: 0 -10px 40px rgba(47, 107, 209, .22);
  transform: translateY(40px);
  opacity: 0;
  transition: transform .34s cubic-bezier(.2,.9,.3,1), opacity .3s ease;
}
.backdrop.show .sheet { transform: none; opacity: 1; }
@media (min-width: 560px) {
  .sheet { border-radius: 30px; padding-bottom: 30px; }
}

.sheet-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: #E9F1FF;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.sheet-close:active { transform: scale(.9); }

.result-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--kicker);
}
.result-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 36px;
  margin-top: 8px;
  color: var(--ink);
}
.result-sub {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.45;
}

.sheet-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 17px;
  padding: 15px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; }

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 8px 20px rgba(47, 107, 209, .35);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 10px 24px rgba(47, 107, 209, .45); }

.btn-ghost {
  color: var(--accent-deep);
  background: #E9F1FF;
}

.link-btn {
  border: none;
  background: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ————— calendar ————— */

.picker-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 26px;
}
.picker-plan {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-deep);
}

.cal { margin-top: 18px; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.cal-month {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--accent-deep);
}
.cal-nav {
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  background: #E9F1FF;
  color: var(--accent-deep);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, opacity .2s ease;
}
.cal-nav:active { transform: scale(.9); }
.cal-nav:disabled { opacity: .3; cursor: default; }

.cal-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--kicker);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, transform .15s cubic-bezier(.34,1.56,.64,1), color .15s ease;
}
.cal-day:not(:disabled):hover { background: #E9F1FF; }
.cal-day:disabled { color: #C3CEE6; cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 3px 10px rgba(34,66,126,.45);
}
.cal-day.sel:disabled { color: #fff; }

.timepick { margin-top: 20px; }
.time-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.time-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.time-pill {
  min-width: 58px;
  padding: 9px 12px;
  border: 2px solid #CFE0FF;
  border-radius: 999px;
  background: #F3F8FF;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), background .14s ease, color .14s ease, border-color .14s ease;
}
.time-pill:active { transform: scale(.93); }
.time-pill:disabled {
  opacity: .4;
  color: var(--ink-soft);
  background: #EEF3FA;
  border-color: #DDE6F3;
  cursor: default;
  text-decoration: line-through;
}
.time-pill.sel {
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(47,107,209,.35);
}

.btn-lock { width: 100%; margin-top: 20px; }

/* ————— success ————— */

.success {
  position: fixed; inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(900px 500px at 50% -10%, #D7E6FF 0%, transparent 60%),
    linear-gradient(180deg, #EEF4FF 0%, #F1ECFF 100%);
  opacity: 0;
  transition: opacity .4s ease;
}
.success.show { opacity: 1; }

.success-card { text-align: center; }
.success-big {
  font-size: 76px;
  animation: pop .6s cubic-bezier(.34,1.56,.64,1) both;
}
.success-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 10vw, 52px);
  margin-top: 10px;
  background: linear-gradient(100deg, var(--accent-deep), var(--peri));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: riseIn .6s .12s cubic-bezier(.2,.9,.3,1) both;
}
.success-date {
  margin-top: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--accent-deep);
  animation: riseIn .6s .22s cubic-bezier(.2,.9,.3,1) both;
}
.success-sub {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  animation: riseIn .6s .3s cubic-bezier(.2,.9,.3,1) both;
}
.btn-text {
  display: inline-block;
  margin-top: 22px;
  min-width: 220px;
  text-decoration: none;
  animation: riseIn .6s .4s cubic-bezier(.2,.9,.3,1) both;
}
.success-change {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  animation: riseIn .6s .55s ease both;
}
@keyframes pop {
  0%   { transform: scale(0);   }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1);   }
}

/* ————— confetti canvas ————— */

#confetti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* ————— reduced motion ————— */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
