:root {
  --red: #dc2626;
  --deep-red: #b30000;
  --red-dark: #7f1010;
  --red-soft: #fff1f1;
  --ink: #111111;
  --soft-ink: #1a1a1a;
  --paper: #ffffff;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #f7f7f8;
  --surface-strong: #f1f2f4;
  --shadow: 0 22px 60px rgba(17, 17, 17, .12);
  --shadow-soft: 0 12px 34px rgba(17, 17, 17, .08);
  --radius: 8px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(9, 9, 9, .86);
  color: white;
  backdrop-filter: blur(18px) saturate(1.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 15px;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 6px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.3vw, 18px);
  font-size: 14px;
  font-weight: 700;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  opacity: .9;
  transition: color .18s ease, background .18s ease, opacity .18s ease;
}
.main-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  opacity: 1;
}
.nav-pill {
  padding: 0 16px !important;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(220, 38, 38, .22);
}

.menu-toggle { display: none; }

.hero {
  position: relative;
  min-height: calc(100vh - 82px);
  overflow: hidden;
  display: grid;
  align-items: end;
  color: white;
  background: #050505;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,.52), rgba(127,16,16,.48)),
    linear-gradient(0deg, rgba(0,0,0,.82), transparent 52%);
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1400ms ease;
  will-change: opacity, transform;
}

.hero-media img.active {
  opacity: 1;
  animation: kenburns 7s ease-out forwards;
}

@keyframes kenburns {
  from { transform: scale(1.12) translate3d(1.4%, 1%, 0); }
  to { transform: scale(1) translate3d(0, 0, 0); }
}

.hero-copy {
  position: relative;
  width: min(var(--container), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(70px, 8vw, 110px) 0 clamp(58px, 7vw, 92px);
}

.hero-mark {
  width: clamp(118px, 14vw, 180px);
  padding: 10px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  filter: drop-shadow(0 16px 30px rgba(0,0,0,.35));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  max-width: 1000px;
  font-size: 140px;
  line-height: .84;
  text-transform: uppercase;
  font-weight: 1000;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  font-size: 24px;
  line-height: 1.4;
  color: rgba(255,255,255,.88);
}

.hero-actions, .footer-links, .contact-grid, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.btn.primary {
  border-color: var(--red);
  color: white;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
}

.btn.ghost {
  color: white;
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.08);
}

.section {
  position: relative;
  isolation: isolate;
  width: min(var(--container), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) 0;
}

.section::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--paper);
  border-top: 1px solid rgba(17,17,17,.06);
}

.section:nth-of-type(odd)::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.92)),
    var(--surface);
}

