/* Torneos FC – página pública */
.tfc-pub { --p: var(--tfc-primary, #0b6b3a); --s: var(--tfc-secondary, #0f172a); --a: var(--tfc-accent, #f5b301); --bg: var(--tfc-bg, #f4f7f5); font-family: inherit; color: #0f172a; background: var(--bg); border-radius: 16px; padding: 16px; margin: 16px 0; box-sizing: border-box; }
.tfc-pub *, .tfc-pub *::before, .tfc-pub *::after { box-sizing: border-box; }
.tfc-pub h2 { margin: 0; }
.tfc-pub h3 { font-size: 1.05em; margin: 22px 0 10px; padding-left: 10px; border-left: 4px solid var(--p); }
.tfc-muted { color: #64748b; }
.tfc-back a { text-decoration: none; }

.tfc-pub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tfc-pub-tcard { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 14px; text-decoration: none !important; color: inherit !important; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); border-top: 4px solid var(--p); position: relative; transition: transform .15s; }
.tfc-pub-tcard:hover { transform: translateY(-2px); }
.tfc-pub-tcard img { width: 56px; height: 56px; object-fit: contain; }
.tfc-pub-tcard div { display: flex; flex-direction: column; }
.tfc-pub-tcard span { font-size: .85em; color: #64748b; }
.tfc-pub-tcard em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: .7em; font-weight: 700; background: var(--a); padding: 2px 8px; border-radius: 99px; }
.tfc-pub-ball { font-size: 40px; }

.tfc-pub-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--s), var(--p)); color: #fff; border-radius: 14px; padding: 18px; }
.tfc-pub-hero img { width: 76px; height: 76px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.tfc-pub-hero h2 { color: #fff; font-size: 1.6em; }
.tfc-pub-hero p { margin: 4px 0 8px; opacity: .9; }
.tfc-pub-status { background: var(--a); color: #111; font-weight: 700; font-size: .75em; padding: 3px 10px; border-radius: 99px; }

.tfc-pub-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0; padding-bottom: 4px; scrollbar-width: thin; }
.tfc-pub-tabs button { flex: none; border: 0; background: #fff; color: var(--s); padding: 9px 14px; border-radius: 99px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); font-size: .9em; }
.tfc-pub-tabs button.active { background: var(--p); color: #fff; }
.tfc-pub-panel { display: none; background: #fff; border-radius: 14px; padding: 14px; }
.tfc-pub-panel.active { display: block; }
.tfc-pub-panel > h3:first-child { margin-top: 4px; }
.tfc-pub-foot { text-align: center; font-size: .75em; color: #94a3b8; margin-top: 12px; }

.tfc-scroll { overflow-x: auto; }
.tfc-ptable { width: 100%; border-collapse: collapse; font-size: .92em; }
.tfc-ptable th { background: var(--s); color: #fff; font-weight: 600; padding: 8px 6px; text-align: center; white-space: nowrap; }
.tfc-ptable th:first-child { border-top-left-radius: 8px; }
.tfc-ptable th:last-child { border-top-right-radius: 8px; }
.tfc-ptable td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #eef2f7; }
.tfc-ptable .tl { text-align: left; }
.tfc-ptable tr.qualify td:first-child { box-shadow: inset 4px 0 0 var(--p); font-weight: 700; }
.tfc-ptable tr.top td { background: #fffbeb; }
.tfc-ptable i { display: inline-block; width: 18px; height: 18px; line-height: 18px; border-radius: 4px; font-size: 10px; font-style: normal; font-weight: 700; color: #fff; margin: 0 1px; }
.tfc-ptable i.f-G { background: #16a34a; }
.tfc-ptable i.f-E { background: #94a3b8; }
.tfc-ptable i.f-P { background: #dc2626; }
i.card { display: inline-block; width: 11px; height: 15px; border-radius: 2px; vertical-align: middle; margin: 0 1px; }
i.card.y { background: #facc15; }
i.card.r { background: #dc2626; }
.tfc-legend { font-size: .8em; color: #64748b; }
.tfc-legend i.qualify { display: inline-block; width: 10px; height: 10px; background: var(--p); border-radius: 2px; }
.tfc-pt { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tfc-pt img, .tfc-pt svg { flex: none; object-fit: contain; }
.tfc-pp { display: inline-flex; align-items: center; gap: 8px; }
.tfc-pp img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tfc-badge-bad { background: #fee2e2; color: #991b1b; font-size: .72em; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.hide-sm { }
@media (max-width: 600px) { .hide-sm { display: none; } .tfc-pub { padding: 10px; } .tfc-pub-hero { flex-direction: column; text-align: center; } }

.tfc-cards, .tfc-bracket { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tfc-match { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; background: #fff; }
.tfc-match .row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.tfc-match .t.h { text-align: right; }
.tfc-match .t.h .tfc-pt { flex-direction: row-reverse; }
.tfc-match .sc { font-weight: 800; background: #f1f5f9; border-radius: 8px; padding: 4px 10px; text-align: center; min-width: 64px; white-space: nowrap; }
.tfc-match .sc small { display: block; font-weight: 400; font-size: .7em; }
.tfc-match.played .sc { background: var(--s); color: #fff; }
.tfc-match .meta { font-size: .78em; color: #64748b; text-align: center; margin-bottom: 6px; }
.tfc-match .meta.venue, .tfc-match .meta.goals { margin: 6px 0 0; }
.tfc-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; font-weight: 600; font-size: .9em; white-space: nowrap; }
/* Selectores legibles aunque el tema del sitio cambie los colores de los formularios. */
.tfc-pub select { -webkit-appearance: none; appearance: none; min-width: 220px; max-width: 100%; padding: 9px 38px 9px 12px !important; border: 1px solid #cbd5e1 !important; border-radius: 10px !important; font: inherit !important; font-size: .95em !important; font-weight: 500 !important; line-height: 1.3 !important; color: #0f172a !important; background-color: #ffffff !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; box-shadow: none !important; color-scheme: light; cursor: pointer; }
.tfc-pub select:focus { outline: 2px solid var(--p); outline-offset: 1px; }
.tfc-pub select option { color: #0f172a !important; background: #ffffff !important; }
.tfc-pub select option:checked { color: #ffffff !important; background: var(--p) !important; }
.tfc-pub[data-mode=dark] select, [data-theme=dark] .tfc-pub select { color: #ece9f5 !important; background-color: #1c1827 !important; border-color: #3a3548 !important; color-scheme: dark; }
.tfc-pub[data-mode=dark] select option, [data-theme=dark] .tfc-pub select option { color: #ece9f5 !important; background: #1c1827 !important; }
@media (max-width: 600px) { .tfc-pub select { min-width: 0; width: 100%; } .tfc-filter { white-space: normal; } }

.tfc-pub-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tfc-pub-team { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; position: relative; }
.tfc-pub-team summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.tfc-pub-team summary::-webkit-details-marker { display: none; }
.tfc-pub-team .shirts { display: flex; gap: 4px; }
.tfc-pub-team .shield { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; object-fit: contain; }
.tfc-pub-team small { color: #64748b; }
.tfc-pub-team .roster { list-style: none; margin: 10px 0 0; padding: 0; font-size: .88em; }
.tfc-pub-team .roster li { padding: 4px 0; border-top: 1px solid #f1f5f9; }
.tfc-pub-team .roster b { display: inline-block; width: 24px; color: var(--p); }
.tfc-pub-team .roster small { color: #94a3b8; }
.tfc-susp li { margin-bottom: 4px; }

.tfc-pub .tfc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tfc-pub .tfc-kpi { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; border-left: 4px solid var(--p); }
.tfc-pub .tfc-kpi span { font-size: .8em; color: #64748b; }
.tfc-pub .tfc-kpi strong { font-size: 1.6em; }
.tfc-split { display: flex; border-radius: 10px; overflow: hidden; font-size: .8em; font-weight: 700; color: #fff; min-height: 32px; }
.tfc-split span { display: flex; align-items: center; justify-content: center; padding: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.tfc-split .h { background: var(--p); }
.tfc-split .d { background: #94a3b8; }
.tfc-split .a { background: var(--s); }
.tfc-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 10px 0; overflow-x: auto; }
.tfc-bars .bar { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.tfc-bars .bar span { width: 100%; background: linear-gradient(180deg, var(--a), var(--p)); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.tfc-bars .bar b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: .75em; }
.tfc-bars .bar small { font-size: .72em; color: #64748b; margin-top: 4px; }
.tfc-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.tfc-highlights .hl { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.tfc-highlights .hl > span { font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.tfc-highlights .hl strong { font-size: 1.6em; }
.tfc-highlights .hl strong.ml { font-size: 1em; }
.tfc-highlights .hl small { color: #64748b; }

/* Inscripción pública */
.tfc-pub-reg form { display: grid; gap: 10px; max-width: 560px; }
.tfc-pub-reg label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.tfc-pub-reg input, .tfc-pub-reg select { padding: 9px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.tfc-pub-reg button { background: var(--p); color: #fff; border: 0; padding: 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.tfc-pub-reg .hp { position: absolute; left: -9999px; }
.tfc-pub-uniform { display: flex; gap: 14px; align-items: center; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; flex-wrap: wrap; }
.tfc-pub-uniform .ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; }
.tfc-pub-uniform input[type=color] { height: 36px; padding: 2px; }
.tfc-alert { padding: 10px 12px; border-radius: 8px; }
.tfc-alert.ok { background: #dcfce7; color: #166534; }
.tfc-alert.bad { background: #fee2e2; color: #991b1b; }

/* CTA de registro */
.tfc-pub-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, var(--s), var(--p)); color: #fff; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.tfc-pub-cta div { display: flex; flex-direction: column; gap: 2px; }
.tfc-pub-cta span { opacity: .85; font-size: .9em; }
.tfc-pub-cta a { background: #fff; color: var(--p) !important; font-weight: 700; padding: 10px 16px; border-radius: 10px; text-decoration: none !important; white-space: nowrap; }

/* Botón modo claro/oscuro */
.tfc-pub-hero { position: relative; }
.tfc-pub-mode { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; cursor: pointer; line-height: 1; }
.tfc-pub .m-light, .tfc-pub[data-mode=dark] .m-dark { display: none; }
.tfc-pub[data-mode=dark] .m-light { display: inline; }

/* Modo oscuro (página pública y estadísticas dentro del panel) */
.tfc-pub[data-mode=dark], [data-theme=dark] .tfc-pub { --bg: #14111c; color: #ece9f5; }
.tfc-pub[data-mode=dark] .tfc-pub-panel, [data-theme=dark] .tfc-pub .tfc-pub-panel,
.tfc-pub[data-mode=dark] .tfc-pub-tcard, [data-theme=dark] .tfc-pub .tfc-pub-tcard,
.tfc-pub[data-mode=dark] .tfc-match, [data-theme=dark] .tfc-pub .tfc-match,
.tfc-pub[data-mode=dark] .tfc-pub-team, [data-theme=dark] .tfc-pub .tfc-pub-team { background: #1c1827; border-color: #2d2839; color: #ece9f5; }
.tfc-pub[data-mode=dark] .tfc-pub-tabs button, [data-theme=dark] .tfc-pub .tfc-pub-tabs button { background: #1c1827; color: #ece9f5; }
.tfc-pub[data-mode=dark] .tfc-pub-tabs button.active, [data-theme=dark] .tfc-pub .tfc-pub-tabs button.active { background: var(--p); color: #fff; }
.tfc-pub[data-mode=dark] .tfc-ptable td, [data-theme=dark] .tfc-pub .tfc-ptable td { border-color: #2d2839; }
.tfc-pub[data-mode=dark] .tfc-ptable tr.top td, [data-theme=dark] .tfc-pub .tfc-ptable tr.top td { background: #2a2233; }
.tfc-pub[data-mode=dark] .tfc-match .sc, [data-theme=dark] .tfc-pub .tfc-match .sc { background: #2a2536; }
.tfc-pub[data-mode=dark] .tfc-match.played .sc, [data-theme=dark] .tfc-pub .tfc-match.played .sc { background: var(--p); }
.tfc-pub[data-mode=dark] .tfc-kpi, [data-theme=dark] .tfc-pub .tfc-kpi,
.tfc-pub[data-mode=dark] .tfc-highlights .hl, [data-theme=dark] .tfc-pub .tfc-highlights .hl { background: #241f30; }
.tfc-pub[data-mode=dark] .tfc-muted, [data-theme=dark] .tfc-pub .tfc-muted, .tfc-pub[data-mode=dark] .tfc-pub-tcard span, .tfc-pub[data-mode=dark] .tfc-match .meta { color: #a49fb6; }
.tfc-pub[data-mode=dark] .tfc-pub-team .roster li, [data-theme=dark] .tfc-pub .tfc-pub-team .roster li { border-color: #2d2839; }
