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

:root {
  --purple:        #6c4ef0;
  --purple-hover:  #5a3ed8;
  --purple-light:  #ede8ff;
  --heads-color:   #4e7af5;
  --tails-color:   #f07a38;
  --text-dark:     #12112a;
  --text-mid:      #4a4868;
  --text-soft:     #7870a0;
  --card-bg:       #ffffff;
  --card-shadow:   0 4px 24px rgba(108, 78, 240, 0.10);
  --coin-size:     260px;
}

/* ── Page ── */
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: linear-gradient(170deg, #ded5ff 0%, #ede8ff 30%, #f8f5ff 60%, #ffffff 100%);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Lock to viewport only on mobile — prevents address-bar reflows on touch browsers */
/* Desktop scrolls naturally; no viewport lock needed since there's no SPA view-switching */

/* ── Navbar ── */
.navbar {
  width: 100%;
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.logo-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  background: white;
  border-radius: 9px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex; align-items: center; gap: 24px;
}

.nav-link {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-mid);
  display: flex; align-items: center; gap: 6px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--purple); }

.nav-link svg { width: 14px; height: 14px; opacity: 0.7; }

.btn-signin {
  padding: 8px 18px;
  background: white;
  border: 1.5px solid var(--purple);
  border-radius: 9px;
  color: var(--purple);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background 0.18s, color 0.18s;
}
.btn-signin:hover { background: var(--purple); color: white; }
.btn-signin svg { width: 13px; height: 13px; }

/* ── Main wrapper ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
  max-width: 1080px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero h1 {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text-dark);
  line-height: 1.1;
}

.hero-sub {
  margin-top: 10px;
  font-size: 18px;
  color: var(--text-soft);
}

.hero-sub em {
  font-style: italic;
  color: var(--purple);
}

.choose-coin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--purple);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1.5px dashed var(--purple);
  padding-bottom: 1px;
  transition: opacity 0.18s;
}
.choose-coin-link:hover { opacity: 0.72; }

/* ── Coin picker popup ── */
.coin-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 35, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.coin-picker-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.coin-picker {
  background: #fff;
  border-radius: 24px;
  padding: 32px 36px;
  box-shadow: 0 20px 60px rgba(108, 78, 240, 0.22), 0 4px 16px rgba(0,0,0,0.1);
  transform: scale(0.88) translateY(16px);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 380px;
  width: 90%;
}

.coin-picker-overlay.show .coin-picker {
  transform: scale(1) translateY(0);
}

.coin-picker-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 20px;
}

.coin-picker-hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  margin-top: 5px;
  opacity: 0.75;
}

.coin-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.coin-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 2px solid #e8e2ff;
  border-radius: 16px;
  background: #faf9ff;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}

.coin-option:hover {
  border-color: var(--purple);
  background: var(--purple-light);
  transform: translateY(-2px);
}

.coin-option.active {
  border-color: var(--purple);
  background: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(108,78,240,0.15);
}

.coin-option-flag {
  font-size: 36px;
  line-height: 1;
}

.coin-option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
}

/* ── Flip area ── */
.flip-area {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 28px;
}

/* ── Side option cards ── */
.side-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  width: 200px;
  min-width: 160px;
  flex-shrink: 0;
}

.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card-label.heads-label { color: var(--heads-color); }
.card-label.tails-label { color: var(--tails-color); }

.card-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #e8e2ff;
  border-radius: 10px;
  padding: 9px 11px;
  background: #faf9ff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-input-row:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(108,78,240,0.10);
}

.card-input-row input {
  border: none; outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  width: 100%;
  min-width: 0;
}

.edit-btn {
  border: none; background: none;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s;
}
.edit-btn:hover { opacity: 1; color: var(--purple); }

/* ── Connector dots ── */
.coin-connector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #c4baee;
}

