/* =========================================================
   FEBOBI · Componentes reutilizables
   Tarjetas (acceso, torneo, jugador, club), fecha, listas
   de datos, resultados de búsqueda y fichas emergentes.
   ========================================================= */

/* Superficie de tarjeta común */
.tile, .torneo, .prow, .club, .org, .m-fact, .faq details, .news-box, .cal {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
}

/* ---------- Acceso rápido ---------- */
.tile {
  position: relative; display: grid; align-content: start; gap: 6px; min-height: 196px; padding: 28px 28px 30px;
  text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.tile:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--gold); }
.tile__ic { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 12px; border-radius: 18px; background: linear-gradient(145deg, var(--felt-600), var(--felt-800)); color: var(--gold-2); }
.tile__ic .ic { width: 28px; height: 28px; }
.tile strong { font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.tile > span:not([class]) { color: var(--ink-2); }
.tile__go { position: absolute; right: 24px; top: 28px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ivory); color: var(--ink-3); transition: background-color .3s, color .3s, transform .3s var(--ease); }
.tile:hover .tile__go { background: var(--gold-2); color: var(--on-gold); transform: translateX(3px); }
@media (max-width: 560px) {
  .tile { min-height: 0; grid-template-columns: auto 1fr; column-gap: 16px; padding: 18px 64px 18px 18px; }
  .tile__ic { grid-row: span 2; margin: 0; width: 52px; height: 52px; }
  .tile__go { top: 50%; right: 14px; margin-top: -20px; }
}

/* ---------- Bloque de fecha ---------- */
.datebox { display: grid; place-content: center; text-align: center; min-width: 96px; padding: 12px 14px; border-radius: 18px; background: var(--felt-900); color: #fff; line-height: 1.1; }
.datebox__m { font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); }
.datebox__d { font-family: var(--display); font-weight: 600; font-size: 1.9rem; white-space: nowrap; }
.datebox__y { font-size: .78rem; opacity: .75; }

/* ---------- Lista de datos con ícono ---------- */
.meta { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); }
.meta li { display: flex; gap: 12px; align-items: flex-start; }
.meta .ic { margin-top: .2em; color: var(--felt-600); }
.meta b { color: var(--ink); }

/* ---------- Tarjeta de torneo ---------- */
.torneo { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); border: 0; box-shadow: var(--shadow-lg); transition: transform .45s var(--ease); }
.torneo:hover { transform: translateY(-6px); }
.torneo__top {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px;
  background:
    radial-gradient(circle at 88% 50%, rgba(230,196,114,.22), transparent 45%),
    radial-gradient(circle at 12px 12px, rgba(255,255,255,.06) 2px, transparent 2.5px) 0 0 / 22px 22px,
    linear-gradient(135deg, var(--felt-600), var(--felt-900));
}
.torneo__top .datebox { background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.torneo__count { display: flex; align-items: center; gap: 10px; color: var(--on-felt-2); font-size: .85rem; line-height: 1.2; text-align: left; }
.torneo__count b { font-family: var(--display); font-weight: 600; font-size: 2.6rem; line-height: 1; color: var(--gold-2); }
.torneo__body { display: grid; gap: 12px; align-content: start; flex: 1; padding: 24px; }
.torneo__body h3 { font-family: var(--display); font-weight: 600; font-size: 1.65rem; }
.torneo__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 24px 24px; }
.torneo__actions .btn { flex: 1 1 160px; }
@media (max-width: 420px) { .torneo__top, .torneo__body { padding: 18px; } .torneo__actions { padding: 0 18px 18px; } .torneo__count b { font-size: 2rem; } }

/* ---------- Fila de jugador ---------- */
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r); animation: row-in .4s var(--ease) both; }
.prow.flash { animation: flash 2.2s var(--ease); }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes flash { 0%, 45% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.prow__name { font-weight: 700; font-size: 1.08rem; line-height: 1.25; }
.prow__club { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: .92rem; text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.prow__club:hover { color: var(--felt-700); text-decoration-color: currentColor; }
@media (max-width: 420px) { .prow { grid-template-columns: auto minmax(0, 1fr); } .prow .badge { grid-column: 2; justify-self: start; } }

/* ---------- Tarjeta de club ---------- */
.club { display: grid; gap: 14px; align-content: start; padding: 22px; text-align: left; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
.club:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--gold); }
.club__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.club__mono { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--felt-800); color: var(--gold-2); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.club__city { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); text-align: right; }
.club__city .ic { width: 1.05em; height: 1.05em; }
.club h3 { font-family: var(--display); font-weight: 600; font-size: 1.28rem; }
.club__bar { display: flex; height: 8px; gap: 2px; overflow: hidden; border-radius: var(--pill); background: var(--ivory); }
.club__bar i { display: block; min-width: 6px; }
.club__foot { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-weight: 700; }
.club__go { display: inline-flex; align-items: center; gap: 6px; color: var(--felt-700); }
.club:hover .club__go .ic { transform: translateX(3px); }
.club__go .ic { transition: transform .3s var(--ease); }
/* En celular: fila compacta (inicial · nombre y ciudad · jugadores) para no hacer la página eterna */
@media (max-width: 600px) {
  .club { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 14px 16px; border-radius: var(--r); }
  .club__top { display: contents; }
  .club__mono { grid-row: span 3; }
  .club__city { order: 2; grid-column: 2; justify-content: flex-start; text-align: left; font-size: .72rem; }
  .club h3 { order: 1; grid-column: 2; font-size: 1.1rem; }
  .club__bar { display: none; }
  .club__foot { order: 3; grid-column: 2; font-size: .9rem; }
}

