/* =============================================
   SpinTheWheel4Me — Shared Stylesheet
   Colour identity: Vibrant purple + warm orange
   Structure mirrors HealthCalc4Me
   ============================================= */

:root {
  --primary:       #6a1b9a;
  --primary-mid:   #7b1fa2;
  --primary-light: #9c27b0;
  --primary-pale:  #f3e5f5;
  --accent:        #ff6f00;
  --accent-light:  #fff3e0;
  --accent2:       #f9a825;
  --bg:            #faf5ff;
  --white:         #ffffff;
  --card:          #ffffff;
  --text:          #1a0a2e;
  --text-muted:    #6d4c8a;
  --border:        #e1bee7;
  --shadow:        0 2px 12px rgba(106,27,154,0.10);
  --shadow-lg:     0 6px 30px rgba(106,27,154,0.15);
  --radius:        12px;
  --radius-sm:     8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { font-family: 'Nunito', 'Segoe UI', sans-serif; font-weight: 800; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p  { margin-bottom: 0.75rem; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
header {
  background: linear-gradient(135deg, #4a0072 0%, #6a1b9a 50%, #7b1fa2 100%);
  color: white;
  padding: 0 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; gap: 1rem; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo-icon { font-size: 2rem; }
.logo-text { display: flex; flex-direction: column; }
.logo-text strong { font-family: 'Nunito',sans-serif; font-size: 1.4rem; font-weight: 900; color: white; letter-spacing: -0.5px; }
.logo-text span   { font-size: 0.75rem; color: #ce93d8; margin-top: -2px; }
nav.main-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
nav.main-nav a { color: #ce93d8; font-size: 0.88rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 6px; transition: background 0.2s,color 0.2s; text-decoration: none; }
nav.main-nav a:hover { background: rgba(255,255,255,0.15); color: white; }
nav.main-nav a.active { background: rgba(255,255,255,0.2); color: white; }

/* Quick access bar */
.quick-access {
  background: rgba(0,0,0,0.15);
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.quick-access span { color: #ce93d8; margin-right: 0.4rem; }
.quick-access a { color: white; margin: 0 0.3rem; text-decoration: none; font-weight: 600; transition: color 0.2s; }
.quick-access a:hover { color: var(--accent2); }

/* ---- Ad Leaderboard ---- */
.ad-leaderboard { background: var(--primary-pale); border-bottom: 1px solid var(--border); text-align: center; padding: 0.5rem 1rem; }
.ad-placeholder { display: inline-flex; align-items: center; justify-content: center; background: #ede7f6; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.8rem; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #f3e5f5 0%, #fce4ec 50%, #fff3e0 100%);
  border-bottom: 2px solid var(--border);
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.hero h1 { color: var(--primary); margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 600px; margin: 0 auto 1rem; }
.hero-badges { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.badge { background: var(--white); border: 1px solid var(--border); border-radius: 50px; padding: 0.3rem 0.9rem; font-size: 0.8rem; font-weight: 600; color: var(--primary); }

/* ---- Main ---- */
main { flex: 1; max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; width: 100%; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.card-title { font-family: 'Nunito',sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--primary); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.4rem; }

/* ---- Tools grid (homepage) ---- */
.tools-category { margin-bottom: 2rem; }
.tools-category h2 { color: var(--primary); font-size: 1.1rem; margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--border); display: flex; align-items: center; gap: 0.4rem; }
.tool-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.tool-card-link {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem; text-align: center; text-decoration: none; color: var(--text);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.tool-card-link:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary-light); text-decoration: none; }
.tool-card-link.current { border-color: var(--primary); background: var(--primary-pale); }
.tool-card-link .tc-icon { font-size: 2rem; }
.tool-card-link .tc-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.tool-card-link .tc-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.7rem 1.6rem; border-radius: var(--radius-sm); font-weight: 700; font-size: 1rem; font-family: 'Nunito',sans-serif; cursor: pointer; border: none; transition: transform 0.15s, box-shadow 0.15s, background 0.2s; text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-mid); }
.btn-accent  { background: var(--accent); color: white; }
.btn-accent:hover  { background: #e65100; }
.btn-outline { background: white; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-pale); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.15rem; border-radius: 50px; }

/* ---- Form elements ---- */
input[type=text], input[type=number], textarea, select {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.65rem 1rem; font-size: 0.95rem; font-family: 'Inter',sans-serif;
  color: var(--text); background: var(--white); transition: border-color 0.2s, box-shadow 0.2s; outline: none; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(156,39,176,0.15); }
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.field { margin-bottom: 1rem; }

/* ---- Spin Wheel specific ---- */
.wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.wheel-container {
  position: relative;
  display: inline-block;
}
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 32px solid var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  z-index: 10;
}
#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(106,27,154,0.25), 0 0 0 4px var(--primary);
  cursor: pointer;
  transition: transform 0.1s;
  display: block;
}
#wheel-canvas:hover { transform: scale(1.01); }
.result-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius);
  padding: 1rem 2rem;
  text-align: center;
  min-width: 260px;
  box-shadow: var(--shadow-lg);
}
.result-box .result-label { font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.2rem; }
.result-box .result-value { font-family: 'Nunito',sans-serif; font-size: 1.8rem; font-weight: 900; }
.entries-list { list-style: none; max-height: 280px; overflow-y: auto; }
.entries-list li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.entries-list li .colour-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.entries-list li .entry-name { flex: 1; font-weight: 600; }
.entries-list li .entry-count { font-size: 0.78rem; color: var(--text-muted); }
.entries-list li .remove-btn { background: none; border: none; cursor: pointer; color: #c62828; font-size: 1rem; padding: 0 0.2rem; }
.preset-btn { background: white; border: 1.5px solid var(--border); border-radius: 50px; padding: 0.3rem 0.8rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text); transition: background 0.15s, border-color 0.15s; }
.preset-btn:hover { background: var(--primary-pale); border-color: var(--primary-light); }
.history-item { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; display: flex; justify-content: space-between; }
.history-item .h-val { font-weight: 700; color: var(--primary); }
.history-item .h-time { color: var(--text-muted); font-size: 0.78rem; }

/* ---- Coin flip ---- */
.coin {
  width: 140px; height: 140px; border-radius: 50%;
  margin: 1rem auto;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.coin-face {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito',sans-serif; font-size: 2.5rem; font-weight: 900;
  backface-visibility: hidden;
}
.coin-heads { background: linear-gradient(135deg, #f9a825, #ff6f00); color: white; }
.coin-tails { background: linear-gradient(135deg, #7b1fa2, #4a0072); color: white; transform: rotateY(180deg); }
@keyframes coinFlip { 0%{transform:rotateY(0)} 100%{transform:rotateY(1800deg)} }
.flipping { animation: coinFlip 1.2s ease-out forwards; }

/* ---- Yes/No ---- */
.yn-display {
  font-family: 'Nunito',sans-serif; font-size: 4rem; font-weight: 900;
  text-align: center; padding: 2rem; border-radius: var(--radius);
  margin: 1rem 0; transition: all 0.3s;
  min-height: 140px; display: flex; align-items: center; justify-content: center;
}
.yn-yes { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #2e7d32; }
.yn-no  { background: linear-gradient(135deg, #ffebee, #ffcdd2); color: #c62828; }
.yn-maybe { background: linear-gradient(135deg, #fff8e1, #fff3e0); color: #f57f17; }
@keyframes bounceIn { 0%{transform:scale(0.5);opacity:0} 60%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }
.yn-animate { animation: bounceIn 0.4s ease-out; }

/* ---- Number generator ---- */
.big-number {
  font-family: 'Nunito',sans-serif; font-size: 5rem; font-weight: 900;
  color: var(--primary); text-align: center; padding: 1.5rem;
  background: var(--primary-pale); border-radius: var(--radius);
  margin: 1rem 0; letter-spacing: -2px;
  min-height: 140px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
@keyframes rollNum { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.rolling { animation: rollNum 0.3s ease-in-out 3; }

/* ---- Name picker ---- */
.picked-name {
  font-family: 'Nunito',sans-serif; font-size: 3rem; font-weight: 900;
  color: var(--primary); text-align: center; padding: 1.5rem;
  background: var(--primary-pale); border-radius: var(--radius);
  margin: 1rem 0; word-break: break-word;
  min-height: 120px; display: flex; align-items: center; justify-content: center;
}
@keyframes shuffle { 0%,100%{opacity:1} 50%{opacity:0.3} }
.shuffling { animation: shuffle 0.1s ease-in-out 8; }

/* ---- Network nav ---- */
.network-nav { background: var(--primary-pale); border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); padding: 2rem 1rem; margin: 2rem 0; }
.network-nav h2 { text-align: center; color: var(--primary); margin-bottom: 1.2rem; font-size: 1.1rem; }
.network-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 0.7rem; }
.net-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; text-align: center; text-decoration: none; color: var(--text); transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.net-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary-light); text-decoration: none; }
.net-card .nc-icon { font-size: 1.5rem; }
.net-card .nc-name { font-size: 0.77rem; font-weight: 700; }
.net-card .nc-site { font-size: 0.67rem; color: var(--text-muted); }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 600; }
.alert-info { background: #e3f2fd; border-left: 4px solid #1976d2; color: #0d47a1; }
.alert-success { background: #e8f5e9; border-left: 4px solid #2e7d32; color: #1b5e20; }
.alert-fun { background: var(--primary-pale); border-left: 4px solid var(--primary); color: var(--primary); }

/* ---- GDPR banner ---- */
#cookie-banner { position: fixed; bottom:0; left:0; right:0; background: #1a0a2e; color: #e1bee7; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; z-index: 9999; box-shadow: 0 -4px 20px rgba(0,0,0,0.3); }
#cookie-banner p { font-size: 0.88rem; margin: 0; flex: 1; min-width: 200px; }
#cookie-banner a { color: #ce93d8; }
.cookie-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cookie-btns button { padding: 0.5rem 1.1rem; border-radius: 6px; font-weight: 700; font-size: 0.85rem; cursor: pointer; border: none; }
#cookie-accept { background: var(--primary-light); color: white; }
#cookie-decline { background: transparent; border: 1px solid #ce93d8 !important; color: #ce93d8; }

/* ---- Footer ---- */
footer { background: #1a0a2e; color: #9e7ab5; text-align: center; padding: 2rem 1rem; margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.8rem; }
.footer-links a { color: #9e7ab5; font-size: 0.85rem; }
.footer-links a:hover { color: #ce93d8; }
.footer-copy { font-size: 0.8rem; color: #5d3f7a; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media(max-width:700px){
  .grid-2 { grid-template-columns: 1fr; }
  nav.main-nav { display: none; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