.section h2, .page-hero h1, .admin-main h1 {
  margin: 0 0 16px;
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

.section p {
  color: #3f434b;
}

.split {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(28px, 6vw, 92px);
  align-items: start;
}

.split p {
  font-size: 21px;
  line-height: 1.7;
  color: #2e333b;
}

.intro-section {
  min-height: 420px;
  align-items: center;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.text-link { color: var(--deep-red); font-weight: 900; }
.cards {
  display: grid;
  gap: 24px;
}
.cards.three { grid-template-columns: repeat(3, minmax(250px, 1fr)); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.event-card, .story-card, .value-grid article, .mission-grid article, .values-list article, .stat-card, .panel, .sponsor-strip figure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.event-card:hover, .story-card:hover, .coach-card:hover, .stat-card:hover, .sponsor-strip figure:hover {
  transform: translateY(-3px);
  border-color: rgba(220,38,38,.3);
  box-shadow: var(--shadow-soft);
}

.event-card img, .story-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.event-card { padding-bottom: 18px; }
.event-card span {
  display: inline-block;
  margin: 18px 18px 2px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--deep-red);
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.event-card h3, .event-card p, .event-card small { margin-left: 18px; margin-right: 18px; }
.event-card h3 {
  min-height: 54px;
  font-size: 22px;
  line-height: 1.12;
}
.event-card p, .event-card small {
  color: var(--muted);
  line-height: 1.5;
}

.dark {
  width: 100%;
  max-width: none;
  padding-left: max(18px, calc((100vw - var(--container)) / 2));
  padding-right: max(18px, calc((100vw - var(--container)) / 2));
  color: white;
  background:
    linear-gradient(135deg, rgba(220,38,38,.16), transparent 42%),
    radial-gradient(circle at 16% 12%, rgba(220,38,38,.36), transparent 30%),
    #101010;
}

.dark::before { display: none; }
.dark .section-head h2 { color: white; }
.dark .eyebrow { color: #ff5a5a; }

.coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.coach-card {
  position: relative;
  display: block;
  min-height: 440px;
  height: 100%;
  padding: 26px 18px 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  color: white;
  font: inherit;
  background:
    radial-gradient(135% 60% at 50% 106%, rgba(220,38,38,.5), rgba(220,38,38,.1) 52%, transparent 74%),
    linear-gradient(180deg, #1d1d20, #0c0c0e);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
}
/* El flex vive en un span interno: los <button> como contenedor flex
   fallan en algunos navegadores y las fotos salen sin altura. */
.coach-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 414px;
}
.coach-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--deep-red));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s cubic-bezier(.22, .8, .3, 1);
}
.coach-card:hover::after { transform: scaleX(1); }
.coach-info { display: block; }
.coach-card strong { display: block; margin: 0; font-size: 20px; line-height: 1.15; }
.coach-role {
  display: block;
  margin-top: 8px;
  color: #d2d2d2;
  font-size: 13px;
  line-height: 1.45;
}
.coach-photo {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 260px;
  margin-top: 12px;
}
.coach-photo img {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
  transform-origin: bottom center;
  filter: drop-shadow(0 22px 30px rgba(0,0,0,.5));
}

dialog {
  width: min(960px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
}
dialog::backdrop { background: rgba(0,0,0,.72); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: 0;
  background: var(--ink);
  color: white;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.modal-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  padding: 34px;
}
.modal-grid > img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  align-self: stretch;
  object-fit: contain;
  object-position: bottom center;
  padding-top: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(130% 55% at 50% 106%, rgba(220,38,38,.48), rgba(220,38,38,.1) 52%, transparent 74%),
    linear-gradient(180deg, #1d1d20, #0c0c0e);
}
.lead { color: var(--deep-red); font-weight: 900; }
.bio-list { line-height: 1.7; padding-left: 20px; }

.values {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(32px, 5vw, 62px);
  align-items: center;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.value-grid article {
  min-height: 230px;
  padding: 24px;
  border-color: rgba(179,0,0,.12);
}
.value-grid article span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 1000;
}
.value-grid h3 { color: var(--deep-red); }

.values-full .section-head {
  margin-bottom: 34px;
}

.values-hero {
  background:
    linear-gradient(90deg, rgba(0,0,0,.92), rgba(0,0,0,.64)),
    url("/assets/images/hero/tecnicos-ibiza-samurais-karate-01.JPG") center/cover;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.mission-grid article {
  padding: clamp(24px, 3vw, 34px);
  border-color: rgba(179,0,0,.15);
  background:
    linear-gradient(135deg, rgba(255,241,241,.9), rgba(255,255,255,.92)),
    white;
}

.mission-grid article span,
.values-list article span {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--red);
  font-weight: 1000;
}

.mission-grid h3,
.values-list h3 {
  margin: 0 0 10px;
  color: var(--deep-red);
}

.mission-grid p,
.values-list p {
  margin: 0;
  line-height: 1.6;
}

.values-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.values-list article {
  min-height: 190px;
  padding: 22px;
}

.story-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 210px;
}
.story-card.vertical { display: block; }
.story-card div { padding: 22px; }
.story-card p { color: var(--red); font-size: 13px; font-weight: 900; text-transform: uppercase; }
.story-card span { color: var(--muted); line-height: 1.5; }

.sponsors { text-align: center; }
.sponsor-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin-top: 26px;
}
.sponsor-strip figure {
  margin: 0;
  padding: 18px;
}
.sponsor-strip img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  filter: grayscale(.1);
}
.sponsor-strip figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; }

.contact {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 34px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.contact-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  min-height: 64px;
  padding: 16px 18px;
  border-radius: var(--radius);
  color: white;
  background:
    linear-gradient(135deg, rgba(220,38,38,.18), transparent),
    var(--ink);
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}
.contact-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.contact-grid svg,
.footer-contact svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: currentColor;
}

