:root {
  --bg: #0b0813;
  --card: #16101f;
  --line: #322748;
  --text: #f4eefc;
  --muted: #a99fc4;
  --accent: #b15cff;
  --accent-2: #ff5cae;
  --accent-3: #5cc8ff;
  --radius: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(-45deg, #0b0813, #1a1030, #2a1147, #0c1c2b, #241042);
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: bgFlow 22s ease infinite;
  overflow-x: hidden;
  accent-color: var(--accent);
}

@keyframes bgFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(700px 460px at 12% 0%, rgba(177, 92, 255, 0.34), transparent 62%),
    radial-gradient(700px 460px at 88% 8%, rgba(255, 92, 174, 0.28), transparent 62%),
    radial-gradient(800px 560px at 50% 110%, rgba(92, 200, 255, 0.24), transparent 62%);
  animation: float 16s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ===================== MICROFONO DE FONDO ===================== */
.bg-deco {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  padding-top: 6vh;
}

/* Efecto matrix: caen notas, microfonos y estrellas */
.bg-matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.bg-deco svg {
  width: min(56vw, 580px);
  height: auto;
  opacity: 0.17;
  filter: drop-shadow(0 0 90px rgba(177, 92, 255, 0.4));
  animation: micFloat 16s ease-in-out infinite;
}

@keyframes micFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-20px) scale(1.03); opacity: 1; }
}

@media (max-width: 620px) {
  .bg-deco svg { width: 82vw; }
}

/* ===================== HERO ===================== */
.hero {
  text-align: center;
  padding: clamp(22px, 4vh, 40px) 24px 6px;
}

.brand { display: flex; align-items: center; justify-content: center; gap: 14px; }

.logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  box-shadow: 0 12px 34px rgba(177, 92, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: pulse 3.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 34px rgba(177, 92, 255, 0.5), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { transform: scale(1.06); box-shadow: 0 16px 44px rgba(255, 92, 174, 0.6), inset 0 1px 0 rgba(255,255,255,0.4); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.1vw, 36px);
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #e7d4ff 40%, #ffc2e6 70%, #bfe7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 18px rgba(177, 92, 255, 0.35));
}

.tagline { color: var(--muted); margin: 10px 0 10px; font-size: clamp(12.5px, 1.15vw, 14px); }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  color: #e8ddff;
  background: rgba(177, 92, 255, 0.12);
  border: 1px solid rgba(177, 92, 255, 0.35);
  backdrop-filter: blur(6px);
}

/* ===================== TABS ===================== */
.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 18px 24px 6px;
}

.tab {
  position: relative;
  overflow: visible;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Anillo conico que gira (efecto "secciones" de desde5pesos) */
.tab::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg,
    transparent 0%, rgba(177, 92, 255, 0) 12%, var(--accent) 26%, rgba(177, 92, 255, 0) 40%,
    transparent 50%, rgba(92, 200, 255, 0) 62%, var(--accent-3) 76%, rgba(92, 200, 255, 0) 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity 0.25s ease;
}

.tab:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border-color: rgba(177, 92, 255, 0.75);
  transform: translateY(-1px) scale(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px -8px rgba(177, 92, 255, 0.6);
}

.tab:hover::before { opacity: 1; animation: tabSpin 1.8s linear infinite; }
@keyframes tabSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tab:active { transform: translateY(0) scale(1.02); }

.tico { display: inline-block; transition: transform 0.35s var(--ease); }
.tab:hover .tico { transform: scale(1.18) rotate(-8deg); }

.tab.active {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-image: linear-gradient(180deg, #dca6ff, var(--accent) 46%, #7a2fe0);
  box-shadow: 0 8px 22px -6px rgba(177, 92, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tab.active:hover { background-position: 100% 0; }

/* ===================== LAYOUT (ancho, espacioso) ===================== */
main {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(16px, 2.4vh, 28px) clamp(16px, 3vw, 40px) 56px;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 34px);
  align-items: start;
  min-width: 0;
}

/* ===================== CARDS ===================== */
.card {
  position: relative;
  min-width: 0;
  border-radius: var(--radius);
  padding: clamp(20px, 2.2vw, 28px);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(26, 18, 42, 0.05), rgba(16, 11, 28, 0.05)) padding-box,
    linear-gradient(135deg, rgba(177, 92, 255, 0.9), rgba(255, 92, 174, 0.55), rgba(92, 200, 255, 0.7)) border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5); }