/* ── 3D Scene ── */
/*
  IMPORTANT: the drop-shadow filter lives on .scene, NOT on .coin.
  Putting filter on .coin would override transform-style:preserve-3d on that
  same element (CSS spec "grouping properties" rule), collapsing all child
  translateZ values to z=0 and permanently hiding the tails backface.
*/
.scene {
  perspective: 680px;
  perspective-origin: 50% 42%;
  flex-shrink: 0;
  position: relative;
  /* Shadow here — safe because .scene has no transform-style:preserve-3d */
  filter:
    drop-shadow(0 28px 16px rgba(0,0,0,0.42))
    drop-shadow(0 8px  6px  rgba(0,0,0,0.28));
  transition: filter 0.2s, transform 0.2s;
}

.scene:hover {
  transform: translateY(-10px);
  filter:
    drop-shadow(0 32px 18px rgba(0,0,0,0.46))
    drop-shadow(0 8px  6px  rgba(0,0,0,0.30))
    drop-shadow(0 0   36px  rgba(180,160,90,0.22));
}

/* Cast shadow on the "ground" beneath the coin */
.scene::after {
  content: '';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(80,60,160,0.22) 0%, transparent 70%);
  pointer-events: none;
}

.coin {
  width: var(--coin-size);
  height: var(--coin-size);
  position: relative;
  transform-style: preserve-3d;  /* must stay clean — no filter/opacity here */
  cursor: pointer;
  will-change: transform;
}

/* Coin faces */
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.face.heads { transform: translateZ(20px); }
.face.tails { transform: translateZ(-20px) rotateX(180deg); }

/* User-provided PNG (hidden until loaded via JS) */
.coin-img {
  position: absolute;   /* overlay the SVG exactly */
  inset: 0;
  display: none;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Default SVG (always visible unless image overrides) */
.coin-svg {
  display: block;
  width: 100%; height: 100%;
}

/* ── Action area ── */
.action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.result-display {
  font-size: 18px;
  font-weight: 600;
  color: var(--purple);
  min-height: 28px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.result-display.show {
  opacity: 1;
  transform: translateY(0);
}
.result-display[data-side="heads"] { color: var(--heads-color); }
.result-display[data-side="tails"] { color: var(--tails-color); }

/* Flip button */
.flip-btn {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 15px 56px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.18s, transform 0.1s, opacity 0.2s;
  user-select: none;
  letter-spacing: 0.1px;
}
.flip-btn:hover:not(:disabled) { background: var(--purple-hover); }
.flip-btn:active:not(:disabled) { transform: scale(0.98); }
.flip-btn:disabled { opacity: 0.72; cursor: not-allowed; }

.btn-spin-icon {
  font-size: 17px;
  display: inline-block;
  line-height: 1;
}
.flip-btn.is-flipping .btn-spin-icon {
  animation: spin 0.55s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tagline */
.tagline {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 7px;
}

.tagline-badge {
  width: 16px; height: 16px;
  background: var(--purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.tagline-badge svg { width: 9px; height: 9px; }

/* ── Views ── */
.view { display: none; width: 100%; }
.view.active { display: flex; flex-direction: column; align-items: center; flex: 1; min-height: 0; }

/* ── Coming soon placeholder ── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
  text-align: center;
  padding: 60px 24px;
}

.coming-soon-icon {
  width: 80px; height: 80px;
  background: var(--purple-light);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
}

.coming-soon h2 {
  font-size: 26px; font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.coming-soon p {
  font-size: 15px;
  color: var(--text-soft);
}

/* ── CardChosen component ── */
.cards-area {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
}

.cards-vs {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-wrapper {
  perspective: 800px;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.card-wrapper:not(.done):hover {
  transform: translateY(-10px);
}

.card-inner {
  width: 150px;
  height: 210px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  /* Shadow on wrapper — safe here since card-inner has no filter */
}

.card-wrapper {
  filter: drop-shadow(0 8px 16px rgba(108,78,240,0.18)) drop-shadow(0 2px 4px rgba(0,0,0,0.10));
  transition: transform 0.2s, filter 0.2s;
}

.card-wrapper:not(.done):hover {
  filter: drop-shadow(0 14px 22px rgba(108,78,240,0.26)) drop-shadow(0 4px 8px rgba(0,0,0,0.14));
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-front {
  transform: rotateY(180deg);
  display: none;  /* only the assigned face is shown */
}

/* Show the right face based on assignment class */
.card-inner.answer-yes .face-yes,
.card-inner.answer-no  .face-no  { display: block; }

.card-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: none;
}

.card-svg {
  display: block;
  width: 100%; height: 100%;
}

/* Hide SVG when image loads */
.card-img.loaded { display: block; }
.card-img.loaded + .card-svg { display: none; }

/* Card result */
.card-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.card-result {
  font-size: 20px;
  font-weight: 600;
  min-height: 30px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.card-result.show {
  opacity: 1;
  transform: translateY(0);
}

.card-result[data-answer="yes"] { color: #16a34a; }
.card-result[data-answer="no"]  { color: #dc2626; }

/* ── Tool nav ── */
.tool-nav {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 24px 12px;
  background: transparent;
  flex-shrink: 0;
}

.tool-btn {
  flex: 1;
  max-width: 180px;
  padding: 5px 10px;
  background: white;
  border: 2px solid #e8e2ff;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.tool-btn:hover:not(.active) {
  border-color: var(--purple);
  color: var(--purple);
}

.tool-btn.active {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-light);
}

/* ── WheelName component ── */
.wheel-main {
  display: flex;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
}

.wheel-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.wheel-canvas-wrap {
  position: relative;
  display: inline-block;
}

/* Triangle pointer at 12 o'clock, pointing down */
.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--purple);
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(108,78,240,0.4));
}

#wheel-canvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(108,78,240,0.14), 0 2px 8px rgba(0,0,0,0.08);
}

.wheel-input-panel {
  flex: 0 0 300px;
  width: 300px;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  gap: 14px;
  min-width: 0;
}

.wheel-panel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-soft);
}

#wheel-input {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  min-height: 200px;
  max-height: 420px;
  border: 1.5px solid #e8e2ff;
  border-radius: 14px;
  padding: 16px 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dark);
  background: #faf9ff;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: text;
  -webkit-user-select: text;
}

#wheel-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(108,78,240,0.10);
}

