/* Caprics design system — tokens per Docs/Caprics Manifest UI Design/tokens/tokens.css.
   Office pages (admin) stay white per the system; public campaign pages opt into
   body.theme-yellow — the Caprics brand yellow used on the bookshelf landing. */

@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Variable.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Action (yellow = action; text on yellow is always Ink 900) */
  --primary: #ffc226;
  --primary-hover: #ffcb45;
  --primary-pressed: #e0a500;
  --on-primary: #16151a;
  --cta: var(--primary);
  --primary-dark: var(--primary-pressed);

  /* Ink palette */
  --ink-900: #16151a;
  --ink-800: #2b2a31;
  --ink-700: #4a4856;
  --ink-600: #6b6878;
  --ink-400: #a5a3ae;
  --ink-300: #cfcdd6;
  --ink-250: #e6e4ec;
  --ink-200: #eeedf2;
  --ink-100: #f2f1f5;
  --ink-50: #f7f7f9;

  /* Feedback / accents */
  --royal: #1e40af;
  --royal-bg: #e8edfb;
  --aqua: #0aa5c0;
  --berry: #e0489a;
  --success: #1f9d55;
  --success-text: #146c3a;
  --success-bg: #e7f6ec;
  --warning: #ea6a0c;
  --warning-text: #b54708;
  --warning-bg: #fff1e6;
  --error: #d92d20;
  --error-text: #b42318;

  /* Brand tints */
  --brand-bg: #fff3cc;
  --brand-fg: #8a5a00;
  --brand-300: #ffd666;
  --brand-700: #b38000;
  --brand-900: #5c3b00;

  --bg: #ffffff;
  --surface: #ffffff;
  --text: #16151a;
  --text-muted: #6b6878;
  --muted: #6b6878;
  --border: #eeedf2;
  --border-field: #cfcdd6;

  --radius: 24px;
  --radius-btn: 14px;
  --radius-field: 14px;
  --shadow: 0 12px 28px -18px rgba(22, 21, 26, 0.25);
  --shadow-lg: 0 24px 48px -24px rgba(22, 21, 26, 0.35);
  --focus: 0 0 0 2px #fff, 0 0 0 4px #1e40af;
}

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

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

body {
  font-family: "Clash Display", system-ui, sans-serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

h1, h2, h3, .display { font-family: "Clash Display", system-ui, sans-serif; font-weight: 600; line-height: 1.2; }

.container { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--ink-200);
  padding: 10px 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.topbar .brand-link { display: inline-flex; align-items: center; text-decoration: none; }
.topbar .brand-logo { height: 44px; width: auto; display: block; }
.topbar .topbar-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  letter-spacing: 0.01em;
}
.topbar .brand {
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-900);
  letter-spacing: -0.02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: "Clash Display", sans-serif;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  touch-action: manipulation;
  width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Primary = yellow action, Ink 900 text */
.btn-primary,
.btn-cta {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 16px -6px rgba(224, 165, 0, 0.55);
}
.btn-primary:hover, .btn-cta:hover { background: var(--primary-hover); }
.btn-primary:active, .btn-cta:active { background: var(--primary-pressed); }

/* Dark = Ink 900 */
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover { background: var(--ink-800); }
.btn-dark:active { background: #000; }

/* Secondary = white + field border */
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-field); }
.btn-ghost:hover { background: var(--ink-50); }
.btn-ghost:active { background: var(--ink-100); }

.btn-ig {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.35);
}
.btn-ig:hover { filter: brightness(1.05); }

.btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 20px 0;
}

.steps { display: flex; gap: 8px; justify-content: center; margin: 24px 0 8px; }
.step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-250);
}
.step-dot.active { background: var(--primary); width: 28px; border-radius: 5px; }

