body {
    margin: 0;
    background: #edf3ea;
    color: #2b2b2b;
    font-family: Outfit, Arial, Helvetica, sans-serif;
}
.header-banner {
    height: 170px;
    background-color: #2f5e36;
    background-image: url(https://scrabble.org.au/images/ScrabbleAustraliaLogo.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 27%;
}
.page-shell {
    max-width: 1400px;
    margin: 30px auto;
}
.layout {
    display: flex;
    background: white;
    border: 1px solid #cfd8cf;
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
}
.sidebar {
    width: 280px;
    background: #f3f8f1;
    border-right: 1px solid #d8e1d4;
    padding: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}
.sidebar h2 {
    color: #2f5e36;
    margin: 12px 0 16px 0;
}
.player-photo {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border: 2px solid #d8e1d4;
    background: white;
    display: block;
    margin: 0 auto 14px auto;
}
.sidebar nav a {
    display: block;
    color: #2f5e36;
    text-decoration: none;
    border-bottom: 1px dotted #7ea387;
    padding: 10px 0;
}
.side-stat {
    background: white;
    border: 1px solid #d8e1d4;
    margin: 8px 0;
    padding: 9px 10px;
}
.side-stat span {
    display: block;
    font-size: 15px;
    color: #2f5e36;
    font-weight: 700;
}
.side-stat strong {
    display: block;
    font-size: 20px;
    color: #111;
    margin-top: 2px;
}
.side-stat strong em {
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-left: 4px;
}
.ranking-bubbles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
}
.rank-bubble,
.state-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    border: 0 !important;
    text-decoration: none !important;
    text-align: center;
}
.state-badge {
    font-size: 13px;
    min-width: 0;
    padding: 4px 8px;
    font-weight: 600;
}
.main {
    flex: 1;
    padding: 32px;
}
h1, h2 {
    color: #2f5e36;
}
.player-main-title {
    margin: 0 0 18px 0;
    font-size: 34px;
    line-height: 1.1;
}
.stats-grid {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}
.top-stats {
    grid-template-columns: repeat(4,1fr);
}
.score-band-grid {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 12px;
    margin: 10px 0 24px 0;
}
.stat {
    background: #f3f8f1;
    border: 1px solid #d8e1d4;
    padding: 9px 10px;
    text-align: center;
}
.label {
    font-size: 15px;
    color: #2f5e36;
    font-weight: 700;
    letter-spacing: .01em;
}
.value {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-top: 3px;
}
.alltime-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff5d6;
    color: #6b4b00;
    border: 1px solid #e3c15f !important;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
    text-decoration: none !important;
}
a.alltime-badge:hover {
    background: #ffeaa3;
    color: #4f3700;
    border: 1px solid #c79d18 !important;
}
.hide-alltime-ranks .alltime-badge {
    display: none;
}
.hide-alltime-ranks .rank-break {
    display: none;
}
.stat-subline {
    white-space: nowrap;
}
.score-band-grid .label {
    font-size: 14px;
}
.score-band-grid .value {
    font-size: 14px;
    margin-top: 0;
}
.score-band-grid .stat {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    padding: 8px 9px;
    white-space: normal;
    flex-wrap: wrap;
}
.highlights {
    background: #fafcf9;
    border: 1px solid #d8e1d4;
    padding: 16px;
    margin: 18px 0 28px 0;
}
.highlights h2 {
    margin-top: 0;
}
.highlights table {
    margin-bottom: 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}
