/* FEDECAT Results — Hoja de estilos principal */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@300;400;600;700&display=swap');

:root {
  --bg:     #1e3828;
  --card:   #264832;
  --panel:  #2e5439;
  --panel2: #355f42;
  --border: rgba(200,151,58,.2);
  --gold:   #c8973a;
  --gold2:  #e8c280;
  --green:  #4a8c5c;
  --green2: #7abf8a;
  --white:  #f0f4f0;
  --grey:   #92b09a;
  --red:    #dc6060;
  --live:   #e05050;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 15px;
  min-height: 100vh;
}

a { color: var(--gold2); text-decoration: none; }
a:hover { color: var(--white); }

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, #122018 0%, #1a3022 100%);
  border-bottom: 2px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.header-logo img { height: 42px; width: auto; }
.header-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  color: var(--gold2);
  letter-spacing: .08em;
  line-height: 1;
}
.header-title span {
  color: var(--white);
  opacity: .6;
  font-size: .85rem;
  display: block;
  letter-spacing: .1em;
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
}
nav a {
  color: var(--grey);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 4px;
  transition: color .2s, background .2s;
}
nav a:hover { color: var(--white); background: rgba(255,255,255,.07); }

/* ── LIVE BANNER ── */
.live-banner {
  background: linear-gradient(90deg, #2a0a0a, #4a1010, #2a0a0a);
  border-bottom: 2px solid var(--live);
  padding: .55rem 2rem;
  text-align: center;
  animation: pulse-bg 2s infinite;
}
@keyframes pulse-bg { 0%,100%{opacity:1} 50%{opacity:.88} }
.live-banner .live-dot {
  display: inline-block;
  width: 9px; height: 9px;
  background: var(--live);
  border-radius: 50%;
  margin-right: .5rem;
  animation: pulse-dot 1s infinite;
}
@keyframes pulse-dot { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.5);opacity:.5} }
.live-banner a { color: #ffaaaa; font-weight: 700; font-size: .9rem; }

/* ── MAIN ── */
main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── PAGE TITLE ── */
.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: var(--gold2);
  letter-spacing: .08em;
  margin-bottom: .25rem;
}
.page-subtitle { color: var(--grey); font-size: .88rem; margin-bottom: 2rem; }

/* ── FILTROS ── */
.filters {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}
.search-input {
  flex: 1; min-width: 200px;
  padding: .55rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: .9rem;
  outline: none;
  transition: border .2s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--grey); }
.filter-select {
  padding: .55rem .9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: .85rem;
  outline: none;
  cursor: pointer;
}

/* ── COMPETITION CARDS ── */
.comps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
}
.comp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
  color: var(--white);
  display: block;
  position: relative;
  overflow: hidden;
}
.comp-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--green2);
  opacity: 0;
  transition: opacity .2s;
}
.comp-card:hover { transform: translateY(-3px); border-color: rgba(200,151,58,.45); box-shadow: var(--shadow); color: var(--white); }
.comp-card:hover::before { opacity: 1; }
.comp-card.live { border-color: rgba(220,80,80,.4); background: linear-gradient(135deg, #2e1a1a, #2a2015); }
.comp-card.live::before { background: var(--live); opacity: 1; }

.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 20px;
  margin-bottom: .7rem;
}
.comp-badge.live    { background: rgba(220,80,80,.2);  color: #ff8888; border: 1px solid rgba(220,80,80,.4); }
.comp-badge.finished{ background: rgba(74,140,89,.2);  color: var(--green2); border: 1px solid rgba(74,140,89,.4); }

.comp-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--gold2);
  letter-spacing: .04em;
  margin-bottom: .45rem;
  line-height: 1.2;
}
.comp-meta { font-size: .8rem; color: var(--grey); line-height: 1.8; }
.comp-meta strong { color: var(--white); }
.comp-footer {
  margin-top: .8rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--grey);
}
.comp-footer .tiradores { color: var(--green2); font-weight: 700; }