.hero {
  text-align: center;
  padding: 40px 0 8px;
}
.hero h1 {
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hero h1 .accent { color: var(--royal); }
.hero p { color: var(--text-muted); font-size: 17px; max-width: 42ch; margin: 0 auto; }

.badge {
  display: inline-block;
  background: var(--brand-bg);
  color: var(--brand-fg);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.hint {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}
.hint a { color: var(--royal); font-weight: 600; }

/* ---------- Prize list ---------- */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.prize-chip {
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}
.prize-chip small { display: block; font-weight: 500; color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ---------- Wheel ---------- */
/* Stage = static rim with chase lights + rotating wheel (SVG or printed artwork) + laby hub */
.wheel-stage {
  position: relative;
  width: min(84vw, 400px);
  margin: 34px auto 28px;
  aspect-ratio: 1;
}
.wheel-rim {
  position: absolute;
  inset: -6.5%;
  width: 113%;
  height: 113%;
  z-index: 0;
  filter: drop-shadow(0 18px 28px rgba(60, 42, 8, 0.35));
}
.wheel-rim .bulb { fill: #fff4da; transition: fill 0.2s, opacity 0.2s; }
.wheel-rim .bulb.alt { opacity: 0.45; }
.wheel-stage.spinning .wheel-rim .bulb { animation: bulb-chase 0.5s steps(1) infinite; }
.wheel-stage.spinning .wheel-rim .bulb.alt { animation-delay: 0.25s; }
.wheel-stage.won .wheel-rim .bulb { animation: bulb-chase 0.22s steps(1) infinite; }
.wheel-stage.won .wheel-rim .bulb.alt { animation-delay: 0.11s; }
@keyframes bulb-chase { 0% { opacity: 1; fill: #fffdf5; } 50% { opacity: 0.3; fill: #ffc226; } }

.wheel-rotor {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background: #fff; /* placeholder while artwork loads */
  overflow: hidden;
  transition: transform 5.2s cubic-bezier(0.1, 0.72, 0.08, 1);
  will-change: transform;
}
.wheel-svg, .wheel-img { display: block; width: 100%; height: 100%; }
.wheel-img { object-fit: contain; user-select: none; -webkit-user-drag: none; }

.wheel-pointer {
  position: absolute;
  top: -11%;
  left: 50%;
  width: 15%;
  transform: translateX(-50%);
  transform-origin: 50% 30%;
  z-index: 5;
  filter: drop-shadow(0 4px 5px rgba(22, 21, 26, 0.35));
}
.wheel-pointer svg { display: block; width: 100%; height: auto; }
.wheel-stage.spinning .wheel-pointer { animation: pointer-tick 0.16s ease-in-out infinite alternate; }
@keyframes pointer-tick { from { transform: translateX(-50%) rotate(0deg); } to { transform: translateX(-50%) rotate(-9deg); } }

.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 25%;
  aspect-ratio: 1;
  z-index: 4;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px var(--ink-900), 0 10px 22px -6px rgba(22, 21, 26, 0.5);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.wheel-hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.94); }
.wheel-hub:disabled { cursor: default; }
.wheel-hub:focus-visible { outline: none; box-shadow: 0 0 0 5px var(--ink-900), 0 0 0 9px #fff, 0 0 0 12px var(--royal); }
.wheel-hub .laby { width: 92% !important; height: 92% !important; }
.wheel-stage.spinning .wheel-hub .laby { --laby-dur: 0.9s !important; }

.wheel-label {
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.wheel-initial { font-family: "Clash Display", sans-serif; font-weight: 700; font-size: 15px; }

/* Tap-to-spin hint that bobs under the wheel until the first spin */
.spin-hint {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-900);
  margin-top: -6px;
  animation: hint-bob 1.6s ease-in-out infinite;
}
@keyframes hint-bob { 50% { transform: translateY(-4px); } }

/* ---------- Result modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(22, 21, 26, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
/* Tall winner form on a short phone: scroll the backdrop, never clip the top of the card */
.modal-backdrop { overflow-y: auto; align-items: flex-start; -webkit-overflow-scrolling: touch; }
.modal-backdrop .modal { margin: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal h2 { font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.modal .prize-name { color: var(--brand-fg); }
.code-box {
  background: var(--ink-50);
  border: 2px dashed var(--royal);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-900);
  user-select: all;
}

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.admin-tab {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border-field);
  background: var(--surface);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-family: "Clash Display", sans-serif;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
  min-height: 48px;
}
.admin-tab:hover { background: var(--ink-50); }
.admin-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat .num { font-family: "Clash Display", sans-serif; font-size: 26px; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--ink-100); }
th {
  background: var(--primary);
  color: var(--on-primary);
  font-family: "Clash Display", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
td { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--ink-50); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ink-100); color: var(--ink-700); }
.tag-ok { background: var(--success-bg); color: var(--success-text); }
.tag-pending { background: var(--warning-bg); color: var(--warning-text); }

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.mini-btn.danger { background: var(--error); color: #fff; }
.mini-btn:hover { background: var(--primary-hover); }
.mini-btn.danger:hover { background: var(--error-text); }
.mini-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-700); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-field);
  border-radius: var(--radius-field);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
}
.field input:hover, .field select:hover { border-color: var(--ink-400); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.14);
}

.error-msg { color: var(--error-text); font-size: 14px; font-weight: 600; text-align: center; min-height: 20px; }

