:root { color-scheme: light; }
body { margin: 0; }
.ranking-shell { max-width: 960px; margin: 40px auto; padding: 0 20px 40px; color: #243c4a; font-family: 'Montserrat', 'Segoe UI', sans-serif; }
.ranking-poster { margin: 32px 0 0; }
.ranking-poster img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 10px 32px #243c4a26; }
[data-ranking-text] { white-space: pre-line; }
.ranking-hero { display: flex; align-items: center; gap: 24px; margin: 32px 0; padding: 0; background: transparent; color: #243c4a; text-align: left; }
.ranking-hero img { width: 96px; height: 96px; object-fit: contain; }
.ranking-hero .eyebrow { color: #326558; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: bold; }
.ranking-hero h1 { display: block; margin: 8px 0; font-size: clamp(1.8rem, 5vw, 2.8rem); }
.ranking-panel { background: #faf6ed; border: 1px solid #cfc4b2; border-radius: 18px; padding: 24px; box-shadow: 0 8px 32px #51493612; }
.ranking-panel nav { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 10px; padding: 0 0 16px; background: transparent; border-bottom: 1px solid #dcd2c1; }
.ranking-panel a { color: #245b55; text-underline-offset: 4px; }
.ranking-panel nav a { padding: 10px 16px; border: 1px solid #c9bfae; border-radius: 9px; background: #f0e9dc; color: #36584f; text-decoration: none; }
.ranking-panel nav a:hover { background: #e4ddcc; color: #243c4a; }
.ranking-panel nav a[aria-current] { background: #326558; color: #fffdf6; border-color: #326558; font-weight: bold; }
.ranking-panel label { display: block; font-weight: bold; margin: 24px 0 8px; }
.ranking-panel input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #bcb29f; border-radius: 8px; background: #fffdf7; color: #243c4a; font: inherit; }
.ranking-panel input::placeholder { color: #706e63; }
.ranking-panel :is(input, a, button):focus-visible { outline: 3px solid #326558; outline-offset: 3px; }
#ranking-status { color: #53635e; line-height: 1.5; }
.table-scroll { overflow-x: auto; }
.ranking-panel table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ranking-panel th, .ranking-panel td { padding: 16px 10px; border-bottom: 1px solid #ded5c5; text-align: right; }
.ranking-panel th { background: #eee7d9; font-size: .85rem; color: #4e6057; }
.ranking-panel tbody tr:hover { background: #f1ebdf; }
.ranking-panel th:nth-child(2), .ranking-panel td:nth-child(2) { text-align: left; }
.ranking-panel td:last-child { font-weight: bold; }
.ranking-panel .positive { color: #267047; }
.ranking-panel .negative { color: #a44236; }
.ranking-panel button { padding: 10px 18px; border: 1px solid #326558; border-radius: 8px; background: #326558; color: #fffdf6; font: inherit; cursor: pointer; }
.ranking-note { color: #53635e; font-size: .9rem; line-height: 1.6; }
.ranking-leaderboard-link { margin-top: 24px; }
.ranking-leaderboard-link h2 { margin: 0 0 12px; }
.ranking-panel .ranking-leaderboard-button { display: inline-block; padding: 12px 18px; border-radius: 8px; background: #326558; color: #fffdf6; font-weight: bold; text-decoration: none; }
.ranking-panel .ranking-leaderboard-button:hover { background: #244e43; }
.ranking-guide, .ranking-prizes { margin-top: 24px; line-height: 1.75; }
.ranking-prizes { margin-bottom: 24px; }
.ranking-shell .eyebrow { color: #326558; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; font-weight: bold; }
.ranking-guide h2, .ranking-prizes h2 { margin: 8px 0 16px; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.3; }
.ranking-guide h3 { margin: 30px 0 12px; line-height: 1.4; }
.ranking-rules { padding-left: 24px; }
.ranking-rules li { margin: 12px 0; padding-left: 4px; }
.rating-formula { padding: 16px 20px; background: #eee7d9; border-left: 4px solid #326558; border-radius: 0 8px 8px 0; }
.rating-examples { display: grid; gap: 18px; margin-top: 20px; }
.rating-example { padding: 20px; border: 1px solid #d4c9b7; border-radius: 12px; background: #fffdf7; }
.rating-example h4 { margin: 8px 0 16px; font-size: 1.15rem; line-height: 1.4; }
.rating-example ul { padding-left: 22px; }
.rating-example li { margin: 6px 0; }
.example-result { padding: 12px 16px; background: #e7eddf; color: #285342; border-radius: 8px; }
.ranking-prize-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.ranking-prize { padding: 22px 16px; background: #eee7d9; border: 1px solid #d4c9b7; border-radius: 12px; text-align: center; }
.ranking-prize:first-child { background: #e6ebdc; border-color: #a8b596; }
.ranking-prize span { color: #326558; font-weight: bold; }
.ranking-prize h3 { margin: 12px 0 4px; font-size: 1.5rem; }
.ranking-prize p { margin: 0; color: #53635e; }
@media (max-width: 600px) { .ranking-prize-grid { grid-template-columns: 1fr; } .rating-example { padding: 16px; } }
@media (max-width: 540px) { .ranking-shell { padding: 0 12px 24px; } .ranking-panel { padding: 16px 10px; } .ranking-hero { gap: 12px; } .ranking-hero img { width: 64px; height: 64px; } .ranking-panel th, .ranking-panel td { padding: 14px 6px; } }

/* Club event leaderboard and the history of the matches that contribute to it. */
.ranking-shell { max-width: 1040px; }
.ranking-hero { border-radius: 22px; padding: 26px; background: linear-gradient(120deg, #102d3b, #234f4d); box-shadow: 0 12px 35px #243c4a18; color: #fffdf6; }
.ranking-hero img { padding: 12px; box-sizing: border-box; border-radius: 18px; background: #fffdf6; }
.ranking-hero .eyebrow { color: #acd0b9; }
.ranking-hero p:last-child { color: #d4e3dc; margin-bottom: 0; }
.ranking-club-picker { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.ranking-club-picker label { font-weight: 700; flex-shrink: 0; }
.ranking-club-picker select { min-width: 0; flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid #bcbfae; background: #fffdf7; color: #243c4a; font: inherit; cursor: pointer; }
.ranking-board { padding: 28px; border-color: #bac7b9; background: #fffdf7; }
.ranking-board-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ranking-board-heading h2 { font-size: clamp(1.3rem, 4vw, 1.8rem); margin: 8px 0 16px; }
.ranking-board-heading .eyebrow { margin: 0; }
.ranking-count { padding: 8px 12px; background: #e9eee3; color: #326558; border-radius: 30px; font-size: .8rem; white-space: nowrap; }
.ranking-hint { color: #53635e; font-size: .85rem; line-height: 1.5; }
.ranking-board table { table-layout: fixed; }
.ranking-board th:first-child { width: 46px; }
.ranking-board th:nth-child(3) { width: 66px; }
.ranking-board th:last-child { width: 90px; }
.ranking-board .ranking-player { display: flex; align-items: center; gap: 12px; padding: 0; width: 100%; text-align: left; border: 0; background: transparent; color: #243c4a; font: inherit; }
.ranking-avatar { position: relative; flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #dde7dd; color: #326558; font-size: .8rem; font-weight: 700; }
.ranking-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ranking-player-copy { min-width: 0; }
.ranking-player-copy strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.ranking-player-copy small { display: block; margin-top: 4px; font-size: .7rem; color: #687b6f; }
.ranking-player:hover strong { color: #267047; text-decoration: underline; text-underline-offset: 3px; }
.ranking-place { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; }
.ranking-top-1 .ranking-place { background: #f6e6ad; color: #71520c; }
.ranking-top-2 .ranking-place { background: #e2e8ea; color: #4d6571; }
.ranking-top-3 .ranking-place { background: #efddcb; color: #8b5534; }
.ranking-top { background: #f7f8ef; }
.ranking-guide summary { cursor: pointer; font-weight: 700; line-height: 1.5; }
.ranking-guide[open] summary { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid #dcd2c1; }
.ranking-guide > section { margin: 0; }
.ranking-method { margin-top: 20px; color: #53635e; font-size: .85rem; line-height: 1.6; }
.ranking-method summary { cursor: pointer; font-weight: 700; color: #326558; }
.ranking-dialog-open { overflow: hidden; }
.ranking-history { box-sizing: border-box; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 26px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #b6c5b8; border-radius: 20px; background: #faf6ed; color: #243c4a; font-family: 'Montserrat', 'Segoe UI', sans-serif; box-shadow: 0 24px 70px #102d3b45; }
.ranking-history::backdrop { background: #0b2236aa; backdrop-filter: blur(4px); }
.ranking-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ranking-history-header h2 { margin: 8px 0; font-size: clamp(1.25rem, 4vw, 1.75rem); overflow-wrap: anywhere; }
.ranking-history .eyebrow { margin: 0; color: #326558; font-size: .75rem; font-weight: 700; }
.ranking-history button { flex-shrink: 0; min-width: 44px; min-height: 44px; border: 1px solid #c6d1c4; border-radius: 10px; background: #e9eee3; color: #244e43; font: inherit; cursor: pointer; }
#ranking-history-status { font-size: .85rem; line-height: 1.6; color: #53635e; margin-bottom: 24px; }
#ranking-history-body { display: grid; gap: 14px; }
.ranking-history-match { padding: 18px; border: 1px solid #d4d8c9; border-radius: 14px; background: #fffdf7; }
.ranking-history-match-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: .8rem; }
.ranking-history-match-head strong { font-size: 1.1rem; white-space: nowrap; }
.ranking-history .positive { color: #267047; }
.ranking-history .negative { color: #a44236; }
.ranking-history-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 18px; }
.ranking-history-team { display: grid; gap: 10px; }
.ranking-history-participant { display: flex; align-items: center; gap: 8px; font-size: .8rem; overflow-wrap: anywhere; min-width: 0; }
.ranking-history-participant .ranking-avatar { flex-basis: 32px; width: 32px; height: 32px; }
.ranking-versus { color: #85958a; font-size: .65rem; font-weight: 700; }
.ranking-history-score { text-align: center; margin: 18px 0 0; padding: 10px; background: #ecf0e6; border-radius: 8px; font-weight: 700; font-size: .9rem; }
.ranking-profile-link { display: inline-block; margin-top: 24px; color: #245b55; font-size: .85rem; font-weight: 700; text-underline-offset: 4px; }
.ranking-history :is(a, button):focus-visible, .ranking-club-picker select:focus-visible { outline: 3px solid #326558; outline-offset: 3px; }
@media (max-width: 600px) {
  .ranking-hero { padding: 18px 16px; margin: 20px 0; }
  .ranking-club-picker { align-items: stretch; flex-direction: column; gap: 8px; font-size: .85rem; }
  .ranking-board { padding: 18px 10px; }
  .ranking-board th { font-size: .65rem; overflow-wrap: anywhere; }
  .ranking-board th:first-child { width: 28px; }
  .ranking-board th:nth-child(3) { width: 42px; }
  .ranking-board th:last-child { width: 58px; }
  .ranking-board td { font-size: .85rem; }
  .ranking-board .ranking-player { gap: 7px; }
  .ranking-player-copy strong { font-size: .8rem; }
  .ranking-player-copy small { font-size: .6rem; }
  .ranking-board .ranking-avatar { flex-basis: 34px; width: 34px; height: 34px; }
  .ranking-board-heading { gap: 8px; }
  .ranking-count { font-size: .65rem; padding: 7px 9px; }
  .ranking-place { width: 25px; height: 25px; }
  .ranking-history { padding: 18px 12px; }
  .ranking-history-match { padding: 14px 10px; }
  .ranking-history-teams { gap: 8px; }
  .ranking-history-participant { flex-direction: column; align-items: flex-start; gap: 4px; font-size: .75rem; }
}
