:root {
  color-scheme: light;
  --ink: #162522;
  --muted: #61716c;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --green: #123b33;
  --green-2: #1f7666;
  --hero-bg: #123b33;
  --hero-bg-2: #0b2d27;
  --hero-ink: #fffdf8;
  --hero-muted: #d8e3df;
  --gold-soft: #e7d27f;
  --gold: #c9a227;
  --line: #dcd7ca;
  --row-even: #faf8f1;
  --row-hover: #edf4f1;
  --control: #e8e3d8;
  --input: #ffffff;
  --notice-bg: #f5e8b9;
  --shadow: 0 18px 50px rgba(25, 48, 42, .09);
  --site-header-height: 80px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1f3ec;
  --muted: #a7b7b1;
  --paper: #0d1714;
  --surface: #15231f;
  --green: #77c7a7;
  --green-2: #8bd8b9;
  --hero-bg: #0a2c25;
  --hero-bg-2: #081f1a;
  --hero-ink: #f8f5ea;
  --hero-muted: #bfd2cb;
  --gold-soft: #ead77e;
  --gold: #d7b84f;
  --line: #30443d;
  --row-even: #192a25;
  --row-hover: #203830;
  --control: #243630;
  --input: #101c18;
  --notice-bg: #493f20;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Manrope, sans-serif; transition: background-color .2s ease, color .2s ease; }
a { color: var(--green-2); text-decoration: none; }
a:hover { color: var(--green); }
.site-header { min-height: var(--site-header-height); display: flex; align-items: center; gap: 24px; padding: 4px 4vw 0; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #ce2939 0 33.333%, #f7f7f2 33.333% 66.666%, #477050 66.666%); }
.brand { color: var(--ink); display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand-logo { width: 80px; height: 40px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,.13)); }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 17px; letter-spacing: .01em; }
.brand-copy small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--ink); font-size: 13px; font-weight: 700; }
.main-nav a:hover { color: var(--green-2); }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; background: var(--paper); color: var(--ink); font: 700 11px Manrope, sans-serif; cursor: pointer; }
.theme-toggle:hover { border-color: var(--green-2); }
.theme-toggle-icon { color: var(--gold); font-size: 17px; line-height: 1; }
.nav-toggle { display: none; }
main { min-height: calc(100vh - 150px); }
.hero { background: linear-gradient(135deg, var(--hero-bg), var(--hero-bg-2)); color: var(--hero-ink); padding: 80px max(5vw, calc((100vw - 1280px)/2)); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 8vw; align-items: center; position: relative; overflow: hidden; box-shadow: inset 5px 0 #ce2939, inset 10px 0 #f7f7f2, inset 15px 0 #477050; }
.hero::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -150px; top: -260px; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.02); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 800; }
h1, h2, h3 { font-family: "Source Serif 4", serif; margin-top: 0; }
.hero h1 { font-size: clamp(44px, 5.2vw, 74px); line-height: .98; letter-spacing: -.045em; margin: 17px 0 25px; }
.hero h1 em { color: var(--gold-soft); font-style: normal; }
.hero p { max-width: 680px; color: var(--hero-muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; padding: 13px 19px; border: 0; border-radius: 8px; font: 700 13px Manrope, sans-serif; cursor: pointer; }
.button-primary { background: var(--gold); color: #1f271f; }
.button-primary:hover { background: #dfbe43; color: #1f271f; }
.button-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.button-small { padding: 9px 13px; }
.score-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 3px 28px 3px 3px; padding: 32px; transform: rotate(1.4deg); box-shadow: 15px 18px 0 rgba(0,0,0,.18); position: relative; z-index: 2; }
.score-card-label { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: 10px; color: var(--muted); }
.score-card-number { font: 650 65px/1 "Source Serif 4"; color: var(--green); }
.score-card > span:not(.score-card-label) { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.mini-stats div { display: grid; }
.mini-stats strong { font-size: 22px; }
.mini-stats span { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.metric-strip { max-width: 900px; margin: -26px auto 0; background: var(--surface); box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; z-index: 4; }
.metric-strip div { padding: 24px 32px; display: flex; justify-content: space-between; align-items: center; border-right: 1px solid var(--line); }
.metric-strip span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric-strip strong { font: 650 27px "Source Serif 4"; color: var(--green); }
.section-shell, .report-shell, .chart-grid { max-width: 1280px; margin: 20px auto; padding: 0 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.section-heading h2 { font-size: 36px; margin: 5px 0 0; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.recent-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 24px; min-height: 180px; transition: .2s ease; }
.recent-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.recent-card h2 { font-size: 23px; margin: 6px 0; }
.recent-card h4 { color: var(--muted); font: 700 12px Manrope, sans-serif; margin: 18px 0 0; }
.recent-card h2 + h4 { margin: 0 0 16px; }
.recent-card > span:last-child { color: var(--muted); font-size: 12px; }
.status-pill { display: inline-block; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 6px 9px; background: #e4e6e3; color: #43514d; }
.status-active { background: #d6ece6; color: #0e6a56; }
.status-completed { background: #e8e2cc; color: #6d5c17; }
.status-registration { background: #dce9ee; color: #285e71; }
.status-cancelled { background: #f4ddd4; color: #994a2c; }
html[data-theme="dark"] .status-pill { background: #293a35; color: #cad7d2; }
html[data-theme="dark"] .status-active { background: #173d32; color: #8bd8b9; }
html[data-theme="dark"] .status-completed { background: #40391f; color: #e1c96a; }
html[data-theme="dark"] .status-registration { background: #1e3944; color: #8bc5da; }
html[data-theme="dark"] .status-cancelled { background: #492b24; color: #f0a085; }
.page-intro, .profile-header { max-width: 1280px; margin: 0 auto; padding: 30px 28px; }
.page-intro h1, .profile-header h1 { font-size: clamp(42px, 6vw, 66px); margin: 8px 0; }
.page-intro p { color: var(--muted); }
.year-bar { max-width: 1280px; margin: 24px auto -38px; padding: 0 28px; display: flex; justify-content: flex-end; position: relative; z-index: 5; }
.year-selector { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; }
.year-selector label { display: block; margin: 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.year-selector select { min-width: 112px; padding: 9px 34px 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: 700 13px Manrope, sans-serif; cursor: pointer; }
.detail-intro { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.report-shell { background: var(--surface); padding: 26px; border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(25,48,42,.04); }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.freshness { color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; background: var(--control); padding: 4px; border-radius: 9px; margin-bottom: 16px; }
.segmented button { border: 0; background: transparent; padding: 9px 13px; border-radius: 6px; color: var(--muted); font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tabulator { border: 0 !important; background: transparent !important; color: var(--ink) !important; font-size: 13px; overflow: visible !important; }
.tabulator .tabulator-header { border: 0 !important; border-bottom: 2px solid var(--green) !important; background: var(--surface) !important; position: sticky !important; top: var(--site-header-height); z-index: 12; }
.tabulator .tabulator-header .tabulator-col { background: transparent !important; border-right: 0 !important; }
html[data-theme="dark"] .tabulator .tabulator-header,
html[data-theme="dark"] .tabulator .tabulator-header .tabulator-col,
html[data-theme="dark"] .tabulator .tabulator-header .tabulator-col-title { color: var(--ink) !important; }
.tabulator .tabulator-tableholder .tabulator-table { background: var(--surface) !important; color: var(--ink) !important; }
.tabulator-row { background: transparent !important; border-bottom: 1px solid #ebe7dc !important; }
html[data-theme="dark"] .tabulator-row { border-bottom-color: var(--line) !important; color: var(--ink) !important; }
.tabulator-row:nth-child(even) { background: var(--row-even) !important; }
.tabulator-row:hover { background: var(--row-hover) !important; }
.tabulator-cell { border-right: 0 !important; padding: 12px 9px !important; }
.tabulator-header-filter input, .tabulator-header-filter select { border: 1px solid var(--line); border-radius: 5px; padding: 6px; background: var(--input); color: var(--ink); }
.tabulator .tabulator-footer { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.tabulator .tabulator-footer .tabulator-page, .tabulator .tabulator-footer .tabulator-page-size { background: var(--input) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.date-range-filter { display: grid; gap: 3px; }
.date-range-filter input { min-width: 132px; font-size: 10px; padding: 4px; }
.table-link { font-weight: 700; }
.withdrawn-player, .withdrawn-player .table-link { opacity: .68; text-decoration: line-through; }
.tournament-links { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.tournament-game-link { color: var(--green); font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.stat-grid { max-width: 1224px; margin: 20px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--green); color: white; }
.stat-grid > div { padding: 24px; display: grid; border-right: 1px solid rgba(255,255,255,.14); }
.stat-grid span { color: #b9ccc6; font-size: 11px; text-transform: uppercase; }
.stat-grid strong { font: 650 36px "Source Serif 4"; }
.stat-grid .small-value { font-size: 18px; overflow-wrap: anywhere; }
.stat-grid small { color: var(--gold); }
html[data-theme="dark"] .stat-grid { color: #10231d; }
html[data-theme="dark"] .stat-grid span { color: #294b40; }
html[data-theme="dark"] .stat-grid small { color: #5c4700; }
html[data-theme="dark"] .stat-grid > div { border-right-color: rgba(16,35,29,.18); }
.notice { max-width: 1224px; margin: 16px auto; padding: 14px 18px; background: var(--notice-bg); border-left: 4px solid var(--gold); }
.profile-header { display: flex; align-items: center; gap: 24px; }
.avatar { width: 96px; height: 96px; border-radius: 24px; background: var(--green); color: var(--gold); display: grid; place-items: center; font: 650 44px "Source Serif 4"; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-facts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 28px; }
.profile-facts div { display: grid; }
.profile-facts strong { font: 650 34px "Source Serif 4"; }
.profile-facts span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; }
.chart-grid article { background: var(--surface); border: 1px solid var(--line); padding: 22px; min-width: 0; }
.chart-grid h2 { font-size: 22px; }
input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--input); color: var(--ink); }
.empty-state { padding: 30px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); }
footer { display: flex; justify-content: space-between; padding: 30px 5vw; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
@media (max-width: 980px) {
  .nav-toggle { display: block; border: 0; background: transparent; font-weight: 800; }
  .main-nav { display: none; position: absolute; top: var(--site-header-height); left: 0; right: 0; padding: 22px 4vw; background: var(--surface); box-shadow: var(--shadow); flex-wrap: wrap; }
  .main-nav.open { display: flex; }
  .hero { grid-template-columns: 1fr; }
  .score-card { max-width: 500px; }
  .recent-grid, .chart-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .brand-copy, .theme-toggle-label { display: none; }
  .theme-toggle { padding: 8px 10px; }
  .hero { padding: 55px 24px; }
  .hero h1 { font-size: 48px; }
  .metric-strip { margin: 0; grid-template-columns: 1fr; }
  .recent-grid, .chart-grid, .stat-grid { grid-template-columns: 1fr; }
  .page-intro, .profile-header { padding-top: 42px; }
  .year-bar { margin: 18px auto -24px; }
  .detail-intro, .profile-header, .report-toolbar { align-items: flex-start; flex-direction: column; }
  .profile-facts { margin-left: 0; }
  .report-shell { padding: 14px; }
  footer { flex-direction: column; gap: 8px; }
}