.map-card {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: white;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  align-items: start;
  gap: 34px;
  padding: 42px clamp(18px, 4vw, 56px);
  color: white;
  background: #0b0b0b;
}
.site-footer p { color: #b8b8b8; }
.footer-brand img {
  width: 94px;
  height: 94px;
  object-fit: contain;
  padding: 9px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.footer-brand strong {
  display: block;
  font-size: 24px;
}
.footer-menu,
.footer-contact {
  display: grid;
  gap: 10px;
}
.footer-menu a,
.footer-contact a {
  color: #d8d8d8;
  font-weight: 800;
}
.footer-menu a:hover,
.footer-contact a:hover { color: white; }
.footer-contact a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-links a { color: #f2b3b3; font-weight: 800; }

.page-hero {
  color: white;
  background:
    linear-gradient(120deg, rgba(0,0,0,.92), rgba(127,16,16,.78)),
    url("/assets/images/hero/tecnicos-ibiza-samurais-karate-01.JPG") center/cover;
}
.page-hero.compact {
  padding: clamp(82px, 11vw, 138px) max(18px, calc((100vw - var(--container)) / 2));
}
.page-hero p { max-width: 660px; font-size: 20px; }

.filters {
  position: sticky;
  top: 96px;
  z-index: 20;
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.filters input, .filters select, .cms-form input, .cms-form select, .cms-form textarea, .panel input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  background: white;
}
.filters input { flex: 1 1 320px; }
.filters select { flex: 0 1 260px; }

.login-screen {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 40px 18px;
  background: linear-gradient(120deg, rgba(0,0,0,.82), rgba(179,0,0,.52)), url("/assets/images/hero/karate-adultos-ibiza-entrenamiento-2.jpg") center/cover;
}
.panel {
  width: min(430px, 100%);
  padding: 32px;
  box-shadow: var(--shadow);
}
.panel label, .cms-form label {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-weight: 800;
}
.alert {
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px;
  background: #fff1f2;
  color: #991b1b;
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 82px);
}
.admin-side {
  position: sticky;
  top: 82px;
  height: calc(100vh - 82px);
  padding: 30px;
  color: white;
  background:
    linear-gradient(180deg, rgba(220,38,38,.18), transparent 44%),
    #111;
}
.admin-side a {
  display: block;
  padding: 13px 14px;
  margin: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  color: rgba(255,255,255,.86);
}
.admin-side a:hover {
  background: rgba(255,255,255,.08);
  color: white;
}
.admin-main {
  padding: clamp(24px, 4vw, 54px);
  background:
    linear-gradient(180deg, #fff, var(--surface) 260px);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
}
.stat-card { padding: 24px; }
.stat-card strong { display: block; font-size: 42px; color: var(--deep-red); }
.table-wrap { overflow-x: auto; background: white; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.table-actions form { margin: 0; }
.link-danger {
  border: 0;
  padding: 0;
  color: var(--deep-red);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.link-danger:hover { text-decoration: underline; }
.cms-form {
  width: min(760px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: white;
    background: transparent;
  }
  .main-nav {
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    display: none;
    padding: 18px;
    background: rgba(17,17,17,.98);
  }
  .main-nav.open { display: grid; gap: 6px; }
  .split, .values, .contact, .admin-layout, .mission-grid { grid-template-columns: 1fr; }
  .cards.three, .cards.two, .sponsor-strip, .stat-grid, .values-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coach-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .modal-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 92px; }
  .hero p:not(.eyebrow) { font-size: 21px; }
  .section h2, .page-hero h1, .admin-main h1 { font-size: 46px; }
  .split p { font-size: 19px; }
  .admin-side {
    position: relative;
    top: 0;
    height: auto;
  }
  .filters { position: static; }
}

@media (max-width: 640px) {
  .brand span { display: none; }
  .hero { min-height: 720px; }
  .hero-copy { padding-bottom: 48px; }
  .hero h1 { font-size: 60px; }
  .hero p:not(.eyebrow) { font-size: 18px; }
  .section h2, .page-hero h1, .admin-main h1 { font-size: 36px; }
  .section { width: min(100% - 28px, var(--container)); padding: 58px 0; }
  .section-head { display: block; }
  .cards.three, .cards.two, .coach-grid, .sponsor-strip, .value-grid, .values-list, .stat-grid { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .admin-main { padding: 20px; }
  .page-hero.compact { padding-top: 72px; padding-bottom: 72px; }
  .event-card h3 { min-height: auto; }
}

/* ============================================================
   Mejoras visuales: animaciones, 4 razones y micro-interacciones
   ============================================================ */

/* --- Entrada del hero --- */
.hero-copy .eyebrow,
.hero-copy h1 .hero-line,
.hero-copy p:not(.eyebrow),
.hero-actions {
  opacity: 0;
  transform: translateY(34px);
  animation: rise-in .9s cubic-bezier(.22, .8, .3, 1) forwards;
}
.hero-copy .eyebrow { animation-delay: .15s; }
.hero-copy h1 .hero-line { display: inline-block; animation-delay: .3s; }
.hero-copy h1 .hero-line.delay { animation-delay: .45s; }
.hero-copy p:not(.eyebrow) { animation-delay: .6s; }
.hero-actions { animation-delay: .75s; }

@keyframes rise-in {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Puntos del slider del hero --- */
.hero-dots {
  display: flex;
  gap: 10px;
  margin-top: 34px;
}
.hero-dots button {
  width: 34px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.32);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: background .3s ease;
}
.hero-dots button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--red);
  transform-origin: left;
  animation: dot-progress 5.2s linear forwards;
}
@keyframes dot-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* --- Indicador de scroll del hero --- */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 28px;
  height: 46px;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 999px;
  display: grid;
  justify-items: center;
  padding-top: 8px;
  opacity: 0;
  animation: rise-in .9s ease 1.2s forwards;
  transition: border-color .3s ease;
}
.hero-scroll:hover { border-color: var(--red); }
.hero-scroll span {
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: white;
  animation: scroll-cue 1.8s ease-in-out infinite;
}
@keyframes scroll-cue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* --- Revelado al hacer scroll --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s cubic-bezier(.22, .8, .3, 1), transform .8s cubic-bezier(.22, .8, .3, 1);
  transition-delay: calc(var(--reveal-delay, 0) * 120ms);
  will-change: opacity, transform;
}
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}
[data-reveal-delay="1"] { --reveal-delay: 1; }
[data-reveal-delay="2"] { --reveal-delay: 2; }
[data-reveal-delay="3"] { --reveal-delay: 3; }
[data-reveal-delay="4"] { --reveal-delay: 4; }
[data-reveal-delay="5"] { --reveal-delay: 5; }

