/* =========================================================
   Spindle — style.css
   Bright, clean, premium SaaS look for a US audience.
   Indigo/violet primary on white, warm playful accent set
   per tool, Sora display type + Inter body.
   ========================================================= */

:root {
  --bg:          #FFFFFF;
  --bg-soft:     #F6F7FB;
  --surface:     #FFFFFF;
  --border:      #E7E9F3;
  --ink:         #16182B;
  --ink-muted:   #6B7080;

  --primary:      #6C5CE7;
  --primary-600:  #5A4BD1;
  --primary-100:  #EFECFE;

  --coral:  #FF6B6B;
  --teal:   #00B39B;
  --amber:  #F5A623;
  --blue:   #3B82F6;
  --pink:   #EC4899;
  --green:  #10B981;

  --font-head: 'Sora', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(22,24,43,0.06);
  --shadow-md: 0 8px 24px rgba(22,24,43,0.08);
  --shadow-lg: 0 20px 48px rgba(22,24,43,0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.15; color: var(--ink); }

/* ---------------- Header / Nav ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }

.nav-link {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover { color: var(--ink); background: var(--bg-soft); }

.nav-link.is-active { color: var(--primary-600); background: var(--primary-100); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2.5px; background: var(--ink); border-radius: 2px; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; flex-direction: column; width: 100%; padding-top: 10px; align-items: stretch; }
  .site-nav.is-open { display: flex; }
  .nav-link { width: 100%; }
}

/* ---------------- Hero (home) ---------------- */

.hero {
  padding: 84px 0 56px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; text-align: center; }
  .hero-visual { order: -1; }
}

.eyebrow-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-100);
  color: var(--primary-600);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.hero-title {
  font-size: clamp(2.6rem, 5.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-title .accent { color: var(--primary); }

.hero-sub {
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 46ch;
}

@media (max-width: 860px) { .hero-sub { margin-inline: auto; } }

.hero-cta {
  margin-top: 32px;
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 860px) { .hero-cta { justify-content: center; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-600); }

.hero-stats {
  margin-top: 34px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
@media (max-width: 860px) { .hero-stats { justify-content: center; } }
.hero-stat strong { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--ink); }
.hero-stat span { font-size: 0.85rem; color: var(--ink-muted); }

.hero-visual { display: flex; justify-content: center; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

.hero-wheel { width: min(320px, 78vw); height: min(320px, 78vw); animation: hero-spin 26s linear infinite; }
@keyframes hero-spin { to { transform: rotate(360deg); } }

.hero-badge {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-badge.b1 { top: -14px; right: -18px; color: var(--green); }
.hero-badge.b2 { bottom: -14px; left: -18px; color: var(--primary-600); }
@media (max-width: 500px) { .hero-badge { display: none; } }

/* ---------------- Tool grid ---------------- */

.tools-section { padding: 30px 0 90px; }

.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-head p { margin-top: 10px; color: var(--ink-muted); font-size: 1.05rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .game-grid { grid-template-columns: 1fr; } }

.game-box {
  --accent: var(--primary);
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 26px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: block;
}

.game-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.game-box .icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.game-box .icon-badge svg { width: 26px; height: 26px; }

.game-box h3 { font-size: 1.2rem; margin-bottom: 8px; }

.game-box p { margin: 0; font-size: 0.94rem; color: var(--ink-muted); }

.game-box .tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------------- Trust strip ---------------- */

.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 28px 0;
}
.trust-inner {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.trust-item svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }

/* ---------------- Tool page shell ---------------- */

.tool-hero { padding: 56px 0 8px; text-align: center; }

.tool-hero h1 { font-size: clamp(2rem, 4.6vw, 2.7rem); letter-spacing: -0.02em; }

.tool-hero p { color: var(--ink-muted); max-width: 56ch; margin: 14px auto 0; font-size: 1.05rem; }

.tool-stage {
  max-width: 720px;
  margin: 40px auto 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: 24px;
  padding: 40px 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
  margin-top: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field input, .field select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  min-width: 100px;
}
.field input:focus, .field select:focus { border-color: var(--primary); outline: none; }

.result-line {
  margin-top: 26px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  min-height: 1.4em;
  color: var(--primary-600);
}

.tool-page-nav {
  max-width: 720px;
  margin: 44px auto 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tool-page-nav a {
  text-decoration: none;
  background: var(--bg-soft);
  color: var(--ink-muted);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tool-page-nav a:hover { color: var(--primary-600); border-color: var(--primary); }

/* ---- Wheel tool ---- */
.wheel-wrap { display: flex; justify-content: center; position: relative; }
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--ink);
  z-index: 5;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}
#wheelCanvas { transition: transform 4.5s cubic-bezier(0.15, 0.85, 0.2, 1); border-radius: 50%; box-shadow: 0 0 0 6px #fff, 0 0 0 8px var(--border), var(--shadow-lg); }

/* ---- Dice tool ---- */
.dice-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.die {
  width: 74px; height: 74px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 11px;
  box-shadow: var(--shadow-md);
  transition: transform 0.6s ease;
}
.die.is-rolling { animation: die-shake 0.15s infinite; }
@keyframes die-shake { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.pip { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); align-self: center; justify-self: center; opacity: 0; }
.pip.on { opacity: 1; }

/* ---- Pocket Draw (carrom) tool ---- */
.carrom-board {
  width: min(320px, 80vw);
  height: min(320px, 80vw);
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, #FBF7FF 0%, var(--primary-100) 78%, #E3DCFB 100%);
  border: 8px solid #fff;
  box-shadow: 0 0 0 2px var(--border), var(--shadow-lg);
  position: relative;
}
.carrom-coin {
  position: absolute;
  top: 50%; left: 50%;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: var(--primary-600);
  transform: translate(-50%, -50%);
  transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: var(--shadow-sm);
}
.carrom-striker {
  position: absolute;
  bottom: 6px; left: 50%;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  transform: translateX(-50%);
  transition: transform 0.5s ease;
}

/* ---- Coin flip tool ---- */
.coin-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 10px; perspective: 600px; }
.coin {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FCD34D, var(--amber));
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; color: #7A4E00;
  box-shadow: var(--shadow-md);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

/* ---- Range / Lottery tool ---- */
.number-out { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.number-chip {
  min-width: 54px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

/* ---------------- Footer ---------------- */

.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 40px 0 30px; }

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.footer-brand-link { text-decoration: none; }
.footer-brand-text { font-size: 1.1rem; }

.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { font-size: 0.9rem; color: var(--ink-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--primary-600); }

.footer-bottom { padding-top: 22px; text-align: center; }

.footer-note { margin: 0 0 8px; font-size: 0.85rem; color: var(--ink-muted); max-width: 60ch; margin-inline: auto; }
.footer-note code { background: #fff; border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--primary-600); }

.footer-copy { margin: 0; font-size: 0.82rem; color: var(--ink-muted); opacity: 0.8; }
