/*
 * Palette pulled from the archived hotslogs.com dark-theme.css (via
 * web.archive.org): background #0d0119, panels #1A1537, accent purple
 * #7d57ba, cyan highlight #49edff/#8fdeff.
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #0d0119 url("/static/img/background.jpg") center 0 no-repeat;
    background-attachment: fixed;
    background-size: cover;
    color: #ddd;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: #ddd;
    text-decoration: none;
}

a:hover, a:visited:hover {
    color: #8fdeff;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 1rem #000;
    margin-top: 0;
}

/* Navbar */

.navbar {
    background-color: #1A1537;
    border-bottom: 1px solid #7d57ba;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.navbar .brand img {
    height: 44px;
    display: block;
    padding: 8px 0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    display: block;
    padding: 18px 16px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 0.02em;
}

.nav-links li a:hover {
    text-shadow: 0 0 1rem #7d57ba;
    background: radial-gradient(ellipse at bottom, #7d57ba 5%, transparent 75%);
}

.starred-box {
    position: relative;
    margin-left: 8px;
}

.starred-toggle {
    position: relative;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #ddd;
    display: flex;
    align-items: center;
}

.starred-count-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7em;
    font-weight: bold;
    color: #f5c518;
    background: rgba(13, 1, 25, 0.85);
    border-radius: 999px;
    padding: 0 3px;
    line-height: 1.4;
}

.starred-toggle svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.starred-toggle:hover {
    color: #f5c518;
}

.star-btn {
    background: none;
    border: none;
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
    color: #999;
    vertical-align: middle;
    display: inline-flex;
}

.star-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.star-btn:hover svg {
    stroke: #f5c518;
}

.star-btn.starred svg {
    fill: #f5c518;
    stroke: #f5c518;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-left: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7d57ba, #49edff);
    color: #0d0119;
    font-weight: bold;
    font-size: 0.85em;
    white-space: nowrap;
}

.download-btn:hover {
    color: #0d0119;
    filter: brightness(1.1);
}

.download-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: #0d0119;
    -webkit-mask-image: url('/static/img/download-icon.svg');
    mask-image: url('/static/img/download-icon.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex-shrink: 0;
}

/* Search box */

.search-box {
    position: relative;
}

.search-box input[type="search"] {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #9393f5;
    border-radius: 999px;
    padding: 9px 18px 9px 36px;
    width: 280px;
    font-size: 0.95em;
}

.search-box input[type="search"]:focus {
    outline: none;
    border-color: #49edff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background-color: #9393f5;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    pointer-events: none;
}

.search-box input[type="search"]:focus ~ .search-icon {
    background-color: #49edff;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    z-index: 20;
}

.search-dropdown:empty {
    display: none;
}

.search-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #1A1537;
    border: 1px solid #7d57ba;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.search-dropdown-list li a {
    display: block;
    padding: 8px 16px;
    color: #fff;
}

.search-dropdown-list li a:hover {
    background: rgba(125, 87, 186, 0.3);
    color: #8fdeff;
}

.search-dropdown-empty {
    background: #1A1537;
    border: 1px solid #7d57ba;
    border-radius: 4px;
    padding: 8px 16px;
    color: #999;
    font-size: 0.85em;
}

/* Layout */

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.panel {
    background-color: rgba(32, 12, 59, 0.9);
    border: 2px solid #7d57ba;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 24px;
}

.panel-title {
    margin-bottom: 16px;
    border-bottom: 1px solid #494794;
    padding-bottom: 10px;
}

/* Two panels side by side (each ~50% width) instead of stacked. */
.panel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel-row > .panel {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .panel-row {
        grid-template-columns: 1fr;
    }
}

.site-footer {
    text-align: center;
    color: #999;
    font-size: 0.85em;
    padding: 20px;
}

/* Filters */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #494794;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-bar select,
.filter-bar input[type="number"] {
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #7d57ba;
    border-radius: 2px;
    padding: 6px 10px;
    min-width: 160px;
    font-size: 0.95em;
}

.filter-bar select:focus,
.filter-bar input[type="number"]:focus {
    outline: none;
    border-color: #49edff;
}

/* Games recorded widget */

.games-recorded-widget {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #494794;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
}

.games-recorded-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #49edff;
    text-shadow: 0 0 10px rgba(73, 237, 255, 0.4);
}