/* --- Imagenes con zoom suave en tarjetas --- */
.card-media {
  overflow: hidden;
  padding: 0 !important;
}
.card-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.22, .8, .3, 1), filter .8s ease;
}
.event-card:hover .card-media img,
.story-card:hover .card-media img {
  transform: scale(1.07);
  filter: saturate(1.08);
}
.story-card .card-media { height: 100%; }
.story-card .card-media img { aspect-ratio: auto; min-height: 210px; }
.story-card.vertical .card-media { height: auto; }
.story-card.vertical .card-media img { aspect-ratio: 16 / 10; min-height: 0; }

.coach-photo img {
  transition: transform .6s cubic-bezier(.22, .8, .3, 1);
}
.coach-card:hover .coach-photo img { transform: translateX(-50%) scale(1.05); }
.coach-card {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.coach-card:hover {
  border-color: rgba(220,38,38,.55);
  box-shadow: 0 18px 44px rgba(0,0,0,.45), 0 0 0 1px rgba(220,38,38,.2);
}

/* --- Seccion 4 razones (Descubre el karate) --- */
.benefits-section .section-head {
  align-items: start;
}
.section-sub {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.benefit-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: center;
  font: inherit;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1), box-shadow .3s ease, border-color .3s ease;
}
.benefit-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--deep-red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.22, .8, .3, 1);
}
.benefit-card:hover {
  transform: translateY(-6px);
  border-color: rgba(220,38,38,.35);
  box-shadow: var(--shadow);
}
.benefit-card:hover::before { transform: scaleX(1); }
.benefit-num {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 13px;
  font-weight: 1000;
  color: rgba(220,38,38,.4);
}
.benefit-icon {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px rgba(220,38,38,.14);
  transition: transform .45s cubic-bezier(.22, .8, .3, 1), box-shadow .3s ease;
}
.benefit-icon img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(17,17,17,.16));
  transition: transform .45s cubic-bezier(.22, .8, .3, 1);
}
.benefit-card:hover .benefit-icon {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px rgba(220,38,38,.3), 0 14px 30px rgba(220,38,38,.16);
}
.benefit-card:hover .benefit-icon img { transform: scale(1.1) rotate(-4deg); }
.benefit-card strong {
  font-size: 20px;
  line-height: 1.2;
}
.benefit-short {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.benefit-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.benefit-more svg {
  width: 16px;
  height: 16px;
  transition: transform .3s ease;
}
.benefit-card:hover .benefit-more svg { transform: translateX(5px); }

/* --- Modal de beneficios --- */
.benefit-modal {
  width: min(880px, calc(100% - 28px));
}
.benefit-modal-head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 34px 24px;
  color: white;
  background:
    linear-gradient(120deg, rgba(220,38,38,.28), transparent 55%),
    #101010;
}
.benefit-modal-head img {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  padding: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.benefit-modal-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.05;
}
.benefit-modal-head .eyebrow { color: #ff5a5a; margin-bottom: 8px; }
.benefit-modal-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 28px 34px 34px;
}
.benefit-block {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--red-soft), white 55%);
}
.benefit-block h4 {
  margin: 0 0 12px;
  color: var(--deep-red);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.benefit-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #3f434b;
  font-size: 14.5px;
  line-height: 1.55;
}

