/* ANPG - Ranking Nacional — estilos públicos (shortcodes). */

.anpg-ranking,
.anpg-bracket { --anpg-blue: #1b75bb; --anpg-blue-d: #155e95; --anpg-green: #2ba24c; --anpg-border: #e2e6ea; color: #1f2733; }

.anpg-ranking h3,
.anpg-bracket h3 { color: var(--anpg-blue); margin: 0 0 10px; }

/* Pestañas de categoría */
.anpg-ranking__tabs a {
	display: inline-block;
	padding: 6px 14px;
	margin: 0 6px 6px 0;
	border-radius: 999px;
	background: #eef4fa;
	color: var(--anpg-blue-d);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.4;
}
.anpg-ranking__tabs a:hover { background: #dceafa; }

/* Tabla de ranking */
.anpg-ranking__table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--anpg-border);
	border-radius: 10px;
	overflow: hidden;
}
.anpg-ranking__table thead th {
	background: var(--anpg-blue);
	color: #fff;
	padding: 10px;
	text-align: left;
	font-weight: 600;
}
.anpg-ranking__table td { padding: 9px 10px; border-top: 1px solid #eef0f2; }
.anpg-ranking__table tbody tr:nth-child(even) td { background: #f9fbfd; }
.anpg-ranking__table td:first-child { font-weight: 700; color: var(--anpg-blue-d); width: 48px; }

/* Botón de cambio de vista del bracket */
.anpg-bracket__toggle {
	background: var(--anpg-blue);
	color: #fff;
	border: none;
	padding: 8px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}
.anpg-bracket__toggle:hover { background: var(--anpg-blue-d); }

/* Grupos y árbol */
.anpg-bracket__group { border: 1px solid var(--anpg-border) !important; border-radius: 10px !important; background: #fff; }
.anpg-bracket__group h4 { color: var(--anpg-blue); }
.anpg-bracket__tree > div > h4 { color: var(--anpg-blue); }

/* Portal del jugador */
.anpg-portal { --anpg-blue: #1b75bb; --anpg-blue-d: #155e95; --anpg-border: #e2e6ea; max-width: 760px; color: #1f2733; }
.anpg-portal h2 { color: var(--anpg-blue); margin: 0 0 4px; }
.anpg-portal h3 { color: var(--anpg-blue); margin: 22px 0 8px; border-bottom: 1px solid var(--anpg-border); padding-bottom: 4px; }
.anpg-portal__meta { color: #6b7280; font-size: 14px; }
.anpg-portal code { background: #eef4fa; color: var(--anpg-blue-d); padding: 1px 6px; border-radius: 4px; }
.anpg-portal__ok { background: #e7f6ec; color: #1a7f37; border: 1px solid #b6e3c4; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.anpg-portal__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.anpg-portal__form label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #1f2733; gap: 4px; }
.anpg-portal__form input { padding: 8px 10px; border: 1px solid var(--anpg-border); border-radius: 6px; font-weight: 400; }
.anpg-portal__note { grid-column: 1 / -1; color: #6b7280; font-size: 12px; margin: 0; }
.anpg-portal__btn { background: var(--anpg-blue); color: #fff; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.anpg-portal__btn:hover { background: var(--anpg-blue-d); }
.anpg-portal__table { width: 100%; border-collapse: collapse; border: 1px solid var(--anpg-border); border-radius: 10px; overflow: hidden; }
.anpg-portal__table th { background: var(--anpg-blue); color: #fff; padding: 9px 10px; text-align: left; font-weight: 600; }
.anpg-portal__table td { padding: 8px 10px; border-top: 1px solid #eef0f2; }
.anpg-portal__table tbody tr:nth-child(even) td { background: #f9fbfd; }
.anpg-portal__win { color: #1a7f37; font-weight: 700; }
.anpg-portal__loss { color: #b32d2e; font-weight: 700; }

/* ===================== VISTA EN VIVO ===================== */
.anpg-live {
	--blue: #1b75bb; --blue-d: #134e7e; --green: #2ba24c; --ink: #15212e; --border: #e6ebf0; --muted: #6b7280;
	max-width: 1100px; margin: 0 auto; color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.anpg-live__bar { display: flex; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.anpg-live__ts::before { content: "⟳ "; }

.anpg-live__hero {
	position: relative; overflow: hidden; border-radius: 18px; padding: 30px 26px;
	background: linear-gradient(135deg, #1b75bb 0%, #134e7e 60%, #0e3a60 100%);
	color: #fff; box-shadow: 0 14px 34px rgba(19, 78, 126, .28); text-align: center;
}
.anpg-live__hero::after {
	content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
	background: radial-gradient(circle, rgba(43,162,76,.35), transparent 70%); pointer-events: none;
}
.anpg-live__badge {
	display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1px;
	background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(4px);
}
.anpg-live__dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255,90,90,.7); animation: anpg-pulse 1.5s infinite; }
@keyframes anpg-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,90,.7); } 70% { box-shadow: 0 0 0 9px rgba(255,90,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); } }
.anpg-live__title { margin: 14px 0 12px; font-size: clamp(24px, 4vw, 38px); font-weight: 800; line-height: 1.1; color: #fff; }
.anpg-live__chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.anpg-live__chip { background: rgba(255,255,255,.18); color: #fff; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
/* Podio 1-2-3 */
.anpg-live__podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 22px auto 8px; max-width: 640px; }
.anpg-live__place { flex: 1; text-align: center; }
.anpg-live__crown { font-size: 26px; line-height: 1; margin-bottom: 2px; }
.anpg-live__pname { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: #15212e; min-height: 36px; display: flex; align-items: flex-end; justify-content: center; }
.anpg-live__pillar { border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 12px; }
.anpg-live__medal { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.3); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.anpg-live__place--1 .anpg-live__pillar { height: 120px; background: linear-gradient(180deg,#f6c33b,#e09b1e); box-shadow: 0 8px 20px rgba(224,155,30,.4); }
.anpg-live__place--2 .anpg-live__pillar { height: 88px; background: linear-gradient(180deg,#c7ccd1,#9aa1a8); }
.anpg-live__place--3 .anpg-live__pillar { height: 64px; background: linear-gradient(180deg,#dd9b6a,#b9743f); }

.anpg-live__h { margin: 28px 0 12px; font-size: 18px; font-weight: 700; color: var(--ink); position: relative; padding-left: 14px; }
.anpg-live__h::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; border-radius: 3px; background: var(--green); }

/* Grupos */
.anpg-live__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.anpg-live__group { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 4px 14px rgba(20,33,46,.06); overflow: hidden; }
.anpg-live__group h4 { margin: 0; padding: 12px 16px; background: #f3f8fc; color: var(--blue-d); font-size: 15px; border-bottom: 1px solid var(--border); }
.anpg-live__group table { width: 100%; border-collapse: collapse; }
.anpg-live__group td { padding: 9px 16px; border-top: 1px solid #f1f4f7; font-size: 14px; }
.anpg-live__pos { width: 30px; color: var(--muted); font-weight: 700; }
.anpg-live__pct { text-align: right; color: var(--blue); font-weight: 700; }
.anpg-live__group tr:first-child td { border-top: none; }
.anpg-live__group tr:nth-child(1) .anpg-live__pos,
.anpg-live__group tr:nth-child(2) .anpg-live__pos { color: var(--green); }

/* Bracket */
.anpg-live__bracket { display: flex; gap: 22px; overflow-x: auto; padding: 6px 2px 14px; }
.anpg-live__round { min-width: 210px; display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.anpg-live__rname { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; }
.anpg-live__match { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 12px rgba(20,33,46,.07); overflow: hidden; }
.anpg-live__mt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 13px; font-size: 14px; }
.anpg-live__mt:first-child { border-bottom: 1px solid #eef2f6; }
.anpg-live__mt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anpg-live__mt b { color: var(--muted); }
.anpg-live__mt.is-win { background: linear-gradient(90deg, rgba(43,162,76,.10), transparent); font-weight: 800; }
.anpg-live__mt.is-win b { color: var(--green); }

/* Feed de resultados */
.anpg-live__feed { display: grid; gap: 8px; }
.anpg-live__result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: 0 2px 8px rgba(20,33,46,.04); }
.anpg-live__ctx { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #fff; background: var(--blue); padding: 3px 8px; border-radius: 6px; }
.anpg-live__vs { color: var(--muted); font-size: 12px; }
.anpg-live__result .is-win { font-weight: 800; color: var(--green); }

/* ===================== PANEL DE OPERADOR ===================== */
.anpg-op { --blue: #1b75bb; --blue-d: #134e7e; --green: #2ba24c; --border: #e6ebf0; max-width: 980px; margin: 0 auto; color: #15212e; }
.anpg-op__title { color: var(--blue); }
.anpg-op__login { display: inline-block; background: var(--blue); color: #fff; padding: 10px 18px; border-radius: 8px; text-decoration: none; }
.anpg-op__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.anpg-op__tab { padding: 8px 14px; border-radius: 999px; background: #eef4fa; color: var(--blue-d); text-decoration: none; font-size: 14px; font-weight: 600; }
.anpg-op__tab.is-active { background: var(--blue); color: #fff; }
.anpg-op__h { margin: 22px 0 10px; color: #15212e; }

.anpg-cap__search { display: flex; gap: 8px; margin-bottom: 12px; }
.anpg-cap__search input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; text-transform: uppercase; }
.anpg-cap__search button, .anpg-cap__save { background: var(--blue); color: #fff; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.anpg-cap__search button:hover, .anpg-cap__save:hover { background: var(--blue-d); }
.anpg-cap__results { display: grid; gap: 12px; }
.anpg-cap__empty { color: #6b7280; font-style: italic; }
.anpg-cap__card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 4px 12px rgba(20,33,46,.06); }
.anpg-cap__card.is-done { opacity: .55; }
.anpg-cap__ctx { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.anpg-cap__ctx code { background: #eef4fa; color: var(--blue-d); padding: 1px 6px; border-radius: 4px; }
.anpg-cap__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anpg-cap__team { font-weight: 600; flex: 1; min-width: 90px; }
.anpg-cap__row input { width: 64px; padding: 12px; font-size: 18px; text-align: center; border: 2px solid var(--border); border-radius: 8px; }
.anpg-cap__row input:focus { border-color: var(--blue); outline: none; }
.anpg-cap__dash { color: #6b7280; font-weight: 700; }
.anpg-cap__act { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.anpg-cap__msg.ok { color: #1a7f37; font-weight: 700; }
.anpg-cap__msg.err { color: #b32d2e; font-weight: 600; }
