@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

/* styles.css version: v1.1 */


:root {
    --brand: #1A7A3C;
    --brand-dark: #0F4D26;
    --accent: #E8191A;
    --ink: #17212b;
    --muted: #637083;
    --line: #d9e2ea;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --surface-tint: #eef8f6;
    --shadow: 0 18px 40px rgba(23, 33, 43, 0.08);
    --radius: 8px;
    --container: 1160px;
    --font-main: "Inter", Arial, Helvetica, sans-serif;
    --font-headings: "Inter", Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--surface-soft);
    color: var(--ink);
    font-family: var(--font-main);
    line-height: 1.6;
}

img {
    max-width: 100%;
}

a {
    color: var(--brand);
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 22px;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 82px;
}

.logo,
.logo-container {
    align-items: center;
    display: flex;
    gap: 14px;
}

a.logo-container {
    color: inherit;
    text-decoration: none;
}

a.logo-container:hover,
a.logo-container:focus-visible {
    opacity: 0.92;
}

.logo-img {
    height: 60px;
    object-fit: cover;
    width: 54px;
}

.logo-text h1 {
    font-size: clamp(1.3rem, 2vw, 1.35rem);
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: baseline;

    margin: 0; 
    padding: 0;

    column-gap: 5px;
    row-gap: 4px;
    flex-wrap: wrap;
}

.logo-text h1 .brand-name {
  color: #1A7A3C;
  font-weight: 900;
}

.logo-text h1 .brand-sub {
  color:  #E8191A;
  font-weight: 900;
}

.logo-text h1 .brand-sub2 {
  font-weight: 900;
}

.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 82px;
    z-index: 49;
}

.nav-list {
    align-items: center;
    display: flex;
    gap: 4px;
    list-style: none;
    min-height: 56px;
}

