/* ==========================================================================
   SelectAWheel — Design System (v12)
   Changes from v11:
     - FIX: .cta-btn inside .content-block now shows white text
       (was being overridden by the higher-specificity .content-block a rule)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;

  --brand-800: #1e40af;
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-200: #bfdbfe;
  --brand-50: #eff6ff;

  --accent-500: #f59e0b;
  --accent-600: #d97706;

  --success-500: #10b981;
  --success-50: #ecfdf5;
  --success-700: #047857;

  --danger-500: #ef4444;

  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.16);

  --max-width: 1440px;
  --header-h: 68px;
  --app-pad: 24px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
img,
canvas {
  display: block;
  max-width: 100%;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}
canvas:focus-visible {
  outline-offset: 6px;
  border-radius: 50%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  background: var(--ink-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent-500), var(--brand-500));
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.main-nav a {
  color: var(--ink-300);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition:
    color 0.15s,
    background 0.15s;
}
.main-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ==========================================================================
   App Shell
   ========================================================================== */
.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--app-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: var(--app-pad);
  align-items: stretch;
  min-height: calc(100vh - var(--header-h));
}

.wheel-area {
  background: linear-gradient(
    135deg,
    #eef2ff 0%,
    #e0e7ff 25%,
    #dbeafe 55%,
    #f0f9ff 80%,
    #f8fafc 100%
  );
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.wheel-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(147, 197, 253, 0.22) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 85% 85%,
      rgba(196, 181, 253, 0.22) 0%,
      transparent 55%
    );
  pointer-events: none;
}

.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--ink-900);
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.25));
  z-index: 10;
}
.pointer::after {
  content: "";
  position: absolute;
  top: -34px;
  left: -10px;
  width: 20px;
  height: 20px;
  background: var(--ink-900);
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.2);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow:
    0 0 0 10px #ffffff,
    0 0 0 12px rgba(148, 163, 184, 0.22),
    0 18px 40px rgba(15, 23, 42, 0.18);
  transition: box-shadow 0.3s;
}

.spin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}
.spin-btn {
  padding: 0 64px;
  height: 58px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-radius: var(--radius-full);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
}
.spin-btn:active:not(:disabled) {
  transform: translateY(0);
}
.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.spin-btn-text {
  position: relative;
  z-index: 1;
}

.mute-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--ink-700);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--ink-200);
  box-shadow: var(--shadow-sm);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.mute-btn:hover {
  background: var(--ink-50);
  border-color: var(--ink-300);
}
.mute-btn[data-muted="1"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger-500);
}
.mute-btn .mute-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.result-box {
  padding: 12px 28px;
  background: #ffffff;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}
.result-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.result-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  word-break: break-word;
}
.result-box.winner {
  background: var(--success-50);
  border: 1.5px solid var(--success-500);
  border-style: solid;
}
.result-box.winner .result-value {
  color: var(--success-700);
}
.result-box.winner .result-label {
  color: var(--success-500);
}
.result-box.spinning {
  border-style: solid;
  border-color: var(--brand-500);
  background: var(--brand-50);
}

/* ----- Sidebar ----- */
.sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--header-h) - (var(--app-pad) * 2));
  overflow-y: auto;
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-100);
}
.share-btn,
.import-btn,
.shuffle-btn,
.sort-btn,
.history-toggle-btn,
.hub-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.share-btn:hover,
.import-btn:hover,
.shuffle-btn:hover,
.sort-btn:hover,
.history-toggle-btn:hover,
.hub-logo-btn:hover {
  background: #dbeafe;
  border-color: var(--brand-500);
}
.history-toggle-btn {
  color: var(--ink-700);
  background: var(--ink-100);
  border-color: var(--ink-200);
}
.history-toggle-btn:hover {
  background: var(--ink-200);
  border-color: var(--ink-300);
  color: var(--ink-900);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-100);
}
.preset-btn {
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-700);
  background: var(--ink-100);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-full);
  transition: all 0.15s;
}
.preset-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-700);
}
.preset-btn.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.preset-btn.active:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
}

.sidebar-advanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-100);
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.toolbar-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.theme-select {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-800);
  background: #fff;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-select:focus {
  outline: 2px solid var(--brand-500);
}
.btn-mini-danger {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--danger-500);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-mini-danger:hover {
  background: #fee2e2;
}

