/* ═══════════════════════════════════════════════════════════════════
   TORNEO DESTACADO (portada) + INSCRIPCIÓN PÚBLICA (inscripcion.php)
   Se carga vía $extra_css sólo en esas dos páginas.
═══════════════════════════════════════════════════════════════════ */

/* ─── Sección destacada en index.php ─────────────────────────────── */
/* Va de PRIMERA en la portada (antes del hero, pedido del usuario
   2026-11-10): lo primero que se ve al entrar es el torneo. Por eso lleva el
   alto del nav fijo en el padding superior y no tiene borde arriba. */
.destacado {
  background: var(--black);
  padding-top: calc(var(--nav-h) + 5rem);
  border-bottom: 3px solid var(--gold-dk);
  position: relative;
  overflow: hidden;
}
.destacado::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(201,168,76,.14), transparent 55%),
    repeating-conic-gradient(#121212 0% 25%, #0e0e0e 0% 50%) 0 0 / 64px 64px;
  opacity: .9;
  pointer-events: none;
}
.destacado .section-inner { position: relative; }

.dt-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 3rem;
  align-items: center;
}
.dt-grid.dt-sin-afiche { grid-template-columns: 1fr; }
/* Con horario, tercera columna a la derecha: la imagen es apaisada (3:2),
   así que a 300px queda a ~200px de alto, al lado del texto y no debajo. */
.dt-grid.dt-con-horario { grid-template-columns: minmax(220px, 320px) 1fr minmax(240px, 300px); }
.dt-grid.dt-sin-afiche.dt-con-horario { grid-template-columns: 1fr minmax(240px, 320px); }

.dt-afiche {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(201,168,76,.25);
  transform: rotate(-1.5deg);
  transition: transform .5s var(--ease);
}
.dt-afiche:hover { transform: rotate(0) scale(1.02); }
.dt-afiche img { display: block; width: 100%; height: auto; }

.dt-body .section-title { margin-bottom: 1rem; }

.dt-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.dt-badge {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; padding: .35rem .75rem; border-radius: 2px;
  border: 1px solid rgba(201,168,76,.4); color: var(--gold-lt);
}
.dt-badge.is-open { background: var(--gold); color: var(--black); border-color: var(--gold); }
.dt-badge.is-closed { border-color: rgba(255,255,255,.2); color: var(--white-dim); }

.dt-desc {
  font-family: var(--sans); color: var(--white-dim);
  font-size: .95rem; line-height: 1.75; max-width: 560px; margin-bottom: 1.75rem;
}

.dt-datos {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
}
.dt-datos li { border-left: 2px solid var(--gold-dk); padding-left: .85rem; }
.dt-datos span {
  display: block; font-family: var(--sans); font-size: .62rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--white-dim);
  margin-bottom: .25rem;
}
.dt-datos strong {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 500;
  color: var(--white); line-height: 1.3;
}

.dt-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.dt-contador { font-family: var(--sans); font-size: .85rem; color: var(--white-dim); margin-top: 1.25rem; }
.dt-contador strong { color: var(--gold-lt); font-size: 1.1rem; }

/* Horario de rondas: tarjeta pequeña en la tercera columna (antes iba
   debajo a 1000px de ancho y se comía media pantalla). Se abre en grande
   al tocarla. */
.dt-horario { margin: 0; align-self: center; }
.dt-horario figcaption {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--white-dim); margin-bottom: .7rem;
}
.dt-horario a {
  display: block; border-radius: 8px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(201,168,76,.25);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.dt-horario a:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(201,168,76,.5); }
.dt-horario img { display: block; width: 100%; height: auto; }
.dt-horario-zoom {
  display: block; margin-top: .55rem; font-family: var(--sans);
  font-size: .72rem; color: var(--white-dim); opacity: .8;
}

/* Entre 901 y 1300px no caben tres columnas sin partir los botones: el horario baja a la fila de
   abajo, bajo el texto, pero sigue pequeño (420px). */
