/* ------------------------------------------------------------------
   Book Your Date — styles
   Palette: energetic blue / violet / teal, playful and bright.
   Look: hand-drawn / sketchbook — wobbly ink outlines, a bit of
   pencil-line jitter (via SVG filters defined in index.html), flat
   offset "paper" shadows instead of soft corporate blur, and a
   handwriting font pairing (Kalam + Patrick Hand).
------------------------------------------------------------------ */

:root {
  --blue: #4a5fea;
  --blue-dark: #3145c4;
  --sky: #2fc1f0;
  --violet: #8b5cf6;
  --teal: #16c79a;
  --sunny: #ffc94a;
  --ink: #1b1f3b;
  --ink-soft: rgba(27, 31, 59, 0.85);
  --paper: #fbfbff;
  --paper-soft: #ececff;
  --text: #22264a;
  --muted: #666c96;
  --shadow: rgba(74, 60, 220, 0.32);
  --sketch-shadow: 5px 5px 0 var(--ink-soft);
  --sketch-shadow-sm: 3px 3px 0 var(--ink-soft);

  --wheel3-1: var(--blue);
  --wheel3-2: var(--violet);
  --wheel3-3: var(--teal);

  --wheel5-1: var(--blue);
  --wheel5-2: var(--violet);
  --wheel5-3: var(--teal);
  --wheel5-4: var(--sky);
  --wheel5-5: var(--sunny);

  --font-heading: "Kalam", "Segoe UI", cursive;
  --font-body: "Patrick Hand", "Segoe UI", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, #9be8ff 0%, #6c63ff 45%, #1b1148 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px;
}

/* ------------------------- floating decor ------------------------- */

.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.float-spark {
  position: absolute;
  color: #fff;
  opacity: 0.4;
  font-size: 20px;
  animation: floatUp 14s linear infinite;
}

.s1 { left: 8%;  font-size: 20px; animation-duration: 16s; animation-delay: 0s;  color: var(--sunny); }
.s2 { left: 25%; font-size: 12px; animation-duration: 12s; animation-delay: 2s;  color: var(--teal); }
.s3 { left: 55%; font-size: 26px; animation-duration: 18s; animation-delay: 1s;  color: #fff; }
.s4 { left: 75%; font-size: 14px; animation-duration: 13s; animation-delay: 4s;  color: var(--sky); }
.s5 { left: 90%; font-size: 10px; animation-duration: 15s; animation-delay: 3s;  color: var(--violet); }

@keyframes floatUp {
  0%   { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) rotate(20deg); opacity: 0; }
}

/* ------------------------------ layout ------------------------------ */

main#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

.screen { display: none; }

.screen.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--paper);
  border-radius: 26px 34px 22px 30px / 30px 22px 34px 24px;
  padding: 40px 32px;
  text-align: center;
  border: 2.5px solid var(--ink);
  outline: 1.5px solid var(--ink);
  outline-offset: 5px;
  box-shadow: var(--sketch-shadow);
  filter: url(#pencil-soft);
  position: relative;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 700;
  color: var(--violet);
  margin: 0 0 8px;
  font-family: var(--font-heading);
}

h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 36px;
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.2;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 17px;
}

/* wheel screens have no subtitle, so give the heading extra breathing
   room before the wheel itself */
#screen-wheel1 h1,
#screen-wheel2 h1 {
  margin-bottom: 24px;
}

/* ------------------------------- entry form ------------------------------- */

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading);
}

.field span em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.field input[type="text"],
.field select {
  font-family: var(--font-body);
  font-size: 17px;
  padding: 12px 16px;
  border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px;
  border: 2.5px solid var(--ink);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  filter: url(#pencil);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.field input[type="text"]:focus,
.field select:focus {
  border-color: var(--violet);
  box-shadow: 3px 3px 0 rgba(139, 92, 246, 0.4);
}

.radio-field {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-field legend {
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading);
}

.radio-options {
  display: flex;
  gap: 10px;
}

.radio-options label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;
  border: 2.5px solid var(--ink);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  filter: url(#pencil);
}

.radio-options label:has(input:checked) {
  border-color: var(--violet);
  background: var(--paper-soft);
}

.radio-options input {
  accent-color: var(--violet);
  cursor: pointer;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0 8px;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--violet);
  cursor: pointer;
}

/* ------------------------------ buttons ------------------------------ */

.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  padding: 13px 30px;
  border-radius: 40px 46px 38px 48px / 46px 36px 48px 38px;
  border: 2.5px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
  filter: url(#pencil);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  box-shadow: var(--sketch-shadow-sm);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink-soft);
}

.btn-primary:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink-soft);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: var(--sketch-shadow-sm);
}