.sidebar-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-900);
}
.entry-count {
  font-size: 0.76rem;
  color: var(--ink-500);
  background: var(--ink-100);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

#entriesInput {
  width: 100%;
  flex: 1 1 auto;
  min-height: 220px;
  padding: 14px 16px;
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink-800);
  resize: vertical;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
#entriesInput:focus {
  outline: none;
  border-color: var(--brand-500);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-50);
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hint {
  font-size: 0.78rem;
  color: var(--ink-500);
}
.hint code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--ink-100);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-800);
}
.btn-ghost {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-500);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition:
    color 0.15s,
    background 0.15s;
}
.btn-ghost:hover {
  color: var(--danger-500);
  background: #fef2f2;
}

.history-panel {
  display: none;
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 12px;
}
.history-panel.open {
  display: block;
}
.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.history-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-800);
}
.history-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.history-time {
  color: var(--ink-400);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}
.history-label {
  font-weight: 600;
  color: var(--ink-800);
}
.history-empty {
  font-size: 0.78rem;
  color: var(--ink-400);
  text-align: center;
  padding: 12px 0;
}

/* ==========================================================================
   Trust bar
   ========================================================================== */
.trust-bar {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 0 24px;
  text-align: center;
}
.trust-bar > p {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 14px;
}
.trust-items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--ink-700);
  font-weight: 500;
}
.trust-items span:nth-child(even) {
  color: var(--ink-300);
}

/* ==========================================================================
   Content section
   ========================================================================== */
.content-section {
  max-width: 960px;
  margin: 64px auto;
  padding: 0 24px;
}
.content-inner {
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.content-block h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.content-block h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-900);
  margin: 28px 0 12px;
}
.content-block p {
  color: var(--ink-700);
  font-size: 1.02rem;
  margin-bottom: 16px;
  line-height: 1.75;
}
.content-block p strong {
  color: var(--ink-900);
  font-weight: 700;
}
.content-block code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--ink-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-800);
}
.content-block a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content-block a:hover {
  color: var(--brand-700);
  text-decoration-thickness: 2px;
}

.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 20px 16px 68px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--ink-700);
  box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps li strong {
  color: var(--ink-900);
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.use-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}
.use-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-500);
}
.use-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
}
.use-card p {
  font-size: 0.92rem;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.6;
}

.faq-block details {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.faq-block details[open] {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.faq-block summary {
  padding: 18px 22px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-block summary::-webkit-details-marker {
  display: none;
}
.faq-block summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--ink-400);
  transition:
    transform 0.2s,
    color 0.2s;
  line-height: 1;
}
.faq-block details[open] summary::after {
  transform: rotate(45deg);
  color: var(--brand-500);
}
.faq-block details p {
  padding: 0 22px 20px;
  margin: 0;
  color: var(--ink-700);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ==========================================================================
   CTA button
   ========================================================================== */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 48px;
  padding: 0 28px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    background 0.2s;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
}
.cta-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink-900);
  color: var(--ink-300);
  margin-top: 80px;
  padding: 56px 24px 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 64px;
  padding-bottom: 40px;
}
.footer-brand .logo-mark {
  display: inline-flex;
  margin-right: 8px;
  vertical-align: middle;
}
.footer-brand .logo-text {
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  vertical-align: middle;
}
.footer-brand p {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ink-400);
  max-width: 320px;
  line-height: 1.65;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.footer-cols h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}
.footer-cols a {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-400);
  padding: 5px 0;
  transition: color 0.15s;
}
.footer-cols a:hover {
  color: #fff;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--ink-500);
  text-align: center;
}

/* ==========================================================================
   Winner Modal — gentle white scrim, no blur
   ========================================================================== */
