/* ==========================================================================
   Page-Specific Styles
   Covers: cup_stats.php, badges_overview.php, rivalries.php, timeline.php,
           about.php, season_archives.php
   ========================================================================== */

/* === Cup Stats === */

.cup-stats-page-header {
    margin-bottom: 40px;
    border-left: 8px solid var(--nintendo-red);
    padding-left: 20px;
}

.cup-stats-page-title {
    font-size: 2.8rem;
    font-weight: 900;
    font-style: italic;
    margin: 0;
    text-transform: uppercase;
}

.cup-stats-page-subtitle {
    color: #666;
    font-weight: 600;
}

.cup-filter-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
}

.cup-filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.cup-filter-label {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
}

.cup-filter-select {
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: white;
}

.cup-filter-hint {
    color: #999;
    font-size: 0.8rem;
}

.cup-empty-state {
    justify-content: center;
    padding: 60px;
    color: #888;
}

/* Telemetry chart card */
.telemetry-card {
    flex-direction: column;
    align-items: stretch;
    padding: 30px;
    margin-bottom: 40px;
}

.telemetry-label {
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
    font-weight: 800;
}

.telemetry-chart-wrap {
    height: 350px;
}

/* Cup Difficulty Analysis */
.difficulty-analysis-card {
    flex-direction: column;
    align-items: stretch;
    padding: 30px;
    margin-bottom: 30px;
}

