/* Portal público de federación (AJEFECH). Todo con prefijo .fp- para no chocar con YNEX ni public.css. */
:root {
  --fp-red: #e53e3e;
  --fp-red-dark: #c53030;
  --fp-navy: #1a365d;
  --fp-bg: #f9fafb;
  --fp-text: #111827;
  --fp-muted: #6b7280;
  --fp-border: #e5e7eb;
  --fp-card: #ffffff;
}

body:has(.fp-root) { background: var(--fp-bg); }

.fp-root {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fp-text);
  background: var(--fp-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.55;
}
.fp-root *, .fp-root *::before, .fp-root *::after { box-sizing: border-box; }
.fp-root a { color: var(--fp-red); text-decoration: none; }
.fp-root a:hover { color: var(--fp-red-dark); text-decoration: underline; }
.fp-root h1, .fp-root h2, .fp-root h3, .fp-root h4 { color: var(--fp-navy); font-weight: 800; line-height: 1.2; margin: 0 0 .5rem; }
.fp-root h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.fp-root h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.fp-root h3 { font-size: 1.15rem; }
.fp-root p { margin: 0 0 1rem; }

.fp-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.fp-main { flex: 1; padding: 2rem 0 3rem; }
.fp-section { margin-bottom: 3rem; }
.fp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.fp-page-head { margin-bottom: 1.5rem; }
.fp-page-head p { color: var(--fp-muted); margin: 0; }
.fp-muted { color: var(--fp-muted); }
.fp-center { text-align: center; }