#wheel-input::placeholder {
  color: #b4aecc;
}

.wheel-btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.wheel-spin-btn {
  flex: 1;
  justify-content: center;
}

.wheel-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 2px solid #e0d9f7;
  border-radius: 14px;
  background: #fff;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.wheel-clear-btn:hover {
  background: #fef2f2;
  border-color: #f5b8b8;
  color: #dc2626;
}

.wheel-clear-btn:hover svg {
  stroke: #dc2626;
}

.wheel-winner {
  font-size: 18px;
  font-weight: 700;
  color: var(--purple);
  text-align: center;
  min-height: 28px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.wheel-winner.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Winner Popup ── */
.wheel-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 35, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.wheel-popup-overlay.show {
  opacity: 1;
  pointer-events: all;
}

#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wheel-popup {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 28px;
  padding: 44px 52px 40px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(108, 78, 240, 0.3), 0 4px 20px rgba(0, 0, 0, 0.14);
  transform: scale(0.78) translateY(24px);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 380px;
  width: 88%;
}

.wheel-popup-overlay.show .wheel-popup {
  transform: scale(1) translateY(0);
}

.wheel-popup-trophy {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
  animation: trophy-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

@keyframes trophy-pop {
  from { transform: scale(0) rotate(-18deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.wheel-popup-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 10px;
}

.wheel-popup-name {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #6c4ef0 0%, #f72585 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wheel-popup-close {
  background: linear-gradient(135deg, #6c4ef0, #845ef7);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 44px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.18s, transform 0.18s;
}

.wheel-popup-close:hover  { opacity: 0.88; transform: translateY(-2px); }
.wheel-popup-close:active { transform: translateY(0); }

/* ── Wheel page heading (h1 for SEO) ── */
.wheel-page-heading {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 10px;
}

/* ── SEO content section ── */
.seo-section {
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 2px 20px rgba(108, 78, 240, 0.08);
  padding: 40px 40px 32px;
  margin: 16px 0 8px;
}

.seo-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 36px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--purple);
  line-height: 1.3;
}

.seo-section h2:first-child {
  margin-top: 0;
}

.seo-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-mid);
}