.diff-description {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.diff-description--sm {
    margin-bottom: 15px;
}

.difficulty-ranking {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diff-row {
    display: grid;
    grid-template-columns: 30px 32px 140px 1fr 40px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 8px;
    transition: background 0.15s;
}

.diff-row:hover {
    background: #f0f0f0;
}

.diff-rank {
    font-weight: 900;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}

.diff-tier {
    font-weight: 900;
    font-size: 0.7rem;
    color: white;
    padding: 3px 0;
    border-radius: 4px;
    text-align: center;
    line-height: 1;
}

.diff-cup-name {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diff-bar-wrap {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.diff-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.diff-score {
    font-weight: 900;
    font-size: 0.85rem;
    color: #333;
    text-align: right;
}

.diff-details {
    display: flex;
    gap: 10px;
    font-size: 0.72rem;
    color: #888;
    font-weight: 600;
}

.diff-details span {
    cursor: help;
}

.diff-legend {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.diff-legend-item {
    font-size: 0.8rem;
    font-weight: 700;
    padding-left: 14px;
    position: relative;
}

.diff-legend-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--tier-color);
}

.diff-legend--s { --tier-color: #e60012; }
.diff-legend--a { --tier-color: #e67e22; }
.diff-legend--b { --tier-color: #f1c40f; }
.diff-legend--c { --tier-color: #2ebd59; }
.diff-legend--d { --tier-color: #3498db; }

.diff-radar-wrap {
    height: 400px;
}

@media (max-width: 768px) {
    .diff-row {
        grid-template-columns: 24px 28px 100px 1fr 36px;
        gap: 6px;
        padding: 6px 8px;
    }
    .diff-details {
        display: none;
    }
    .diff-cup-name {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .diff-row {
        grid-template-columns: 24px 28px 80px 1fr 32px;
    }
}

/* Cup analysis grid */
.cup-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.cup-telemetry-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.cup-card-header h4 {
    margin: 10px 0;
    font-size: 1.6rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    color: #1a1a1a;
}

.cup-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.run-tag {
    font-size: 0.7rem;
    color: #aaa;
    font-weight: bold;
}

/* Track Intelligence Tags */
.track-intel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.track-chip {
    font-size: 0.7rem;
    background: #f8f9fa;
    color: #666;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid #eee;
}

/* Core cup stats row */
.cup-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.c-stat { text-align: center; }
.c-label { display: block; font-size: 0.65rem; font-weight: 800; color: #999; text-transform: uppercase; margin-bottom: 5px; }
.c-val { font-size: 1.3rem; font-weight: 900; color: #1a1a1a; }
.c-val--red { color: var(--nintendo-red); }

/* Podium section */
.cup-podium-box {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 12px;
    margin-top: auto;
}

.cup-podium-box h5 {
    margin: 0 0 10px 0;
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.podium-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
}

.podium-entry:last-child { border: none; }
.pod-rank { font-weight: 900; font-style: italic; width: 30px; }
.pod-name { flex: 1; color: #eee; font-weight: 600; }
.pod-ppg { font-weight: 800; color: #888; }

/* Cup History Matrix section */
.cup-matrix-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 3px solid #eee;
}

.cup-matrix-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.cup-matrix-title {
    font-size: 1.8rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin: 0;
}

.cup-matrix-subtitle {
    color: #666;
    font-weight: 600;
    margin: 6px 0 0 0;
    font-size: 0.9rem;
}

.cup-matrix-legend {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.cup-matrix-legend--complete { color: #4caf50; }
.cup-matrix-legend--pending  { color: #bbb; }

.cup-matrix-scroll {
    overflow-x: auto;
}

.cup-matrix-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 0.82rem;
}

.cup-matrix-table th {
    padding: 8px 10px;
    background: #1a1a1a;
    color: white;
    font-weight: 700;
    text-align: center;
    min-width: 80px;
}

.cup-matrix-table th.racer-col {
    text-align: left;
    padding: 10px 14px;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 130px;
}

.cup-matrix-table th.score-col {
    color: #ffd700;
    font-weight: 800;
    min-width: 80px;
    padding: 8px 14px;
}

.cup-matrix-table th.done-col {
    color: #ffd700;
    font-weight: 800;
    min-width: 80px;
    padding: 8px 14px;
}

.cup-matrix-table td {
    padding: 8px 10px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee;
}

.cup-matrix-table td.racer-name-col {
    padding: 10px 14px;
    font-weight: 800;
    color: #1a1a1a;
    position: sticky;
    left: 0;
    border-right: 2px solid #eee;
}

.cup-matrix-table td.score-total-col {
    padding: 8px 14px;
    text-align: center;
    font-weight: 900;
    color: var(--nintendo-red);
}

.cup-matrix-table td.done-count-col {
    padding: 8px 14px;
    text-align: center;
    font-weight: 900;
}

.matrix-cell--perfect  { background: #fff8e1; color: #e65100; }
.matrix-cell--done     { background: #e8f5e9; color: #2e7d32; }
.matrix-cell--pending  { background: transparent; color: #bbb; }
.matrix-cell--self     { background: #eee; }
.matrix-row--complete  { background: #f1f8f4; }
.matrix-row--normal    { background: white; }

.done-complete { color: #4caf50; }
.done-partial  { color: #ff9800; }

/* === ELO Trends === */

.elo-header-card {
    flex-direction: column;
    align-items: stretch;
    padding: 40px;
    margin-bottom: 40px;
}

.elo-title {
    font-style: italic;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}

.elo-subtitle {
    color: #888;
    font-weight: bold;
    margin-bottom: 30px;
}

.elo-note {
    font-size: 0.8em;
    color: #e60012;
}

.elo-range-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.elo-season-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.elo-season-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e60012;
    cursor: pointer;
}

.elo-chart-wrap {
    height: 600px;
    position: relative;
}

.elo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.elo-grid-mt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.elo-section-card {
    flex-direction: column;
    align-items: stretch;
    padding: 30px;
}

.elo-section-title {
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--nintendo-red);
}

.elo-section-desc {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 20px;
}

.elo-th-rank {
    width: 40px;
    text-align: center;
}

.elo-th-center {
    text-align: center;
}

.elo-th-right {
    text-align: right;
}

.elo-td-rank {
    text-align: center;
    font-weight: 900;
    color: #888;
}

.elo-td-rating {
    text-align: center;
    font-weight: 900;
    font-size: 1.1rem;
}

.elo-change-icon {
    font-size: 0.7rem;
}

.elo-td-peak {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.elo-td-games {
    text-align: center;
    color: #666;
}

.elo-td-bar {
    text-align: center;
}

.elo-bar-track {
    background: #f0f0f0;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.elo-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.elo-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 800;
    color: #333;
}

.elo-td-minmax {
    text-align: right;
    color: #888;
    font-size: 0.9rem;
}

.elo-td-gp {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

.elo-td-gain {
    text-align: center;
    font-weight: 900;
    color: #2EBD59;
}

.elo-td-loss {
    text-align: center;
    font-weight: 900;
    color: #e60012;
}

.elo-td-right-gray {
    text-align: right;
    color: #666;
}

/* --- ELO GP Changelog --- */

.elo-changelog-card {
    margin-top: 30px;
}

.elo-cl-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.elo-cl-btn {
    padding: 6px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #f9f9f9;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    color: #666;
}

.elo-cl-btn:hover { border-color: #aaa; }

.elo-cl-btn-active {
    border-color: var(--nintendo-red);
    background: var(--nintendo-red);
    color: #fff;
}

.elo-cl-search {
    margin-left: auto;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    background: #f9f9f9;
    width: 180px;
}

.elo-cl-search:focus {
    border-color: var(--nintendo-red);
    outline: none;
}

.elo-cl-list {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 4px;
}

.elo-cl-gp {
    margin-bottom: 6px;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.elo-cl-gp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
    background: #fafafa;
    flex-wrap: wrap;
}

.elo-cl-gp-header:hover {
    background: #f0f0f0;
}

.elo-cl-gp-header::before {
    content: 'â–¸';
    font-size: 0.8rem;
    color: #aaa;
    transition: transform 0.2s;
}

.elo-cl-gp-open .elo-cl-gp-header::before {
    transform: rotate(90deg);
}

.elo-cl-gpid {
    font-weight: 900;
    font-size: 0.82rem;
    text-transform: uppercase;
    color: #111;
    background: #eee;
    padding: 2px 8px;
    border-radius: 4px;
}

.elo-cl-cup {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--nintendo-red);
}

.elo-cl-date {
    font-size: 0.78rem;
    color: #999;
    font-weight: 600;
}

.elo-cl-count {
    font-size: 0.72rem;
    color: #bbb;
    font-weight: 700;
    margin-left: auto;
}

.elo-cl-rows {
    border-top: 1px solid #f0f0f0;
}

.elo-cl-row {
    display: grid;
    grid-template-columns: 40px 1fr 70px 120px 1fr;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    font-size: 0.82rem;
    border-bottom: 1px solid #f8f8f8;
    transition: background 0.1s;
}

.elo-cl-row:last-child { border-bottom: none; }
.elo-cl-row:hover { background: #fafafa; }

.elo-cl-rank {
    font-weight: 900;
    color: #888;
    font-size: 0.78rem;
}

.elo-cl-name {
    font-weight: 800;
    color: #222;
}

.elo-cl-delta {
    font-weight: 900;
    text-align: right;
    font-size: 0.85rem;
}

.elo-cl-up .elo-cl-delta { color: #2EBD59; }
.elo-cl-down .elo-cl-delta { color: #e60012; }
.elo-cl-flat .elo-cl-delta { color: #999; }

.elo-cl-arrow {
    font-size: 0.7rem;
    margin-right: 2px;
}

.elo-cl-rating {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.elo-cl-reason {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    cursor: help;
}

@media (max-width: 768px) {
    .elo-cl-row {
        grid-template-columns: 32px 1fr 60px;
        gap: 4px;
    }
    .elo-cl-rating,
    .elo-cl-reason { display: none; }
    .elo-cl-search { width: 120px; }
    .elo-cl-controls { gap: 6px; }
}

@media (max-width: 480px) {
    .elo-cl-gp-header { padding: 8px 10px; gap: 6px; }
    .elo-cl-row { padding: 6px 10px; }
}

/* === Season Report === */

.report-container {
    margin-top: 40px;
    margin-bottom: 60px;
}

/* 2-Column Layout */
.report-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* Main Paper Styling */
.report-paper {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-top: 6px solid #1a1a1a;
    position: relative;
    overflow: hidden;
}

.report-paper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z' /%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.report-inner {
    padding: 60px;
    position: relative;
    z-index: 1;
}

.report-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.omk-branding {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.omk-logo {
    background: #1a1a1a;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    padding: 10px 20px;
    border-radius: 8px;
    letter-spacing: 2px;
}

.omk-full {
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.report-title {
    font-size: 3.5rem;
    font-style: italic;
    font-weight: 900;
    margin: 5px 0;
    color: #111;
    line-height: 1;
}

.report-date {
    font-family: sans-serif;
    font-size: 0.85rem;
    color: #555;
    font-weight: bold;
    margin-top: 10px;
}

.scoring-badge {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.scoring-badge-icon {
    font-size: 1rem;
    margin-right: 6px;
}

.scoring-badge-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-body {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.report-body p {
    margin-bottom: 25px;
}

.highlight-name {
    color: #000;
    font-weight: 900;
    text-decoration: underline;
    text-decoration-color: var(--nintendo-red);
    text-decoration-thickness: 3px;
}

/* Sidebar Styling */
.sidebar-title {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-card {
    background: white;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid #eee;
    gap: 12px;
}

.sidebar-card.gold   { border-left-color: var(--gold); }
.sidebar-card.silver { border-left-color: var(--silver); }
.sidebar-card.bronze { border-left-color: var(--bronze); }

.s-rank { font-weight: 900; font-style: italic; color: #ccc; width: 30px; }
.gold .s-rank { color: var(--gold); }

.s-portrait { width: 40px; height: 40px; flex-shrink: 0; }
.s-portrait img { width: 100%; height: auto; }

.s-info { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.s-name { font-weight: 800; font-size: 0.9rem; text-transform: uppercase; }
.s-score { font-weight: 900; font-size: 1rem; color: #1a1a1a; }

.report-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature { font-size: 0.8rem; color: #888; }
.signature-label { font-style: italic; }
.signature-location { font-size: 0.7rem; color: #aaa; }

.btn-back {
    text-decoration: none;
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s;
}

/* Timeline / Season Replay */
.timeline-container {
    background: var(--background);
    
    border-radius: 12px;
    margin: 30px 0;
}

.timeline-heading {
    font-weight: 900;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.timeline-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.timeline-slider-wrap {
    margin-bottom: 30px;
}

.timeline-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--nintendo-red) 0%, #ff4444 100%);
    cursor: pointer;
}

.timeline-info {
    text-align: center;
    margin-bottom: 20px;
}

.timeline-current-gp {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--nintendo-red);
}

.timeline-current-date {
    font-size: 0.9rem;
    color: #888;
}

.timeline-snapshot {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.timeline-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.timeline-card.leader { border-left-color: #FFD700; background: linear-gradient(135deg, #FFF9E6 0%, white 100%); }
.timeline-card.podium { border-left-color: #2EBD59; }

.timeline-card-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-card-rank {
    font-size: 1.5rem;
    font-weight: 900;
    width: 40px;
}

.timeline-card-body {
    flex: 1;
}

.timeline-card-name {
    font-weight: 900;
    font-size: 0.95rem;
}

.timeline-card-score {
    font-size: 0.8rem;
    color: var(--nintendo-red);
    font-weight: 700;
}

/* Edit Controls (Admin) */
.edit-controls {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid var(--nintendo-red);
}

.edit-controls-title {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
}

.edit-toggle-btn {
    margin-bottom: 10px;
}

.edit-form {
    display: none;
    margin-top: 20px;
}

.report-editor {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: vertical;
}

.edit-form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .report-layout { grid-template-columns: 1fr; }
    .standings-sidebar { order: -1; margin-bottom: 30px; }
    .report-inner { padding: 30px; }
}

@media (max-width: 768px) {
    .omk-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* iPhone Mini & Small Devices */
@media (max-width: 390px) {
    .report-inner { padding: 15px; }
    .omk-branding { padding: 12px; }
    .omk-logo { font-size: 1.8rem; }
    .omk-full { font-size: 0.75rem; }
    .timeline-card { padding: 10px; font-size: 0.85rem; }
    .standings-sidebar { padding: 15px; }
}


/* ============================================================
   === Badges Overview ===
   Source: badges_overview.php
   ============================================================ */

.badge-overview-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.badge-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.badge-overview-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
}

.badge-category {
    margin-bottom: 50px;
}

.badge-category h2 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--nintendo-red);
    border-bottom: 3px solid var(--nintendo-red);
    padding-bottom: 10px;
}

.badge-card {
    background: white;
    border: 3px solid #eee;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.badge-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.badge-icon {
    font-size: 3rem;
}

.badge-info h3 {
    font-size: 1.3rem;
    font-weight: 900;
    margin: 0 0 5px 0;
}

.badge-info p {
    color: #888;
    margin: 0;
    font-size: 0.95rem;
}

.badge-holders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.holder-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--nintendo-red);
}

.holder-card.earned {
    background: #e8f5e9;
    border-left-color: #2EBD59;
}

.holder-card.in-progress {
    background: #fff8e1;
    border-left-color: #FF8F00;
}

.holder-card-centered {
    text-align: center;
}

.holder-name {
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.holder-status {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.progress-bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF8F00, #F2E500);
    transition: width 0.3s ease;
}

.progress-fill.earned {
    background: linear-gradient(90deg, #2EBD59, #4CAF50);
}

.progress-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

.season-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.season-selector-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.season-selector-label {
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
}

.season-selector-select {
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.no-holders {
    color: #888;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

.unique-badge-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 10px;
}

.unique-badge-title {
    font-weight: 900;
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--nintendo-red);
}

.unique-badge-awarded {
    margin-top: 10px;
}

.unique-badge-awarded strong {
    color: #2EBD59;
}


/* ============================================================
   === Rivalries ===
   Source: rivalries.php
   ============================================================ */

.rivals-nemesis-card {
    margin-bottom: 40px;
    background: #111;
    color: white;
    border: none;
    padding: 40px;
    display: block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rivals-live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--nintendo-red);
    color: white;
    padding: 5px 15px;
    font-weight: 900;
    font-style: italic;
    font-size: 0.8rem;
    border-radius: 4px;
}

.rivals-nemesis-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.rivals-nemesis-names {
    font-size: 2.5rem;
    font-weight: 900;
    font-style: italic;
}

.rivals-nemesis-names .vs-text {
    color: var(--nintendo-red);
}

.rivals-nemesis-subtext {
    color: #aaa;
    margin-top: 15px;
    font-weight: bold;
}

.rivals-section-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 20px;
}

.rivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rivals-feud-card {
    padding: 20px;
    text-align: center;
    flex-direction: column;
    border-top: 4px solid var(--nintendo-red);
}

.rivals-feud-names {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 5px;
}

.rivals-feud-names .vs-text {
    color: var(--nintendo-red);
}

.rivals-feud-count {
    font-size: 0.8rem;
    color: #555;
}

.rivals-matrix-wrap {
    overflow-x: auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.matrix-table {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
}

.matrix-table td {
    padding: 14px;
    text-align: center;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s;
}

.matrix-table td.matchup-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.matrix-table th.matrix-corner {
    background: #1a1a1a;
    color: white;
    border-radius: 8px 0 0 0;
}

.row-header {
    text-align: right;
    padding-right: 15px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    white-space: nowrap;
}

th.rotate {
    height: 120px;
    position: relative;
}

th.rotate > div {
    transform: rotate(-45deg);
    width: 30px;
    position: absolute;
    bottom: 15px;
    left: 25px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.rivals-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    overflow-y: auto;
}

.rivals-modal-inner {
    background: white;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 12px;
    padding: 40px;
    position: relative;
}

.rivals-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.rivals-modal-close:hover {
    color: var(--nintendo-red);
}

.rivals-modal-title {
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.rivals-modal-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.matchup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    border-left: 4px solid #ddd;
}

.matchup-row.win {
    border-left-color: #2EBD59;
    background: #e8f5e9;
}

.matchup-row.loss {
    border-left-color: #e60012;
    background: #ffebee;
}

.matchup-date {
    font-size: 0.8rem;
    color: #888;
}

.matchup-cup {
    font-weight: 900;
    font-size: 0.9rem;
}

.matchup-gpid {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

.matchup-ranks {
    display: flex;
    gap: 20px;
    align-items: center;
}

.matchup-rank {
    font-size: 1.2rem;
    font-weight: 900;
}

.matchup-rank-label {
    font-size: 0.7rem;
    color: #888;
}

.matchup-vs-sep {
    font-size: 1.5rem;
    color: #ddd;
}

.matchup-points-wrap {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 2px solid #eee;
}

.matchup-points-label {
    font-size: 0.7rem;
    color: #888;
}

.matchup-points-value {
    font-size: 0.9rem;
    font-weight: 900;
}

.matchup-rank--win {
    color: #2EBD59;
}

.matchup-rank--loss {
    color: #e60012;
}

.rivals-page-title {
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.rivals-h2h-title {
    font-size: 2rem;
    margin-top: 20px;
}

.rivals-h2h-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 25px;
}


/* ============================================================
   === Timeline ===
   Source: timeline.php
   ============================================================ */

.timeline-container {
    max-width: 1000px;
    margin: 0 auto;
    
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.timeline-page-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
}

.timeline-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-filter-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
}

.timeline-filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.timeline {
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--nintendo-red) 0%, #999 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 30px;
    width: 16px;
    height: 16px;
    background: var(--nintendo-red);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #f0f0f0;
}

.timeline-date {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--nintendo-red);
    margin-bottom: 12px;
}

.timeline-winner {
    font-size: 1rem;
    color: #333;
    margin-bottom: 12px;
}

.timeline-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f8f8;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* Activity Feed (between cup name and results) */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 12px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid var(--nintendo-red);
}

.feed-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    transition: background 0.15s;
}

.feed-event:hover {
    background: rgba(0,0,0,0.04);
}

.feed-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.feed-text {
    line-height: 1.3;
}

/* Event type colors */
.feed-debut { color: #8e44ad; }
.feed-pb { color: #e74c3c; }
.feed-milestone { color: #d4a017; }
.feed-streak { color: #e67e22; }
.feed-comeback { color: #27ae60; }
.feed-record { color: #2980b9; }
.feed-perfect { color: #c0392b; font-weight: 800; }
.feed-drama { color: #e84393; }
.feed-chaos { color: #6c5ce7; }
.feed-tight { color: #00b894; }
.feed-lobby { color: #636e72; }

.results-list {
    margin-top: 15px;
    display: grid;
    gap: 8px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid var(--gray-300);
}

.result-row.winner {
    border-left-color: var(--nintendo-red);
    background: linear-gradient(90deg, rgba(230, 0, 18, 0.1) 0%, #f8f8f8 100%);
}

.result-row.podium {
    border-left-color: #FFD700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, #f8f8f8 100%);
}

.result-rank {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--gray-700);
    min-width: 35px;
}

.result-name {
    font-weight: 700;
    color: var(--gray-900);
    flex: 1;
}

.result-points {
    font-weight: 900;
    color: var(--nintendo-red);
    font-size: 1rem;
    min-width: 60px;
    text-align: right;
}

.season-divider {
    position: relative;
    text-align: center;
    margin: 60px 0 40px;
}

.season-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e0e0e0 50%, transparent 100%);
}

.season-divider-text {
    position: relative;
    display: inline-block;
    padding: 10px 30px;
    background: white;
    border: 3px solid var(--nintendo-red);
    border-radius: 30px;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--nintendo-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.timeline-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.timeline-empty-heading {
    color: #666;
}

@media (max-width: 768px) {
    .timeline {
        padding-left: 30px;
    }
    .timeline::before {
        left: 10px;
    }
    .timeline-item::before {
        left: -28px;
    }
}


/* ============================================================
   === About ===
   Source: about.php
   ============================================================ */

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 60px;
}

.about-section h2 {
    font-size: 2rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin-bottom: 25px;
    color: var(--gray-900);
    border-bottom: 3px solid var(--nintendo-red);
    padding-bottom: 10px;
}

.about-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.about-section strong {
    color: var(--nintendo-red);
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--nintendo-red);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--gray-900);
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin: 0;
}

.tech-stack {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.tech-stack li {
    padding: 12px 20px;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--nintendo-red);
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.personas-list {
    margin-top: 25px;
}

.persona-item {
    padding: 18px;
    background: white;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--nintendo-red);
    font-size: 1rem;
    line-height: 1.6;
}

.persona-item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--nintendo-red);
}

.about-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.about-page-title {
    font-size: 3rem;
}

.about-cta-section {
    text-align: center;
    background: var(--gray-50);
    padding: 40px;
    border-radius: 12px;
    margin-top: 50px;
}

.about-cta-section h2 {
    margin-bottom: 20px;
}

.about-cta-section p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.about-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.about-cta-btn {
    text-decoration: none;
    padding: 15px 30px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .about-section h2 {
        font-size: 1.6rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .about-section p {
        font-size: 1rem;
    }
}

@media (max-width: 390px) {
    .about-section {
        padding: 20px 15px;
    }
    .about-section h2 {
        font-size: 1.3rem;
    }
    .about-section p {
        font-size: 0.85rem;
    }
    .feature-item {
        padding: 12px;
    }
    .feature-icon {
        font-size: 1.8rem;
    }
    .feature-item h3 {
        font-size: 0.95rem;
    }
}


/* ============================================================
   === Season Archives ===
   Source: season_archives.php
   ============================================================ */

.archives-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 40px;
}

.archives-title {
    font-size: 3.2rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin: 0;
}

.archives-subtitle {
    color: #888;
    letter-spacing: 4px;
    font-weight: 700;
}

.archives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.archive-season-card {
    flex-direction: column;
    padding: 0;
    overflow: visible;
    position: relative;
    border-top: 6px solid var(--gold);
    background: white;
}

.archive-card-top {
    background: #fdfdfd;
    padding: 50px 20px 30px 20px;
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
}

.archive-champion-img {
    width: 140px;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.15));
}

.archive-champion-name {
    margin: 20px 0 5px 0;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #1a1a1a;
}

.archive-champion-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--nintendo-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.archive-card-bottom {
    padding: 30px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.archive-season-id {
    margin: 0;
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 900;
    color: #555;
}

.archive-scoring-badge {
    display: inline-block;
    margin: 12px 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.archive-scoring-icon {
    font-size: 1rem;
    margin-right: 6px;
}

.archive-scoring-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.archive-season-name {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0 5px 0;
    font-weight: 600;
    font-style: italic;
}

.archive-closed-date {
    font-size: 0.85rem;
    color: #999;
    margin: 10px 0 25px 0;
    font-weight: 600;
}

.archive-report-btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.archive-tournament-card {
    flex-direction: column;
    padding: 0;
    overflow: visible;
    position: relative;
    border-top: 6px solid #009BE0;
    background: white;
}

.archive-tournament-trophy {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 10px;
}

.archive-tournament-champion-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #009BE0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.archive-tournament-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
    color: #555;
}

.archive-tournament-format {
    font-size: 0.85rem;
    color: #999;
    margin: 8px 0;
    font-weight: 600;
}

.archive-tournament-date {
    font-size: 0.85rem;
    color: #999;
    margin: 10px 0 25px 0;
    font-weight: 600;
}

.archive-tournament-btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background: #009BE0;
}

.crown-anim {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    z-index: 100;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
    animation: crownFloat 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
    50% { transform: translateX(-50%) translateY(-15px) rotate(8deg); }
}

/* ============================================================
   View Recap Page (/view-recap)
   ============================================================ */
.recap-layout-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    max-width: 1100px;
    margin: -50px auto 60px auto;
    position: relative;
    z-index: 10;
    padding: 0 20px;
}
.program-hero-header { height: 280px; position: relative; display: flex; align-items: center; justify-content: center; color: white; }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(circle, transparent 20%, #000 120%), url("/assets/img/noise.svg"); opacity: 0.2; }
.hero-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 25px; }
.hero-logo { height: 100px; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); }
.hero-title { font-size: 2.2rem; font-weight: 900; font-style: italic; text-transform: uppercase; margin: 0; line-height: 1; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.hero-subtitle { font-size: 0.8rem; letter-spacing: 2px; font-weight: 800; opacity: 0.9; display: block; margin-bottom: 5px; }
.recap-paper { background: white; border-radius: 12px; box-shadow: var(--shadow-xl); overflow: hidden; }
.recap-body-padding { padding: 50px; }
.recap-top-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.recap-season-pill { background: #1a1a1a; color: white; padding: 4px 8px; border-radius: 4px; font-weight: 900; font-size: 0.8rem; margin-right: 10px; }
.recap-date-label { color: #888; font-weight: 600; font-size: 0.9rem; }
.admin-controls { display: flex; gap: 10px; }
.btn-edit-recap,
.btn-delete-recap { text-decoration: none; font-size: 0.75rem; font-weight: 800; padding: 6px 12px; border-radius: 4px; }
.btn-edit-recap { background: #eee; color: #333; }
.btn-edit-recap:hover { background: #ddd; }
.btn-delete-recap { background: #fee; color: #c0392b; }
.btn-delete-recap:hover { background: #fdd; }
.recap-full-headline { font-size: 2.5rem; line-height: 1.1; margin: 10px 0 30px 0; color: #111; }
.recap-featured-quote { border-left: 4px solid var(--nintendo-red); font-style: italic; color: #555; font-size: 1.1rem; margin-bottom: 30px; background: #f9f9f9; padding: 20px; border-radius: 0 8px 8px 0; }
.highlight-name { color: #000; font-weight: 900; text-decoration: underline; text-decoration-color: var(--nintendo-red); text-decoration-thickness: 3px; }
.recap-transcript p { font-family: 'Georgia', serif; font-size: 1.2rem; line-height: 1.7; color: #333; margin-bottom: 25px; }
.recap-sidebar { padding-top: 60px; }
.sidebar-label { font-size: 0.9rem; font-weight: 900; text-transform: uppercase; color: #555; margin: 0; }
.sidebar-sub { font-size: 0.8rem; color: #999; margin: 5px 0 20px 0; }
.sidebar-empty { color: #999; font-size: 0.9rem; }
.sidebar-gp-card { background: white; border-radius: 8px; margin-bottom: 20px; box-shadow: var(--shadow-sm); overflow: hidden; border-left: 4px solid var(--nintendo-red); }
.sgp-header { background: #f9f9f9; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.sgp-cup { font-weight: 800; font-size: 0.85rem; color: #333; }
.sgp-date { font-size: 0.75rem; color: #aaa; }
.sgp-podium { padding: 10px 15px; }
.sgp-row { display: flex; align-items: center; padding: 4px 0; font-size: 0.85rem; border-bottom: 1px solid #f5f5f5; }
.sgp-row:last-child { border-bottom: none; }
.sgp-rank { width: 25px; font-weight: bold; }
.sgp-name { flex: 1; font-weight: 600; color: #444; }
.sgp-pts { font-weight: 900; color: #111; }
.recap-footer { margin-top: 60px; padding-top: 30px; border-top: 1px solid #eee; display: flex; flex-direction: column; align-items: center; gap: 20px; }
@media (max-width: 900px) {
    .recap-layout-grid { grid-template-columns: 1fr; margin-top: 0; }
    .recap-sidebar { padding-top: 0; order: 2; }
    .recap-paper { margin-bottom: 30px; }
    .program-hero-header { height: 200px; }
}
@media (max-width: 390px) {
    .recap-body-padding { padding: 15px; }
    .program-hero-header { height: 150px; padding: 15px; }
    .hero-title { font-size: 1.5rem; }
    .recap-sidebar { padding: 15px; }
}

/* ============================================================
   Add Result Page (/add-result)
   ============================================================ */
.inactive-row { opacity: 0.4; transition: opacity 0.3s; }
.active-row { opacity: 1.0; background-color: #fff !important; }
.gp-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
}
.meta-item label { display: block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #888; margin-bottom: 5px; }
.admin-table input,
.admin-table select,
.meta-item input,
.meta-item select {
    height: 48px;
    font-size: 16px !important;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
}
.admin-table input:focus,
.admin-table select:focus { border-color: var(--nintendo-red); outline: none; }
.char-input-group { display: flex; align-items: center; gap: 8px; }
.portrait-preview { width: 40px; height: 40px; background: #eee; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid #ddd; }
.portrait-preview img { height: 100%; width: auto; }
.btn-scanner {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
    box-shadow: var(--shadow-sm);
}
.btn-scanner:hover { background: #34495e; transform: translateY(-2px); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.spinner { display: inline-block; animation: spin 1s linear infinite; }
.add-result-title { font-style: italic; font-weight: 900; text-transform: uppercase; }
.add-result-error { background: var(--nintendo-red); color: white; padding: 15px; margin-bottom: 20px; }
.add-result-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}
.add-result-scanner-wrap { margin-bottom: 30px; display: flex; flex-direction: column; gap: 10px; }
.add-result-scan-status { display: none; text-align: center; color: #666; font-size: 0.9rem; }
.add-result-gpid-input { font-weight: bold; letter-spacing: 1px; border-color: var(--nintendo-red); }
.add-result-cup-select { font-size: 1.1rem; }
.add-result-rank-input { text-align: center; }
.add-result-lol-cell { text-align: center; }
.add-result-lol-checkbox { transform: scale(1.4); }

/* Wall Code */
.wall-code-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 24px 0 16px;
}

.wall-code-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.wall-code-input {
    width: 120px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 8px;
    padding: 10px 14px;
    border: 2px solid var(--gray-300, #ccc);
    border-radius: 10px;
    background: white;
    transition: border-color 0.2s;
}

.wall-code-input:focus {
    outline: none;
    border-color: var(--nintendo-red);
}
@media (max-width: 768px) {
    .gp-meta-grid { grid-template-columns: 1fr; }
    .admin-table thead { display: none; }
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td { display: block; width: 100%; }
    .admin-table tr { margin-bottom: 20px; border: 2px solid #eee; border-radius: 12px; padding: 15px; background: white; }
    .admin-table tr.active-row { border-color: var(--nintendo-red); background: #fff9f9; }
    .admin-table td { padding: 8px 0; border: none; position: relative; }
    .admin-table td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #888; margin-bottom: 5px; }
    .admin-table tr:nth-child(1),
    .admin-table tr:nth-child(2),
    .admin-table tr:nth-child(3),
    .admin-table tr:nth-child(4) { display: block; }
    .btn-generate { padding: 22px; font-size: 1.3rem; }
    .btn-scanner { font-size: 0.9rem; padding: 18px; }
}
@media (max-width: 390px) {
    .gp-meta-grid { gap: 10px; }
    .admin-table tr { padding: 12px; margin-bottom: 15px; }
    .admin-table td::before { font-size: 0.7rem; }
    .admin-select { font-size: 16px; padding: 10px; }
    .btn-generate { padding: 18px; font-size: 1.1rem; }
    .btn-scanner { font-size: 0.8rem; padding: 14px; }
}

/* ============================================================
   Login Page (/login)
   ============================================================ */
.login-container { max-width: 400px; margin-top: 100px; text-align: center; }
.login-error { color: red; }
.login-input { width: 100%; padding: 10px; margin-bottom: 20px; }

/* ============================================================
   Cards Page (/cards)
   ============================================================ */
.cards-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.cards-page-title { margin: 0; }
.cards-controls { display: flex; gap: 15px; align-items: center; }
.cards-season-select { padding: 10px 15px; font-size: 1rem; border: 2px solid var(--nintendo-red); border-radius: 5px; background: white; cursor: pointer; }
.cards-pdf-btn { padding: 10px 20px; background: var(--nintendo-red); color: white; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 1rem; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 357px); gap: 40px; justify-content: center; margin-bottom: 60px; }
.card-backing {
    width: 357px;
    height: 498px;
    background: linear-gradient(135deg, var(--nintendo-red) 0%, #c00010 100%);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    border: 6px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 40px;
}
.card-backing-title { font-size: 3rem; font-weight: 900; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 4px; }
.card-backing-divider { width: 80px; height: 3px; background: white; margin-bottom: 30px; }
.card-backing-season-label { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; opacity: 0.9; }
.card-backing-season-name { font-size: 1.8rem; font-weight: 900; margin-bottom: 5px; font-style: italic; }
.card-backing-year { font-size: 1rem; font-weight: 600; opacity: 0.9; }

/* ============================================================
   Tournament Report Page (/view-tournament-report)
   ============================================================ */
.tourney-report-header-card {
    flex-direction: column;
    align-items: stretch;
    padding: 40px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}
.tourney-report-top-row { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.tourney-report-format-label { font-size: 0.85rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.tourney-report-title { font-size: 2.5rem; font-weight: 900; margin: 0 0 15px 0; font-style: italic; text-transform: uppercase; }
.tourney-report-dates { font-size: 1rem; color: #666; margin-bottom: 10px; }
.tourney-season-badge { display: inline-block; padding: 6px 12px; background: var(--nintendo-red); color: white; border-radius: 4px; font-size: 0.85rem; font-weight: 700; }
.tourney-champion-box { text-align: right; padding: 20px; background: white; border-radius: 12px; border: 3px solid var(--nintendo-red); min-width: 250px; }
.tourney-champion-label { font-size: 0.85rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.tourney-champion-name { font-size: 2rem; font-weight: 900; color: var(--nintendo-red); margin-bottom: 5px; }
.tourney-champion-medal { font-size: 1.5rem; }
.tourney-stat-row { display: flex; gap: 30px; margin-top: 20px; padding-top: 20px; border-top: 2px solid #eee; }
.tourney-stat-label { font-size: 0.85rem; color: #888; font-weight: 700; }
.tourney-stat-value { font-size: 1.1rem; font-weight: 900; }
.tourney-results-card { flex-direction: column; align-items: stretch; padding: 40px; margin-bottom: 40px; }
.tourney-section-title { font-weight: 900; font-size: 1.5rem; margin-bottom: 25px; color: #111; }
.tourney-round-block { margin-bottom: 30px; }
.tourney-round-name { font-weight: 900; font-size: 1.2rem; margin-bottom: 15px; color: var(--nintendo-red); text-transform: uppercase; }
.tourney-matches-grid { display: grid; gap: 15px; }
.tourney-match-num { font-size: 0.75rem; color: #888; font-weight: 700; margin-bottom: 10px; }
.tourney-bye-text { color: #666; }
.tourney-matchup-row { display: flex; justify-content: space-between; align-items: center; }
.tourney-matchup-players { flex: 1; }
.tourney-vs-divider { margin: 5px 0; color: #888; font-size: 0.9rem; }
.tourney-winner-check { margin-left: 10px; }
.tourney-winner-box { text-align: right; padding-left: 20px; }
.tourney-winner-label { font-size: 0.75rem; color: #888; }
.tourney-winner-name { font-weight: 900; color: var(--nintendo-red); }
.tourney-participants-card { flex-direction: column; align-items: stretch; padding: 40px; }
.tourney-participants-sub { color: #666; margin-bottom: 20px; }
.tourney-participants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.tourney-participant-name { font-weight: 900; font-size: 1rem; }
.tourney-winner-medal { margin-left: 8px; }
.tourney-participant-elo { font-size: 0.85rem; color: #888; margin-top: 4px; }
.tourney-participant-seed { font-size: 1.5rem; font-weight: 900; color: #ccc; }
.tourney-back-row { margin-top: 40px; text-align: center; }
.tourney-back-btn {
    display: inline-block;
    padding: 15px 30px;
    background: var(--nintendo-red);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 900;
    text-transform: uppercase;
    transition: all 0.2s;
}

/* ============================================================
   Tournament Hall of Fame (/tournaments-hall-of-fame)
   ============================================================ */
.hof-page-header { margin-bottom: 50px; border-left: 8px solid var(--nintendo-red); padding-left: 25px; }
.hof-page-title { font-size: 3rem; font-weight: 900; font-style: italic; margin: 0; text-transform: uppercase; }
.hof-page-tagline { color: #666; font-weight: 700; letter-spacing: 1px; }
.hof-empty-card { text-align: center; padding: 60px 40px; }
.hof-empty-icon { font-size: 4rem; margin-bottom: 20px; }
.hof-year-card { flex-direction: column; align-items: stretch; padding: 30px; margin-bottom: 40px; }
.hof-year-heading {
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--nintendo-red);
    border-bottom: 3px solid var(--nintendo-red);
    padding-bottom: 10px;
}
.hof-cards-grid { display: grid; gap: 20px; }
.hof-tournament-card { border: 2px solid #eee; border-radius: 12px; padding: 25px; transition: all 0.2s; cursor: pointer; }
.hof-card-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.hof-card-info { flex: 1; }
.hof-format-label { font-size: 0.75rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.hof-card-title { font-size: 1.4rem; font-weight: 900; margin: 0 0 10px 0; color: #111; }
.hof-card-date { font-size: 0.9rem; color: #666; }
.hof-season-link { color: var(--nintendo-red); font-weight: 700; }
.hof-champion-col { text-align: right; padding-left: 20px; }
.hof-champion-label { font-size: 0.75rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.hof-champion-name { font-size: 1.5rem; font-weight: 900; color: var(--nintendo-red); }
.hof-card-footer { display: flex; gap: 20px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0; font-size: 0.85rem; color: #666; }
.hof-view-report-link { color: var(--nintendo-red); font-weight: 700; margin-left: auto; }
.hof-empty-heading { color: #666; margin-bottom: 10px; }
.hof-empty-sub { color: #888; }
.hof-participant-count { color: #333; }


/* ============================================================
   Stats Page (/stats)
   ============================================================ */
.stats-scoring-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.stats-scoring-inner { display: flex; align-items: center; gap: 15px; }
.stats-scoring-icon { font-size: 2rem; }
.stats-scoring-text { flex: 1; }
.stats-scoring-name { font-weight: 900; font-size: 1.1rem; margin-bottom: 5px; }
.stats-scoring-desc { font-size: 0.85rem; opacity: 0.9; }
.stats-filter-row { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.stats-filter-form { display: flex; align-items: center; gap: 10px; }
.stats-filter-label { font-weight: 900; font-size: 0.8rem; text-transform: uppercase; color: #888; }
.stats-filter-select {
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}
.stats-chart-card { flex-direction: column; align-items: stretch; padding: 40px; margin-bottom: 40px; }
.stats-chart-title { font-style: italic; font-weight: 900; margin: 0; text-transform: uppercase; }
.stats-chart-subtitle { color: #888; font-weight: bold; margin-bottom: 30px; }
.stats-threshold-note { font-size: 0.8em; color: var(--nintendo-red); }
.stats-chart-wrap { height: 600px; position: relative; }
.stats-sections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 30px; }
.stats-section-card { flex-direction: column; align-items: stretch; padding: 30px; }
.stats-section-card--top { margin-top: 30px; }
.stats-section-heading { font-weight: 900; font-size: 1rem; text-transform: uppercase; margin-bottom: 10px; color: var(--nintendo-red); }
.stats-section-sub { font-size: 0.75rem; color: #888; margin-bottom: 20px; }
.stats-highlight-val { font-weight: 900; font-size: 1.2rem; color: var(--nintendo-red); }
.stats-muted-val { color: #888; font-size: 0.9rem; }
.stats-rank-num { font-weight: 900; color: #888; }
.stats-trend-icon { font-size: 1.3rem; }
.vol-bar-track { background: #f0f0f0; height: 20px; border-radius: 4px; overflow: hidden; position: relative; }
.vol-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 800;
    color: #333;
}
/* Shared utility classes */
.txt-center { text-align: center; }
.txt-right { text-align: right; }
.racer-link { text-decoration: none; color: inherit; transition: color 0.2s; }


/* ============================================================
   All-Time / Telemetry Hub Page (/all-time)
   ============================================================ */
.alltime-page-header { margin-bottom: 50px; border-left: 8px solid #111; padding-left: 25px; }
.alltime-page-title { font-size: 3rem; font-weight: 900; font-style: italic; margin: 0; text-transform: uppercase; }
.alltime-page-tagline { color: #666; font-weight: 700; letter-spacing: 1px; }
.alltime-page-note { color: #888; font-size: 0.85rem; margin-top: 10px; font-style: italic; }
.alltime-chart-label { text-transform: uppercase; font-size: 0.9rem; color: #888; margin-bottom: 25px; font-weight: 800; }
.alltime-chart-wrap { height: 400px; }
.alltime-sections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.alltime-trophy-cell { font-size: 1.2rem; }
.alltime-trophy-span { cursor: help; }
.alltime-no-trophy { color: #ccc; }
.alltime-empty-row { color: #999; }
.alltime-trophy-legend { margin-top: 15px; font-size: 0.85rem; color: #888; text-align: center; }
.alltime-ppg-val { font-weight: 900; color: #111; }
.alltime-recent-tournaments { margin-top: 40px; }
.alltime-section-sub { color: #666; margin-bottom: 20px; font-size: 0.9rem; }
.alltime-link { color: var(--nintendo-red); font-weight: 700; text-decoration: none; }
.alltime-tournament-list { display: grid; gap: 15px; }
.alltime-tournament-row {
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid var(--nintendo-red);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alltime-tournament-name { font-weight: 900; font-size: 1.1rem; margin-bottom: 5px; }
.alltime-tournament-meta { font-size: 0.85rem; color: #666; }
.alltime-tournament-winner { text-align: right; }
.alltime-champion-label { font-size: 0.75rem; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.alltime-champion-name { font-weight: 900; font-size: 1.2rem; color: var(--nintendo-red); }
.alltime-table-scroll { overflow-x: auto; }
.alltime-lols-val { color: var(--nintendo-red); font-weight: 700; }
.alltime-name-cell { font-weight: 900; }

/* ============================================================
   === Head-to-Head Comparison ===
   Source: compare.php
   ============================================================ */

/* Picker */
.compare-picker {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
}
.compare-picker-form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
    justify-content: center;
}
.compare-picker-slot { display: flex; flex-direction: column; gap: 6px; }
.compare-picker-slot label { font-weight: 800; font-size: 0.75rem; text-transform: uppercase; color: #888; }
.compare-picker-slot select { padding: 10px 15px; border: 2px solid #e0e0e0; border-radius: 8px; font-weight: 700; font-size: 0.95rem; min-width: 180px; }
.compare-picker-vs { font-weight: 900; font-size: 1.5rem; font-style: italic; color: var(--nintendo-red); padding: 0 10px; align-self: center; }

/* Showdown Header */
.compare-showdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: #111;
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}
.compare-showdown::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(230, 0, 18, 0.15) 0%, transparent 50%, rgba(0, 100, 230, 0.15) 100%);
}
.compare-fighter { text-align: center; position: relative; z-index: 1; flex: 1; max-width: 200px; }
.compare-fighter-img { width: 100px; height: 100px; object-fit: contain; margin-bottom: 10px; }
.compare-fighter-name { font-weight: 900; font-size: 1.5rem; font-style: italic; }
.compare-fighter-nick { font-size: 0.85rem; color: #aaa; margin-top: 4px; }
.compare-vs-block { position: relative; z-index: 1; text-align: center; }
.compare-vs-text { font-size: 2.5rem; font-weight: 900; font-style: italic; color: var(--nintendo-red); }
.compare-meetings { font-size: 0.85rem; color: #888; margin-top: 4px; font-weight: 600; }

/* Record Bar */
.compare-record { margin-top: 20px; }
.compare-record-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    font-weight: 900;
    font-size: 0.85rem;
    color: white;
}
.compare-record-bar-a {
    background: var(--nintendo-red);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    transition: width 0.5s;
}
.compare-record-bar-b {
    background: #0066cc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    transition: width 0.5s;
    flex: 1;
}
.compare-record-bar-draw {
    background: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}
.compare-record-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #666;
}
.compare-record-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.compare-record-stat { text-align: center; }
.compare-record-stat-label { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: #888; margin-bottom: 6px; }
.compare-record-stat-values { font-size: 1.1rem; font-weight: 900; display: flex; gap: 8px; align-items: center; }
.compare-record-stat-vs { color: #ccc; font-size: 0.8rem; font-weight: 600; }

/* Career Comparison Table */
.compare-table { margin-top: 15px; }
.compare-col-a { text-align: center; }
.compare-col-b { text-align: center; }
.compare-stat-name { font-weight: 700; }
.compare-winner { color: var(--nintendo-red); font-weight: 900; }

/* Cup-by-Cup */
.compare-cups-grid {
    display: grid;
    gap: 4px;
    margin-top: 15px;
}
.compare-cup-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fafafa;
}
.compare-cup-row:nth-child(even) { background: white; }
.compare-cup-score {
    font-weight: 900;
    font-size: 1rem;
}
.compare-cup-row .compare-cup-score:first-child { text-align: right; }
.compare-cup-row .compare-cup-score:last-child { text-align: left; }
.compare-cup-name {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    color: #555;
    min-width: 120px;
}
.compare-cup-name.compare-tied { color: #999; }
.compare-empty { color: #ccc; }
.compare-cups-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    font-weight: 700;
    font-size: 0.9rem;
    color: #666;
}

/* Score Distribution */
.compare-dist { margin-top: 15px; }
.compare-dist-row {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 5px;
    align-items: center;
    margin-bottom: 4px;
}
.compare-dist-bar-left { display: flex; justify-content: flex-end; height: 22px; }
.compare-dist-bar-right { display: flex; justify-content: flex-start; height: 22px; }
.compare-dist-fill {
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    min-width: 0;
    transition: width 0.3s;
}
.compare-dist-fill--a { background: var(--nintendo-red); justify-content: flex-end; }
.compare-dist-fill--b { background: #0066cc; justify-content: flex-start; }
.compare-dist-label {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
}
.compare-dist-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    font-weight: 700;
    font-size: 0.85rem;
}
.compare-dist-legend-a { color: var(--nintendo-red); }
.compare-dist-legend-a::before { content: ''; display: inline-block; width: 12px; height: 12px; background: var(--nintendo-red); border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.compare-dist-legend-b { color: #0066cc; }
.compare-dist-legend-b::before { content: ''; display: inline-block; width: 12px; height: 12px; background: #0066cc; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* Responsive */
@media (max-width: 700px) {
    .compare-showdown { flex-direction: column; padding: 25px; gap: 15px; }
    .compare-fighter-img { width: 70px; height: 70px; }
    .compare-fighter-name { font-size: 1.2rem; }
    .compare-vs-text { font-size: 1.8rem; }
    .compare-picker-form { flex-direction: column; align-items: stretch; }
    .compare-picker-vs { text-align: center; }
    .compare-cup-row { grid-template-columns: 40px auto 40px; gap: 8px; }
    .compare-cup-name { min-width: 80px; font-size: 0.75rem; }
}

/* ==========================================================================
   RANK GRAPHIC PAGE (rg-*)
   Layout: #1 tall left | #2-3 top-right, #4-5-6 bottom-right | #7+ full width
   ========================================================================== */

/* Controls bar â€” outside canvas, not captured */
.rg-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.rg-controls-form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.rg-controls-label {
    font-weight: 700;
    font-size: var(--text-md);
    color: var(--gray-700);
}

.rg-controls-select {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-300);
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
    background: white;
}

.rg-download-btn {
    font-size: var(--text-md);
    padding: 10px 20px;
}

/* Canvas â€” the downloadable graphic */
.rg-canvas {
    max-width: 960px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-xl);
    color: #fff;
    overflow: hidden;
}

/* ---- Header ---- */
.rg-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.rg-header-league {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

/* Single line: "Season S01: FUNdamentals" */
.rg-header-season {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold) 0%, #fff 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rg-header-scoring {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

/* ---- Main 2-column grid: #1 left (spans full height) | right col ---- */
.rg-main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-lg);
    align-items: stretch;
    margin-bottom: var(--space-lg);
}

/* Champion card fills entire left column height */
.rg-main-grid > .rg-card--champion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Right column: podium row on top, contenders row below */
.rg-right-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* #2, #3 side by side */
.rg-podium-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    flex: 1;
}

/* #4, #5, #6 three across */
.rg-contenders-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    flex: 1;
}

/* Field: small square cards in a wrapping row */
.rg-row--field {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

/* ---- Cards â€” shared base ---- */
.rg-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

/* Champion card */
.rg-card--champion {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.03) 100%);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15), inset 0 0 20px rgba(255, 215, 0, 0.05);
    padding: var(--space-lg);
}

/* Silver card */
.rg-card--silver {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.1) 0%, rgba(192, 192, 192, 0.02) 100%);
    border-color: var(--silver);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.1);
}

/* Bronze card */
.rg-card--bronze {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.02) 100%);
    border-color: var(--bronze);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.1);
}

/* Contender card */
.rg-card--contender {
    padding: var(--space-sm) var(--space-md);
}

/* Field card â€” small square, vertical layout */
.rg-card--field {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    width: 90px;
}

/* Ineligible racers â€” dimmed with dotted border */
.rg-card--ineligible {
    opacity: 0.55;
    border-style: dashed;
}

/* ---- Rank labels ---- */
.rg-rank {
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.6);
}

.rg-rank--gold { color: var(--gold); font-size: 1.5rem; }
.rg-rank--silver { color: var(--silver); font-size: 1.1rem; }
.rg-rank--bronze { color: var(--bronze); font-size: 1.1rem; }
.rg-rank--field { font-size: 0.75rem; margin-bottom: 2px; }

/* ---- Portraits ---- */
.rg-portrait {
    position: relative;
    display: inline-block;
    border-radius: var(--radius-full);
    overflow: visible;
    margin-bottom: 4px;
    isolation: isolate; /* creates stacking context so z-index:-1 medal stays behind img but visible */
}

.rg-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
}

.rg-portrait--lg { width: 130px; height: 130px; }
.rg-portrait--md { width: 72px; height: 72px; }
.rg-portrait--sm { width: 52px; height: 52px; }
.rg-portrait--xs { width: 38px; height: 38px; flex-shrink: 0; }

/* Medal overlay on portrait â€” sits behind character image */
.rg-medal {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    line-height: 1;
}

.rg-medal--lg { font-size: 2rem; }
.rg-medal--md { font-size: 1.4rem; }

/* ---- Names ---- */
.rg-name { font-weight: 800; }
.rg-name--lg { font-size: 1.3rem; margin-bottom: 2px; }
.rg-name--md { font-size: 0.9rem; margin-bottom: 1px; }
.rg-name--sm { font-size: 0.8rem; margin-bottom: 1px; }
.rg-name--xs { font-size: 0.7rem; }

/* ---- Scores ---- */
.rg-score {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
}

.rg-score--lg { font-size: 1.2rem; color: var(--gold); }
.rg-score--md { font-size: 0.9rem; }
.rg-score--sm { font-size: 0.8rem; }
.rg-score--field { font-size: 0.7rem; }

/* GP count */
.rg-gp-count {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Field inline badges (compact, centered) */
.rg-field-badges {
    display: flex;
    justify-content: center;
    gap: 2px;
    font-size: 0.65rem;
    flex-wrap: wrap;
    margin-top: 2px;
}

.rg-field-badge-img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    vertical-align: middle;
}

/* ---- Hanging badge medals (directly below portrait, overlapping) ---- */
.rg-hanging-badges {
    display: flex;
    justify-content: center;
    margin-top: -2px;
    margin-bottom: 6px;
}

.rg-hanging-badges--sm {
    margin-top: -2px;
    margin-bottom: 4px;
}

.rg-hanging-badges--xs {
    margin-top: -2px;
    margin-bottom: 3px;
}

.rg-hanging-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    margin: 0 -3px; /* overlap badges slightly */
    /* rotation applied via JS data-rotation attribute */
}

.rg-hanging-badges--sm .rg-hanging-badge { margin: 0 -2px; }
.rg-hanging-badges--xs .rg-hanging-badge { margin: 0 -2px; }

/* Ribbon â€” thin vertical line above the badge */
.rg-badge-ribbon {
    width: 2px;
    height: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 1px;
}

.rg-hanging-badges--sm .rg-badge-ribbon { height: 9px; }
.rg-hanging-badges--xs .rg-badge-ribbon { height: 7px; }

/* Badge medal (the emoji itself) */
.rg-badge-medal {
    font-size: 1.1rem;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    cursor: default;
}

.rg-hanging-badges--sm .rg-badge-medal { font-size: 0.9rem; }
.rg-hanging-badges--xs .rg-badge-medal { font-size: 0.75rem; }

/* Badge medal image (for unique badges) */
.rg-badge-medal-img {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.rg-hanging-badges--sm .rg-badge-medal-img { width: 18px; height: 18px; }
.rg-hanging-badges--xs .rg-badge-medal-img { width: 14px; height: 14px; }

/* ---- Footer (season dates) ---- */
.rg-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

/* Empty state */
.rg-empty {
    text-align: center;
    padding: var(--space-3xl);
}

.rg-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .rg-canvas {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--radius-lg);
    }

    .rg-main-grid {
        grid-template-columns: 1fr;
    }

    .rg-podium-row {
        grid-template-columns: 1fr 1fr;
    }

    .rg-contenders-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .rg-header-season { font-size: 1.5rem; }
    .rg-portrait--lg { width: 100px; height: 100px; }
    .rg-portrait--md { width: 65px; height: 65px; }
    .rg-portrait--sm { width: 48px; height: 48px; }

    .rg-name--lg { font-size: 1.1rem; }
    .rg-name--md { font-size: 0.85rem; }

    .rg-controls { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .rg-podium-row { grid-template-columns: 1fr; }
    .rg-contenders-row { grid-template-columns: 1fr; }
    .rg-portrait--lg { width: 90px; height: 90px; }
    .rg-medal--lg { font-size: 1.5rem; }
}


/* =======================================================================
   ANIMATED GPSCORE RACE (anim-*)
   ======================================================================= */

.anim-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.anim-header {
    text-align: center;
    margin-bottom: 30px;
}

.anim-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.anim-title {
    font-size: 2.4rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    color: #111;
    margin: 0;
}

.anim-season-form {
    display: inline-block;
}

.anim-season-select {
    padding: 8px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    background: #f9f9f9;
    cursor: pointer;
}

.anim-season-select:focus {
    border-color: var(--nintendo-red);
    outline: none;
}

.anim-subtitle {
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Controls */
.anim-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #eee;
}

.anim-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    background: #e0e0e0;
    color: #555;
}

.anim-btn:hover:not(:disabled) {
    background: #d0d0d0;
    transform: scale(1.03);
}

.anim-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.anim-btn-play {
    background: var(--nintendo-red);
    color: white;
}

.anim-btn-play:hover:not(:disabled) {
    background: #c70010;
}

.anim-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.anim-speed label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #999;
}

.anim-speed input[type="range"] {
    width: 100px;
    accent-color: var(--nintendo-red);
}

.anim-gp-indicator {
    font-size: 0.85rem;
    font-weight: 800;
    color: #333;
    min-width: 90px;
    text-align: right;
}

/* Progress Bar */
.anim-progress-track {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.anim-progress-fill {
    height: 100%;
    background: var(--nintendo-red);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Chart Area */
.anim-chart-wrapper {
    background: white;
    border-radius: 14px;
    padding: 20px 10px 20px 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    overflow: hidden;
    min-height: 300px;
}

#anim-chart svg {
    display: block;
    width: 100%;
}

/* GP Info Footer */
.anim-gp-info {
    text-align: center;
    margin-top: 16px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.anim-gp-tag {
    font-weight: 900;
    font-size: 0.85rem;
    color: #111;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.anim-gp-cup {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--nintendo-red);
}

.anim-gp-date {
    font-weight: 600;
    font-size: 0.8rem;
    color: #999;
}

/* Responsive */
@media (max-width: 640px) {
    .anim-title { font-size: 1.6rem; }
    .anim-title-row { flex-direction: column; gap: 8px; }
    .anim-controls { flex-direction: column; align-items: stretch; }
    .anim-speed { margin-left: 0; justify-content: center; }
    .anim-gp-indicator { text-align: center; }
    .anim-chart-wrapper { padding: 12px 4px; }
}


/* =======================================================================
   RECORDS PAGE (rec-*)
   ======================================================================= */

.rec-header-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 40px;
    margin-bottom: 40px;
    border-left: 8px solid var(--nintendo-red);
}

.rec-title {
    font-size: 2.8rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
}

.rec-subtitle {
    color: #888;
    font-weight: 600;
    margin: 8px 0 0 0;
    font-size: 1rem;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.rec-card {
    flex-direction: column;
    align-items: stretch;
    padding: 28px;
    gap: 0;
    border: 2px solid #f0f0f0;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rec-card.rec-visible {
    opacity: 1;
    transform: translateY(0);
}

.rec-card:hover {
    border-color: var(--nintendo-red);
}

.rec-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
    line-height: 1;
}

.rec-card-title {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin: 0 0 14px 0;
    line-height: 1.3;
}

.rec-holder {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 12px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 10px;
}

.rec-holder-name {
    font-size: 1.15rem;
    font-weight: 900;
    font-style: italic;
    color: #1a1a1a;
}

.rec-holder-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--nintendo-red);
    white-space: nowrap;
}

.rec-context {
    font-size: 0.78rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.5;
}

.rec-runners {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.rec-runner {
    font-size: 0.8rem;
    color: #777;
    font-weight: 600;
    padding: 3px 0;
}

.rec-runner:first-child {
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .rec-grid {
        grid-template-columns: 1fr;
    }

    .rec-title {
        font-size: 2rem;
    }

    .rec-header-card {
        padding: 25px;
    }

    .rec-card {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .rec-title {
        font-size: 1.6rem;
    }

    .rec-holder {
        flex-direction: column;
        gap: 4px;
    }

    .rec-holder-value {
        font-size: 1rem;
    }
}


/* =======================================================================
   RIVALRY WEB PAGE (rweb-*)
   ======================================================================= */

.rweb-header-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
    margin-bottom: 0;
}

.rweb-title {
    font-size: 2.4rem;
    font-weight: 900;
    font-style: italic;
    margin: 0;
    text-transform: uppercase;
}

.rweb-subtitle {
    color: #888;
    font-weight: 600;
    margin: 6px 0 0;
    font-size: 0.95rem;
}

.rweb-graph-card {
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
}

.rweb-controls {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.rweb-season-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rweb-season-form label {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rweb-season-form select {
    padding: 8px 14px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: white;
}

.rweb-slider-label {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rweb-slider-label input[type="range"] {
    width: 140px;
    cursor: pointer;
}

.rweb-graph-container {
    width: 100%;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #fafafa;
}

.rweb-graph-container svg {
    display: block;
    width: 100%;
    height: 600px;
}

.rweb-tooltip {
    background: rgba(0, 0, 0, 0.88);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    max-width: 260px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.rweb-tooltip-title { font-weight: 900; margin-bottom: 4px; font-size: 0.85rem; }
.rweb-tooltip-stat { color: #ccc; }

.rweb-detail-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 24px 28px;
    margin-top: 0;
}

.rweb-detail-panel h3 {
    font-size: 1.4rem;
    font-weight: 900;
    margin: 0 0 16px;
}

.rweb-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.rweb-detail-table th {
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #888;
    padding: 8px 10px;
    border-bottom: 2px solid #eee;
}

.rweb-detail-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.rweb-detail-table tr:last-child td {
    border-bottom: none;
}

.rweb-winrate-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 8px;
}

.rweb-close-btn {
    margin-top: 16px;
    background: #eee;
    color: #555;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.2s;
}

.rweb-close-btn:hover {
    background: #ddd;
}

.rweb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.1rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .rweb-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .rweb-graph-container svg {
        height: 400px;
    }
    .rweb-title {
        font-size: 1.6rem;
    }
}


/* =======================================================================
   PREDICTIONS PAGE (pred-*)
   ======================================================================= */

.pred-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 30px 30px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    border: none;
}

.pred-title {
    font-size: 2.8rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin: 0 0 8px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f5d020 0%, #f53803 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pred-subtitle {
    font-size: 0.95rem;
    color: #aab;
    margin: 0 0 8px;
    font-weight: 600;
}

.pred-disclaimer {
    font-size: 0.78rem;
    color: #667;
    margin: 0;
    font-style: italic;
}

.pred-season-tag {
    display: inline-block;
    background: rgba(245, 208, 32, 0.15);
    color: #f5d020;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Chart Card */
.pred-chart-card {
    flex-direction: column;
    padding: 30px;
    margin-bottom: 30px;
}

.pred-chart-label {
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #888;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

/* Racer Grid */
.pred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.pred-racer-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pred-racer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.pred-racer-card.pred-top-1 {
    border-left: 5px solid #f5d020;
    background: linear-gradient(135deg, #fffbe6 0%, #fff 40%);
}

.pred-racer-card.pred-top-2 {
    border-left: 5px solid #c0c0c0;
}

.pred-racer-card.pred-top-3 {
    border-left: 5px solid #cd7f32;
}

.pred-racer-rank {
    font-size: 1.4rem;
    font-weight: 900;
    color: #ccc;
    min-width: 32px;
    text-align: center;
    font-style: italic;
}

.pred-top-1 .pred-racer-rank { color: #d4a800; }
.pred-top-2 .pred-racer-rank { color: #999; }
.pred-top-3 .pred-racer-rank { color: #b06c2a; }

.pred-racer-portrait {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
    border: 3px solid #eee;
    flex-shrink: 0;
}

.pred-top-1 .pred-racer-portrait { border-color: #f5d020; }

.pred-racer-info {
    flex: 1;
    min-width: 0;
}

.pred-racer-name {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pred-probability {
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--nintendo-red);
    line-height: 1;
    margin-bottom: 6px;
}

.pred-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.pred-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--nintendo-red), #ff6b35);
    transition: width 0.6s ease;
}

.pred-racer-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.72rem;
    color: #999;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

/* Parameters Card */
.pred-params-card {
    flex-direction: column;
    padding: 30px;
    margin-bottom: 30px;
}

.pred-section-title {
    font-size: 1.2rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin: 0 0 16px;
    letter-spacing: 1px;
}

.pred-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.pred-param {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 10px;
    background: #f9f9f9;
    border-radius: 10px;
}

.pred-param-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
}

.pred-param-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #333;
}

/* Scenarios Card */
.pred-scenarios-card {
    flex-direction: column;
    padding: 30px;
    margin-bottom: 30px;
}

.pred-scenario {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pred-scenario:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pred-scenario-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--nintendo-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pred-scenario-text {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    font-weight: 500;
}

/* Edge case messages */
.pred-message-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 30px;
    margin-bottom: 30px;
}

.pred-message-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.pred-message-title {
    font-size: 1.4rem;
    font-weight: 900;
    margin: 0 0 8px;
}

.pred-message-text {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pred-title { font-size: 2rem; }
    .pred-grid { grid-template-columns: 1fr; }
    .pred-racer-card { padding: 16px; gap: 12px; }
    .pred-racer-portrait { width: 40px; height: 40px; }
    .pred-probability { font-size: 1.2rem; }
    .pred-racer-stats { font-size: 0.68rem; }
    .pred-params-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .pred-header-card { padding: 30px 16px 20px; }
    .pred-title { font-size: 1.6rem; }
    .pred-params-grid { grid-template-columns: 1fr 1fr; }
}


/* =======================================================================
   POWER RANKINGS PAGE (pwr-*)
   ======================================================================= */

.pwr-header-card {
    text-align: center;
    padding: 40px 30px 30px;
}

.pwr-title {
    font-size: 2.2rem;
    font-weight: 900;
    font-style: italic;
    color: #111;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pwr-subtitle {
    font-size: 0.95rem;
    color: #777;
    margin: 0 0 20px;
}

.pwr-ai-btn {
    background: var(--nintendo-red);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.pwr-ai-btn:hover {
    background: #c70010;
    transform: scale(1.03);
}

.pwr-ai-btn:disabled {
    background: #999;
    cursor: wait;
    transform: none;
}

.pwr-ai-status {
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 20px;
}

/* Radar Card */
.pwr-radar-card {
    padding: 30px;
}

.pwr-section-title {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #333;
    margin: 0 0 20px;
    text-align: center;
}

/* Rankings List */
.pwr-rankings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwr-rank-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pwr-rank-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.pwr-rank-top {
    border-left: 4px solid var(--nintendo-red);
}

/* Main row: position | portrait | name+meta | score */
.pwr-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px 12px;
}

/* Position & Movement */
.pwr-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    flex-shrink: 0;
}

.pwr-pos-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: #222;
    line-height: 1;
}

.pwr-movement {
    font-size: 0.7rem;
    font-weight: 800;
    margin-top: 4px;
    line-height: 1;
}

.pwr-up { color: #2EBD59; }
.pwr-down { color: #E60012; }
.pwr-flat { color: #bbb; font-size: 0.85rem; }

/* Character Portrait */
.pwr-portrait {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
    flex-shrink: 0;
    background: #f5f5f5;
}

.pwr-rank-top .pwr-portrait {
    border-color: var(--nintendo-red);
}

/* Info Block */
.pwr-info {
    flex: 1;
    min-width: 0;
}

.pwr-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 3px;
}

.pwr-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pwr-streak {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #E60012;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.pwr-streak-podium {
    background: #FF8F00;
}

.pwr-gps-played {
    font-size: 0.72rem;
    color: #999;
    font-weight: 600;
}

/* Score Value â€” right-aligned in main row */
.pwr-score-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--nintendo-red);
    flex-shrink: 0;
    min-width: 54px;
    text-align: right;
    line-height: 1;
}

/* Bar row: full-width score bar below the main row */
.pwr-bar-row {
    padding: 0 20px 14px;
}

.pwr-score-bar {
    display: flex;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
}

.pwr-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    transition: width 0.4s ease;
}

.pwr-seg-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 0 6px;
}

.pwr-seg-elo { background: #E60012; }
.pwr-seg-form { background: #0066CC; }
.pwr-seg-cons { background: #2EBD59; }

/* Commentary */
.pwr-commentary {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    padding: 0 20px 16px;
    line-height: 1.5;
}

.pwr-commentary:empty {
    display: none;
}

/* Methodology Card */
.pwr-methodology-card {
    padding: 30px;
    margin-top: 10px;
}

.pwr-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pwr-method {
    text-align: center;
    padding: 20px 15px;
    background: #f9f9f9;
    border-radius: 12px;
}

.pwr-method-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pwr-method h3 {
    font-size: 0.9rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #222;
}

.pwr-method p {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pwr-card-main {
        padding: 14px 16px 10px;
        gap: 12px;
    }

    .pwr-bar-row {
        padding: 0 16px 12px;
    }

    .pwr-commentary {
        padding: 0 16px 14px;
    }

    .pwr-method-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pwr-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .pwr-portrait {
        width: 40px;
        height: 40px;
    }

    .pwr-pos-num {
        font-size: 1.2rem;
    }

    .pwr-position {
        min-width: 36px;
    }

    .pwr-score-value {
        font-size: 1.3rem;
    }

    .pwr-card-main {
        gap: 10px;
    }
}


/* =======================================================================
   FANTASY DRAFT PAGE (fan-*)
   ======================================================================= */

/* Header Card */
.fan-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 30px 30px;
    border-top: 6px solid var(--nintendo-red);
}

.fan-title {
    font-size: 2.8rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    color: var(--gray-800);
}

.fan-subtitle {
    color: var(--gray-500);
    font-weight: 600;
    margin: 8px 0 0;
    font-size: 1rem;
}

/* Tabs */
.fan-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.fan-tab {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 3px solid transparent;
}

.fan-tab:hover {
    color: var(--gray-800);
    background: var(--gray-100);
    opacity: 1;
}

.fan-tab-active {
    color: var(--nintendo-red);
    border-bottom-color: var(--nintendo-red);
    background: white;
}

/* Section Titles */
.fan-section-title {
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

/* Leaderboard Card */
.fan-leaderboard-card {
    flex-direction: column;
    padding: 30px;
}

.fan-rank {
    font-weight: 900;
    color: var(--gray-500);
}

.fan-points-val {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--nintendo-red);
}

/* Empty State */
.fan-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Score Card (admin) */
.fan-score-card {
    flex-direction: column;
    padding: 24px 30px;
}

.fan-score-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.fan-score-form .fan-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* Form Elements */
.fan-input {
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    background: white;
    transition: border-color var(--transition-fast);
    width: 100%;
}

.fan-input:focus {
    outline: none;
    border-color: var(--nintendo-red);
}

.fan-input-sm {
    width: 80px;
    text-align: center;
}

.fan-select {
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    width: 100%;
}

.fan-select:focus {
    outline: none;
    border-color: var(--nintendo-red);
}

.fan-select-sm {
    width: auto;
    min-width: 140px;
}

.fan-select-xs {
    width: auto;
    min-width: 90px;
}

.fan-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--nintendo-red);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.fan-btn:hover {
    background: var(--nintendo-red-dark);
    transform: translateY(-1px);
    opacity: 1;
}

.fan-btn-back {
    margin-top: 20px;
}

/* Submit Card */
.fan-submit-card {
    flex-direction: column;
    padding: 30px;
}

.fan-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.fan-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fan-label {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.fan-pts-badge {
    display: inline-block;
    background: var(--nintendo-red);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
}

.fan-pts-gold {
    background: #d4a017;
}

.fan-pts-blue {
    background: #009BE0;
}

.fan-hint {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-style: italic;
    margin-top: 2px;
}

/* Over/Under Row */
.fan-ou-group {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.fan-ou-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fan-ou-text {
    font-weight: 700;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Submit Button */
.fan-submit-btn {
    background: var(--nintendo-red);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: var(--radius-3xl);
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-fast);
    align-self: center;
    margin-top: 10px;
}

.fan-submit-btn:hover {
    background: var(--nintendo-red-dark);
    transform: scale(1.03);
}

/* Flash Messages */
.fan-success {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.fan-error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

/* History Section */
.fan-history-card {
    flex-direction: column;
    padding: 30px;
}

.fan-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fan-hist-gp {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.fan-hist-gp.fan-hist-open {
    border-color: var(--nintendo-red);
}

.fan-hist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.fan-hist-header:hover {
    background: var(--gray-200);
}

.fan-hist-gpid {
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--gray-800);
    min-width: 70px;
}

.fan-hist-count {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 600;
}

.fan-hist-scored {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.fan-hist-pending {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--gray-400);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.fan-hist-toggle {
    margin-left: auto;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--gray-400);
    transition: transform var(--transition-fast);
}

.fan-hist-open .fan-hist-toggle {
    transform: rotate(45deg);
}

.fan-hist-rows {
    padding: 0 16px 12px;
    background: white;
}

.fan-hist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.fan-hist-row:last-child {
    border-bottom: none;
}

.fan-hist-predictor {
    font-weight: 800;
    font-size: 0.9rem;
    min-width: 100px;
    color: var(--gray-800);
}

.fan-hist-picks {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
}

.fan-hist-pick {
    font-size: 0.78rem;
    color: var(--gray-600);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fan-hist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.fan-hit {
    background: #28a745;
}

.fan-miss {
    background: #dc3545;
}

.fan-hist-pts {
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--nintendo-red);
    min-width: 50px;
    text-align: right;
}

/* Score Results */
.fan-score-result-card {
    flex-direction: column;
    padding: 30px;
}

.fan-result-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
}

.fan-result-hit {
    background: var(--success-bg);
    color: var(--success-text);
}

.fan-result-miss {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* Week Badge */
.fan-week-badge {
    display: inline-block;
    background: var(--nintendo-red);
    color: white;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-top: 10px;
}

/* Deadline line */
.fan-deadline {
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 700;
}

.fan-deadline-open { color: #2EBD59; }
.fan-deadline-locked { color: var(--nintendo-red); }

/* Deadline banners (submit page) */
.fan-deadline-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-size: 1.2rem;
}

.fan-deadline-banner-open {
    background: #f0fdf4;
    border-left: 4px solid #2EBD59;
}

.fan-deadline-banner-locked {
    background: var(--error-bg);
    border-left: 4px solid #dc3545;
    font-size: 0.85rem;
}

.fan-deadline-label {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #166534;
}

.fan-deadline-remaining {
    font-size: 0.8rem;
    color: #15803d;
    font-weight: 600;
}

/* This Week Entries */
.fan-thisweek-card {
    flex-direction: column;
    padding: 24px 30px;
}

.fan-entries-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fan-entry-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 6px 14px;
}

.fan-entry-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--gray-800);
}

.fan-entry-count {
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 600;
}

/* Bet Sections (submit form) */
.fan-bet-section {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.fan-bet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.fan-bet-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0;
    color: var(--gray-800);
}

.fan-bet-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0 0 16px;
    line-height: 1.4;
}

/* Head-to-Head Matchups */
.fan-h2h-matchup {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--gray-200);
    transition: border-color var(--transition-fast);
}

.fan-h2h-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.fan-h2h-option:hover {
    background: var(--gray-50);
}

.fan-h2h-option input[type="radio"] {
    accent-color: var(--nintendo-red);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.fan-h2h-option input[type="radio"]:checked ~ .fan-h2h-name {
    color: var(--nintendo-red);
}

.fan-h2h-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.fan-h2h-form {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
    margin-left: auto;
}

.fan-h2h-vs {
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: white;
    background: var(--gray-400);
    padding: 4px 10px;
    flex-shrink: 0;
    letter-spacing: 1px;
}

/* Prop Bets */
.fan-prop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: white;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 2px solid var(--gray-200);
}

.fan-prop-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
    flex: 1;
    line-height: 1.3;
}

.fan-prop-buttons {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.fan-prop-btn {
    cursor: pointer;
    display: block;
}

.fan-prop-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fan-prop-yes,
.fan-prop-no {
    display: block;
    padding: 8px 18px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    color: var(--gray-500);
    background: white;
}

.fan-prop-btn input[type="radio"]:checked ~ .fan-prop-yes {
    background: #2EBD59;
    color: white;
}

.fan-prop-btn input[type="radio"]:checked ~ .fan-prop-no {
    background: var(--nintendo-red);
    color: white;
}

.fan-prop-yes:hover,
.fan-prop-no:hover {
    background: var(--gray-100);
}

/* Responsive */
@media (max-width: 768px) {
    .fan-title {
        font-size: 2rem;
    }

    .fan-tabs {
        border-radius: var(--radius-md);
    }

    .fan-tab {
        padding: 12px 10px;
        font-size: 0.78rem;
    }

    .fan-h2h-matchup {
        flex-direction: column;
    }

    .fan-h2h-vs {
        width: 100%;
        text-align: center;
        padding: 6px;
    }

    .fan-prop-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fan-prop-buttons {
        align-self: flex-start;
    }

    .fan-hist-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .fan-hist-pts {
        text-align: left;
    }

    .fan-hist-picks {
        flex-direction: column;
        gap: 4px;
    }

    .fan-score-form {
        flex-direction: column;
        align-items: stretch;
    }

    .fan-header-card {
        padding: 30px 20px 24px;
    }

    .fan-leaderboard-card,
    .fan-submit-card,
    .fan-history-card,
    .fan-score-card,
    .fan-score-result-card,
    .fan-thisweek-card {
        padding: 20px;
    }

    .fan-bet-section {
        padding: 16px;
    }
}

/* ==========================================================================
   Scoring Explainer (scoring.php)
   ========================================================================== */

.scr-header-card {
    margin-bottom: 30px;
}

.scr-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.scr-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.scr-subtitle {
    font-size: 15px;
    color: #666;
    font-weight: 600;
    margin: 0;
}

.scr-formula {
    margin-top: 24px;
}

.scr-formula h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.scr-formula-box {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.scr-formula-box code {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    font-family: 'Courier New', monospace;
}

.scr-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.scr-rule {
    font-size: 14px;
    color: #444;
    padding: 6px 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #eee;
}

.scr-rule strong {
    color: #222;
}

.scr-racer-card {
    margin-bottom: 16px;
    padding: 20px 24px;
}

.scr-racer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.scr-racer-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.scr-racer-score {
    text-align: right;
}

.scr-gpscore {
    font-size: 22px;
    font-weight: 800;
    color: #222;
}

.scr-gpscore-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.scr-unranked {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.scr-summary {
    font-size: 13px;
    color: #777;
    margin-bottom: 12px;
}

.scr-gp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scr-gp-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 48px;
    cursor: default;
}

.scr-gp-chip.scr-counted {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.scr-gp-chip.scr-dropped {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    opacity: 0.7;
}

.scr-gp-pts {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.scr-gp-label {
    font-size: 10px;
    color: #c62828;
    font-weight: 600;
    text-transform: uppercase;
}

.scr-gp-cup {
    font-size: 10px;
    color: #555;
    font-weight: 600;
    margin-bottom: 2px;
}

.scr-dropped .scr-gp-pts {
    text-decoration: line-through;
    color: #999;
}

.scr-gp-rank {
    display: inline-block;
    background: var(--nintendo-red, #e60012);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
}

.scr-cut-divider {
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--nintendo-red, #e60012);
    padding: 8px 0;
    border-top: 2px dashed var(--nintendo-red, #e60012);
    margin-top: 4px;
}

@media (max-width: 600px) {
    .scr-top-row { flex-direction: column; }
    .scr-racer-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .scr-racer-score { text-align: left; }
    .scr-rules { flex-direction: column; }
}