/* SpinTheWheel – Public styles (mobile-first, no frameworks) */

:root {
  --primary: #e85d04;
  --primary-dark: #d00000;
  --secondary: #370617;
  --accent: #faa307;
  --bg: #fff8f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e8d9c8;
  --success: #2d6a4f;
  --warning: #b08900;
  --danger: #9b2226;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(55, 6, 23, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --max: 1100px;
  --header-h: 56px;
  --focus: 0 0 0 3px rgba(232, 93, 4, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(250, 163, 7, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 93, 4, 0.12), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--secondary);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Layout */
.container {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--secondary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary),
    var(--accent),
    var(--primary-dark),
    var(--primary)
  );
  box-shadow: inset 0 0 0 3px #fff;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--secondary);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(232, 93, 4, 0.1);
  color: var(--primary-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

/* Forms */
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  margin-bottom: 1rem;
}

.form-hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.35rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Hero / Wheel */
.hero {
  padding: 1.25rem 0 2rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
}

.brand-hero {
  font-family: var(--display);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--secondary);
  margin: 0 0 0.5rem;
}

.hero-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.wheel-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.wheel-stage {
  position: relative;
  width: min(100%, 360px);
  margin: 0.5rem auto 1.25rem;
  aspect-ratio: 1;
  max-width: 100%;
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  touch-action: none;
  background: conic-gradient(
    from 0deg,
    #e85d04 0 60deg,
    #faa307 60deg 120deg,
    #dc2f02 120deg 180deg,
    #9d0208 180deg 240deg,
    #f48c06 240deg 300deg,
    #ae2012 300deg 360deg
  );
  box-shadow: 0 10px 28px rgba(55, 6, 23, 0.18);
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--secondary);
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.wheel-center-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--secondary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.wheel-center-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.wheel-center-btn:focus-visible {
  box-shadow: var(--focus), 0 6px 16px rgba(0,0,0,0.25);
}

.wheel-result {
  text-align: center;
  min-height: 3.25rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(232, 93, 4, 0.08);
  border: 1px dashed var(--border);
}

.wheel-result.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.wheel-result.is-winner {
  background: rgba(45, 106, 79, 0.12);
  border-style: solid;
  border-color: #95d5b2;
  animation: winner-pop 0.35s ease;
}

.wheel-result span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.wheel-result strong {
  display: block;
  margin-top: 0.2rem;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  color: var(--primary-dark);
  line-height: 1.2;
  word-break: break-word;
}

@keyframes winner-pop {
  from { transform: scale(0.96); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

.wheel-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  max-height: 280px;
  overflow: auto;
}

.option-list:empty::after {
  content: "No options yet. Add Option 1, Option 2, and more above.";
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.option-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 0.35rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.4rem;
}

.option-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  justify-self: center;
}

.option-item input {
  min-height: 40px;
  border: none;
  background: transparent;
  width: 100%;
}

.option-item button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.option-item button:hover {
  background: rgba(155, 34, 38, 0.08);
  color: var(--danger);
}

.option-item button[data-move]:hover {
  background: rgba(232, 93, 4, 0.1);
  color: var(--primary-dark);
}

.option-item button:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  flex-shrink: 0;
}

.btn .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.share-bar a,
.share-bar button {
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.share-bar .icon {
  width: 1rem;
  height: 1rem;
}

.add-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.options-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}

.options-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.options-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.storage-note {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(45, 106, 79, 0.1);
  border: 1px solid #95d5b2;
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
}

.storage-note[hidden] {
  display: none;
}

/* Content sections */
.section {
  padding: 2rem 0;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  margin: 0 0 0.5rem;
  color: var(--secondary);
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.prose {
  max-width: 70ch;
}

.prose h2,
.prose h3 {
  color: var(--secondary);
  line-height: 1.25;
}

.prose p,
.prose li {
  color: var(--text);
  line-height: 1.65;
}

.wheel-side-copy {
  max-width: none;
}

.wheel-side-copy h2 {
  margin-top: 0;
}

.wheel-side-copy h3 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.wheel-side-copy ul,
.wheel-side-copy ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
}

