mirror of
https://github.com/LucasKalil-Programador/world-2026-hub.git
synced 2026-07-04 17:41:28 -03:00
- Verdict hero: champion (trophy + flag + name) and a 2/3/4 podium (runner-up/3rd/4th) above the shared count-up tiles. Gated on the REAL final via computeVerdict() — getBracketTree()'s FINAL node must be a real finished result (!simulated), so a user's simulated champion never leaks into the verdict. Third/fourth from the third-place match, independently. Falls back to the existing aggregate 'in progress' hero until the final is in, so an early merge stays correct. - Goals-by-round chart beside goals-by-stage: group stage split into its 3 matchdays (derived per group; no matchday field exists) plus each knockout round. Hidden until >=2 rounds have data so it never duplicates the goals-by-stage Group bar early on. - stats.js imports getBracketTree from bracket.js (4th circular import with app.js, render-time only). i18n stats.goalsByRound/matchday/verditTitle/ runnerUp/thirdPlace/fourthPlace (EN/PT); verdict-hero CSS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
551 lines
11 KiB
CSS
551 lines
11 KiB
CSS
/* stats.css — "Stats" tab: tournament-to-date hero, overview cards and the
|
|
goals-by-stage chart. Reuses the global tokens and the .stat-card pattern.
|
|
Repeated tiles use a flat translucent fill (no backdrop-filter) per the
|
|
project's perf rule; blur is reserved for the few large .glass surfaces. */
|
|
|
|
/* --------------------------------------------------------- hero "pulse" */
|
|
|
|
.stats-hero {
|
|
padding: clamp(1.4rem, 4vw, 2.4rem);
|
|
text-align: center;
|
|
}
|
|
|
|
.stats-hero .hero-label {
|
|
flex-direction: column;
|
|
gap: 0.4rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.stats-hero-tiles {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 0.85rem;
|
|
}
|
|
|
|
.stats-tile {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.35rem;
|
|
padding: 1rem 0.6rem;
|
|
background: var(--glass-bg);
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: var(--radius-sm);
|
|
}
|
|
|
|
.stats-tile-value {
|
|
font-size: clamp(1.5rem, 4.5vw, 2.1rem);
|
|
font-weight: 700;
|
|
color: var(--accent-gold-soft);
|
|
font-variant-numeric: tabular-nums;
|
|
line-height: 1;
|
|
}
|
|
|
|
.stats-tile-label {
|
|
font-size: 0.72rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* -------------------------------------------------------- verdict hero */
|
|
/* post-tournament hero: champion + podium above the count-up tiles */
|
|
|
|
.stats-verdict {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 1.3rem;
|
|
}
|
|
|
|
.stats-verdict .hero-label { margin-bottom: 0.1rem; }
|
|
|
|
.verdict-champion {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.45rem;
|
|
}
|
|
|
|
.verdict-trophy {
|
|
font-size: 2.4rem;
|
|
line-height: 1;
|
|
}
|
|
|
|
.verdict-flag {
|
|
border-radius: 4px;
|
|
box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
|
|
outline: 2px solid var(--accent-gold);
|
|
}
|
|
|
|
.verdict-name {
|
|
font-size: clamp(1.6rem, 5vw, 2.5rem);
|
|
font-weight: 800;
|
|
line-height: 1.05;
|
|
color: var(--accent-gold-soft);
|
|
}
|
|
|
|
.verdict-crown {
|
|
font-size: 0.72rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.14em;
|
|
color: var(--accent-gold);
|
|
}
|
|
|
|
.verdict-podium {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
gap: 0.8rem 1.5rem;
|
|
}
|
|
|
|
.verdict-place {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.28rem;
|
|
min-width: 84px;
|
|
}
|
|
|
|
.verdict-rank {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 1.5rem;
|
|
height: 1.5rem;
|
|
border-radius: 50%;
|
|
background: var(--glass-bg-strong);
|
|
border: 1px solid var(--glass-border);
|
|
font-size: 0.78rem;
|
|
font-weight: 700;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.verdict-place-name {
|
|
font-size: 0.92rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.verdict-place-label {
|
|
font-size: 0.66rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.stats-verdict .stats-hero-tiles { width: 100%; }
|
|
|
|
/* ----------------------------------------------------------- overview */
|
|
|
|
.stats-overview-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
.stats-overview-grid .stat-value {
|
|
display: inline-flex;
|
|
align-items: baseline;
|
|
gap: 0.3rem;
|
|
}
|
|
|
|
.stat-sub {
|
|
font-size: 1rem;
|
|
font-weight: 400;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
/* ------------------------------------------------- goals-by-stage chart */
|
|
|
|
.stats-chart {
|
|
display: grid;
|
|
gap: 0.85rem;
|
|
padding: 1.25rem 1.4rem;
|
|
}
|
|
|
|
.chart-row {
|
|
display: grid;
|
|
grid-template-columns: clamp(86px, 22vw, 150px) 1fr auto;
|
|
align-items: center;
|
|
gap: 0.8rem;
|
|
}
|
|
|
|
.chart-bar-label {
|
|
font-size: 0.85rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.chart-track {
|
|
height: 14px;
|
|
background: var(--glass-bg-strong);
|
|
border-radius: 999px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.chart-bar {
|
|
height: 100%;
|
|
border-radius: 999px;
|
|
background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
|
|
transform-origin: left center;
|
|
animation: stats-bar-grow 0.6s ease both;
|
|
}
|
|
|
|
@keyframes stats-bar-grow {
|
|
from { transform: scaleX(0); }
|
|
to { transform: scaleX(1); }
|
|
}
|
|
|
|
.chart-bar-val {
|
|
font-size: 0.9rem;
|
|
font-weight: 700;
|
|
font-variant-numeric: tabular-nums;
|
|
min-width: 1.5ch;
|
|
text-align: right;
|
|
}
|
|
|
|
/* ------------------------------------------------- team statistics */
|
|
|
|
.stats-leaders {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
gap: 1rem;
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
.leader-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 1.1rem 1rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.leader-label {
|
|
font-size: 0.72rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.07em;
|
|
color: var(--accent-gold);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.leader-team {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.leader-name {
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.leader-value {
|
|
font-size: 1.6rem;
|
|
font-weight: 700;
|
|
font-variant-numeric: tabular-nums;
|
|
color: var(--accent-gold-soft);
|
|
}
|
|
|
|
/* horizontal scroll on narrow screens; rank + team columns stay frozen */
|
|
.stats-table-wrap {
|
|
overflow-x: auto;
|
|
border-radius: var(--radius);
|
|
border: 1px solid var(--glass-border);
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
|
|
.stats-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 0.88rem;
|
|
background: var(--glass-bg);
|
|
}
|
|
|
|
.stats-table th,
|
|
.stats-table td {
|
|
padding: 0.6rem 0.7rem;
|
|
text-align: right;
|
|
white-space: nowrap;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.stats-table thead th {
|
|
position: sticky;
|
|
top: 0;
|
|
background: var(--bg-secondary);
|
|
border-bottom: 1px solid var(--glass-border);
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.stats-table tbody tr {
|
|
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.stats-table tbody tr:hover {
|
|
background: var(--glass-bg-strong);
|
|
}
|
|
|
|
.col-rank {
|
|
text-align: center;
|
|
color: var(--text-secondary);
|
|
width: 2.5rem;
|
|
}
|
|
|
|
.col-team {
|
|
text-align: left;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
/* freeze rank + team to the left while metric columns scroll under them */
|
|
.stats-table .col-rank,
|
|
.stats-table .col-team {
|
|
position: sticky;
|
|
background: var(--bg-secondary);
|
|
z-index: 1;
|
|
}
|
|
|
|
.stats-table .col-rank { left: 0; }
|
|
.stats-table .col-team { left: 2.5rem; }
|
|
|
|
.stats-table tbody .col-rank,
|
|
.stats-table tbody .col-team {
|
|
background: var(--bg-primary);
|
|
}
|
|
|
|
.stats-table tbody tr:hover .col-rank,
|
|
.stats-table tbody tr:hover .col-team {
|
|
background: var(--bg-secondary);
|
|
}
|
|
|
|
.col-sort {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0;
|
|
color: inherit;
|
|
font: inherit;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.col-sort:hover {
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.stats-table th.sorted,
|
|
.stats-table td.sorted {
|
|
color: var(--accent-gold-soft);
|
|
}
|
|
|
|
.sort-arrow {
|
|
font-size: 0.7rem;
|
|
}
|
|
|
|
.row-idle td {
|
|
color: var(--text-secondary);
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.stats-pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
flex-wrap: wrap;
|
|
gap: 0.4rem;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.page-btn {
|
|
min-width: 2.2rem;
|
|
padding: 0.4rem 0.6rem;
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text-secondary);
|
|
font-variant-numeric: tabular-nums;
|
|
transition: color 0.2s, border-color 0.2s, background-color 0.2s;
|
|
}
|
|
|
|
.page-btn:hover:not(:disabled) {
|
|
color: var(--text-primary);
|
|
border-color: var(--accent-gold);
|
|
}
|
|
|
|
.page-btn.active {
|
|
color: var(--bg-primary);
|
|
background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-soft));
|
|
border-color: transparent;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.page-btn:disabled {
|
|
opacity: 0.35;
|
|
cursor: default;
|
|
}
|
|
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
/* ---------------------------------------------- header tooltips + key */
|
|
|
|
.has-tip { cursor: help; }
|
|
.col-sort.has-tip { cursor: pointer; }
|
|
|
|
.app-tooltip {
|
|
position: fixed;
|
|
z-index: 1000;
|
|
max-width: 220px;
|
|
padding: 0.45rem 0.65rem;
|
|
background: var(--bg-secondary);
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: var(--radius-sm);
|
|
box-shadow: var(--shadow-soft);
|
|
color: var(--text-primary);
|
|
font-size: 0.76rem;
|
|
font-weight: 400;
|
|
line-height: 1.4;
|
|
text-align: center;
|
|
text-transform: none;
|
|
letter-spacing: normal;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.app-tooltip[hidden] { display: none; }
|
|
|
|
/* abbreviation key — hidden on desktop (tooltips cover it), shown on mobile */
|
|
.stats-legend { display: none; }
|
|
|
|
.legend-pair b {
|
|
color: var(--text-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.stats-legend {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.35rem 0.9rem;
|
|
margin: 0.9rem 0 0;
|
|
padding: 0.8rem 1rem;
|
|
background: var(--glass-bg);
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: var(--radius-sm);
|
|
font-size: 0.76rem;
|
|
color: var(--text-secondary);
|
|
line-height: 1.5;
|
|
}
|
|
}
|
|
|
|
/* --------------------------------------------------------------- misc */
|
|
|
|
.stats-more {
|
|
margin-top: 1.5rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.stats-link {
|
|
padding: 0.55rem 1.2rem;
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: 999px;
|
|
color: var(--text-secondary);
|
|
font-size: 0.9rem;
|
|
transition: color 0.2s, border-color 0.2s, background-color 0.2s;
|
|
}
|
|
|
|
.stats-link:hover {
|
|
color: var(--text-primary);
|
|
border-color: var(--accent-gold);
|
|
background: var(--glass-bg-strong);
|
|
}
|
|
|
|
/* -------------------------------------------------- sub-nav (scrollspy) */
|
|
|
|
/* sticks just below the variable-height sticky header (--header-h is kept live
|
|
by app.js trackHeaderHeight). NOT a tablist — it's a <nav> of in-page anchors
|
|
whose clicks are intercepted, so the top tablist's arrow keys never conflict. */
|
|
.stats-subnav {
|
|
position: sticky;
|
|
top: var(--header-h, 64px);
|
|
z-index: 20;
|
|
display: flex;
|
|
gap: 0.35rem;
|
|
margin: 1.4rem 0;
|
|
padding: 0.4rem;
|
|
overflow-x: auto;
|
|
scrollbar-width: none;
|
|
background: rgba(8, 20, 33, 0.88);
|
|
backdrop-filter: blur(10px) saturate(1.2);
|
|
-webkit-backdrop-filter: blur(10px) saturate(1.2);
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: 999px;
|
|
}
|
|
|
|
.stats-subnav::-webkit-scrollbar { display: none; }
|
|
|
|
.stats-subnav-chip {
|
|
flex: 0 0 auto;
|
|
padding: 0.4rem 0.95rem;
|
|
border-radius: 999px;
|
|
color: var(--text-secondary);
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
transition: color 0.2s, background-color 0.2s;
|
|
}
|
|
|
|
.stats-subnav-chip:hover { color: var(--text-primary); }
|
|
|
|
.stats-subnav-chip.active {
|
|
color: var(--bg-primary);
|
|
background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-soft));
|
|
}
|
|
|
|
/* offset scroll targets so the sticky header + sub-nav never cover a heading */
|
|
.stats-section {
|
|
scroll-margin-top: calc(var(--header-h, 64px) + 3.75rem);
|
|
}
|
|
|
|
.stats-section + .stats-section { margin-top: 2.5rem; }
|
|
.stats-section:focus { outline: none; }
|
|
/* section spacing is owned by the wrapper, not the first heading inside it */
|
|
.stats-section > .section-title:first-child { margin-top: 0; }
|
|
|
|
/* flag monogram fallback (graceful degradation §0.3) — never a broken-img icon */
|
|
.flag-fallback {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--glass-bg-strong);
|
|
border: 1px solid var(--glass-border);
|
|
border-radius: 3px;
|
|
color: var(--text-secondary);
|
|
font-size: 0.5rem;
|
|
font-weight: 700;
|
|
letter-spacing: 0.01em;
|
|
vertical-align: middle;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* ---------------------------------------------------------- responsive */
|
|
|
|
@media (max-width: 600px) {
|
|
.stats-hero-tiles {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.chart-bar { animation: none; }
|
|
}
|