/* Squish Spin & Win — base styles
 * Palette + typography locked in design doc 2026-04-28.
 */

:root {
  --c-green: #00A651;
  --c-green-dark: #007A3D;
  --c-pink: #E91E63;
  --c-orange: #FF7B00;
  --c-yellow: #FFD60A;
  --c-purple: #6B2D8C;
  --c-cream: #FFF8F0;
  --c-grey: #D4CFC7;
  --c-grey-text: #6B6B6B;
  --c-text: #2A2A2A;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.05;
  color: var(--c-purple);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(32px, 8vw, 44px); }
h2 { font-size: clamp(24px, 6vw, 32px); }
h3 { font-size: clamp(20px, 5vw, 24px); }

p { font-size: 17px; line-height: 1.55; }
p.big { font-size: 20px; line-height: 1.5; font-weight: 600; }
p.why {
  font-size: 14px;
  color: var(--c-grey-text);
  margin-bottom: 16px;
  font-style: italic;
}
p.hint {
  font-size: 14px;
  color: var(--c-grey-text);
  margin: 4px 0 12px;
  text-align: left;
  font-style: italic;
}
p.form-error {
  font-size: 14px;
  color: #C62828;
  background: #FFEBEE;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0 12px;
  text-align: left;
  font-weight: 600;
}

a { color: var(--c-green-dark); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

button, .btn {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 19px;
  border: 0;
  border-radius: var(--r);
  padding: 18px 36px;
  min-height: 60px;
  background: var(--c-green);
  color: white;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 320px;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn-large, button.btn-large {
  font-size: 22px;
  padding: 20px 36px;
  min-height: 66px;
}
.btn-xl, button.btn-xl {
  font-size: 30px;
  padding: 22px 36px;
  min-height: 76px;
  letter-spacing: 0.04em;
}
/* Long-press progress ring (invisible by default; activates only when held) */
button .lp-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  transition: transform 0s linear;
}
button.lp-active .lp-fill {
  transform: scaleX(1);
  transition: transform 2s linear;
}
button:active, .btn:active { transform: scale(0.96); }
button:hover, .btn:hover { box-shadow: var(--shadow-lg); }
button.secondary, .btn.secondary { background: var(--c-orange); }
button.pink, .btn.pink { background: var(--c-pink); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="text"],
input[type="email"],
input[type="tel"] {
  font: inherit;
  font-size: 17px;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--c-grey);
  border-radius: var(--r);
  background: white;
  color: var(--c-text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--c-green);
}

label {
  display: block;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--c-text);
}
label.popia {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.45;
  margin: 8px 0 12px;
  cursor: pointer;
  text-align: left;
}
label.popia input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--c-green);
  cursor: pointer;
}

.field { margin-bottom: 14px; text-align: left; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  text-align: center;
}

.logo-lockup {
  margin: 8px 0 4px;
  user-select: none;
  -webkit-user-drag: none;
}
.logo-lockup img {
  max-width: 260px;
  width: 60vw;
  height: auto;
  display: block;
  pointer-events: auto;
}
.logo-small {
  max-width: 140px;
  margin: 16px auto 0;
  display: block;
}

[data-screen] {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}
[data-screen][hidden] { display: none; }

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