.nav-list a {
    border-radius: var(--radius);
    color: var(--muted);
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    padding: 10px 13px;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.nav-list a:hover,
.nav-list a.active {
    background: var(--surface-tint);
    color: var(--brand-dark);
}

.burger-menu {
    align-items: center;
    background: #1A7A3C;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 4px;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.burger-menu span {
    background: #fff;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 19px;
}

.main {
    min-height: 62vh;
    padding: 42px 0 58px;
}

.main h1 {
    font-family: var(--font-headings);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    display: block;
    width: 100%;
}

.main h2 {
    font-family: var(--font-headings);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    display: block;
    width: 100%;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12%;
    height: 4px;
    background-color: #e74c3c;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 12%;
    height: 4px;
    background-color: #e74c3c;
}


.header .logo-text h1::after {
    display: none; /* Hides the underline for the logo */
}


.hero {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.5), rgba(19, 78, 74, 0.5)), url("pictures/homepage/teampicture1.jpeg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: var(--radius);
    color: #fff;
    margin-bottom: 34px;
    padding: clamp(44px, 8vw, 84px);
    padding-bottom: calc(clamp(44px, 8vw, 84px) + 10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 500px;
}



.hero h1 {
    color: #fff;
    max-width: 760px;
    text-align: center;
    
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Keep text close to the button (within ~10px on small screens) */
    gap: 10px;
    width: 100%;
    /* Keep the whole content block from sitting too low in the hero */
    padding-bottom: 10px;
    padding-top: 0;
}





.hero p {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(1rem, 2vw, 1.18rem);
    max-width: 640px;
    text-align: center;
    margin: 0;
}

.content-section {
    margin-bottom: 38px;
}

.content-section h2 {
    border-bottom: 1px solid var(--line);
    font-family: var(--font-headings);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin-bottom: 18px;
    padding-bottom: 10px;
}

.card-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.calendar-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.custom-calendar-container {
    /* CALENDAR SIZE TWEAK: change --calendar-scale (1 = full size, 0.9 = 10% smaller) */
    --calendar-scale: 0.99;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-inline: auto;
    max-width: min(100%, calc(760px * var(--calendar-scale)));
    padding: calc(22px * var(--calendar-scale));
}

.calendar-header {
    align-items: center;
    display: flex;
    gap: calc(16px * var(--calendar-scale));
    justify-content: space-between;
    margin-bottom: calc(20px * var(--calendar-scale));
}

.calendar-header h3 {
    font-family: var(--font-headings);
    /* CALENDAR SIZE TWEAK: month title scales with --calendar-scale above */
    font-size: clamp(calc(1.15rem * var(--calendar-scale)), 4vw, calc(1.5rem * var(--calendar-scale)));
    margin: 0;
    text-align: center;
}

.calendar-header h3::after {
    display: none;
}

.calendar-header .button {
    margin-top: 0;
    min-width: calc(42px * var(--calendar-scale));
    padding: calc(8px * var(--calendar-scale)) calc(12px * var(--calendar-scale));
    background-color: #E8191A;
}

.calendar-header .button:hover,
.calendar-header .button:focus-visible {
    background-color: #C71515;
}

.calendar-grid-header,
.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid-header {
    color: var(--muted);
    /* CALENDAR SIZE TWEAK: weekday labels scale with --calendar-scale */
    font-size: calc(0.84rem * var(--calendar-scale));
    font-weight: 800;
    gap: calc(8px * var(--calendar-scale));
    margin-bottom: calc(10px * var(--calendar-scale));
    text-align: center;
}

.calendar-days-grid {
    gap: calc(8px * var(--calendar-scale));
}

.calendar-day {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: default;
    display: flex;
    flex-direction: column;
    /* CALENDAR SIZE TWEAK: day numbers scale with --calendar-scale */
    font-size: calc(0.95rem * var(--calendar-scale));
    font-weight: 700;
    justify-content: center;
    margin: 0;
    min-width: 0;
    padding: 0;
    position: relative;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
    width: 100%;
}

.calendar-day:disabled {
    color: var(--ink);
    opacity: 1;
}

.calendar-day.empty {
    background: transparent;
    border-color: transparent;
}

.calendar-day.today {
    border-color: var(--accent);
}

.calendar-day.has-event {
    background: #FDEAEA;
    border-color: var(--accent);
    color: #A80F10;
    cursor: pointer;
}

.calendar-day.no-event:hover,
.calendar-day.no-event:focus-visible {
    background: #FFF2F2;
}

.calendar-day.has-event::after {
    background: currentColor;
    border-radius: 999px;
    bottom: calc(8px * var(--calendar-scale));
    content: "";
    height: calc(5px * var(--calendar-scale));
    position: absolute;
    width: calc(5px * var(--calendar-scale));
}

.calendar-day.has-multiple-events::before {
    background: var(--accent);
    border-radius: 999px;
    color: #fff;
    content: attr(data-event-count);
    font-size: calc(0.58rem * var(--calendar-scale));
    font-weight: 800;
    line-height: 1;
    min-width: calc(14px * var(--calendar-scale));
    padding: 2px 4px;
    position: absolute;
    right: calc(4px * var(--calendar-scale));
    top: calc(4px * var(--calendar-scale));
    text-align: center;
}

.calendar-day.has-event:hover,
.calendar-day.has-event:focus-visible {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}
 


.events-submit-section {
    text-align: center;
}

.event-modal-back {
    background: transparent;
    border: 0;
    color: var(--brand);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 0;
}

.event-modal-back:hover,
.event-modal-back:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}

.event-modal-picker-heading {
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 14px;
}

.event-modal-picker-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.event-modal-picker-btn {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
    width: 100%;
}

.event-modal-picker-btn:hover,
.event-modal-picker-btn:focus-visible {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.event-modal {
    align-items: center;
    background: rgba(23, 33, 43, 0.62);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 18px;
    pointer-events: none;
    position: fixed;
    transition: opacity 200ms ease;
    z-index: 1000;
}

.event-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.event-modal-content {
    margin: 0;
    max-width: 420px;
    position: relative;
    transform: translateY(18px);
    transition: transform 200ms ease;
    width: min(100%, 420px);
}

.event-modal.active .event-modal-content {
    transform: translateY(0);
}

.close-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 18px;
    top: 12px;
}

.close-btn:hover,
.close-btn:focus-visible {
    background: transparent;
    color: var(--accent);
    transform: none;
}

.card h2,
.card h3,
.card h4 {
    color: var(--ink);
    line-height: 1.25;
    margin-bottom: 10px;
    text-align: left;
}

