/* Lunch Wheel — matches Pesapane dark hub palette. No inline styles. */

.lunch-wheel-page {
  background-attachment: scroll;
  overflow-x: hidden;
}

.lw {
  flex: 1;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 0.25rem clamp(1rem, 4vw, 1.5rem) 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  overflow-x: visible;
}

.lw-head { text-align: center; }
.lw-title {
  margin: 0;
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-weight: 600;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  letter-spacing: 0.1em;
  color: var(--ink, #F3EEE4);
  text-shadow:
    0 0 12px rgba(170, 220, 255, 0.35),
    0 2px 18px rgba(0, 0, 0, 0.55);
}
.lw-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--accent-soft, #D4A574);
  letter-spacing: 0.03em;
}

.lw-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  /* break out of .lw max-width so the wheel can be ~95vw */
  width: 100vw;
  max-width: 40rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  overflow: visible;
}

.lw-wheel-wrap {
  position: relative;
  /* wide flame band: disc ~76-78% via AURA_PAD */
  width: min(100vw, 40rem);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: visible;
}
.lw-wheel-wrap::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5,12,18,0.55) 0%, rgba(5,12,18,0.35) 55%, rgba(5,12,18,0) 78%);
  pointer-events: none;
  z-index: 0;
}
#lw-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  background-color: transparent;
}