/* Result overlay — sits on top of the wheel screen so the landed slice
 * stays visible behind a softly blurred backdrop. */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 248, 240, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.35s ease-out;
}
.result-overlay[hidden] { display: none; }
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cardPop {
  0% { opacity: 0; transform: translateY(20px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.result-card {
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  animation: cardPop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.result-card.win {
  background: linear-gradient(160deg, var(--c-green) 0%, var(--c-green-dark) 100%);
  color: white;
}
.result-card.win h1,
.result-card.win h2 { color: white; }
.result-card.win .stand {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.22);
  padding: 10px 20px;
  border-radius: var(--r);
  display: inline-block;
}
.result-card.lose {
  background: white;
  color: var(--c-text);
}
.result-card.lose h1 { color: var(--c-purple); }
.result-card .logo-small {
  max-width: 110px;
  margin-top: 4px;
}
.result-card p.thanks {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.92;
  max-width: 320px;
  margin: 4px auto 0;
}
.result-card.win p.thanks { color: rgba(255, 255, 255, 0.95); }
.result-card.lose p.thanks { color: var(--c-purple); }

/* Done / Next Shopper restart button — sits at the bottom of result card */
.result-card .btn-restart {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 17px;
  border: 0;
  border-radius: var(--r);
  padding: 14px 24px;
  min-height: 50px;
  margin-top: 12px;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow);
}
.result-card .btn-restart:active { transform: scale(0.96); }
/* WIN card has green background, so use semi-transparent white button */
.result-card.win .btn-restart {
  background: rgba(255, 255, 255, 0.95);
  color: var(--c-green-dark);
}
/* LOSE card has white background, so use Squish-purple button */
.result-card.lose .btn-restart {
  background: var(--c-purple);
  color: white;
}

/* Honeypot — anti-bot field, must NOT be visible to real users. We
 * position it offscreen rather than display:none because some bots
 * skip display:none fields. tabindex=-1 prevents keyboard focus. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================================
 * Admin dashboard — D's remote control panel
 * ============================================================ */
body.admin {
  background: var(--c-cream);
}
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
@media (min-width: 1100px) {
  .admin-shell { padding: 32px 40px 80px; }
}

/* Dashboard grid — two columns on laptop, single column on phone */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 900px) {
  .dash-col { gap: 20px; }
}
/* Right-column leads panel can grow tall to use vertical space */
.panel-tall .leads-list {
  max-height: 720px;
  overflow-y: auto;
}
.admin-header {
  text-align: center;
  margin-bottom: 24px;
}
.admin-logo {
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}
.admin-header h1 {
  font-size: clamp(28px, 5vw, 38px);
  margin-bottom: 4px;
}
.admin-subtitle {
  color: var(--c-grey-text);
  font-size: 14px;
  font-weight: 600;
}
.admin-footer {
  text-align: center;
  margin-top: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
.kpi {
  background: white;
  border-radius: var(--r);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-value {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: var(--c-purple);
}
.kpi-label {
  font-size: 12px;
  color: var(--c-grey-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel {
  background: white;
  border-radius: var(--r-lg);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: left;
}
.panel h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  color: var(--c-purple);
  margin-bottom: 8px;
}
.panel p { font-size: 14px; }
.panel p.muted { color: var(--c-grey-text); margin-bottom: 14px; }

.rate-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 16px;
}
.rate-label { color: var(--c-grey-text); font-weight: 600; }
.rate-value { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px; color: var(--c-green-dark); }
.rate-value.muted { color: var(--c-grey-text); font-size: 18px; font-weight: 600; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--c-grey);
  border-radius: 4px;
  margin: 16px 0 6px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-green);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-green);
  cursor: pointer;
  border: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--c-grey-text);
  font-weight: 600;
  margin-bottom: 12px;
}
.slider-labels span:nth-child(2) {
  color: var(--c-green-dark);
  font-size: 15px;
}

.pool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pool-row label {
  flex-shrink: 0;
  margin: 0;
  font-size: 14px;
}
.pool-row input[type="number"] {
  flex: 1;
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid var(--c-grey);
  border-radius: var(--r);
}
.btn-small {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 16px;
  min-height: 0;
  width: auto;
  border-radius: 12px;
}
.pool-progress { margin-top: 8px; }
.pool-bar {
  width: 100%;
  height: 14px;
  background: var(--c-grey);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 6px;
}
.pool-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-green) 0%, var(--c-orange) 70%, var(--c-pink) 100%);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 7px;
}
.pool-text { font-size: 14px; }

.device-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}
.device-row > div {
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--c-cream);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.device-row span {
  color: var(--c-grey-text);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.device-row strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  color: var(--c-purple);
  line-height: 1;
}

.leads-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leads-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--c-cream);
  border-radius: 10px;
  font-size: 14px;
}
.leads-list li.muted { justify-content: center; color: var(--c-grey-text); display: block; text-align: center; }
.lead-name { font-weight: 600; color: var(--c-text); }
.lead-meta { font-size: 12px; color: var(--c-grey-text); }
.lead-prize {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.lead-prize.win { background: var(--c-green); color: white; }
.lead-prize.lose { background: var(--c-grey); color: var(--c-grey-text); }

button.secondary { background: var(--c-purple); }

/* Locked / already-played screen */
.locked {
  text-align: center;
  padding: 48px 24px;
}
.locked h2 { margin-bottom: 12px; }
.locked p { color: var(--c-grey-text); }

/* Index nav links (dev only) */
.dev-nav { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.dev-nav a { display: inline-block; padding: 14px 24px; background: white; border-radius: var(--r); box-shadow: var(--shadow); }

/* Wheel container */
.wheel-stage {
  position: relative;
  width: min(86vw, 360px);
  aspect-ratio: 1;
  margin: 12px auto;
}
.wheel-stage svg {
  width: 100%;
  height: 100%;
  transform-origin: center;
  transition: transform 0s linear;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.18));
}

/* Squishier pointer — rounded tip, soft drop shadow.
 * Built from a single SVG shape rather than CSS triangles so the tip can
 * be rounded instead of geometric. Sized large enough to draw the eye to
 * the landing spot. */
.wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 50px;
  z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'><path d='M20 32 C 4 16, 4 4, 20 4 C 36 4, 36 16, 20 32 Z' fill='%236B2D8C' stroke='%23FFF8F0' stroke-width='2.5'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.32));
}

/* Laptop / tablet — bump wheel size on bigger screens for D's testing.
 * Phone-first design isn't affected (the @media min-width gates it). */
@media (min-width: 768px) {
  .app-shell {
    max-width: 640px;
  }
  .wheel-stage {
    width: min(58vw, 480px);
  }
  .wheel-pointer {
    top: -22px;
    width: 76px;
    height: 68px;
  }
  h1 { font-size: clamp(40px, 5vw, 52px); }
  .btn-xl, button.btn-xl {
    font-size: 34px;
    min-height: 84px;
  }
}