/* --- Animacion de dialogos --- */
dialog[open] {
  animation: modal-in .35s cubic-bezier(.22, .8, .3, 1);
}
dialog[open]::backdrop {
  animation: backdrop-in .35s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-close {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  transition: transform .25s ease, background .25s ease;
}
.modal-close:hover { transform: rotate(90deg); background: var(--red); }
.coach-modal[open],
.benefit-modal[open] {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 860px);
  overflow: hidden;
}
.coach-modal .modal-grid,
.benefit-modal .benefit-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Patrocinadores --- */
.sponsor-strip img {
  filter: grayscale(.85) opacity(.75);
  transition: filter .4s ease, transform .4s ease;
}
.sponsor-strip figure:hover img {
  filter: grayscale(0) opacity(1);
  transform: scale(1.05);
}

/* --- Header con scroll --- */
.site-header {
  transition: box-shadow .3s ease, background .3s ease, min-height .3s ease;
}
.site-header.scrolled {
  background: rgba(9, 9, 9, .96);
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
}

/* --- Botones con brillo --- */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-2px); }
.btn.primary:hover { box-shadow: 0 14px 32px rgba(220,38,38,.38); }

.text-link {
  position: relative;
}
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--deep-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.22, .8, .3, 1);
}
.text-link:hover::after { transform: scaleX(1); }

/* --- Responsive de la seccion 4 razones --- */
@media (max-width: 980px) {
  .benefits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefit-modal-body { grid-template-columns: 1fr; }
  .section-sub { max-width: none; }
  .modal-grid { gap: 16px; padding: 24px; }
  .modal-grid > img {
    min-height: 0;
    height: 320px;
    align-self: auto;
    object-fit: contain;
    object-position: bottom center;
  }
}
@media (max-width: 640px) {
  .benefits-grid { grid-template-columns: 1fr; }
  .benefit-modal-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 20px 18px; }
  .benefit-modal-body { padding: 20px; }
  .hero-scroll { display: none; }
}

