:root {
  --ink: #223548;
  --muted: #65758a;
  --paper: #eef3f8;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(34, 53, 72, 0.1);
  --shadow: 0 26px 70px rgba(34, 53, 72, 0.12);
  --card-shadow: 0 20px 45px rgba(34, 53, 72, 0.1), 0 3px 8px rgba(34, 53, 72, 0.06);
  --accent: #8c63eb;
  --accent-soft: #ebe2ff;
  --accent-ghost: rgba(140, 99, 235, 0.14);
  --relax: #89bb84;
  --picante: #f09c4f;
  --fuerte: #ec6666;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.96), rgba(238, 243, 248, 0.7) 34%, transparent 65%),
    linear-gradient(180deg, #edf3f8 0%, #e6edf5 100%);
}

body::before {
  position: fixed;
  inset: 0;
  content: '';
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(140, 99, 235, 0.08), transparent 18%),
    radial-gradient(circle at 82% 72%, rgba(61, 140, 238, 0.08), transparent 17%);
}

.swipe-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-decoration: none;
}

.dashboard-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

.title-wrap {
  min-width: 0;
}

.eyebrow,
.section-kicker,
.card-id,
.card-category,
.card-age,
.cap-label,
.motif-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
}

.title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 0.98;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.25rem);
}

.tooltip-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-ghost);
}

.tooltip-bubble {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: 252px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(34, 53, 72, 0.94);
  color: white;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.tooltip-anchor:hover .tooltip-bubble,
.tooltip-anchor:focus .tooltip-bubble {
  opacity: 1;
}

.swipe-stage {
  display: grid;
  gap: 22px;
  margin-top: 20px;
}

.start-panel,
.play-panel,
.saved-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.start-panel {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 34px 30px;
}

.start-panel h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.start-copy {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.primary-button,
.mini-button,
.ghost-button,
.saved-tab {
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.primary-button,
.mini-button.next,
.mini-button.save,
.saved-tab.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 68%, #223548));
}

.primary-button {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: pointer;
}

.play-panel {
  padding: 22px;
}

.status-bar,
.saved-head,
.saved-preview-topline,
.controls,
.card-cap,
.card-footer,
.footer-stack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-bar {
  margin-bottom: 14px;
}

.status-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.card-id,
.card-category,
.card-age,
.cap-label,
.motif-label {
  font-size: 0.74rem;
  font-weight: 800;
}

.card-id,
.card-category,
.motif-label {
  color: var(--accent);
}

.card-age,
.cap-label {
  color: var(--muted);
}

.hold-status {
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.hold-status.full {
  background: rgba(236, 102, 102, 0.14);
  color: #cf4c4c;
}

.swipe-surface {
  position: relative;
  min-height: 740px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.surface-hint {
  position: absolute;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.6rem;
  color: rgba(34, 53, 72, 0.22);
}

.surface-hint.right {
  top: 44%;
  right: 28px;
}

.surface-hint.down {
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.swipe-surface.hint-right .surface-hint.right,
.swipe-surface.hint-down .surface-hint.down {
  opacity: 1;
}

.card-frame {
  width: min(100%, 430px);
  aspect-ratio: 0.7;
  position: relative;
  touch-action: none;
}

.card-shadow,
.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: 32px;
}

.card-shadow {
  transform: translateY(22px) scale(0.94);
  background: linear-gradient(180deg, rgba(34, 53, 72, 0.14), rgba(34, 53, 72, 0.04));
  filter: blur(24px);
}

.swipe-card {
  display: grid;
  border: 1px solid rgba(34, 53, 72, 0.08);
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.92), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.94));
  box-shadow: var(--card-shadow);
  transition: transform 220ms ease, opacity 220ms ease;
  user-select: none;
}

.swipe-card.dragging {
  transition: none;
}

.swipe-card.exit-right {
  transform: translateX(140%) rotate(20deg);
  opacity: 0;
}

.swipe-card.exit-down {
  transform: translateY(150%) rotate(6deg);
  opacity: 0;
}

.card-front {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
  height: 100%;
  padding: 22px 22px 20px;
}

.motif-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.motif-disc,
.motif-orbit,
.motif-center {
  border-radius: 50%;
}

.motif-disc {
  position: absolute;
  background: var(--accent-soft);
}

.motif-disc-a {
  width: 176px;
  height: 176px;
  bottom: 22px;
  left: 68px;
}

.motif-disc-b {
  width: 82px;
  height: 82px;
  top: 28px;
  right: 82px;
  background: color-mix(in srgb, var(--accent) 22%, white);
}

.motif-orbit {
  position: relative;
  width: 164px;
  height: 164px;
  border: 5px solid var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.82);
}