.spin-guard {
  background: var(--warning-bg);
  border: 1.5px solid var(--warning);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--warning-text);
  text-align: center;
  margin-bottom: 4px;
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .prize-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 64px 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-svg { transition-duration: 0.01s; }
  * { animation-duration: 0.01s !important; transition-duration: 0.01s !important; }
}

/* [hidden] must win over display:inline-flex on .btn etc. */
[hidden] { display: none !important; }

/* ---------- Winner claim form ---------- */
.claim-form { display: flex; flex-direction: column; gap: 10px; }
.claim-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-700); text-align: left; }
.claim-form input,
.claim-form textarea {
  font: inherit; font-weight: 500;
  padding: 10px 12px;
  min-height: 44px;
  border: 1.5px solid var(--border-field);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.claim-form input:hover,
.claim-form textarea:hover { border-color: var(--ink-400); }
.claim-form input:focus,
.claim-form textarea:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.14);
}

/* ======================================================================
   Caprics yellow theme — public campaign pages (landing + wheel)
   ====================================================================== */
body.theme-yellow {
  background: radial-gradient(120% 70% at 80% 0%, var(--brand-300) 0%, var(--primary) 58%, #f2b400 100%) fixed;
  background-color: var(--primary);
  color: var(--ink-900);
}
.theme-yellow .topbar { background: transparent; border-bottom: 0; padding-top: 14px; }
.theme-yellow .topbar .brand-logo { height: 64px; filter: drop-shadow(0 4px 8px rgba(60, 42, 8, 0.18)); }
.theme-yellow .hero { padding-top: 8px; }
.theme-yellow .hero p { color: #3a2d0e; }
.theme-yellow .hero h1 .accent {
  display: inline-block;
  color: var(--primary);
  background: var(--ink-900);
  padding: 0 0.28em 0.04em;
  border-radius: 0.22em;
  transform: rotate(-3deg);
}
.theme-yellow .badge { background: var(--ink-900); color: var(--primary); }
.theme-yellow main > .hint, .theme-yellow .stack > .hint { color: var(--brand-900); }
.theme-yellow .card { border-color: rgba(22, 21, 26, 0.08); box-shadow: 0 18px 40px -22px rgba(60, 42, 8, 0.55); }
.theme-yellow .card .hint { color: var(--text-muted); }
.theme-yellow .step-dot { background: rgba(22, 21, 26, 0.18); }
.theme-yellow .step-dot.active { background: var(--ink-900); }

/* On yellow the action button flips to ink with yellow text (bookshelf CTA) */
.theme-yellow .btn-primary,
.theme-yellow .btn-cta {
  background: #241b06;
  color: #ffd25a;
  box-shadow: 0 10px 22px -10px rgba(36, 27, 6, 0.75);
}
.theme-yellow .btn-primary:hover, .theme-yellow .btn-cta:hover { background: #3a2d0e; }
.theme-yellow .btn-primary:active, .theme-yellow .btn-cta:active { background: #000; }
.theme-yellow .btn-cta.btn-xl { min-height: 60px; font-size: 19px; letter-spacing: 0.04em; }

.theme-yellow .spin-guard { background: #fff; }

.footer-note {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-900);
  padding: 8px 0 40px;
}
.footer-note a { color: var(--ink-900); font-weight: 600; }

/* Landing: hero row with the floating labyrinth */
.hero-laby-wrap { display: grid; place-items: center; margin: 4px auto 8px; }

/* Prize list on the landing page */
.prize-list { display: grid; gap: 10px; margin-top: 14px; }
.prize-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.prize-row .swatch {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
}
.prize-row small { display: block; font-weight: 500; color: var(--text-muted); font-size: 12px; }

/* Result modal accents */
.modal .result-burst {
  width: 72px; height: 72px;
  margin: -68px auto 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px #fff, 0 10px 20px -8px rgba(60, 42, 8, 0.6);
  display: grid; place-items: center;
}
.modal .result-burst img { width: 82%; height: 82%; }

/* ---------- Confetti (win) ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: confetti-fall var(--d, 2.4s) cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes confetti-fall {
  to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 540deg)); opacity: 0.9; }
}

/* ======================================================================
   Caprics labyrinth — brand animation (from hub.caprics.in bookshelf)
   mark variant: logo + light sweep running through the maze walls + spark
   hero variant: floating 3-D maze face with a glowing ball rolling through
   ====================================================================== */
.laby { position: relative; display: block; --laby-dur: 3s; }
.laby .laby-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.laby-clip {
  position: absolute; inset: 0; overflow: hidden; border-radius: 50%;
  -webkit-mask: url(/img/brand/caprics-walls-mask.png) center/contain no-repeat;
  mask: url(/img/brand/caprics-walls-mask.png) center/contain no-repeat;
}
.laby-sweep {
  position: absolute; inset: -30%;
  mix-blend-mode: screen;
  will-change: transform;
  animation: laby-spin var(--laby-dur) linear infinite;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(255, 240, 205, 0.12) 68%, rgba(255, 247, 225, 0.92) 80%, #fffdf5 84%, rgba(255, 247, 225, 0.92) 88%, rgba(255, 240, 205, 0.12) 96%, transparent 100%);
}
.laby-sweep.b { animation-duration: calc(var(--laby-dur) * 1.6); animation-direction: reverse; opacity: 0.55; }
.laby-spark { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.laby-cpulse {
  position: absolute; left: 50%; top: 50%; width: 22%; height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: laby-cpulse var(--laby-dur) ease-in-out infinite;
}
@keyframes laby-spin { to { transform: rotate(360deg); } }
@keyframes laby-cpulse {
  0%, 58% { box-shadow: 0 0 0 0 rgba(255, 231, 150, 0); }
  80% { box-shadow: 0 0 15px 3px rgba(255, 231, 150, 0.7); }
  to { box-shadow: 0 0 0 0 rgba(255, 231, 150, 0); }
}

.laby-hero { perspective: 1100px; }
.laby-halo { position: absolute; inset: -12%; z-index: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 252, 242, 0.5), rgba(255, 252, 242, 0) 60%); }
.laby-tilt { position: absolute; inset: 0; z-index: 2; transform-style: preserve-3d; will-change: transform; animation: laby-float 13s ease-in-out infinite; }
@keyframes laby-float {
  0% { transform: rotateX(5deg) rotateY(-8deg) translateY(-1.6%); }
  50% { transform: rotateX(-4deg) rotateY(8deg) translateY(2%); }
  to { transform: rotateX(5deg) rotateY(-8deg) translateY(-1.6%); }
}
.laby-face, .laby-spec {
  position: absolute; inset: 0;
  -webkit-mask: url(/img/brand/caprics-walls-mask.png) center/contain no-repeat;
  mask: url(/img/brand/caprics-walls-mask.png) center/contain no-repeat;
}
.laby-face { background: #2a1f07; filter: drop-shadow(0 6px 11px rgba(42, 31, 7, 0.32)); }
.laby-spec {
  background: linear-gradient(115deg, transparent 38%, rgba(255, 248, 224, 0.9) 50%, transparent 62%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: 0.7;
  animation: laby-sheen 7s ease-in-out infinite;
}
@keyframes laby-sheen { 0% { background-position: 0% 0; } 50% { background-position: 100% 0; } to { background-position: 0% 0; } }
.laby-ballsvg { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.laby-ball { fill: #fff4da; filter: drop-shadow(0 0 2px rgba(255, 236, 180, 0.95)) drop-shadow(0 0 5px rgba(255, 206, 96, 0.55)); }
.laby-shadow {
  position: absolute; left: 14%; right: 14%; bottom: -3%; height: 11%; z-index: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(60, 42, 8, 0.3), transparent 70%);
  filter: blur(7px);
  animation: laby-shadow 13s ease-in-out infinite;
}
@keyframes laby-shadow { 0%, to { transform: scale(0.9); opacity: 0.55; } 50% { transform: scale(1.04); opacity: 0.72; } }
.hero-laby-in { animation: hero-laby-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes hero-laby-in { 0% { opacity: 0; transform: scale(0.84); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .laby-sweep, .laby-spark, .laby-cpulse, .laby-ballsvg, .confetti { display: none; }
  .laby-tilt { animation: none; transform: rotateX(4deg) rotateY(-6deg); }
  .laby-spec, .laby-shadow, .hero-laby-in, .spin-hint { animation: none; }
  .wheel-rotor { transition-duration: 0.01s; }
}

/* ---------- Admin: funnel + breakdowns ---------- */
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 92px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.funnel-bar { height: 26px; border-radius: 8px; background: var(--ink-100); overflow: hidden; }
.funnel-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 8px; min-width: 2px; }
.funnel-row .pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-700); }
.funnel-row .pct small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.mini-table { width: 100%; font-size: 13px; }
.mini-table td, .mini-table th { padding: 8px 10px; }
.analytics-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .analytics-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .funnel-row { grid-template-columns: 110px 1fr 70px; font-size: 13px; } }

/* Claim form details */
.claim-form label > span b { color: var(--error-text); font-weight: 700; }
.claim-form label > span em { font-style: normal; font-weight: 500; color: var(--text-muted); }
.claim-form input.readonly { background: var(--brand-bg); border-color: var(--primary); color: var(--brand-900); font-weight: 600; cursor: default; }
.claim-form input[aria-invalid] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12); }
.claim-form input[type="date"] { min-height: 44px; -webkit-appearance: none; appearance: none; }
.field-error { color: var(--error-text); font-size: 12px; font-weight: 600; }

/* ---------- Result card, phone-first ---------- */
.modal-backdrop { padding: 56px 14px 24px; }
.modal { padding: 26px 18px 20px; border-radius: 22px; }
.modal h2 { font-size: 26px; outline: none; }
.modal .prize-name { font-size: 19px; line-height: 1.3; display: inline-block; }
.modal .result-burst { width: 64px; height: 64px; margin: -58px auto 8px; }
.modal .code-hint { margin-top: 10px; font-size: 13px; }
.modal .code-box { margin: 8px 0 4px; padding: 10px; font-size: 20px; }
.claim-section { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--ink-250); text-align: left; }
.claim-section .claim-intro { text-align: left; margin-bottom: 10px; font-size: 14px; }
.claim-form { gap: 12px; }
.claim-form input { font-size: 16px; } /* 16px stops iOS zooming into fields */
.modal-actions { margin-top: 12px; }
.modal-actions:not(:has(> :not([hidden]))) { display: none; }
#claimBtn { min-height: 54px; margin-top: 4px; }
@media (min-width: 480px) { .modal { padding: 32px 26px 24px; } }

/* ---------- Admin: full-width office layout ---------- */
.admin-page .container { max-width: 1440px; padding: 0 clamp(16px, 3vw, 40px); }
.admin-page .topbar { justify-content: flex-start; padding: 10px clamp(16px, 3vw, 40px); }
.admin-page .campaign-bar .field { max-width: 480px; }
.admin-page #campaignUrl { text-align: left; }
.admin-page .admin-tabs { flex-wrap: nowrap; overflow-x: auto; }
.admin-page .admin-tab { flex: 0 0 auto; padding: 12px 22px; }
.admin-page .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-page #loginView { max-width: 440px; margin-inline: auto; }
.admin-page #logoutBtn { width: auto; padding-inline: 32px; }
.admin-page td { vertical-align: top; }
@media (max-width: 640px) { .admin-page .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Admin: wheel set-up ---------- */
.setup-help { margin-top: 0; }
.setup-help h3, .odds-preview h3 { font-size: 16px; margin-bottom: 8px; }
.setup-help ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-700); }
.prize-setup { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .prize-setup { grid-template-columns: minmax(0, 1fr) 340px; } }
.prize-table th.r, .prize-table td.r { text-align: right; }
.prize-table td { vertical-align: middle; }
.prize-table input[type="text"], .prize-table input[type="number"], .prize-table select {
  font: inherit; font-weight: 500; min-height: 40px; padding: 6px 10px;
  border: 1.5px solid var(--border-field); border-radius: 10px; background: var(--surface); color: var(--text);
}
.prize-table input[type="text"] { width: 100%; min-width: 220px; }
.prize-table input[type="number"] { width: 84px; text-align: right; }
.prize-table input:disabled { background: var(--ink-50); color: var(--ink-400); }
.prize-table input[type="checkbox"] { width: 22px; height: 22px; }
.prize-table .pct-field { display: inline-flex; align-items: center; gap: 4px; }
.prize-table .pct-field b { font-weight: 600; color: var(--ink-600); }
.prize-table tfoot td { background: var(--ink-50); border-top: 2px solid var(--ink-200); }
.spoke-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.pct-total { font-family: "Clash Display", sans-serif; font-weight: 700; font-size: 18px; padding: 4px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.pct-total.ok { background: var(--success-bg); color: var(--success-text); }
.pct-total.bad { background: #fdecea; color: var(--error-text); }
.odds-preview { margin: 0; display: grid; gap: 10px; }
.big-stat { display: grid; }
.big-stat span { font-family: "Clash Display", sans-serif; font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.big-stat small { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.odds-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.odds-list li { display: grid; gap: 1px; padding: 8px 10px; background: var(--ink-50); border-radius: 10px; }
.odds-list li small { color: var(--text-muted); font-size: 12px; }
.save-bar { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
  padding: 12px 0; margin-top: 12px; background: linear-gradient(to top, var(--surface) 70%, transparent); }