/* ---------- Entidades ---------- */
.org { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r); text-decoration: none; }
.org__badge { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--felt-800); color: var(--gold-2); font-weight: 700; font-size: .95rem; letter-spacing: .06em; }
.org div { display: grid; }
.org div span { color: var(--ink-3); font-size: .92rem; }
.org--link { transition: border-color .2s, transform .3s var(--ease); }
.org--link:hover { border-color: var(--gold); transform: translateX(4px); }
.org__go { margin-left: auto; color: var(--ink-3); }

/* ---------- Nota destacada ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 20px 24px; border-radius: var(--r); background: rgba(230,196,114,.12); border: 1px solid rgba(230,196,114,.35); }
.notice > .ic { width: 1.5em; height: 1.5em; color: var(--gold-2); }

/* ---------- Resultados de búsqueda ---------- */
.res-group + .res-group { margin-top: 8px; }
.res-group h5 { padding: 8px 12px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.res { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px; border: 0; border-radius: 14px; background: transparent; text-align: left; }
.res:hover, .res.is-active { background: var(--ivory); }
.res.is-active { box-shadow: inset 0 0 0 2px var(--felt-600); }
.res__ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--felt-800); color: var(--gold-2); font-weight: 700; font-size: .85rem; }
.res__t { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.res__t strong { font-size: 1.02rem; }
.res__t > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--ink-2); }
.res > .ic { color: var(--ink-3); }
.res--more .res__ic { background: var(--gold-2); color: var(--on-gold); }
.res-empty, .res-tips { padding: 22px 16px; color: var(--ink-2); }
.res-empty { text-align: center; }
.res-empty strong { display: block; color: var(--ink); font-size: 1.05rem; }
.res-tips p { margin-bottom: 12px; }
.results--drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; max-height: min(440px, 60vh); overflow-y: auto; padding: 10px;
  background: var(--paper); color: var(--ink); border-radius: 22px; box-shadow: var(--shadow-lg); text-align: left; overscroll-behavior: contain;
}

/* Ventana del buscador */
.search-dlg { width: min(720px, 100% - 24px); margin: 8vh auto auto; }
.search-dlg__box { overflow: hidden; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow-lg); }
.search-dlg__bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.search-dlg__bar > .ic { width: 1.5em; height: 1.5em; color: var(--felt-700); }
.search-dlg__bar input[type="search"] { min-height: 60px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 1.2rem; }
.search-dlg .results { max-height: min(60vh, 560px); overflow-y: auto; padding: 10px; overscroll-behavior: contain; }
.search-dlg__hint { display: flex; justify-content: center; gap: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }
.search-dlg__hint kbd { margin-right: 3px; }
@media (max-width: 600px) { .search-dlg { margin-top: 12px; } .search-dlg__hint { display: none; } }

/* ---------- Ficha emergente ---------- */
.modal { width: min(780px, 100% - 24px); margin: auto; }
.modal__box { position: relative; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow-lg); }
.modal__close { position: absolute; right: 16px; top: 16px; z-index: 2; }
.m-hero { padding: 36px 32px 28px; color: var(--on-felt); background: radial-gradient(circle at 90% 0%, rgba(230,196,114,.2), transparent 50%), linear-gradient(160deg, var(--felt-700), var(--felt-900)); }
.m-hero .eyebrow { margin-bottom: 10px; }
.m-hero h2 { padding-right: 56px; font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.m-hero p { margin-top: 8px; color: var(--on-felt-2); }
.m-count { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 16px; padding: 8px 16px; border-radius: var(--pill); background: rgba(0,0,0,.22); color: var(--on-felt-2); font-weight: 700; }
.m-count b { font-family: var(--display); font-size: 1.6rem; color: var(--gold-2); }
.m-body { display: grid; gap: 24px; padding: 28px 32px 32px; }
.m-body h3 { margin-bottom: 12px; font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
.m-body > p, .m-text { color: var(--ink-2); font-size: 1.08rem; }
.m-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-fact { padding: 16px 18px; border-radius: 16px; }
.m-fact dt { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.m-fact dd { margin-top: 4px; font-size: 1.08rem; font-weight: 700; }
.m-note { padding: 14px 16px; border-radius: 14px; background: #fff8e6; border: 1px solid #f0d48d; color: var(--ink-2); font-size: .95rem; }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.m-dist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.m-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.m-players li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.m-players li span:not(.badge):not(.avatar) { flex: 1; min-width: 0; }
.m-players .avatar { width: 38px; height: 38px; font-size: .8rem; }
.m-host { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-align: left; transition: border-color .2s; }
.m-host:hover { border-color: var(--gold); }
.m-host .datebox { min-width: 84px; padding: 8px; }
.m-host .datebox__d { font-size: 1.4rem; }
@media (max-width: 620px) {
  .m-hero { padding: 28px 20px 22px; } .m-body { padding: 22px 20px 24px; }
  .m-facts, .m-players { grid-template-columns: minmax(0, 1fr); }
  .m-actions .btn { flex: 1 1 100%; }
}