/* --- Accesibilidad: sin movimiento --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero-copy .eyebrow,
  .hero-copy h1 .hero-line,
  .hero-copy p:not(.eyebrow),
  .hero-actions,
  .hero-scroll { opacity: 1; transform: none; animation: none; }
  .hero-media img { transition: opacity .4s ease; }
  .hero-media img.active { animation: none; transform: none; }
  dialog[open], dialog[open]::backdrop { animation: none; }
  .hero-dots button.active::after { animation: none; transform: scaleX(1); }
  .hero-scroll span { animation: none; }
}

/* --- Detalle de galeria --- */
.page-hero .eyebrow a {
  color: inherit;
  transition: opacity .2s ease;
}
.page-hero .eyebrow a:hover { opacity: .75; }
.gallery-count {
  margin-top: 4px;
  font-size: 14px !important;
  font-weight: 800;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 14px;
}
.gallery-item {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  transition: transform .3s cubic-bezier(.22, .8, .3, 1), box-shadow .3s ease, border-color .3s ease;
}
.gallery-item.is-large { grid-column: span 2; grid-row: span 2; }
.gallery-item.is-wide { grid-column: span 2; }
.gallery-item.is-tall { grid-row: span 2; }
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.42));
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(220,38,38,.4);
  box-shadow: var(--shadow-soft);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.22, .8, .3, 1), filter .7s ease;
}
.gallery-item:hover img { transform: scale(1.06); filter: saturate(1.08); }
.gallery-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: rgba(220,38,38,.92);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(8px) scale(.85);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22, .8, .3, 1);
}
.gallery-zoom svg { width: 19px; height: 19px; }
.gallery-item:hover .gallery-zoom { opacity: 1; transform: none; }

.card-media { position: relative; }
.story-card .media-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 999px;
  color: white;
  background: rgba(9,9,9,.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  backdrop-filter: blur(6px);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--deep-red) !important;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.card-cta svg {
  width: 15px;
  height: 15px;
  transition: transform .3s ease;
}
.story-card:hover .card-cta svg { transform: translateX(5px); }

/* --- Lightbox --- */
.lightbox {
  width: min(1100px, calc(100% - 20px));
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox figure {
  margin: 0;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.lightbox figure img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  background: #0b0b0b;
  transition: opacity .22s ease, transform .22s cubic-bezier(.22, .8, .3, 1);
}
.lightbox.slide-left figure img { opacity: 0; transform: translateX(-30px) scale(.98); }
.lightbox.slide-right figure img { opacity: 0; transform: translateX(30px) scale(.98); }
.lightbox.enter-left figure img,
.lightbox.enter-right figure img { transition: none; opacity: 0; }
.lightbox.enter-left figure img { transform: translateX(-30px) scale(.98); }
.lightbox.enter-right figure img { transform: translateX(30px) scale(.98); }
.lb-count {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}
.lightbox .modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
}
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(20,20,20,.65);
  color: white;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-nav:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-50%) scale(1.06);
}

/* --- Carrusel de miniaturas del lightbox --- */
.lb-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 4px 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}
.lb-thumb {
  flex: 0 0 auto;
  width: 66px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #0b0b0b;
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s ease, border-color .25s ease, transform .25s ease;
}
.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb-thumb:hover { opacity: .85; transform: translateY(-2px); }
.lb-thumb.active {
  opacity: 1;
  border-color: var(--red);
}

@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 180px; }
}

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; gap: 10px; }
  .gallery-zoom { display: none; }
  .lb-nav { width: 40px; height: 40px; font-size: 22px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lightbox .modal-close { top: 10px; right: 10px; }
  .lb-thumb { width: 52px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox figure img { transition: none; }
  .lightbox.slide-left figure img,
  .lightbox.slide-right figure img { opacity: 1; transform: none; }
}

/* ============================================================
   Horarios
   ============================================================ */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.schedule-day {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
}
.schedule-day h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--red);
  font-size: 22px;
  text-transform: uppercase;
}
.schedule-slot {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.schedule-slot:last-child { border-bottom: 0; padding-bottom: 0; }
.slot-time {
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
}
.schedule-slot strong { font-size: 17px; }
.slot-ages { color: var(--muted); font-size: 13.5px; }
.schedule-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  color: #3f434b;
}
.schedule-note svg { width: 18px; height: 18px; fill: var(--red); flex: 0 0 auto; }

/* ============================================================
   Botones de calendario en eventos
   ============================================================ */
.event-cal {
  display: flex;
  gap: 8px;
  margin: 12px 18px 0;
}
.event-cal a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #3f434b;
  font-size: 12px;
  font-weight: 800;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.event-cal a:hover {
  border-color: rgba(220,38,38,.45);
  color: var(--deep-red);
  background: var(--red-soft);
}
.event-cal svg { width: 14px; height: 14px; }