/* Header */
.fp-header { background: #fff; border-bottom: 1px solid var(--fp-border); position: sticky; top: 0; z-index: 50; }
.fp-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.fp-brand { display: flex; align-items: center; gap: .6rem; color: var(--fp-navy) !important; font-weight: 800; text-decoration: none !important; }
.fp-brand img { height: 44px; width: auto; display: block; }
.fp-brand-text { font-size: 1.1rem; letter-spacing: .02em; }
.fp-nav { display: flex; align-items: center; gap: .25rem; }
.fp-nav a { color: var(--fp-text); padding: .5rem .8rem; border-radius: 9999px; font-weight: 500; font-size: .95rem; text-decoration: none !important; }
.fp-nav a:hover { background: #f3f4f6; color: var(--fp-navy); }
.fp-nav a.is-active { color: var(--fp-red); font-weight: 700; }
.fp-nav a.fp-nav-cta { background: var(--fp-red); color: #fff; font-weight: 700; margin-left: .35rem; }
.fp-nav a.fp-nav-cta:hover { background: var(--fp-red-dark); color: #fff; }
.fp-nav-toggle, .fp-burger { display: none; }

@media (max-width: 900px) {
  .fp-burger { display: inline-flex; flex-direction: column; gap: 5px; padding: .5rem; cursor: pointer; }
  .fp-burger span { width: 24px; height: 2px; background: var(--fp-navy); display: block; }
  .fp-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--fp-border); flex-direction: column; align-items: stretch; padding: .5rem 1rem 1rem; }
  .fp-nav a { padding: .75rem 1rem; }
  .fp-nav-toggle:checked ~ .fp-nav { display: flex; }
}

/* Botones pill */
.fp-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 9999px; padding: .65rem 1.4rem; font-weight: 700; border: 2px solid transparent; cursor: pointer; font-size: .95rem; text-decoration: none !important; transition: background .15s, color .15s, box-shadow .15s; }
.fp-btn-primary { background: var(--fp-red); color: #fff !important; box-shadow: 0 4px 12px rgba(229, 62, 62, .3); }
.fp-btn-primary:hover { background: var(--fp-red-dark); }
.fp-btn-outline { background: transparent; color: var(--fp-navy) !important; border-color: var(--fp-navy); }
.fp-btn-outline:hover { background: var(--fp-navy); color: #fff !important; }
.fp-btn-light { background: #fff; color: var(--fp-navy) !important; }
.fp-btn-sm { padding: .35rem .9rem; font-size: .85rem; }

/* Hero */
.fp-hero { position: relative; color: #fff; background: linear-gradient(135deg, rgba(10, 20, 40, .92), rgba(26, 54, 93, .85)), repeating-conic-gradient(#1a365d 0% 25%, #16304f 0% 50%) 0 0 / 80px 80px; padding: 5rem 0; text-align: center; }
.fp-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.fp-hero > .fp-container { position: relative; z-index: 1; }
.fp-hero h1 { color: #fff; max-width: 900px; margin: 0 auto 1rem; font-size: clamp(2rem, 5vw, 3.4rem); }
.fp-hero p { max-width: 720px; margin: 0 auto 2rem; font-size: 1.2rem; color: #e2e8f0; }
.fp-hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Tarjetas */
.fp-grid { display: grid; gap: 1.25rem; }
.fp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.fp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.fp-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .fp-grid-3, .fp-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .fp-grid-3, .fp-grid-2, .fp-grid-4 { grid-template-columns: 1fr; } }

.fp-card { background: var(--fp-card); border: 1px solid var(--fp-border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); overflow: hidden; }
.fp-card-body { padding: 1.25rem; }
.fp-card h3 { margin-bottom: .4rem; }
.fp-link-card { display: block; color: inherit !important; text-decoration: none !important; padding: 1.5rem; height: 100%; transition: box-shadow .15s, transform .15s; }
.fp-link-card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.fp-link-card .fp-icon { width: 48px; height: 48px; border-radius: 9999px; background: rgba(229, 62, 62, .1); color: var(--fp-red); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: .75rem; }

.fp-banner { background: var(--fp-navy); color: #fff; border-radius: 12px; padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }
.fp-banner strong { font-size: 1.1rem; }
.fp-banner p { margin: .15rem 0 0; color: #cbd5e1; }

.fp-news-card img, .fp-news-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #e5e7eb; }
.fp-news-card h3 a { color: var(--fp-navy); }
.fp-news-meta { color: var(--fp-muted); font-size: .85rem; margin-bottom: .35rem; }
.fp-featured { display: grid; grid-template-columns: 1.2fr 1fr; margin-bottom: 1.5rem; }
@media (max-width: 800px) { .fp-featured { grid-template-columns: 1fr; } }

.fp-tourney { display: flex; gap: 1rem; padding: 1.1rem; align-items: flex-start; }
.fp-date-box { flex: 0 0 62px; text-align: center; border-radius: 10px; background: rgba(26, 54, 93, .07); padding: .4rem 0; line-height: 1.1; }
.fp-date-box b { display: block; font-size: 1.5rem; color: var(--fp-navy); }
.fp-date-box small { font-size: .7rem; color: var(--fp-muted); text-transform: uppercase; }

.fp-badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 9999px; padding: .15rem .6rem; background: #eef2f7; color: var(--fp-navy); }
.fp-badge-red { background: rgba(229, 62, 62, .12); color: var(--fp-red-dark); }
.fp-badge-green { background: #dcfce7; color: #166534; }
.fp-badge-gray { background: #f3f4f6; color: #4b5563; }
.fp-title-tag { font-weight: 700; text-transform: uppercase; font-size: .72rem; color: var(--fp-red); margin-right: .3rem; }

.fp-honor { display: flex; gap: 1rem; align-items: center; padding: 1.25rem; }
.fp-avatar { flex: 0 0 56px; height: 56px; border-radius: 9999px; background: var(--fp-navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.fp-honor-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fp-red); font-weight: 700; }
.fp-honor-elo { display: flex; gap: 1.25rem; margin-top: .25rem; font-size: .9rem; color: var(--fp-muted); }
.fp-honor-elo b { color: var(--fp-text); font-size: 1.1rem; }

/* Tablas */
.fp-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--fp-border); border-radius: 12px; }
.fp-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.fp-table th { text-align: left; background: #f3f4f6; color: var(--fp-navy); font-weight: 700; padding: .7rem .9rem; white-space: nowrap; border-bottom: 1px solid var(--fp-border); }
.fp-table td { padding: .65rem .9rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.fp-table tr:last-child td { border-bottom: 0; }
.fp-table tbody tr:hover { background: #fafafa; }
.fp-num { text-align: right; font-variant-numeric: tabular-nums; }
.fp-table th.fp-num { text-align: right; }

/* Formularios / filtros */
.fp-filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; background: #fff; border: 1px solid var(--fp-border); border-radius: 12px; padding: 1rem; margin-bottom: 1.25rem; }
.fp-field { display: flex; flex-direction: column; gap: .25rem; min-width: 150px; }
.fp-field label { font-size: .8rem; font-weight: 600; color: var(--fp-navy); }
.fp-input, .fp-select { border: 1px solid #d1d5db; border-radius: 8px; padding: .5rem .7rem; font: inherit; background: #fff; color: var(--fp-text); min-height: 40px; }
.fp-input:focus, .fp-select:focus { outline: 2px solid rgba(229, 62, 62, .4); border-color: var(--fp-red); }

/* Pestañas */
.fp-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.fp-tab { padding: .5rem 1.1rem; border-radius: 9999px; background: #fff; border: 1px solid var(--fp-border); color: var(--fp-navy) !important; font-weight: 600; font-size: .9rem; text-decoration: none !important; }
.fp-tab.is-active { background: var(--fp-navy); border-color: var(--fp-navy); color: #fff !important; }

/* Paginación */
.fp-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; color: var(--fp-muted); font-size: .9rem; }
.fp-pager-links { display: flex; gap: .4rem; }

/* Estados */
.fp-notice { border: 1px dashed #cbd5e1; border-radius: 12px; padding: 1.5rem; text-align: center; background: #fff; color: var(--fp-muted); }
.fp-notice.is-error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

/* Contenido HTML editorial */
.fp-prose { font-size: 1.02rem; overflow-wrap: anywhere; }
.fp-prose img { max-width: 100%; height: auto; }
.fp-prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.fp-prose th, .fp-prose td { border: 1px solid var(--fp-border); padding: .4rem .6rem; }
.fp-prose h1, .fp-prose h2, .fp-prose h3 { margin-top: 1.4rem; }
.fp-article { max-width: 820px; margin: 0 auto; }
.fp-article-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin-bottom: 1.25rem; }
.fp-breadcrumb { font-size: .88rem; color: var(--fp-muted); margin-bottom: 1rem; }

/* Mapa */
.fp-map { width: 100%; height: 360px; border-radius: 12px; border: 1px solid var(--fp-border); margin-bottom: 1.5rem; background: #e5e7eb; }
.fp-map-pin { width: 18px; height: 18px; border-radius: 9999px; background: var(--fp-red); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); cursor: pointer; }

/* Ficha de jugador */
.fp-player-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.fp-player-head .fp-avatar { flex-basis: 80px; height: 80px; font-size: 1.6rem; }
.fp-stat { padding: 1.1rem 1.25rem; }
.fp-stat small { display: block; color: var(--fp-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.fp-stat b { font-size: 1.9rem; color: var(--fp-navy); font-variant-numeric: tabular-nums; }
.fp-chart { width: 100%; height: auto; display: block; }
.fp-chart text { font-size: 11px; fill: var(--fp-muted); font-family: inherit; }
.fp-chart .fp-line { fill: none; stroke: var(--fp-red); stroke-width: 2.5; stroke-linejoin: round; }
.fp-chart .fp-dot { fill: #fff; stroke: var(--fp-red); stroke-width: 2; }
.fp-chart .fp-grid-line { stroke: #e5e7eb; stroke-width: 1; }
.fp-delta-up { color: #166534; font-weight: 600; }
.fp-delta-down { color: #b91c1c; font-weight: 600; }

/* Organización */
.fp-authority { text-align: center; padding: 1.5rem 1rem; }
.fp-authority img, .fp-authority .fp-avatar { width: 112px; height: 112px; border-radius: 9999px; object-fit: cover; margin: 0 auto .75rem; display: block; }
.fp-authority .fp-avatar { font-size: 2rem; }
.fp-role { color: var(--fp-red); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }

/* Footer */
.fp-footer { background: var(--fp-navy); color: #cbd5e1; padding: 3rem 0 1.5rem; margin-top: auto; }
.fp-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.fp-footer a { color: #cbd5e1; }
.fp-footer a:hover { color: #fff; }
.fp-footer ul { list-style: none; margin: 0; padding: 0; }
.fp-footer li { margin-bottom: .45rem; }
.fp-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 800px) { .fp-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .fp-footer-grid { grid-template-columns: 1fr; } }
.fp-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; text-align: center; }
.fp-socials { display: flex; gap: .75rem; margin-top: .5rem; }