.card h2 {
  margin: 0 0 16px;
  font-size: clamp(16px, 1.4vw, 19px);
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #fff, #d9c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* La tarjeta de resultado acompaña al hacer scroll (solo desktop) */
@media (min-width: 981px) {
  .card.result { position: sticky; top: 24px; }
}

/* ===================== FORM ===================== */
label { display: block; font-size: 13px; color: #d3c7ee; margin-bottom: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

.muted, .hint, .provider, .lyrics, .story, .joke, .out { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 7px;
  padding: 11px 13px;
  background: rgba(10, 8, 18, 0.04);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder, textarea::placeholder { color: #c6bce0; }
input:hover, select:hover, textarea:hover { border-color: rgba(177, 92, 255, 0.6); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(14, 10, 24, 0.28);
  box-shadow: 0 0 0 3px rgba(177, 92, 255, 0.22), 0 0 22px rgba(177, 92, 255, 0.2);
}

select { cursor: pointer; }
textarea { resize: vertical; min-height: 78px; line-height: 1.5; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.check input { width: auto; margin: 0; }

.filefield {
  display: block;
  border: 1px dashed rgba(177, 92, 255, 0.45);
  border-radius: 13px;
  padding: 12px 14px;
  margin-bottom: 13px;
  background: rgba(177, 92, 255, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.filefield:hover { border-color: rgba(177, 92, 255, 0.75); background: rgba(177, 92, 255, 0.1); }

.ff-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.ff-title .opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.ff-desc { display: block; font-size: 12px; color: var(--muted); margin: 3px 0 2px; line-height: 1.45; }

.filefield input[type="file"] {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.filefield input[type="file"]::file-selector-button {
  padding: 9px 15px;
  margin-right: 12px;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(177, 92, 255, 0.35);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.filefield input[type="file"]::file-selector-button:hover { transform: translateY(-1px); filter: brightness(1.1); }

.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.5; }

/* Dictado por voz (STT) */
.dictate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dictate button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ecdcff;
  background: rgba(177, 92, 255, 0.12);
  border: 1px solid rgba(177, 92, 255, 0.42);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.dictate button:hover { transform: translateY(-1px); background: rgba(177, 92, 255, 0.24); box-shadow: 0 6px 16px -6px rgba(177, 92, 255, 0.65); }
.dictate-mic.is-rec {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #ff7a90, #e11d48);
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 60, 90, 0.55); } 50% { box-shadow: 0 0 0 9px rgba(255, 60, 90, 0); } }
.dictate-status { font-size: 12px; color: var(--muted); }

/* ===================== BOTONES ===================== */
button.primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 12px;
  padding: 15px 30px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50px;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(180deg, #dca6ff, var(--accent) 46%, #7a2fe0);
  box-shadow: 0 8px 26px -6px rgba(177, 92, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), filter 0.2s ease;
}

button.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  animation: btnShine 3.8s var(--ease) infinite;
}

@keyframes btnShine {
  0%, 55% { left: -120%; }
  100% { left: 130%; }
}

button.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -6px rgba(177, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
button.primary:hover::after { animation-duration: 1.3s; }
button.primary:active { transform: translateY(0) scale(0.98); }
button.primary:disabled { cursor: progress; filter: grayscale(0.3) brightness(0.85); transform: none; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }

.ico { display: inline-block; transition: transform 0.3s var(--ease); }
button.primary:hover .ico { transform: translateX(4px); }

/* ===================== RESULTADO ===================== */
.out { min-height: 110px; }
.muted { color: var(--muted); line-height: 1.6; }

.song-title {
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #ff9ad4, #b98bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.provider { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.lyrics { white-space: pre-wrap; line-height: 1.7; font-size: 14.5px; }

.audio-block {
  margin-top: 18px;
  padding: 16px;
  border-radius: 15px;
  background: rgba(10, 8, 18, 0.14);
  border: 1px solid var(--line);
}

audio { width: 100%; margin-top: 4px; }
audio::-webkit-media-controls-panel { background: #1a1330; }

.download {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(177, 92, 255, 0.25), rgba(92, 200, 255, 0.25));
  border: 1px solid rgba(177, 92, 255, 0.5);
  transition: transform 0.16s ease, box-shadow 0.22s ease, background 0.3s ease;
}
.download:hover { transform: translateY(-2px); background: linear-gradient(135deg, var(--accent), var(--accent-3)); box-shadow: 0 10px 24px rgba(92, 200, 255, 0.4); }

.joke { font-size: 15.5px; line-height: 1.7; }
.remate {
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(90deg, #ff8ac2, #ffd08a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.story { white-space: pre-wrap; line-height: 1.8; font-size: 14.5px; }

/* Libro de cuentos ilustrado */
.storybook { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; }
.scene { margin: 0; }
.scene img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.2);
}
.scene figcaption {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.75;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ===================== LIBRO DE CUENTOS ===================== */
.book-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  background: rgba(6, 4, 12, 0.82);
  backdrop-filter: blur(6px);
}
.book-overlay.open { display: flex; animation: fadeUp 0.3s ease; }

.book-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: transform 0.15s ease, background 0.2s ease;
}
.book-close:hover { transform: scale(1.08); background: rgba(255, 255, 255, 0.22); }

.book-stage { perspective: 1900px; width: min(94vw, 980px); }

.book-page {
  width: 100%;
  height: min(74vh, 600px);
  border-radius: 14px;
  overflow: hidden;
  transform-origin: left center;
  background: linear-gradient(180deg, #fdf8ef, #f2e7d4);
  color: #3a2c22;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.book-page .bp-media { background: #e8ddca; overflow: hidden; }
.book-page .bp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-page .bp-media.empty {
  display: grid;
  place-items: center;
  font-size: 60px;
  color: #c9b48f;
  background: radial-gradient(circle at 50% 40%, #f6ecd8, #e4d5bb);
}
.book-page .bp-text {
  padding: clamp(20px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.85;
}
.book-page .bp-text h3 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.6vw, 30px);
  color: #4a2e6b;
}

/* Portada */
.book-page.cover { grid-template-columns: 1fr; }
.book-page.cover .bp-text {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 10px;
}
.book-page.cover .bp-text h3 { font-size: clamp(28px, 4vw, 44px); }

.book-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.book-btn {
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #c79bff, var(--accent) 46%, #6a26c9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px -8px rgba(177, 92, 255, 0.8);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.book-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.book-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.book-ind { color: #e8ddff; font-size: 14px; font-weight: 600; min-width: 60px; text-align: center; }

.story-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Impresion / Guardar como PDF */
.book-print { display: none; }
@media print {
  body * { visibility: hidden !important; }
  .book-print,
  .book-print * { visibility: visible !important; }
  .book-print { display: block !important; position: absolute; top: 0; left: 0; width: 100%; }
  .print-page {
    page-break-after: always;
    padding: 26px;
    color: #111;
    font-family: system-ui, sans-serif;
  }
  .print-page img { max-width: 100%; max-height: 60vh; display: block; margin: 0 auto 18px; border-radius: 10px; }
  .print-page h1 { font-size: 30px; text-align: center; margin-top: 160px; }
  .print-page .cover-sub { text-align: center; font-size: 18px; }
  .print-page p { font-size: 16px; line-height: 1.6; }
}

@media (max-width: 720px) {
  .book-page { grid-template-columns: 1fr; grid-template-rows: 45% 55%; height: min(80vh, 640px); }
  .book-page.cover { grid-template-rows: 1fr; }
}

.error { color: #ff7a90; }
.spinner { color: var(--muted); }

.progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(177, 92, 255, 0.6);
  transition: width 0.4s ease;
}
.progress-pct { font-size: 12px; margin: 6px 0 0; }

.spinner::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  border: 2px solid rgba(177, 92, 255, 0.35);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== FOOTER ===================== */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 40px) 22px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sound-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: #ecdcff;
  background: rgba(177, 92, 255, 0.14);
  border: 1px solid rgba(177, 92, 255, 0.45);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sound-toggle:hover { transform: translateY(-2px) scale(1.06); background: rgba(177, 92, 255, 0.26); box-shadow: 0 8px 18px -6px rgba(177, 92, 255, 0.7); }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0d0a16; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  border: 2px solid #0d0a16;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent-3)); }

/* =================================================================
   TABLET / MOVIL: una columna
   ================================================================= */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .card.result { position: static; }
  .tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .hero h1 { font-size: 28px; }
}