.motif-center {
  position: absolute;
  inset: 45px;
  border: 5px solid var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.motif-line {
  position: absolute;
  background: var(--ink);
  border-radius: 999px;
}

.motif-line-a {
  width: 184px;
  height: 4px;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}

.motif-line-b,
.motif-line-c {
  width: 4px;
  height: 26px;
  top: 38px;
}

.motif-line-b {
  right: 88px;
  transform: rotate(24deg);
}

.motif-line-c {
  right: 58px;
  transform: rotate(64deg);
}

.card-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.card-question {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.intensity-chip,
.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, rgba(34, 53, 72, 0.08));
  background: color-mix(in srgb, var(--accent) 8%, white);
  color: var(--ink);
}

.pill-mode {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(34, 53, 72, 0.08));
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
}

.card-footer {
  align-items: end;
}

.footer-stack {
  flex-direction: column;
  align-items: flex-start;
}

.mode-badge {
  border: 1.5px solid var(--accent);
  background: white;
  color: var(--accent);
}

.intensity-chip {
  color: white;
}

.intensity-chip.relax {
  background: var(--relax);
}

.intensity-chip.picante {
  background: var(--picante);
}

.intensity-chip.fuerte {
  background: var(--fuerte);
}

.controls {
  justify-content: center;
  margin-top: 18px;
}

.mini-button,
.ghost-button,
.saved-tab {
  min-height: 46px;
  border: 1px solid var(--line);
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
}

.mini-button.save {
  background: linear-gradient(135deg, #3b8cff, #3069d7);
}

.mini-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.saved-panel {
  padding: 20px;
}

.saved-head {
  margin-bottom: 14px;
}

.saved-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.saved-tab {
  width: 48px;
  padding: 0;
}

.saved-preview {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 172px;
  padding: 18px;
  border: 1px solid rgba(34, 53, 72, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--category-soft, var(--accent-soft)) 78%, white), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
}

.saved-preview::after {
  position: absolute;
  inset: auto 18px 18px auto;
  width: 54px;
  height: 54px;
  content: '';
  border-radius: 50%;
  background: var(--category-soft, var(--accent-soft));
  opacity: 0.92;
}

.saved-preview > * {
  position: relative;
  z-index: 1;
}

.saved-preview.empty {
  align-content: center;
}

.saved-preview h3,
.saved-empty-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.saved-empty-title,
.saved-empty-copy {
  margin: 0;
}

.saved-empty-copy {
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.6;
}

.saved-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 840px) {
  .swipe-shell {
    width: min(100% - 18px, 1160px);
    padding-top: 16px;
  }

  .topbar,
  .start-panel,
  .play-panel,
  .saved-panel {
    border-radius: 24px;
  }

  .tooltip-bubble {
    left: auto;
    right: 0;
    top: calc(100% + 10px);
    transform: none;
  }

  .swipe-surface {
    min-height: 660px;
  }
}

@media (max-width: 640px) {
  .status-bar,
  .saved-head,
  .saved-preview-topline,
  .controls,
  .card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .play-panel {
    padding: 18px 16px 22px;
  }

  .swipe-surface {
    min-height: 880px;
  }

  .card-frame {
    width: 100%;
    max-width: 350px;
    min-height: 760px;
    aspect-ratio: auto;
  }

  .motif-stage {
    min-height: 190px;
  }

  .motif-disc-a {
    width: 138px;
    height: 138px;
    left: 34px;
  }

  .motif-orbit {
    width: 136px;
    height: 136px;
  }

  .motif-center {
    inset: 36px;
  }

  .card-question {
    font-size: clamp(1.55rem, 8vw, 2.2rem);
    line-height: 0.98;
  }

  .card-front {
    gap: 14px;
    padding: 20px 18px 18px;
  }

  .pill,
  .intensity-chip,
  .mode-badge {
    min-height: 32px;
    padding: 7px 11px;
    font-size: 0.74rem;
  }

  .controls {
    margin-top: 12px;
  }
}