th {
    background: #3f6f3d;
    color: white;
    text-align: left;
    padding: 9px;
}
td {
    border-bottom: 1px solid #ddd;
    padding: 8px;
}
a {
    color: #2f5e36;
    text-decoration: none;
    border-bottom: 1px dotted #7ea387;
}
a:hover {
    color: #1d3d25;
    border-bottom: 1px solid #1d3d25;
}
.sidebar nav a:hover {
    background: #e4eee0;
    padding-left: 8px;
}
.rating-gap {
    border-left: 18px solid white;
}
.positive {
    color: #1f7a1f;
    font-weight: 700;
}
.negative {
    color: #b22222;
    font-weight: 700;
}
.neutral {
    color: #333;
}
.gold-place {
    background: #f3d36b;
    font-weight: 700;
}
.silver-place {
    background: #d9d9d9;
    font-weight: 700;
}
.bronze-place {
    background: #d8a36c;
    font-weight: 700;
}
.state-nsw {
    background: #90D5F7;
    color: #16384f !important;
}
.state-vic {
    background: #1E8449;
    color: white !important;
}
.state-qld {
    background: #8A2F4D;
    color: white !important;
}
.state-sa {
    background: #E74C3C;
    color: white !important;
}
.state-wa {
    background: #F1C40F;
    color: #3d3200 !important;
}
.state-tas {
    background: #6ED6C3;
    color: #103b34 !important;
}
.state-nt {
    background: #ffe7cc;
    color: #9a5a00 !important;
}
.state-act {
    background: #163A7A;
    color: white !important;
}
.state-all {
    background: #eef1ee;
    color: #4d5f50 !important;
}
.page-breadcrumbs {
    background: white;
    border: 1px solid #cfd8cf;
    border-bottom: 0;
    padding: 10px 18px;
    min-height: 22px;
    box-shadow: 0 3px 10px rgba(0,0,0,.04);
}
.breadcrumbs a {
    color: #2f5e36;
    text-decoration: none;
    border-bottom: 1px dotted #7ea387;
    font-weight: 600;
}
.breadcrumbs a:hover {
    color: #1d3d25;
    border-bottom: 1px solid #1d3d25;
}
.breadcrumbs span {
    margin: 0 6px;
}
.state-col {
    width: 1%;
    white-space: nowrap;
}
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px 0;
}
.filter-row label {
    font-weight: 700;
    color: #2f5e36;
}
.filter-row select {
    padding: 8px 34px 8px 10px;
    border: 1px solid #c9ddce;
    border-radius: 10px;
    background: white;
    color: #1f3524;
    font-family: Outfit, Arial, sans-serif;
    font-size: 14px;
}
.player-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px 0;
}
.player-title-row .player-main-title {
    margin: 0;
}
.rank-toggle-row {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    justify-content: flex-end;
    margin: 0;
    color: #2f5e36;
    font-size: 14px;
    font-weight: 700;
}
.rank-toggle-row {
    cursor: pointer;
}
.rank-toggle-row input {
    vertical-align: middle;
    margin: 0;
}

.tab-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0;
    margin: 0 0 26px 0;
    border: 1px solid #c9ddce;
    border-radius: 18px;
    overflow: hidden;
    background: #f3f8f1;
    box-shadow: 0 2px 7px rgba(0,0,0,.06);
}
.tab-button {
    display: block;
    box-sizing: border-box;
    text-decoration: none;
    appearance: none;
    border: 0;
    border-right: 1px solid #c9ddce;
    background: #f3f8f1;
    color: #2f5e36;
    padding: 16px 18px;
    font-family: Outfit, Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.tab-button:last-child {
    border-right: 0;
}
.tab-button:hover {
    background: #e4eee0;
}
.tab-button.active {
    background: #2f5e36;
    color: white;
}

.tab-button:focus-visible {
    outline: 3px solid #7ea387;
    outline-offset: -3px;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.h2h-box {
    background: white;
    border: 1px solid #d8e1d4;
    margin-top: 14px;
    padding: 12px;
}
.h2h-title {
    color: #2f5e36;
    font-weight: 800;
    margin-bottom: 8px;
}
.h2h-input {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #c9ddce;
    border-radius: 10px;
    font-family: Outfit, Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 8px;
}
.h2h-button {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: #2f5e36;
    color: white;
    font-family: Outfit, Arial, sans-serif;
    font-weight: 800;
    cursor: pointer;
}
.h2h-button:hover {
    background: #1d3d25;
}

@media(max-width:800px) {
    .header-banner {
        height: 120px;
        background-size: 80%;
    }
    .page-shell {
        margin: 0;
    }
    .layout {
        display: block;
    }
    .sidebar {
        position: relative;
        width: auto;
        height: auto;
    }
    .player-photo {
        width: 120px;
        height: 160px;
        margin-left: 0;
    }
    .player-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }
    .tab-bar {
        grid-template-columns: 1fr;
        border-radius: 14px;
    }
    .tab-button {
        border-right: 0;
        border-bottom: 1px solid #c9ddce;
        padding: 12px 10px;
    }
    .tab-button:last-child {
        border-bottom: 0;
    }
    table {
        font-size: .9em;
        display: block;
        overflow-x: auto;
    }
}