.games-recorded-label {
    color: #aaa;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hero grid */

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.hero-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.hero-tile:hover {
    background: radial-gradient(ellipse at bottom, #7d57ba 5%, transparent 75%);
}

.hero-portrait {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #7d57ba;
    object-fit: cover;
    background: #1A1537;
}

.hero-tile:hover .hero-portrait {
    border-color: #49edff;
    box-shadow: 0 0 12px #49edff;
}

.hero-name {
    margin-top: 6px;
    font-size: 0.8em;
    color: #ddd;
}

.hero-winrate {
    font-size: 0.75em;
    color: #8fdeff;
}

.hero-tile.low-sample .hero-winrate {
    color: #a89bc4;
}

.low-sample-flag {
    color: #e0c05a;
    cursor: help;
}

/* Tables */

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table thead tr {
    background: #64419d;
}

table.data-table th.sortable-col {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

table.data-table th.sortable-col:hover {
    background: rgba(255, 255, 255, 0.08);
}

table.data-table th.sortable-col::after {
    content: "\2195";
    position: absolute;
    right: 6px;
    opacity: 0.35;
    font-size: 0.85em;
}

table.data-table th.sortable-col.sorted-asc::after {
    content: "\2191";
    opacity: 1;
    color: #49edff;
}

table.data-table th.sortable-col.sorted-desc::after {
    content: "\2193";
    opacity: 1;
    color: #49edff;
}

table.data-table th, table.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

table.data-table tbody tr:hover {
    background: rgba(125, 87, 186, 0.15);
}

table.data-table .rank-cell {
    color: #49edff;
    font-weight: bold;
    width: 40px;
}

.mvp-disclosure-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.mvp-disclosure-toggle:focus-visible {
    outline: 2px solid #49edff;
    outline-offset: 2px;
    border-radius: 2px;
}

.mvp-disclosure-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: #49edff;
    -webkit-mask-image: url('/static/img/disclosure-chevron.svg');
    mask-image: url('/static/img/disclosure-chevron.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: transform 0.15s ease;
}

/* Chevron points down at rest (collapsed) and flips to point up when the
   sub-rows are showing -- a plain 180deg flip so there's no left/right
   rotation direction to get backwards. */
.mvp-disclosure-toggle[aria-expanded="true"] .mvp-disclosure-icon {
    transform: rotate(180deg);
}

tr.mvp-subrow {
    background: rgba(100, 65, 157, 0.15);
}

tr.mvp-subrow:hover {
    background: rgba(125, 87, 186, 0.25);
}

tr.mvp-subrow td {
    color: #b3b3c6;
    font-size: 0.92em;
}

tr.mvp-subrow .mvp-subrow-label {
    padding-left: 30px;
}

.mini-portrait {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #7d57ba;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: cover;
}

.win { color: #7fd97f; }
.loss { color: #e06666; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(32, 12, 59, 0.9);
    border: 1px solid #494794;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
}

.stat-card .value {
    font-size: 1.6em;
    font-weight: bold;
    color: #49edff;
    text-shadow: 0 0 10px rgba(73, 237, 255, 0.5);
}

.stat-icon {
    width: 0.8em;
    height: 0.8em;
    margin-right: 6px;
    vertical-align: middle;
}

.stat-card .label {
    font-size: 0.8em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-state {
    text-align: center;
    color: #aaa;
    padding: 30px;
}

.battletag {
    color: #fff;
    font-weight: bold;
}

/* Maps */

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.map-card {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #494794;
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease;
}

a.map-card:hover {
    border-color: #49edff;
}

.map-thumb {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
    background: #1A1537;
}

.map-card-body {
    padding: 10px 12px;
}

.map-name {
    color: #fff;
    font-weight: bold;
}

.map-substat {
    font-size: 0.8em;
    color: #8fdeff;
}

/* Hero detail */

.hero-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-portrait-lg {
    width: 96px;
    height: 96px;
}

/* Map detail */

.map-detail-banner {
    position: relative;
    max-width: 560px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.map-detail-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.map-side-label {
    position: absolute;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(13, 1, 25, 0.75);
    color: #49edff;
    border: 1px solid rgba(73, 237, 255, 0.4);
}

/* Team 0 always spawns bottom-left, team 1 top-right, in the
   unflipped/replay camera every map uses -- see MapStatRow.Team0WinRate. */
.map-side-label-left {
    left: 10px;
    bottom: 10px;
}

.map-side-label-right {
    right: 10px;
    top: 10px;
}

.talent-tier {
    margin-bottom: 22px;
}

.talent-tier-title {
    color: #8fdeff;
    text-shadow: none;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #494794;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.talent-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.talent-option {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #494794;
    border-radius: 4px;
    padding: 10px 12px;
}

.talent-option.best {
    border-color: #49edff;
    box-shadow: 0 0 10px rgba(73, 237, 255, 0.35);
}

.talent-option.low-sample .talent-name {
    color: #a89bc4;
}

.best-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(73, 237, 255, 0.15);
    border: 1px solid #49edff;
    color: #49edff;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.talent-name {
    color: #fff;
    font-weight: bold;
    margin-bottom: 8px;
}

.talent-bar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.talent-bar-fill {
    background: linear-gradient(90deg, #7d57ba, #49edff);
    height: 100%;
}

.talent-stats {
    font-size: 0.75em;
    color: #999;
}

/* Vertical bar chart (player profile's Role Distribution and Win Rate by
   Role widgets -- same visual component, different data/percent meaning
   per column). */

.vbar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 16px;
    min-height: 200px;
    padding: 28px 8px 16px;
}

.vbar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
    flex: 1;
    min-width: 0;
}

.vbar-value {
    font-size: 0.85em;
    color: #8fdeff;
    font-weight: bold;
}

.vbar-track {
    width: 100%;
    max-width: 44px;
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px 3px 0 0;
    overflow: hidden;
}

.vbar-fill {
    width: 100%;
    background: linear-gradient(180deg, #49edff, #7d57ba);
    border-radius: 3px 3px 0 0;
    transition: height 0.3s ease;
}

.vbar-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-weight: bold;
    font-size: 0.85em;
    text-align: center;
}

.vbar-games {
    font-size: 0.78em;
    color: #999;
}

/* Hero win rate bars (home page) */

.winrate-bar-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 720px) {
    .winrate-bar-columns {
        grid-template-columns: 1fr;
    }
}

.winrate-bar-column-title {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin: 0 0 10px 0;
}

.winrate-bar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.winrate-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 110px;
    align-items: center;
    gap: 10px;
}

.winrate-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.winrate-bar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    height: 12px;
    overflow: hidden;
}

.winrate-bar-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
}