.card h2::after,
.card h3::after,
.card h4::after {
    display: none !important;
}

.card p,
.card li {
    color: var(--muted);
    overflow-wrap: break-word;
    word-break: break-word;
}

.card ul,
.calendar-container ul {
    padding-left: 20px;
}

.post-meta,
.card .post-meta,
.news-preview-card .post-meta,
.event-modal-content .post-meta {
    color: #C71515;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.button,
button {
    background: var(--brand);
    border: 0;
    border-radius: var(--radius);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    line-height: 1.2;
    margin-top: 14px;
    padding: 11px 16px;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.button:hover,
button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.button-muted {
    background: #637083;
}

table {
    background: var(--surface);
    border-collapse: collapse;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
    width: 100%;
}

.icon {
    width: 1em;
    height: 1em;
    vertical-align: text-bottom;
    
}

.social-link{
    text-decoration: none;
}
th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px;
    text-align: left;
}

th {
    background: var(--brand-dark);
    color: #fff;
}

tr:hover td {
    background: var(--surface-tint);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    color: var(--ink);
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
    outline: none;
}

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

.result-box,
.opponent-row {
    background: var(--surface-tint);
    border: 1px solid rgba(15, 118, 110, 0.25);
    border-radius: var(--radius);
    margin-top: 18px;
    padding: 18px;
}

.result-value {
    color: var(--brand);
    font-size: 2rem;
    font-weight: 900;
}

.gallery-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-item img {
    display: block;
    height: 220px;
    object-fit: cover;
    width: 100%;
}

.missing-image::before {
    align-items: center;
    background: var(--surface-tint);
    border: 1px dashed rgba(15, 118, 110, 0.35);
    border-radius: var(--radius);
    color: var(--brand-dark);
    content: "Image coming soon";
    display: flex;
    font-weight: 800;
    height: 160px;
    justify-content: center;
    margin-bottom: 14px;
}

.footer {
    background: #0F4D26;
    color: #fff;
    padding: 42px 0 22px;
}

.footer-content {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 26px;
}

.footer-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.68);
    padding-top: 18px;
    text-align: center;
}

@media (max-width: 900px) {
    .burger-menu {
        display: flex;
    }

    .nav {
        top: 82px;
    }

    .nav-list {
        align-items: stretch;
        display: none;
        min-height: 0;
        padding: 12px 0;
    }

    .nav.active .nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-list a {
        padding: 12px;
    }
}

@media (max-width: 620px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        min-height: 74px;
    }

    .logo-img {
        height: 46px;
        width: 46px;
    }

    .nav {
        top: 74px;
    }

    .nav.active .nav-list {
        grid-template-columns: 1fr;
    }

    .main {
        padding-top: 28px;
    }

    .hero {
        min-height: auto;
        padding: clamp(18px, 5vw, 32px);
    }

    .hero-content {
        gap: clamp(16px, 3vw, 24px);
    }

    .hero p {
        font-size: clamp(0.95rem, 2vw, 1rem);
    }

    .card,
    .calendar-container {
        padding: 18px;
    }

    .custom-calendar-container {
        /* CALENDAR SIZE TWEAK: mobile padding also follows --calendar-scale */
        padding: calc(14px * var(--calendar-scale));
    }

    .calendar-grid-header,
    .calendar-days-grid {
        gap: calc(5px * var(--calendar-scale));
    }

    .calendar-day {
        border-radius: 6px;
        font-size: calc(0.85rem * var(--calendar-scale));
    }
}

/* ============================================================================
   RATINGS TABLE PAGE — ratings-table.html
   ============================================================================ */

.ratings-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.ratings-search-wrap {
    position: relative;
    flex: 1 1 220px;
    min-width: 200px;
}

.ratings-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.ratings-search {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ratings-search:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 122, 60, 0.13);
}

