:root {
  --blue-900: #0f3a5f;
  --blue-800: #164a73;
  --blue-700: #1d5c8f;
  --blue-500: #2f86c4;
  --sky: #17a2d8;
  --line: #a9c8e0;
  --line-soft: #d7e6f2;
  --bg: #ffffff;
  --bg-soft: #f3f8fc;
  --text: #1c3550;
  --muted: #5d7489;
  --gold: #c99a3b;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(15, 58, 95, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
#app { max-width: 1180px; margin: 0 auto; min-height: 100vh; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  height: 230px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 18% 40%, rgba(255,255,255,.85), rgba(255,255,255,0) 32%),
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.25), rgba(255,255,255,0) 40%),
    linear-gradient(115deg, #dceefa 0%, #9cc6e4 30%, #4e8fbf 62%, #2a6596 100%);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1.5px);
  background-size: 23px 19px;
  opacity: .35;
  mask-image: linear-gradient(90deg, transparent 10%, #000 50%, transparent 95%);
  pointer-events: none;
}
.hero-tooth { height: 190px; width: auto; margin-left: 4%; filter: drop-shadow(0 10px 14px rgba(15,58,95,.35)); position: relative; z-index: 1; }
.hero-txt { margin-left: auto; margin-right: 5%; text-align: right; color: #fff; position: relative; z-index: 1; }
.hero-logo { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); margin-left: auto; }
.hero h1 { margin: 2px 0 0; font-size: clamp(26px, 6vw, 40px); font-style: italic; font-weight: 600; letter-spacing: .2px; text-shadow: 0 2px 10px rgba(15,58,95,.45); line-height: 1.1; }
.hero p { margin: 4px 0 0; font-size: clamp(15px, 3.6vw, 20px); font-style: italic; font-weight: 500; text-shadow: 0 1px 6px rgba(15,58,95,.5); }

.search { display: flex; align-items: center; gap: 10px; margin: 16px 16px 0; padding: 0 16px; height: 48px; border-radius: 24px; background: var(--bg-soft); border: 1px solid var(--line-soft); color: var(--muted); }
.search svg { width: 22px; height: 22px; flex: none; }
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--text); outline: none; height: 100%; }
.search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47,134,196,.15); }

