/* /stats only: overall banner, achievements, special cards, all-time records, Hoyt. Loads after stats.css. */
/* Overall Stats Banner */
.overall-banner {
    background: var(--gradient);
    color: white;
    padding: 20px;
}

/* Tiles size to their content: a "672-62" or "7.2 hands" never wraps or overflows (2026-09-06) */
.overall-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    text-align: center;
}

.overall-stat {
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    min-width: 0;
}

.overall-value {
    font-size: clamp(18px, 4.2vw, 28px);
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.overall-label {
    font-size: 11px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-length-note {
    text-align: center;
    margin-top: 15px;
    font-size: 12px;
    opacity: 0.85;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.achievement-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--line);
}

.achievement-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--line-soft);
}

/* Rows are a real grid (name | value | detail) so every card's columns line up; the old
   space-between flex ragged at each long value (2026-09-06, was already fixed for Hoyt only) */
.achievement-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1.1fr);
    gap: 10px;
    align-items: baseline;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.achievement-row .achievement-value { white-space: nowrap; text-align: right; }
.achievement-row .achievement-detail { text-align: right; overflow-wrap: anywhere; }
.achievement-row .achievement-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-title { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 4px; }
.live-title:first-child { margin-top: 0; }
.live-empty { font-size: 13px; color: #999; padding: 4px 0; }

.achievement-row:last-child {
    border-bottom: none;
}

.achievement-player {
    font-weight: 600;
    color: var(--ink);
}

.achievement-value {
    font-weight: bold;
    color: var(--win);
}

.achievement-value.streak-value {
    color: var(--accent);
}

.achievement-value.bags-value {
    color: var(--bags);
}

.achievement-value.loss-value {
    color: var(--loss);
}

.achievement-detail {
    font-size: 11px;
    color: var(--muted);
}

.streak-game-link {
    color: var(--accent);
    text-decoration: none;
}
.streak-game-link:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .overall-label {
        font-size: 10px;
    }

    .achievement-row {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 2px;
    }
    .achievement-row .achievement-detail {
        grid-column: 1 / -1;
        text-align: left;
    }
}

/* Special Cards Section */
.special-cards-section {
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--line-soft) 100%);
}

.special-cards-intro {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.special-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.special-card-box {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid var(--line);
}

.special-card-box.ten-clubs {
    border-color: var(--ink);
}

.special-card-box.seven-diamonds {
    border-color: #ff6200;
}

.card-icon {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.ten-clubs .card-icon {
    color: var(--ink);
}

.seven-diamonds .card-icon {
    color: #ff6200;
}

.card-name {
    font-weight: bold;
    font-size: 12px;
    color: var(--ink);
}

.card-effect {
    font-size: 11px;
    color: var(--win);
    margin-bottom: 8px;
}

.capture-stat {
    font-size: 12px;
    color: var(--muted);
    padding: 2px 0;
}

.special-player-stats {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.special-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

.special-player-row:last-child {
    border-bottom: none;
}

.special-captures {
    display: flex;
    gap: 12px;
}

.ten-capture {
    color: var(--ink);
    font-weight: 600;
}

.seven-capture {
    color: #ff6200;
    font-weight: 600;
}

.bags-saved {
    color: var(--win);
    font-weight: bold;
    font-size: 12px;
}

.marta-comparison {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--loss);
}

@media (max-width: 480px) {
    .special-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .card-icon {
        font-size: 24px;
    }

    .special-player-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .special-captures {
        width: 100%;
        justify-content: space-between;
    }
}

/* All-Time Records Section */
.overall-records-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 25px 20px;
}

.overall-records-section .section-title {
    color: var(--gold);
    border-bottom-color: rgba(255, 215, 0, 0.3);
    font-size: 22px;
}

.all-time-subtitle {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.big-numbers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.big-number-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
}

.big-number-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.big-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
    margin-bottom: 8px;
}

.big-label {
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.big-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.records-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 215, 0, 0.5);
}

.record-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.record-value {
    font-weight: 700;
    font-size: 14px;
    color: #4fc3f7;
}

.record-value.highlight-value {
    color: var(--gold);
}