.winner-modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s,
    visibility 0.25s;
  padding: 24px;
}
.winner-modal.show {
  opacity: 1;
  visibility: visible;
}
.winner-modal-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 40px 36px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.winner-modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--brand-500) 0%,
    var(--brand-600) 50%,
    var(--accent-500) 100%
  );
}
.winner-modal-card:focus {
  outline: none;
}
.winner-modal.show .winner-modal-card {
  transform: translateY(0) scale(1);
}
.winner-modal-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success-500);
  margin-bottom: 12px;
}
.winner-modal-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  word-break: break-word;
}
.winner-modal-actions {
  display: flex;
  gap: 10px;
}
.winner-modal-actions button {
  flex: 1;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
}
.btn-keep {
  background: var(--ink-100);
  color: var(--ink-700);
  border: 1px solid var(--ink-200);
}
.btn-keep:hover {
  background: var(--ink-200);
}
.btn-remove {
  background: var(--ink-900);
  color: #fff;
  border: 1px solid var(--ink-900);
}
.btn-remove:hover {
  background: var(--ink-800);
  transform: translateY(-1px);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px 0;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-500);
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--ink-300);
}
.breadcrumbs a {
  color: var(--brand-600);
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Blog CTA box (also used on content pages)
   ========================================================================== */
.blog-cta {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin: 0;
  text-align: center;
}
.blog-cta-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brand-800);
  margin: 0 0 12px;
}
.blog-cta-text {
  font-size: 1rem;
  color: var(--brand-700);
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ==========================================================================
   Alt hero — compact hero for content pages (no wheel)
   ========================================================================== */
.alt-hero {
  background: radial-gradient(ellipse at top, #1e293b 0%, #0f172a 70%);
  color: #fff;
  padding: 64px 24px 56px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.alt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(59, 130, 246, 0.16) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 85% 75%,
      rgba(245, 158, 11, 0.12) 0%,
      transparent 50%
    );
  pointer-events: none;
}
.alt-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.alt-hero .hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-200);
  margin-bottom: 20px;
}
.alt-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.alt-hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--ink-300);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.65;
}
.alt-hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Comparison table
   ========================================================================== */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.92rem;
  min-width: 540px;
}
.comparison-table thead th {
  background: var(--ink-100);
  color: var(--ink-900);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--ink-200);
}
.comparison-table tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-700);
  font-size: 0.9rem;
  padding: 12px 16px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-100);
  width: 40%;
}
.comparison-table tbody td {
  padding: 12px 16px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--ink-100);
  vertical-align: top;
  line-height: 1.5;
}
.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: none;
}
.comparison-note {
  font-size: 0.88rem;
  color: var(--ink-500);
  line-height: 1.65;
  font-style: italic;
  padding: 12px 16px;
  background: var(--ink-50);
  border-left: 3px solid var(--brand-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ==========================================================================
   FIX: CTA button inside .content-block must show white text.
   The rule `.content-block a { color: var(--brand-600); }` had higher
   specificity than `.cta-btn { color: #fff; }`, making CTA button text
   nearly invisible on the blue gradient. This block restores white text
   and removes the underline for CTA buttons specifically.
   ========================================================================== */
.content-block .cta-btn,
.content-block .cta-btn:visited,
.content-block .cta-btn:hover,
.content-block .cta-btn:active {
  color: #ffffff;
  text-decoration: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .sidebar {
    max-height: none;
    overflow: visible;
  }
  .wheel-area {
    min-height: 520px;
  }
  .wheel-stage {
    max-width: 520px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
    --app-pad: 16px;
  }
  .header-inner {
    padding: 0 16px;
  }
  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--ink-900);
    padding: 16px;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .main-nav.open a {
    padding: 12px 16px;
    width: 100%;
  }
  .nav-toggle {
    display: flex;
  }

  .wheel-area {
    padding: 20px 16px 20px;
    border-radius: var(--radius);
    min-height: 400px;
  }
  .pointer {
    top: -10px;
    border-left-width: 13px;
    border-right-width: 13px;
    border-top-width: 24px;
  }
  .pointer::after {
    top: -24px;
    left: -7px;
    width: 14px;
    height: 14px;
  }
  .spin-row {
    gap: 8px;
  }
  .spin-btn {
    padding: 0 40px;
    height: 54px;
    font-size: 0.95rem;
  }
  .mute-btn {
    height: 54px;
    padding: 0 16px;
    font-size: 0.85rem;
  }
  .result-box {
    padding: 10px 20px;
    flex-direction: column;
    gap: 2px;
    border-radius: var(--radius);
  }
  .result-value {
    font-size: 1.05rem;
  }
  .sidebar {
    padding: 16px;
    border-radius: var(--radius);
  }
  #entriesInput {
    min-height: 160px;
  }

  .alt-hero {
    padding: 44px 20px 40px;
  }

  .comparison-table {
    font-size: 0.85rem;
  }
  .comparison-table thead th,
  .comparison-table tbody th,
  .comparison-table tbody td {
    padding: 10px 12px;
  }

  .content-section {
    margin: 48px auto;
  }
  .use-grid {
    grid-template-columns: 1fr;
  }
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .trust-items {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .winner-modal-card {
    transform: none;
  }
}