/* ------------------------------- wheel ------------------------------- */

.wheel-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 8px auto 28px;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 6px solid var(--paper);
  outline: 2.5px solid var(--ink);
  outline-offset: 4px;
  box-shadow: 0 12px 30px var(--shadow);
  transition: transform 4.2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  filter: url(#pencil-soft);
}

.wheel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  background: var(--paper);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px var(--shadow);
  border: 2px solid var(--ink);
}

.wheel-number {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.wheel-number span {
  display: block;
  transform: translate(-50%, -120px);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--ink);
  z-index: 2;
  filter: url(#pencil) drop-shadow(0 3px 4px var(--shadow));
}

.wheel-result {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 21px;
  color: var(--violet);
  min-height: 26px;
  margin: 0 0 18px;
}

.wheel-result:empty {
  visibility: hidden;
}

/* ------------------------------- mode picker ------------------------------- */

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 20px 26px 18px 28px / 26px 18px 28px 20px;
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.12s ease;
  box-shadow: var(--sketch-shadow-sm);
  filter: url(#pencil);
}

.mode-btn:hover {
  border-color: var(--violet);
  background: var(--paper-soft);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink-soft);
}

.mode-btn-emoji {
  font-size: 28px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 8px;
  border: 2px solid var(--ink);
}

#mode-select-btn .mode-btn-emoji {
  background: linear-gradient(135deg, var(--sky), var(--blue));
}

#mode-random-btn .mode-btn-emoji {
  background: linear-gradient(135deg, var(--violet), var(--teal));
}

.mode-btn-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 21px;
  color: var(--text);
}

.mode-btn-desc {
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------- calendar ------------------------------- */

.calendar {
  margin: 4px 0 24px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--blue-dark);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
  filter: url(#pencil-soft);
}

.calendar-nav-btn:hover:not(:disabled) { border-color: var(--violet); }

.calendar-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.calendar-month-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px 11px 7px 12px / 11px 7px 12px 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  filter: url(#pencil-soft);
}

.calendar-day:hover:not(:disabled) { border-color: var(--violet); }

.calendar-day.is-today {
  border-color: var(--sunny);
  background: rgba(255, 201, 74, 0.14);
}

.calendar-day.is-selected {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: var(--ink);
  color: #fff;
}

.calendar-day.is-past {
  color: var(--muted);
  opacity: 0.35;
  cursor: default;
}

/* ------------------------------- review ------------------------------- */

.review-icon {
  font-size: 42px;
  line-height: 1;
  margin: 4px auto 16px;
  display: inline-block;
  animation: reviewWiggle 1.8s ease-in-out infinite;
}

@keyframes reviewWiggle {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  25%      { transform: rotate(6deg) scale(1.06); }
  50%      { transform: rotate(-4deg) scale(1.1); }
  75%      { transform: rotate(8deg) scale(1.06); }
}

.review-status {
  font-size: 17px;
  font-weight: 600;
  color: var(--violet);
  min-height: 24px;
  margin: 0 0 24px;
}

.review-summary {
  background: var(--paper-soft);
  border: 2px solid var(--ink);
  border-radius: 16px 20px 14px 22px / 20px 14px 22px 16px;
  padding: 16px 18px;
  margin: 0 0 28px;
  filter: url(#pencil-soft);
}

.review-summary-line {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  padding: 4px 0;
}

.review-summary-line:empty { display: none; }

/* -------------------------------- responsive -------------------------------- */

@media (max-width: 420px) {
  .card { padding: 32px 20px; }
  h1 { font-size: 30px; }
  .wheel-wrap { width: 220px; height: 220px; }
  .wheel-number span { font-size: 24px; transform: translate(-50%, -100px); }
}