@media (max-width: 1300px) {
  .dt-grid.dt-con-horario { grid-template-columns: minmax(220px, 320px) 1fr; }
  .dt-grid.dt-sin-afiche.dt-con-horario { grid-template-columns: 1fr; }
  .dt-grid.dt-con-horario .dt-horario { grid-column: 2; max-width: 420px; margin-top: .5rem; }
  .dt-grid.dt-sin-afiche.dt-con-horario .dt-horario { grid-column: 1; }
}
@media (max-width: 900px) {
  .dt-grid, .dt-grid.dt-con-horario, .dt-grid.dt-sin-afiche.dt-con-horario { grid-template-columns: 1fr; gap: 2.5rem; }
  /* En teléfono el texto y el botón van primero: con el afiche arriba el
     nombre del torneo quedaba a pantalla y media de scroll. */
  .dt-body { order: 1; }
  .dt-afiche { order: 2; max-width: 300px; margin: 0 auto; transform: none; }
  .dt-grid.dt-con-horario .dt-horario { order: 3; grid-column: 1; max-width: 420px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
  .destacado { padding: calc(var(--nav-h) + 2.5rem) 1.25rem 4rem; }
  .dt-datos strong { font-size: 1.05rem; }
  .dt-cta .btn { width: 100%; justify-content: center; }
}

/* ─── inscripcion.php ─────────────────────────────────────────────── */
.ins-hero {
  background: var(--black);
  padding: calc(var(--nav-h) + 3rem) 2rem 3rem;
  border-bottom: 3px solid var(--gold-dk);
  color: var(--white);
}
.ins-hero .section-inner { display: flex; gap: 2rem; align-items: center; }
.ins-hero-thumb {
  width: 110px; flex: 0 0 auto; border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.ins-hero-thumb img { display: block; width: 100%; height: auto; }
.ins-hero .section-label { margin-bottom: .4rem; }
.ins-hero h1 {
  font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 500; margin: 0 0 .75rem; line-height: 1.15;
}
.ins-hero-meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-family: var(--sans); font-size: .85rem; color: var(--white-dim);
}
.ins-hero-meta strong { color: var(--white); font-weight: 500; }

.ins-section { padding: 3.5rem 2rem 5rem; background: var(--bg); }
.ins-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem; align-items: start;
}

.ins-card {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 2.25rem;
}
.ins-card h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin-bottom: .35rem; }
.ins-lead { font-family: var(--sans); color: var(--text-sub); font-size: .9rem; margin-bottom: 1.75rem; line-height: 1.6; }

.ins-fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
.ins-fieldset legend {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-dk); margin-bottom: .9rem;
  padding: 0; display: flex; align-items: center; gap: .6rem; width: 100%;
}
.ins-fieldset legend::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.ins-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.ins-row.ins-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.ins-hint { font-family: var(--sans); font-size: .75rem; color: var(--text-lt); margin-top: .3rem; line-height: 1.4; }
.ins-req { color: #dc2626; }
select.form-input { appearance: auto; cursor: pointer; }

.ins-radio { display: flex; gap: .5rem; }
.ins-radio label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem; border: 1px solid var(--border); border-radius: 3px;
  background: var(--bg); font-family: var(--sans); font-size: .9rem; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.ins-radio input { accent-color: var(--gold-dk); }
.ins-radio label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,.12); }

.ins-error {
  background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c;
  border-radius: 6px; padding: .9rem 1rem; margin-bottom: 1.5rem;
  font-size: .88rem; font-family: var(--sans);
}
.ins-error ul { margin: .4rem 0 0 1.1rem; }
.ins-closed {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 2rem; text-align: center; font-family: var(--sans); color: var(--text-sub); line-height: 1.6;
}
.ins-closed strong { color: var(--text); }
.ins-privacy { font-family: var(--sans); font-size: .75rem; color: var(--text-lt); margin-top: 1rem; line-height: 1.5; }

.ins-aside { display: flex; flex-direction: column; gap: 1.25rem; }
.ins-aside-afiche { border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.18); }
.ins-aside-afiche img { display: block; width: 100%; height: auto; }
.ins-aside-box {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.4rem; font-family: var(--sans); font-size: .88rem; color: var(--text-sub); line-height: 1.6;
}
.ins-aside-box h3 { font-family: var(--serif); font-size: 1.05rem; color: var(--text); margin-bottom: .5rem; }
.ins-aside-box .ins-count { font-family: var(--serif); font-size: 2.4rem; color: var(--gold-dk); line-height: 1; }
.ins-aside-box a { color: var(--gold-dk); }