.ratings-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ratings-sort-wrap label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.ratings-sort-select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.ratings-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.filter-chip {
    padding: 5px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.filter-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.filter-chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.ratings-table-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.ratings-table-meta strong {
    color: var(--ink);
}

/* Sortable table headers */
.th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.th-sortable:hover {
    background: var(--brand);
    opacity: 0.88;
}

.sort-arrow {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.78rem;
    opacity: 0.55;
}

.th-sortable.sort-asc .sort-arrow::after  { content: "▲"; opacity: 1; }
.th-sortable.sort-desc .sort-arrow::after { content: "▼"; opacity: 1; }
.th-sortable:not(.sort-asc):not(.sort-desc) .sort-arrow::after { content: "⇅"; }

/* Player name link in table */
.player-name-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.player-name-link:hover {
    text-decoration: underline;
    color: var(--brand-dark);
}

.table-responsive {
    overflow-x: auto;
}

.ratings-no-results {
    text-align: center;
    padding: 42px 20px;
    color: var(--muted);
    font-weight: 700;
}

/* ============================================================================
   PLAYER PROFILE PAGE — player.html
   ============================================================================ */

.player-header-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.player-header-card h1 {
    text-align: left;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    margin-bottom: 6px;
}

.player-header-card h1::after {
    display: none;
}

.player-header-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.player-header-meta span {
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 600;
}

.player-header-meta span strong {
    color: var(--ink);
}

.player-rank-badge {
    background: #1A7A3C;
    color: #fff;
    border-radius: var(--radius);
    padding: 14px 22px;
    text-align: center;
    min-width: 100px;
    flex-shrink: 0;
}

.player-rank-badge .rank-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
    display: block;
    margin-bottom: 2px;
}

.player-rank-badge .rank-number {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.rating-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.rating-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
}

.rating-card .tc-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #A80F10;
    margin-bottom: 6px;
}

.rating-card .rc-value {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 2px;
}

.rating-card .rc-type {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.rating-card .rc-live {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.rating-card .rc-detail {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.rating-card .rc-rank {
    display: inline-block;
    margin-top: 10px;
    background: var(--surface-tint);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #A80F10;
}

.chess-sa-card {
    background: var(--surface-tint);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 28px;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    align-items: center;
}

/* Make the Chess SA rating card white-filled */
.chess-sa-card.chess-sa-card-white {
    background: #fff;
}


.chess-sa-card .csa-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: #A80F10;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.chess-sa-card .csa-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--ink);
}

.chart-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 28px;
}

.chart-section h2 {
    text-align: left;
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--ink);
}

.chart-section h2::after { display: none; }

.chart-toggles {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.chart-toggle-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 140ms ease;
    margin-top: 0;
}

.chart-toggle-btn.inactive {
    opacity: 0.35;
}

.chart-container {
    position: relative;
    height: 260px;
}

.games-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 28px;
    overflow-x: auto;
}

.games-section h2 {
    text-align: left;
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--ink);
}

.games-section h2::after { display: none; }

.games-table {
    margin-bottom: 0;
    box-shadow: none;
    border: none;
}

.games-table td, .games-table th {
    font-size: 0.88rem;
    padding: 10px 12px;
    white-space: nowrap;
}

.result-win  { color: #1a7a3c; font-weight: 800; }
.result-draw { color: #637083; font-weight: 700; }
.result-loss { color: #c0392b; font-weight: 800; }

.change-positive { color: #1a7a3c; font-weight: 800; }
.change-negative { color: #c0392b; font-weight: 800; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #A80F10;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 140ms ease;
}

.back-link:hover { color: #8a0c0d; }

.player-loading, .player-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-weight: 700;
    font-size: 1.05rem;
}

.player-error { color: var(--accent); }

@media (max-width: 700px) {
    .rating-cards-grid {
        grid-template-columns: 1fr;
    }
    .player-header-card {
        flex-direction: column;
        padding: 20px;
    }
    .player-rank-badge {
        align-self: flex-start;
    }
    .ratings-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: stretch;
    }
    .ratings-search-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }
    .ratings-sort-wrap {
        justify-content: space-between;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-responsive .table {
        min-width: 680px;
    }
    .ratings-table th,
    .ratings-table td {
        white-space: nowrap;
        padding: 10px 12px;
    }
    .ratings-table th {
        font-size: 0.82rem;
    }
    .ratings-table td {
        font-size: 0.88rem;
    }
    .ratings-filter-chips {
        justify-content: flex-start;
    }
    .ratings-table-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