/* ── YEAR SECTION ── */
.year-section { margin-bottom: 2.5rem; }
.year-header {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: var(--green2);
  letter-spacing: .1em;
  padding: .4rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── COMP HEADER ── */
.comp-header {
  background: linear-gradient(135deg, var(--card), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.comp-header-info { flex: 1; min-width: 200px; }
.comp-header-info h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  color: var(--gold2);
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.comp-header-info .meta {
  font-size: .84rem;
  color: var(--grey);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  line-height: 1.7;
}
.comp-stats { display: flex; gap: .8rem; flex-wrap: wrap; }
.stat-box {
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem .9rem;
  text-align: center;
  min-width: 72px;
}
.stat-box .num { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--gold2); line-height: 1; }
.stat-box .lbl { font-size: .62rem; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; }

/* ── CLASIFICACIONES NAV ── */
.clasif-nav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.clasif-nav-tab {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: .08em;
  color: var(--grey);
  padding: .6rem .2rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.clasif-nav-tab:hover { color: var(--white); }
.clasif-nav-tab.active { color: var(--gold2); border-bottom-color: var(--gold); }

/* ── CATEGORY BUTTONS ── */
.cat-section { margin-bottom: 1.2rem; }
.cat-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: .5rem;
  padding-left: .2rem;
}
.cat-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .3rem;
}
.cat-btn {
  padding: .38rem 1rem;
  border-radius: 5px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--grey);
  transition: all .15s;
  white-space: nowrap;
}
.cat-btn:hover { color: var(--white); border-color: rgba(200,151,58,.5); background: var(--panel2); }
.cat-btn.active {
  background: var(--gold);
  color: #1a1000;
  border-color: var(--gold);
  font-weight: 700;
}
.cat-btn.team-btn { border-color: rgba(122,191,138,.25); }
.cat-btn.team-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── RESULTS TABLE ── */
.results-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.results-title {
  padding: .7rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: .06em;
  color: var(--gold2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.results-title span { font-family: 'Barlow',sans-serif; font-size: .72rem; color: var(--grey); font-weight: 400; letter-spacing: 0; }
.results-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.results-table thead th {
  background: var(--panel2);
  color: var(--grey);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .65rem .75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.results-table thead th.al { text-align: left; }
.results-table tbody tr { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s; }
.results-table tbody tr:hover { background: rgba(255,255,255,.03); }
.results-table tbody tr:last-child { border-bottom: none; }
.results-table td { padding: .55rem .75rem; text-align: center; vertical-align: middle; }
.results-table td.al { text-align: left; }

/* Posición */
.pos-medal {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: .95rem;
}
.pos-1 { background: linear-gradient(135deg,#c8973a,#f0c060); color: #1a1000; }
.pos-2 { background: linear-gradient(135deg,#a0aab0,#c8d0d8); color: #1a1a1a; }
.pos-3 { background: linear-gradient(135deg,#a07040,#c09060); color: #1a0800; }
.pos-n { background: rgba(255,255,255,.07); color: var(--grey); font-size: .82rem; }

/* Nombre */
.t-apellidos { font-weight: 700; color: var(--white); }
.t-nombre { font-weight: 400; color: var(--grey); }

/* Series */
.serie-val { color: var(--grey); }
.serie-val.best { color: var(--green2); font-weight: 700; }

/* Total */
.total-val { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: var(--gold2); }
.final-val { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: #f1a0a0; }

/* ── LIVE ── */
.live-indicator {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(220,80,80,.15); border: 1px solid rgba(220,80,80,.3);
  border-radius: 20px; padding: .22rem .65rem;
  font-size: .72rem; font-weight: 700; color: #ff8888; letter-spacing: .06em;
}
.live-indicator .dot { width: 7px; height: 7px; background: var(--live); border-radius: 50%; animation: pulse-dot 1s infinite; }
.last-update { font-size: .72rem; color: var(--grey); text-align: right; padding: .5rem .8rem; border-top: 1px solid rgba(255,255,255,.05); }

/* ── BACK ── */
.btn-back {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--grey); font-size: .85rem; font-weight: 600;
  margin-bottom: 1.2rem; padding: .3rem 0; transition: color .2s;
}
.btn-back:hover { color: var(--gold2); }

/* ── EMPTY ── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--grey); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: .35; }

/* ── FOOTER ── */
footer {
  background: #111e16;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: .78rem;
  color: var(--grey);
  margin-top: 3rem;
}
footer strong { color: var(--gold2); }

/* ── ADMIN ── */
.admin-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .75rem; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.form-group input, .form-group select {
  width: 100%; padding: .6rem .9rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 5px;
  color: var(--white); font-size: .9rem; outline: none; transition: border .2s;
}
.form-group input:focus { border-color: var(--gold); }
.btn-primary { background: var(--gold); color: #1a1000; font-weight: 700; padding: .65rem 1.5rem; border: none; border-radius: 5px; font-size: .9rem; cursor: pointer; transition: background .2s; }
.btn-primary:hover { background: var(--gold2); }
.btn-secondary { background: var(--panel); color: var(--white); font-weight: 600; padding: .65rem 1.2rem; border: 1px solid var(--border); border-radius: 5px; font-size: .9rem; cursor: pointer; transition: background .2s; }
.btn-secondary:hover { background: rgba(255,255,255,.07); }
.alert { padding: .8rem 1rem; border-radius: 5px; font-size: .88rem; margin-bottom: 1rem; }
.alert-ok  { background: rgba(74,140,89,.2); border: 1px solid rgba(74,140,89,.4); color: var(--green2); }
.alert-err { background: rgba(220,80,80,.15); border: 1px solid rgba(220,80,80,.3); color: #ff9090; }

/* ── RESPONSIVE ── */
@media (max-width: 650px) {
  .header-inner { height: auto; padding: .8rem 0; flex-wrap: wrap; }
  main { padding: 1rem .8rem 3rem; }
  .comp-header { padding: 1rem; gap: 1rem; }
  .results-table { font-size: .78rem; }
  .results-table td, .results-table th { padding: .4rem .35rem; }
  .comps-grid { grid-template-columns: 1fr; }
  .clasif-nav { gap: 1rem; }
}

/* ── NAV ACTIVE ── */
nav a.nav-act { color: var(--gold2); }

/* ── SECTION LABEL ── */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: .8rem;
  padding-left: .2rem;
}

/* ── VER TODO ── */
.btn-ver-todo {
  display: inline-block;
  padding: .55rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--gold2);
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-ver-todo:hover { background: rgba(200,151,58,.1); color: var(--gold2); }

/* ── CARD ADMIN BAR ── */
.comp-card-wrap { position: relative; }
.card-admin-bar {
  display: flex;
  gap: .4rem;
  padding: .4rem .6rem;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  flex-wrap: wrap;
}
.btn-admin-edit {
  font-size: .72rem;
  padding: .22rem .55rem;
  background: rgba(200,151,58,.15);
  border: 1px solid rgba(200,151,58,.3);
  border-radius: 4px;
  color: var(--gold2);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-admin-edit:hover { background: rgba(200,151,58,.3); color: var(--gold2); }
.btn-admin-del {
  font-size: .72rem;
  padding: .22rem .55rem;
  background: rgba(220,80,80,.12);
  border: 1px solid rgba(220,80,80,.25);
  border-radius: 4px;
  color: #ff9090;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-admin-del:hover { background: rgba(220,80,80,.25); color: #ff9090; }
.btn-admin-live {
  font-size: .72rem;
  padding: .22rem .55rem;
  background: rgba(74,140,89,.15);
  border: 1px solid rgba(74,140,89,.3);
  border-radius: 4px;
  color: var(--green2);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-admin-live:hover { background: rgba(74,140,89,.3); color: var(--green2); }

/* ── ARCHIVO POR MODALIDAD ── */
.mod-section { margin-bottom: 2rem; }
.mod-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}
.mod-icon { font-size: 1.1rem; }
.mod-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: .07em;
  color: var(--gold2);
  flex: 1;
}
.mod-count {
  background: rgba(200,151,58,.15);
  border: 1px solid rgba(200,151,58,.25);
  border-radius: 20px;
  padding: .15rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  color: var(--gold2);
}
.mod-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.mod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.mod-table thead th {
  background: var(--panel2);
  color: var(--grey);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .55rem .8rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mod-table thead th.al { text-align: left; }
.mod-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.mod-table tbody tr:last-child { border-bottom: none; }
.mod-table tbody tr:hover { background: rgba(255,255,255,.03); }
.mod-table td { padding: .55rem .8rem; }
.comp-link {
  color: var(--white);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: color .15s;
}
.comp-link:hover { color: var(--gold2); }
.live-pill {
  display: inline-block;
  margin-left: .5rem;
  font-size: .62rem;
  font-weight: 700;
  background: rgba(220,80,80,.2);
  color: #ff8888;
  border: 1px solid rgba(220,80,80,.35);
  border-radius: 20px;
  padding: .1rem .4rem;
  letter-spacing: .05em;
  vertical-align: middle;
}
.badge-live {
  font-size: .62rem;
  font-weight: 700;
  background: rgba(220,80,80,.2);
  color: #ff8888;
  border: 1px solid rgba(220,80,80,.3);
  border-radius: 20px;
  padding: .15rem .5rem;
  letter-spacing: .05em;
  white-space: nowrap;
}
.badge-fin {
  font-size: .62rem;
  font-weight: 700;
  background: rgba(74,140,89,.15);
  color: var(--green2);
  border: 1px solid rgba(74,140,89,.3);
  border-radius: 20px;
  padding: .15rem .5rem;
  letter-spacing: .05em;
  white-space: nowrap;
}
.btn-ver {
  display: inline-block;
  padding: .22rem .65rem;
  background: rgba(200,151,58,.12);
  border: 1px solid rgba(200,151,58,.25);
  border-radius: 4px;
  color: var(--gold2);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.btn-ver:hover { background: rgba(200,151,58,.25); color: var(--gold2); }