.first-game-note {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-top: 10px;
}

@media (min-width: 768px) {
    .big-numbers-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .big-number {
        font-size: 36px;
    }

    .records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .overall-records-section {
        padding: 20px 12px;
    }

    .big-numbers-grid {
        gap: 10px;
    }

    .big-number-card {
        padding: 15px 10px;
    }

    .big-number {
        font-size: 20px;
        word-break: break-word;
    }

    .big-label {
        font-size: 10px;
        line-height: 1.2;
    }

    .big-detail {
        font-size: 9px;
        line-height: 1.3;
    }

    .record-item {
        padding: 8px 10px;
    }

    .record-label {
        font-size: 12px;
    }

    .record-value {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .big-numbers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .big-number-card {
        padding: 12px;
    }

    .big-number {
        font-size: 24px;
    }

    .big-label {
        font-size: 12px;
    }

    .big-detail {
        font-size: 11px;
    }
}

/* Game detail links */
.game-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
.game-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Time Records Grid */
.time-records-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.time-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
}

.time-record-item.fastest {
    border-left-color: var(--win);
}

.time-record-item.slowest {
    border-left-color: var(--bags);
}

.time-record-label {
    font-size: 13px;
    color: var(--muted);
}

.time-record-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}

@media (min-width: 768px) {
    .time-records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Hoyt jukebox cards (2026-09-05): rows are a real grid so the three columns line up,
   title | value | detail, instead of flex rows that ragged at every long title */
.hoyt-section .achievement-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 5.5em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.hoyt-section .achievement-player { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoyt-section .achievement-value { white-space: nowrap; text-align: right; }
.hoyt-section .achievement-detail { text-align: right; font-size: 11px; color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoyt-section .overall-stats-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 767px) {
    .hoyt-section .achievement-row { grid-template-columns: minmax(0, 1fr) 5em; }
    .hoyt-section .achievement-detail { grid-column: 1 / -1; text-align: left; }
    .hoyt-section .overall-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Robot League (2026-09-06): Otto vs Marta, the house algorithm playing itself */
#robotLeague .robot-blurb { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
#robotLeague .overall-stats-grid { grid-template-columns: repeat(6, 1fr); margin-bottom: 16px; }
@media (max-width: 767px) { #robotLeague .overall-stats-grid { grid-template-columns: repeat(3, 1fr); } }

/* Playing styles + Marta levels (2026-09-06): humans next to the bot control rows */
.styles-table td:first-child { text-align: left; font-weight: 600; }
.styles-table tr.control td { color: var(--muted); font-style: italic; background: #f3f4fb; }
.section-blurb { font-size: 13px; color: var(--muted); margin: -4px 0 12px; line-height: 1.45; text-align: center; }
.level-bars { display: grid; gap: 6px; margin-bottom: 12px; }
.level-bar { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 4.5em; gap: 8px; align-items: center; font-size: 13px; }
.level-bar .bar { height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.level-bar .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.level-bar .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Marta's read on the table (2026-09-06): one card per regular, title earned from the numbers */
.reads-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.read-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; border-top: 4px solid var(--accent); }
.read-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.read-title { font-size: 18px; font-weight: 800; color: var(--accent-2); margin: 2px 0 6px; }
.read-evidence { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.read-hands { font-size: 11px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.reads-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.read-why, .read-counter { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 0 0 8px; }
.read-counter { background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; }
.read-counter strong { color: var(--accent-2); }

/* Page groups (2026-09-08): overall / players / records / Marta / music, so sections that
   belong together read together instead of alternating. */
.group-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 2px 10px; flex-wrap: wrap; }
.group-title span { font-size: 13px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #5a67d8; }
.group-title small { font-size: 12px; color: #999; }
.group-title::after { content: ''; flex: 1; height: 1px; background: #e6e6ee; min-width: 20px; }

/* Advanced cards carry a short note saying what the number means (2026-09-08) */
.card-note { font-size: 11.5px; color: #999; line-height: 1.45; margin: 0 0 10px; }
.card-note a { color: #5a67d8; text-decoration: none; }