/* Top Heroes lists (player profile) */

.top-heroes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.top-heroes-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.top-heroes-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-heroes-stat {
    font-size: 0.85em;
    color: #8fdeff;
    white-space: nowrap;
}

.winrate-bar-fill-good {
    background: linear-gradient(90deg, #7d57ba, #49edff);
}

.winrate-bar-fill-bad {
    background: linear-gradient(90deg, #a23b3b, #ff8a5c);
}

.winrate-bar-stats {
    font-size: 0.8em;
    color: #8fdeff;
    text-align: right;
}

@media (max-width: 560px) {
    .winrate-bar-row {
        grid-template-columns: 90px 1fr;
    }
    .winrate-bar-stats {
        grid-column: 1 / -1;
        text-align: left;
    }
}

/* Stat distribution charts */

.dist-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.dist-chart-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #494794;
    border-radius: 4px;
    padding: 10px 12px 6px;
}

.dist-chart-title {
    color: #fff;
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.dist-chart {
    display: block;
    width: 100%;
    height: auto;
}

/* Low-sample table rows (compositions, etc.) */

table.data-table tr.low-sample {
    opacity: 0.6;
}

/* Guess the Victor */

.gtv-teams {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.gtv-team {
    text-align: center;
}

.gtv-pick-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid #7d57ba;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.gtv-pick-btn:hover {
    border-color: #49edff;
}

.gtv-pick-btn.correct {
    border-color: #7fd97f;
    box-shadow: 0 0 10px rgba(127, 217, 127, 0.4);
}

.gtv-pick-btn.wrong {
    border-color: #e06666;
    box-shadow: 0 0 10px rgba(224, 102, 102, 0.4);
}

.gtv-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
}

.gtv-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gtv-result {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #494794;
    text-align: center;
}

.gtv-result p {
    font-size: 1.1em;
    font-weight: bold;
}

[x-cloak] {
    display: none !important;
}

/* Award badges on match scoreboard */

.award-badge {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
    cursor: help;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: bold;
    letter-spacing: 0.02em;
    color: #8fdeff;
    border: 1px solid #494794;
    background: rgba(0, 0, 0, 0.25);
    text-shadow: none;
}

/* Role icons: original line-art glyphs (not game assets) tinted via
   currentColor through a CSS mask, so one SVG per role works anywhere. */
.role-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.hero-portrait-wrap {
    position: relative;
    display: inline-block;
}

.league-icon {
    width: 1.4em;
    height: 1.4em;
    vertical-align: middle;
    margin-right: 4px;
}

.league-icon-lg {
    width: 28px;
    height: 28px;
    display: block;
    margin: 0 auto 4px;
}

.league-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.5em;
    font-weight: bold;
    letter-spacing: 0.02em;
    color: var(--league-color, #ddd);
    border: 1px solid var(--league-color, #7d57ba);
    background: color-mix(in srgb, var(--league-color, #7d57ba) 15%, rgba(32, 12, 59, 0.9));
    text-shadow: none;
    box-shadow: 0 0 8px color-mix(in srgb, var(--league-color, #7d57ba) 50%, transparent);
    cursor: help;
}