.wheel-side-copy li {
  margin-bottom: 0.35rem;
}

.content-card,
.related-grid a,
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-grid,
.tool-grid {
  display: grid;
  gap: 0.75rem;
}

.tool-card h3,
.related-grid h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--secondary);
}

.tool-card p,
.related-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--secondary);
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1rem 0;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: #d8f3dc; color: var(--success); }
.badge-warning { background: #fff3bf; color: #7a6200; }
.badge-muted { background: #eee; color: #555; }
.badge-danger { background: #ffd6d6; color: var(--danger); }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.alert-success { background: #d8f3dc; border-color: #95d5b2; }
.alert-error { background: #ffe3e3; border-color: #ffa8a8; }
.alert-info { background: #e7f5ff; border-color: #a5d8ff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-form {
  margin-top: 1.5rem;
  max-width: 36rem;
}

.contact-form .hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

.wheel-feedback {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 186, 8, 0.12), rgba(255, 255, 255, 0.7));
  animation: fb-in 0.45s ease-out;
}

@keyframes fb-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wheel-feedback-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: var(--secondary);
}

.wheel-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wheel-feedback-actions .btn.is-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.wheel-feedback-comment {
  margin-top: 0.85rem;
}

.wheel-feedback-comment textarea {
  width: 100%;
}

.wheel-feedback-thanks {
  margin: 0;
  font-weight: 600;
  color: var(--secondary);
}

.recent-winners {
  margin-top: 1.25rem;
}

.recent-winners-title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.recent-winners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.recent-winners-list > .rw-item,
.recent-winners-list > .recent-winners-empty {
  border-radius: 10px;
  background: rgba(55, 6, 23, 0.04);
  border: 1px solid rgba(55, 6, 23, 0.08);
}

.recent-winners-list > .rw-item {
  padding: 0;
  overflow: hidden;
}

.recent-winners-list > .rw-item.rw-flash {
  animation: rw-flash 0.55s ease;
}

@keyframes rw-flash {
  from { background: rgba(250, 163, 7, 0.28); transform: translateY(-4px); }
  to { background: rgba(55, 6, 23, 0.04); transform: translateY(0); }
}

.rw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}

.rw-item.is-expandable .rw-row {
  cursor: pointer;
}

.rw-item.is-expandable .rw-row:hover {
  background: rgba(55, 6, 23, 0.04);
}

.rw-label {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.rw-mult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: var(--secondary);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}

.rw-times {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem 0.55rem;
  display: grid;
  gap: 0.25rem;
  border-top: 1px solid rgba(55, 6, 23, 0.08);
}

.rw-times li {
  padding: 0.2rem 0 0.2rem 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
  border: 0;
  background: transparent;
}

.recent-winners-empty {
  color: var(--muted);
  font-size: 0.9rem;
  border: none !important;
  background: transparent !important;
  padding: 0.35rem 0 !important;
}

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 2rem 0;
  color: var(--muted);
}

.footer-learn {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.footer-learn a {
  color: var(--secondary);
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

.footer-grid h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--secondary);
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid a {
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem 0;
}

.footer-grid a:hover {
  color: var(--primary-dark);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.blog-list {
  display: grid;
  gap: 1rem;
}

.blog-item h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.blog-item h2 a {
  text-decoration: none;
  color: var(--secondary);
}

.meta-line {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Tablet+ */
@media (min-width: 720px) {
  .nav-toggle { display: none; }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .site-nav ul {
    display: flex;
    gap: 0.15rem;
  }

  .site-nav a {
    padding: 0.5rem 0.7rem;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  .wheel-side-copy {
    padding: 0.25rem 0 0.5rem;
  }

  .related-grid,
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .wheel-toolbar {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 980px) {
  .related-grid,
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wheel-stage {
    width: min(100%, 420px);
  }
}

@media (min-width: 1200px) {
  :root { --max: 1180px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