.lw-pointer {
  position: absolute;
  /* top of disc ≈ AURA_PAD (~11.5%) */
  top: 10%;
  left: 50%;
  z-index: 4;
  width: 1.85rem;
  height: 2.3rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.lw-pointer__tip {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 0.72rem solid transparent;
  border-right: 0.72rem solid transparent;
  border-top: 1.55rem solid #F3EEE4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}
.lw-pointer::before {
  content: "";
  position: absolute;
  top: -0.2rem;
  left: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #C8884A;
  border: 2px solid #F3EEE4;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}


.lw-pegs {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.lw-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.lw-spin {
  appearance: none;
  border: 2px solid rgba(200, 230, 255, 0.35);
  cursor: pointer;
  min-width: 9.5rem;
  padding: 0.95rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #E0A060 0%, #C8884A 55%, #A66B35 100%);
  color: #0B1A16;
  font-family: var(--font-body, "Source Sans 3", system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    0 0 16px rgba(160, 210, 255, 0.25),
    0 4px 0 #6e4218,
    0 8px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.lw-spin:hover:not(:disabled) { filter: brightness(1.06); }
.lw-spin:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #6e4218, 0 4px 12px rgba(0, 0, 0, 0.35);
}
.lw-spin:focus-visible {
  outline: 2px solid #f5b301;
  outline-offset: 3px;
}
.lw-spin:disabled {
  opacity: 0.72;
  cursor: wait;
}

.lw-mute {
  appearance: none;
  border: 1px solid rgba(232, 225, 212, 0.22);
  background: rgba(18, 40, 33, 0.88);
  color: var(--ink-muted, #E8E1D4);
  font: 600 0.8125rem/1.2 var(--font-body, system-ui, sans-serif);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.lw-mute[aria-pressed="true"] { opacity: 0.65; }
.lw-mute:focus-visible {
  outline: 2px solid #f5b301;
  outline-offset: 2px;
}

.lw-result {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.2rem, 4.5vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink, #F3EEE4);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.lw-result.is-win {
  animation: lw-flash 0.7s ease;
}
@keyframes lw-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  35% { filter: brightness(1.35); transform: scale(1.04); }
  60% { filter: brightness(1.1); transform: scale(1.02); }
}

.lw-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.lw-confetti span {
  position: absolute;
  top: -8%;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: lw-fall 1.15s ease-out forwards;
}
@keyframes lw-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(110%) rotate(540deg); }
}

.lw-edit {
  margin-top: 0.25rem;
  padding: 1rem 1rem 1.15rem;
  border-radius: var(--radius, 0.875rem);
  background: rgba(18, 40, 33, 0.88);
  border: 1px solid rgba(232, 225, 212, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lw-edit__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lw-edit__h {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink, #F3EEE4);
}
.lw-gear {
  appearance: none;
  border: 1px solid rgba(232, 225, 212, 0.18);
  background: transparent;
  color: rgba(232, 225, 212, 0.55);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.lw-gear:hover,
.lw-gear[aria-expanded="true"] { color: var(--accent-soft, #D4A574); border-color: rgba(200, 136, 74, 0.45); }
.lw-gear:focus-visible { outline: 2px solid #f5b301; outline-offset: 2px; }

.lw-edit__hint {
  margin: 0.45rem 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--ink-muted, #E8E1D4);
  opacity: 0.75;
}

.lw-list,
.lw-weights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lw-item {
  display: grid;
  grid-template-columns: 0.7rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  background: rgba(11, 26, 22, 0.45);
  border: 1px solid rgba(232, 225, 212, 0.08);
}
.lw-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.lw-item input[type="text"] {
  width: 100%;
  min-width: 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink, #F3EEE4);
  font: 500 0.9375rem/1.3 var(--font-body, system-ui, sans-serif);
  padding: 0.2rem 0;
}
.lw-item input[type="text"]:focus {
  outline: none;
  box-shadow: 0 1px 0 rgba(200, 136, 74, 0.7);
}
.lw-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(232, 225, 212, 0.55);
  font: 600 0.75rem/1 system-ui, sans-serif;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  cursor: pointer;
}
.lw-remove:hover { color: #f3eee4; background: rgba(234, 85, 65, 0.25); }
.lw-remove:disabled { opacity: 0.35; cursor: not-allowed; }
.lw-remove:focus-visible { outline: 2px solid #f5b301; outline-offset: 1px; }

.lw-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.lw-add input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid rgba(232, 225, 212, 0.18);
  background: rgba(11, 26, 22, 0.55);
  color: var(--ink, #F3EEE4);
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  font: 500 0.9375rem/1.3 var(--font-body, system-ui, sans-serif);
}
.lw-add input:focus {
  outline: 2px solid #f5b301;
  outline-offset: 1px;
}
.lw-btn,
.lw-reset {
  appearance: none;
  border: 1px solid rgba(200, 136, 74, 0.45);
  background: rgba(200, 136, 74, 0.18);
  color: var(--accent-soft, #D4A574);
  font: 600 0.875rem/1.2 var(--font-body, system-ui, sans-serif);
  padding: 0.6rem 0.95rem;
  border-radius: 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}
.lw-btn:hover,
.lw-reset:hover { background: rgba(200, 136, 74, 0.3); }
.lw-btn:focus-visible,
.lw-reset:focus-visible {
  outline: 2px solid #f5b301;
  outline-offset: 2px;
}
.lw-reset {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  background: transparent;
  border-color: rgba(232, 225, 212, 0.18);
  color: var(--ink-muted, #E8E1D4);
  opacity: 0.85;
}

.lw-advanced {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(232, 225, 212, 0.1);
}
.lw-advanced__note {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(232, 225, 212, 0.55);
}
.lw-wrow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  background: rgba(11, 26, 22, 0.35);
}
.lw-wrow span {
  font-size: 0.875rem;
  color: var(--ink-muted, #E8E1D4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lw-step {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.lw-step button {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(232, 225, 212, 0.2);
  background: rgba(18, 40, 33, 0.9);
  color: var(--ink, #F3EEE4);
  font: 700 1rem/1 system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
}
.lw-step button:disabled { opacity: 0.35; cursor: not-allowed; }
.lw-step button:focus-visible { outline: 2px solid #f5b301; outline-offset: 1px; }
.lw-step b {
  min-width: 1.1rem;
  text-align: center;
  font: 600 0.875rem/1 var(--font-body, system-ui, sans-serif);
  color: var(--accent-soft, #D4A574);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .lw { max-width: 36rem; }
  .lw-stage { max-width: 40rem; margin-left: auto; margin-right: auto; width: 100%; }
  /* desktop disc target ~520-600px → wrap ~560-640 with small pad */
  /* ~480px disc with AURA_PAD 0.115 → wrap ≈ 624px */
  .lw-wheel-wrap { width: min(92vw, 39rem); }
}

@media (prefers-reduced-motion: reduce) {
  .lw-spin { transition: none; }
  .lw-result.is-win { animation: none; }
  .lw-confetti span { animation: none; opacity: 0; }
}

/* Swatch colors (no inline styles — CSP style-src 'self') */
.lw-swatch--0 { background: #e24a38; }
.lw-swatch--1 { background: #c9a20f; }
.lw-swatch--2 { background: #2f9e28; }
.lw-swatch--3 { background: #2fc4a0; }
.lw-swatch--4 { background: #3b7de0; }
.lw-swatch--5 { background: #7a3ae0; }
.lw-swatch--6 { background: #e03aa8; }
.lw-swatch--7 { background: #e07828; }
.lw-swatch--8 { background: #2cbcbc; }
.lw-swatch--9 { background: #8fc41a; }
.lw-swatch--10 { background: #e03860; }
.lw-swatch--11 { background: #3858e0; }

.lw-wnum {
  width: 3.5rem;
  appearance: textfield;
  -moz-appearance: textfield;
  border: 1px solid rgba(232, 225, 212, 0.2);
  border-radius: 0.35rem;
  background: rgba(11, 26, 22, 0.55);
  color: var(--accent-soft, #D4A574);
  font: 600 0.875rem/1.2 var(--font-body, system-ui, sans-serif);
  text-align: center;
  padding: 0.25rem;
}
.lw-wnum::-webkit-outer-spin-button,
.lw-wnum::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lw-wnum:focus {
  outline: 2px solid #f5b301;
  outline-offset: 1px;
}

/* Confetti bits — fixed positions/colors via classes */
.lw-bit { left: 50%; background: #ea5541; }
.lw-bit--0 { left: 8%; background: #ea5541; animation-delay: 0.02s; }
.lw-bit--1 { left: 14%; background: #eae641; animation-delay: 0.08s; }
.lw-bit--2 { left: 22%; background: #5dea41; animation-delay: 0.12s; }
.lw-bit--3 { left: 30%; background: #41eab6; animation-delay: 0.05s; }
.lw-bit--4 { left: 38%; background: #418dea; animation-delay: 0.18s; }
.lw-bit--5 { left: 46%; background: #8641ea; animation-delay: 0.03s; }
.lw-bit--6 { left: 54%; background: #ea41be; animation-delay: 0.15s; }
.lw-bit--7 { left: 62%; background: #ea8a41; animation-delay: 0.09s; }
.lw-bit--8 { left: 70%; background: #41eaea; animation-delay: 0.21s; }
.lw-bit--9 { left: 78%; background: #a8ea41; animation-delay: 0.06s; }
.lw-bit--10 { left: 86%; background: #ea4168; animation-delay: 0.11s; }
.lw-bit--11 { left: 92%; background: #4168ea; animation-delay: 0.17s; }