/* ============================================================
   Cronicas: tarjeta con desplegable
   ============================================================ */
.chronicle-list { display: grid; gap: 24px; }
.chronicle-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.chronicle-card:hover { border-color: rgba(220,38,38,.3); box-shadow: var(--shadow-soft); }
.chronicle-card .card-media img { aspect-ratio: auto; min-height: 240px; }
.chronicle-body { padding: 26px 28px; }
.chronicle-meta {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.chronicle-body h3 { margin: 0 0 10px; font-size: 26px; line-height: 1.1; }
.chronicle-excerpt { color: var(--muted); line-height: 1.6; }
.chronicle-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(220,38,38,.4);
  border-radius: 999px;
  color: var(--deep-red);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.chronicle-toggle:hover { background: var(--red-soft); }
.chronicle-toggle svg { width: 16px; height: 16px; transition: transform .35s cubic-bezier(.22, .8, .3, 1); }
.chronicle-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.chronicle-full {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .6s cubic-bezier(.22, .8, .3, 1), opacity .45s ease;
}
.chronicle-full.open { opacity: 1; }
.chronicle-text { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.chronicle-text p { margin: 0 0 14px; line-height: 1.75; color: #2e333b; }
.chronicle-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.chronicle-photos .gallery-item { aspect-ratio: 4 / 3; }

/* ============================================================
   Palmares
   ============================================================ */
.palmares-hero {
  background:
    linear-gradient(120deg, rgba(0,0,0,.92), rgba(127,16,16,.8)),
    url("/assets/images/hero/karate-adultos-ibiza-entrenamiento-2.jpg") center/cover;
}
.medal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.medal-total {
  padding: 26px;
  border-radius: var(--radius);
  text-align: center;
  color: #1a1a1a;
  border: 1px solid rgba(17,17,17,.08);
  box-shadow: var(--shadow-soft);
}
.medal-total strong { display: block; font-size: 46px; line-height: 1; }
.medal-total span { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.medal-oro { background: linear-gradient(150deg, #fef3c0, #f5ce62); }
.medal-plata { background: linear-gradient(150deg, #f4f4f5, #d4d4d8); }
.medal-bronce { background: linear-gradient(150deg, #f3ddc9, #d9a06b); }
.medal-otro { background: linear-gradient(150deg, #f4f4f5, #e4e4e7); }
.palmares-year { margin-bottom: 38px; }
.palmares-year h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 40px;
}
.palmares-year h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.palmares-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.palmares-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.palmares-item:hover { transform: translateY(-2px); border-color: rgba(220,38,38,.3); box-shadow: var(--shadow-soft); }
.palmares-item strong { display: block; font-size: 16px; }
.palmares-item p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.palmares-item small { display: block; margin-top: 6px; color: #9ca3af; }
.medal-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid rgba(17,17,17,.1);
}

/* ============================================================
   Juegos
   ============================================================ */
.games-hero {
  background:
    linear-gradient(120deg, rgba(0,0,0,.93), rgba(127,16,16,.72)),
    url("/assets/images/hero/deporte-escolar-ibiza-karate-1.jpg") center/cover;
}
.games-hub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.game-card {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17,17,17,.04);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1), box-shadow .3s ease, border-color .3s ease;
}
.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--deep-red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.22, .8, .3, 1);
}
.game-card:hover { transform: translateY(-5px); border-color: rgba(220,38,38,.35); box-shadow: var(--shadow); }
.game-card:hover::before { transform: scaleX(1); }
.game-tag {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--deep-red);
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.game-card h3 { margin: 6px 0 0; font-size: 24px; }
.game-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.game-meta {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 800;
}
.game-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.game-cta svg { width: 16px; height: 16px; transition: transform .3s ease; }
.game-card:hover .game-cta svg { transform: translateX(5px); }

.game-panel { max-width: 860px; margin: 0 auto; }
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.game-top h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.game-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #3f434b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.game-back:hover { border-color: rgba(220,38,38,.4); color: var(--deep-red); }
.quiz-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
  margin-bottom: 8px;
}
.quiz-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--deep-red));
  transition: width .4s cubic-bezier(.22, .8, .3, 1);
}
.quiz-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.quiz-streak { color: var(--deep-red); }
.quiz-category {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--deep-red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.quiz-question {
  margin: 0 0 20px;
  font-size: clamp(20px, 3.2vw, 27px);
  font-weight: 900;
  line-height: 1.25;
  animation: rise-in .45s cubic-bezier(.22, .8, .3, 1) both;
}
.quiz-answers { display: grid; gap: 10px; }
.quiz-answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  animation: rise-in .45s cubic-bezier(.22, .8, .3, 1) both;
}
.quiz-answer:nth-child(2) { animation-delay: .05s; }
.quiz-answer:nth-child(3) { animation-delay: .1s; }
.quiz-answer:nth-child(4) { animation-delay: .15s; }
.quiz-answer:not(:disabled):hover {
  transform: translateX(4px);
  border-color: rgba(220,38,38,.45);
  box-shadow: var(--shadow-soft);
}
.quiz-answer .key {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.quiz-answer.correct {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
}
.quiz-answer.correct .key { background: #16a34a; color: white; }
.quiz-answer.incorrect {
  border-color: #dc2626;
  background: #fef2f2;
  color: #7f1d1d;
  animation: shake .4s ease;
}
.quiz-answer.incorrect .key { background: #dc2626; color: white; }
.quiz-answer.dimmed { opacity: .45; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-result { text-align: center; padding: 30px 0 10px; }
.quiz-result .belt {
  width: min(300px, 80%);
  height: 26px;
  margin: 22px auto 10px;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}
.quiz-result .belt::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 34px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.16);
}
.quiz-result h3 { margin: 12px 0 4px; font-size: clamp(26px, 4vw, 38px); }
.quiz-result .score-big { font-size: clamp(40px, 7vw, 64px); font-weight: 1000; color: var(--deep-red); line-height: 1; }
.quiz-result p { color: var(--muted); }
.quiz-result .best { margin-top: 4px; font-size: 13px; font-weight: 800; color: #9ca3af; }
.quiz-result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.match-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.match-topic {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.match-topic:hover { transform: translateY(-3px); border-color: rgba(220,38,38,.4); box-shadow: var(--shadow-soft); }
.match-topic small { display: block; margin-top: 4px; color: var(--muted); font-weight: 600; }
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-top: 18px;
}
.match-col { display: grid; gap: 10px; align-content: start; }
.match-chip {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .3s ease;
}
.match-chip:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(220,38,38,.45); }
.match-chip.selected { border-color: var(--red); background: var(--red-soft); color: var(--deep-red); }
.match-chip.matched {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
  cursor: default;
  animation: match-pop .35s cubic-bezier(.22, .8, .3, 1);
}
.match-chip.error { border-color: #dc2626; background: #fef2f2; animation: shake .4s ease; }
@keyframes match-pop {
  0% { transform: scale(.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.match-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* Confeti simple del resultado */
.confetti {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 16px;
  z-index: 999;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .2; }
}

/* ============================================================
   Admin: preview de imagen, gestor de fotos, login help
   ============================================================ */
.form-preview {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 800;
}
.form-preview span { font-size: 14px; }
.form-preview img {
  width: min(280px, 100%);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.media-manager {
  width: min(760px, 100%);
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}
.media-manager h2 { margin: 0 0 6px; font-size: 24px; }
.media-hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.media-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.media-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.media-item figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.media-actions { display: flex; gap: 4px; }
.media-actions form { margin: 0; }
.media-actions button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.media-actions button:hover { border-color: rgba(220,38,38,.5); color: var(--deep-red); }
.media-actions .media-delete:hover { background: var(--red); border-color: var(--red); color: white; }
.login-help { margin: 4px 0 0; text-align: center; font-size: 14px; }
.login-help a { color: var(--deep-red); font-weight: 800; }
.alert-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

@media (max-width: 980px) {
  .schedule-grid { grid-template-columns: 1fr; }
  .palmares-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chronicle-card { grid-template-columns: 1fr; }
  .chronicle-card .card-media img { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 640px) {
  .games-hub, .match-topics, .palmares-list, .medal-summary { grid-template-columns: 1fr; }
  .match-board { gap: 8px 10px; }
  .chronicle-body { padding: 20px; }
  .event-cal { margin-left: 18px; margin-right: 18px; flex-wrap: wrap; }
}