.seo-section ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.seo-section li {
  background: var(--purple-light);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-mid);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.seo-section li::before {
  content: "✓";
  color: var(--purple);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.seo-section em {
  font-style: italic;
}

/* ── Footer SEO text ── */
.footer-seo {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  opacity: 0.65;
  margin: 0 0 2px;
}

/* ── Site footer ── */
.site-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 24px 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.site-footer a {
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.18s;
}

.site-footer a:hover { color: var(--purple); }

.footer-dot {
  font-size: 12px;
  color: var(--text-soft);
  opacity: 0.5;
}

/* ── Hamburger button (mobile only) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
}

/* ── Sidebar ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 42, 0.45);
  z-index: 100;
}
.sidebar-backdrop.open { display: block; }

.sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100svh;
  background: white;
  z-index: 101;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(108, 78, 240, 0.12);
}
.sidebar.open { right: 0; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f0ecff;
}
.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.2px;
}
.sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
}
.sidebar-close svg { width: 16px; height: 16px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-mid);
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover { background: var(--purple-light); color: var(--purple); }
.sidebar-link.active { background: var(--purple-light); color: var(--purple); }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ═══════════════════════════════════════
   RESPONSIVE — mobile ( ≤ 768px )
═══════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Root overrides ── */
  :root { --coin-size: 200px; }

  /* ── Navbar ── */
  .navbar { padding: 12px 16px; }
  .nav-link { display: none; }   /* hide History & How it works */

  /* ── Hero ── */
  .hero { margin-bottom: 20px; }
  .hero h1 { font-size: 34px; letter-spacing: -0.8px; }
  .hero-sub { font-size: 15px; }

  /* ── Main padding ── */
  .main { padding: 12px 16px 28px; }

  /* ── Flip area: coin on top, side cards in a row below ── */
  .flip-area {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
  }

  /* Side cards share the first row (above the coin) */
  .side-card {
    order: -1;
    flex: 1;
    min-width: 130px;
    max-width: 200px;
    width: auto;
  }

  /* Coin drops to its own second row, centered */
  .scene { order: 1; align-self: center; }

  /* Hide connecting dots on mobile */
  .coin-connector { display: none; }

  /* Shrink ground shadow to match smaller coin */
  .scene::after { width: 160px; }

  /* ── Action area ── */
  .flip-btn { padding: 14px 36px; font-size: 15px; }

  /* ── CardChosen ── */
  .cards-area { gap: 14px; margin-bottom: 24px; }

  .card-inner {
    width: 120px;
    height: 168px;
  }

  .card-result { font-size: 17px; }

  /* ── Coming soon ── */
  .coming-soon { padding: 40px 20px; }
  .coming-soon h2 { font-size: 22px; }

  /* ── WheelName ── */
  .wheel-main { flex-direction: column; overflow-y: auto; }

  .wheel-panel {
    border-right: none;
    border-bottom: 1px solid #e8e2ff;
    padding: 24px 16px 20px;
  }

  #wheel-canvas {
    width: 300px;
    height: 300px;
  }

  .wheel-input-panel {
    flex: none;
    width: 100%;
    padding: 20px 16px;
    gap: 12px;
  }

  #wheel-input {
    min-height: 130px;
    max-height: 180px;
  }

  .wheel-clear-btn {
    justify-content: center;
  }

  /* ── Winner popup ── */
  .wheel-popup {
    padding: 36px 28px 32px;
    border-radius: 22px;
  }

  .wheel-popup-trophy { font-size: 48px; }

  .wheel-popup-name {
    font-size: 28px;
    margin-bottom: 26px;
  }

  .wheel-popup-close {
    padding: 14px 36px;
    width: 100%;
  }

  /* ── Tool nav — hidden on mobile, replaced by sidebar ── */
  .tool-nav { display: none; }
  .footer-seo { display: none; }
  .hamburger { display: flex; }

  /* ── SEO section ── */
  .seo-section { padding: 28px 20px 20px; border-radius: 16px; }
  .seo-section h2 { font-size: 15px; margin-top: 28px; }
  .seo-section p, .seo-section li { font-size: 13px; }
  .seo-section ul { grid-template-columns: 1fr; }
}