.menu { position: relative; padding: 4px 0 8px; overflow: hidden; }
.wire-tooth { position: absolute; top: 40px; right: -70px; height: 92%; width: auto; opacity: .32; pointer-events: none; transform: rotate(-8deg); }
.menu a {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  margin-left: 13%;
  padding: 22px 16px 22px 0;
  border-bottom: 2px solid var(--line);
  text-decoration: none;
  color: var(--blue-800);
  font-size: clamp(21px, 5.2vw, 27px);
  font-weight: 500;
}
.menu a small { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--blue-500); background: rgba(47,134,196,.1); border-radius: 12px; padding: 1px 9px; }
.menu a:hover span, .menu a:focus-visible span { color: var(--blue-500); }
.menu a svg { width: 34px; height: 34px; color: var(--sky); }
.menu-fav { color: var(--sky) !important; border-bottom: 0 !important; }
.menu-video svg { stroke-width: 2.4; }
.foot { margin: 18px 16px 28px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  min-height: 60px; padding: 6px 8px;
  background: linear-gradient(100deg, #2a6596, #1d5c8f 60%, #164a73);
  color: #fff;
  box-shadow: 0 2px 10px rgba(15,58,95,.25);
}
.topbar h1 { flex: 1; margin: 0; font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 2px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.fav.on { color: #ffd45c; }

/* ---------- Listas ---------- */
.page { padding: 16px; }
.intro { margin: 0 0 14px; color: var(--muted); }
.group h2 { color: var(--blue-800); font-size: 20px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line-soft); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card-link { display: block; text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(#f4f9fd, #dbe9f4); overflow: hidden; }
.thumb-svg, .thumb-svg svg { width: 100%; height: 100%; }
.dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; background: rgba(15,58,95,.85); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.tplay { position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.88); color: var(--blue-700); display: grid; place-items: center; box-shadow: 0 3px 12px rgba(15,58,95,.25); opacity: .92; }
.tplay svg { width: 24px; height: 24px; margin-left: 3px; }
.card-body { padding: 12px 52px 14px 14px; }
.card h3 { margin: 0 0 4px; font-size: 17px; color: var(--blue-800); line-height: 1.25; }
.card p { margin: 0 0 6px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.meta { font-size: 12px; color: var(--blue-500); font-weight: 600; }
.card .fav { position: absolute; right: 8px; bottom: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--line); cursor: pointer; display: grid; place-items: center; }
.card .fav svg { width: 24px; height: 24px; }
.card .fav.on { color: var(--sky); }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty svg { width: 54px; height: 54px; margin: 0 auto 10px; color: var(--line); }

/* ---------- Detalle ---------- */
.detail { display: grid; gap: 22px; }
@media (min-width: 960px) {
  .detail { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .video-col { position: sticky; top: 76px; }
}
.hint { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.send { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 2px 0; font-size: 14px; color: var(--blue-800); font-weight: 600; }
.send-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 20px; border: 1px solid #d4e1ee; background: #fff; color: var(--blue-800); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.send-btn svg { width: 20px; height: 20px; }
.send-btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.send-btn:hover { filter: brightness(.96); }
.foot a { color: inherit; }
.crumb { margin: 0; color: var(--blue-500); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; }
.title { margin: 2px 0 8px; font-size: 26px; color: var(--blue-800); line-height: 1.2; }
.info h2 { font-size: 17px; color: var(--blue-700); margin: 18px 0 6px; }
.info p { margin: 0; }
.info ul { margin: 0; padding-left: 20px; }
.info li { margin: 3px 0; }
.chapters { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.chapters li { counter-increment: ch; }
.chapters button {
  width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px;
  border: 0; background: transparent; padding: 9px 8px; border-radius: 12px; cursor: pointer;
}
.chapters button::before { content: counter(ch); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-soft); border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--blue-700); }
.chapters b { color: var(--blue-800); }
.chapters span { font-size: 14px; color: var(--muted); }
.chapters button:hover { background: var(--bg-soft); }
.chapters button.cur { background: #e7f2fb; }
.chapters button.cur::before { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.pn a { display: block; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); text-decoration: none; color: var(--blue-800); font-weight: 600; font-size: 15px; }
.pn a small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.pn .nx { text-align: right; }

/* ---------- Reproductor ---------- */
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #dbe9f4; box-shadow: var(--shadow); outline: none; user-select: none; -webkit-user-select: none; }
.player:focus-visible { box-shadow: 0 0 0 3px var(--blue-500); }
.stage { aspect-ratio: 16 / 9; cursor: pointer; }
.stage svg, .scene-svg { width: 100%; height: 100%; }
.scene-svg .a { transform-box: fill-box; transform-origin: center; }
.lbl-t { font: 700 21px "Roboto", "Segoe UI", system-ui, sans-serif; fill: #164a73; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.tag-t { font: 700 18px "Roboto", "Segoe UI", system-ui, sans-serif; fill: #fff; }
.big-play { position: absolute; left: 50%; top: 42%; translate: -50% -50%; width: 74px; height: 74px; border-radius: 50%; border: 0; background: rgba(29,92,143,.9); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 20px rgba(15,58,95,.35); transition: opacity .2s, scale .2s; }
.big-play svg { width: 38px; height: 38px; }
.big-play:hover { scale: 1.06; }
.player.is-playing .big-play { opacity: 0; pointer-events: none; }
.caption {
  position: absolute; left: 50%; bottom: 74px; translate: -50% 0; width: min(92%, 760px);
  background: rgba(10,38,62,.82); color: #fff; border-radius: 12px; padding: 8px 14px;
  font-size: clamp(13px, 1.6vw, 16px); line-height: 1.4; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(4px);
}
.cap-n { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #9fd3f5; font-weight: 700; }
.cap-t { margin-right: 6px; }
.player:not(.is-playing) .caption { opacity: 0; }
.player.no-cc .caption { opacity: 0 !important; }
.controls { position: relative; background: linear-gradient(transparent, rgba(10,38,62,.06)); padding: 6px 10px 6px; background-color: #fff; }
.bar { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--line-soft); }
.bar-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--blue-500); }
.bar-knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--blue-700); box-shadow: 0 0 0 3px rgba(47,134,196,.25); }
.bar-ticks i { position: absolute; top: 7px; width: 3px; height: 8px; margin-left: -1.5px; background: #fff; border-radius: 1px; }
.ctl-row { display: flex; align-items: center; gap: 2px; }
.ctl-row button { width: 42px; height: 42px; border: 0; background: transparent; border-radius: 50%; color: var(--blue-700); display: grid; place-items: center; cursor: pointer; }
.ctl-row button:hover { background: var(--bg-soft); }
.ctl-row button svg { width: 24px; height: 24px; }
.ctl-row button[data-a="cc"], .ctl-row button[data-a="voice"] { color: #9db3c6; }
.ctl-row button.on { color: var(--blue-700) !important; }
.time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 6px; }
.sp { flex: 1; }
.player:fullscreen, .player.pseudo-full { border-radius: 0; display: flex; flex-direction: column; justify-content: center; background: #cfe0ee; }
.player.pseudo-full { position: fixed; inset: 0; z-index: 100; }
.player:fullscreen .stage, .player.pseudo-full .stage { flex: 1; aspect-ratio: auto; min-height: 0; }
.player:fullscreen .caption { font-size: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; background: var(--blue-900); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 200; box-shadow: var(--shadow); animation: tin .2s ease-out; }
@keyframes tin { from { opacity: 0; translate: -50% 10px; } }

@media (max-width: 600px) {
  .hero { height: 190px; }
  .hero-tooth { height: 160px; }
  .menu a { margin-left: 13%; padding: 19px 16px 19px 0; }
  .page { padding: 12px; }
  .caption { bottom: 66px; padding: 6px 10px; }
  .caption .cap-x { display: none; }
  .ctl-row button { width: 38px; height: 38px; }
  .time { font-size: 12px; }
  .title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .card, .big-play { transition: none; } }

/* ---------- Videos renderizados ---------- */
.scene-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player:has(.scene-video) { background: #000; }