.ins-ok { text-align: center; padding: 2rem 1rem; }
.ins-ok-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--gold); color: var(--black);
  display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1.25rem;
}
.ins-ok h2 { font-family: var(--serif); font-size: 1.8rem; font-weight: 500; margin-bottom: .6rem; }
.ins-ok p { font-family: var(--sans); color: var(--text-sub); max-width: 460px; margin: 0 auto 1.75rem; line-height: 1.65; }
.ins-ok-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }

/* Campo trampa para bots: fuera de pantalla, no display:none (algunos lo respetan). */
.ins-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* En teléfono el formulario va primero: las cajas laterales (contador,
   descripción, dudas) lo empujaban dos pantallas hacia abajo. */
@media (max-width: 900px) {
  .ins-wrap { grid-template-columns: 1fr; }
  .ins-aside-afiche { display: none; }
}
@media (max-width: 640px) {
  .ins-hero { padding: calc(var(--nav-h) + 1.5rem) 1.25rem 2rem; }
  .ins-hero .section-inner { gap: 1.25rem; }
  .ins-hero-thumb { width: 80px; }
  .ins-section { padding: 2rem 1rem 4rem; }
  .ins-card { padding: 1.5rem 1.25rem; }
  .ins-row, .ins-row.ins-row-3 { grid-template-columns: 1fr; }
  .ins-ok-actions .btn { width: 100%; justify-content: center; }
}

/* ─── Buscador de miembros en el formulario ───────────────────────── */
.ins-oculto { display: none !important; }
.ins-fieldset legend small { font-size: .62rem; letter-spacing: .08em; text-transform: none; color: var(--text-lt); }

.ins-buscar { position: relative; }
.ins-buscar .form-input { padding-left: 2.6rem; }
.ins-buscar::before {
  content: ''; position: absolute; left: .95rem; top: .95rem; width: 1rem; height: 1rem;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  pointer-events: none;
}
.ins-dd {
  position: absolute; left: 0; right: 0; top: calc(100% - 1.4rem); z-index: 30;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.16); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.ins-dd-item {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; align-items: center;
  width: 100%; text-align: left; padding: .7rem .95rem; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer; font-family: var(--sans);
}
.ins-dd-item:last-child { border-bottom: 0; }
.ins-dd-item:hover, .ins-dd-item.is-activo { background: rgba(201,168,76,.12); }
.ins-dd-nom { font-size: .95rem; color: var(--text); grid-column: 1; }
.ins-dd-nom em { font-style: normal; font-weight: 700; color: var(--gold-dk); font-size: .75rem; }
.ins-dd-meta { font-size: .75rem; color: var(--text-lt); grid-column: 1; }
.ins-dd-ya {
  grid-column: 2; grid-row: 1 / 3; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-lt); border: 1px solid var(--border); border-radius: 2px; padding: .2rem .45rem;
}
.ins-dd-item.is-ya { cursor: default; opacity: .6; }
.ins-dd-item.is-ya:hover { background: transparent; }
.ins-dd-vacio { padding: .8rem .95rem; font-family: var(--sans); font-size: .85rem; color: var(--text-sub); line-height: 1.5; }

.ins-sel {
  display: flex; align-items: center; gap: .9rem;
  background: rgba(201,168,76,.1); border: 1px solid var(--gold); border-radius: 6px; padding: .9rem 1rem;
}
.ins-sel-ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--black);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.ins-sel-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-family: var(--sans); }
.ins-sel-txt strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; color: var(--text); }
.ins-sel-txt span { font-size: .78rem; color: var(--text-sub); }
.ins-sel-x {
  flex: 0 0 auto; background: transparent; border: 1px solid var(--border); border-radius: 3px;
  padding: .45rem .75rem; font-family: var(--sans); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-sub); cursor: pointer;
}
.ins-sel-x:hover { border-color: var(--text); color: var(--text); }

/* El hero (frases + puzzle) queda en segundo lugar cuando hay destacado: ya
   no está bajo el nav fijo, así que sobra el hueco que reservaba para él, y
   no necesita ocupar la pantalla entera. */
.destacado + .hero { min-height: 0; }
.destacado + .hero .hero-content { padding-top: 4rem; }
.destacado + .hero .hero-puzzle  { padding-top: 3rem; }
@media (max-width: 640px) {
  .destacado + .hero .hero-content { padding-top: 2.5rem; }
}
