/* ── Page shell ─────────────────────────────────────── */
#content {
    min-height: 100vh;
    width: 80vw;
    display: flex;
    flex-flow: column;
    align-items: center;
    padding-bottom: 80px;
    gap: 32px;
}

/* ── Page header ─────────────────────────────────────── */
#page-header {
    width: 100%;
    padding: 48px 0 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-flow: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

#page-header-left { display: flex; flex-flow: column; gap: 8px; }

/* ── Team selector bar ───────────────────────────────── */
#team-selector {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.team-selector-side {
    display: flex;
    flex-flow: column;
    gap: 10px;
}

.team-selector-side.right {
    align-items: flex-end;
}

.team-select-label {
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    font-weight: normal;
}

.team-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: rgba(255,255,255,0.85);
    font-family: "Archimoto V01", sans-serif;
    font-size: 14px;
    padding: 9px 14px;
    outline: none;
    cursor: pointer;
    width: 100%;
    transition: border-color 150ms;
}

.team-select:focus { border-color: rgba(255,255,255,0.3); }

.team-select option {
    background: #1a1a1a;
    color: rgba(255,255,255,0.85);
}

.vs-badge {
    font-family: "Abolition", sans-serif;
    font-size: 28px;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.15);
    text-align: center;
    white-space: nowrap;
}

/* Team identity display (shown after selection) */
.selected-team {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-team.right { flex-direction: row-reverse; }

.selected-team-logo {
    height: 48px;
    width: 48px;
    object-fit: contain;
}

.selected-team-name {
    font-family: "Abolition", sans-serif;
    font-size: 28px;
    letter-spacing: 4px;
    color: white;
    line-height: 1;
}

/* ── Comparison panel ────────────────────────────────── */
#comparison {
    width: 100%;
    display: flex;
    flex-flow: column;
    gap: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
}

/* Section divider header */
.section-divider {
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 10px 20px;
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    font-weight: normal;
}

.section-divider:first-child { border-top: none; }

/* Comparison row */
.comp-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.04);
    transition: background-color 120ms;
}

.comp-row:hover { background: rgba(255,255,255,0.02); }

.comp-label {
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 0 24px;
    font-weight: normal;
    white-space: nowrap;
}

.comp-value {
    display: flex;
    flex-flow: column;
    gap: 2px;
}

.comp-value.right { align-items: flex-end; }

.comp-val-main {
    font-family: "Abolition", sans-serif;
    font-size: 26px;
    letter-spacing: 3px;
    line-height: 1;
    color: rgba(255,255,255,0.58);
    transition: color 150ms;
}

.comp-val-main.wins  { color: rgba(255,255,255,0.9); }

.comp-val-sub {
    font-family: "Archimoto V01", sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}

/* ── Map records section ─────────────────────────────── */
#map-records {
    width: 100%;
    display: flex;
    flex-flow: column;
    gap: 24px;
}

.map-records-section-title {
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    font-weight: normal;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.map-records-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-family: "Archimoto V01", sans-serif;
    font-size: 15px;
}

.map-records-table colgroup col.col-map  { width: 50%; }
.map-records-table colgroup col.col-rec  { width: 25%; }

.map-records-table thead th {
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 10px 16px;
    font-weight: normal;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.map-records-table thead th.map-col { text-align: left; }
.map-records-table thead th.rec-col { text-align: center; }

.map-records-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.map-records-table tbody tr:last-child { border-bottom: none; }
.map-records-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.map-records-table tbody td {
    padding: 13px 16px;
    color: rgba(255,255,255,0.7);
}

.map-records-table tbody td.map-name-cell {
    color: rgba(255,255,255,0.85);
    font-family: "Archimoto V01", sans-serif;
}

.map-records-table tbody td.rec-cell { text-align: center; }

.record-win  { color: rgba(255,255,255,0.9); font-family: "Archimoto V01 Black", sans-serif; font-weight: normal; }
.record-loss { color: rgba(255,255,255,0.5); }
.record-even { color: rgba(255,255,255,0.65); }

/* ── Expandable map detail rows ─────────────────────── */
.map-row {
    cursor: pointer;
    user-select: none;
}

.map-row-arrow {
    display: inline-block;
    margin-right: 8px;
    color: rgba(255,255,255,0.25);
    font-size: 14px;
    transition: transform 150ms;
    line-height: 1;
}

.map-row.expanded .map-row-arrow {
    transform: rotate(90deg);
}

.map-detail-row {
    display: none;
}

.map-detail-row.open {
    display: table-row;
}

.map-detail-row > td {
    padding: 0 !important;
}

.map-detail-inner {
    background: rgba(255,255,255,0.025);
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 8px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.map-detail-stat {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.map-detail-stat:last-child {
    border-bottom: none;
}

.map-detail-label {
    font-family: "Archimoto V01 Black", sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    text-align: center;
    padding: 0 20px;
    font-weight: normal;
    white-space: nowrap;
}

.map-detail-v {
    font-family: "Abolition", sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
}

.map-detail-v.right {
    text-align: right;
}

.map-detail-v.wins {
    color: rgba(255,255,255,0.88);
}

/* ── Game History ────────────────────────────────────── */
.game-history {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 8px 12px;
    gap: 8px;
}

.game-history-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-history-col.right {
    align-items: flex-end;
}

.game-history-entry {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: "Abolition", sans-serif;
    font-size: 16px;
    color: rgba(255,255,255,0.4);
}

.game-history-entry.won {
    color: rgba(255,255,255,0.88);
}

.game-history-col.right .game-history-entry {
    flex-direction: row-reverse;
}

.gh-opponent {
    font-family: "Archimoto V01", sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
}

.gh-score {
    font-size: 18px;
}

/* ── Prompt (no teams selected) ─────────────────────── */
#select-prompt {
    width: 100%;
    text-align: center;
    padding: 60px 0;
    font-family: "Archimoto V01", sans-serif;
    font-size: 14px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
}

/* ── Responsive ──────────────────────────────────────── */
@media screen and (max-width: 900px) {
    #content        { width: 95%; }
    #page-header    { flex-flow: column; align-items: flex-start; gap: 16px; }
    #team-selector  { grid-template-columns: 1fr auto 1fr; gap: 12px; }
    .comp-val-main  { font-size: 20px; }
    .comp-label     { font-size: 10px; padding: 0 12px; }
}

@media screen and (max-width: 640px) {
    #content              { width: 100%; padding: 0 16px 100px; box-sizing: border-box; gap: 20px; }
    #page-header          { padding: 20px 0 14px; }
    #team-selector        { grid-template-columns: 1fr; }
    .vs-divider           { transform: rotate(90deg); }
    .table-scroll         { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .comp-row             { padding: 10px 12px; }
    .comp-label           { padding: 0 8px; letter-spacing: 1px; }
    .comp-val-main        { font-size: 18px; letter-spacing: 1px; }
    .game-history         { grid-template-columns: 1fr; }
}

@media screen and (max-width: 480px) {
    #content       { padding: 0 12px 100px; }
    .comp-val-main { font-size: 16px; letter-spacing: 1px; }
    .comp-label    { font-size: 9px; padding: 0 6px; }
}
