:root {
  color-scheme: dark;
  --bg: #090c12;
  --surface: #111720;
  --surface-2: #151b26;
  --line: #242c39;
  --line-soft: #1c2430;
  --text: #f2f5f9;
  --muted: #8992a3;
  --muted-2: #687284;
  --green: #3a8046;
  --green-2: #143522;
  --orange: #ff9d00;
  --blue: #38a7ff;
  --danger: #ff5c7a;
  --radius: 8px;
  --sidebar: 236px;
  font-family:
    Sora, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.theme-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.theme-logo-light {
  display: none !important;
}

body.theme-light .theme-logo-dark {
  display: none !important;
}

body.theme-light .theme-logo-light {
  display: block !important;
}

.startup-theme-logo {
  width: min(350px, 86vw);
  margin: 0 auto 12px;
}

.auth-theme-logo {
  width: min(300px, 78vw);
  margin: 0 auto 8px;
  transform: translateX(-3.5%);
}

.brand-theme-logo {
  width: 220px;
  max-width: 100%;
}
body.theme-light {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --line: #d6dee9;
  --line-soft: #e3e9f1;
  --text: #111827;
  --muted: #5d6675;
  --muted-2: #758093;
  --green: #3a8046;
  --green-2: #dcefe3;
  --orange: #d97706;
  --blue: #1476d4;
  --danger: #d92d50;
}

body.theme-light .auth-screen {
  background:
    radial-gradient(circle at 50% -10%, rgba(58, 128, 70, 0.12), transparent 34%),
    var(--bg);
}

body.theme-light .auth-icon,
body.theme-light .avatar {
  background: #e1f8ea;
}

body.theme-light .sidebar,
body.theme-light .profile-dropdown,
body.theme-light .account-panel,
body.theme-light .panel,
body.theme-light .event-card,
body.theme-light .opponent-card,
body.theme-light .match-page-card {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.1);
}

body.theme-light .dropdown-sign-out,
body.theme-light .account-panel input,
body.theme-light .language-toggle,
body.theme-light .settings-toggle,
body.theme-light select {
  background: #ffffff;
}

body.theme-light .profile-link:hover,
body.theme-light .profile-link:focus-visible {
  background: rgba(58, 128, 70, 0.1);
}


* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.is-hidden,
[hidden] {
  display: none !important;
}

.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% -10%, rgba(58, 128, 70, 0.16), transparent 34%),
    #090c12;
  color: #f2f5f9;
  opacity: 1;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.startup-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.startup-loader-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}


.startup-loader-animation {
  display: block;
  width: min(640px, 92vw);
  height: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  transform: translateX(-3.5%);
}
.startup-loader-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(58, 128, 70, 0.18);
}

.startup-loader-brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 4px;
  font-size: 25px;
  font-weight: 560;
  letter-spacing: 0.16em;
  line-height: 1;
}

.startup-loader-brand span:first-child {
  color: var(--text);
}

.startup-loader-brand span:last-child {
  color: var(--green);
}

.startup-loader-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.app-shell.app-entering {
  animation: app-shell-enter 260ms ease both;
}

@keyframes app-shell-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button,
select,
input {
  font: inherit;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 0 24px 48px;
  background:
    radial-gradient(circle at 50% -10%, rgba(58, 128, 70, 0.14), transparent 34%),
    var(--bg);
  color: var(--text);
}

.auth-heading {
  display: grid;
  justify-items: center;
  margin-top: clamp(14px, 3vh, 34px);
  margin-bottom: 18px;
  text-align: center;
}

.auth-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(58, 128, 70, 0.34);
  border-radius: 16px;
  background: #0d3a26;
  color: var(--green);
}

.auth-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-heading h1 {
  margin: 22px 0 8px;
  color: var(--text);
  font-size: clamp(36px, 5vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101720;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.login-card label {
  display: grid;
  gap: 12px;
  color: var(--text);
  font-weight: 560;
  font-size: 13px;
}


.login-card .auth-consent {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.auth-consent a,
.auth-legal-links a {
  color: var(--green);
  font-weight: 650;
  text-decoration: none;
}

.auth-consent a:hover,
.auth-legal-links a:hover {
  text-decoration: underline;
}
.oauth-button {
  width: min(560px, 100%);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid #dce1e8;
  border-radius: 8px;
  background: #0b1018;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.oauth-button:hover,
.oauth-button:focus-visible {
  border-color: rgba(66, 133, 244, 0.72);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.14);
}

.oauth-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-divider {
  width: min(560px, 100%);
}

.auth-divider em {
  font-style: normal;
}
.google-mark {
  color: #4285f4;
  font-weight: 620;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: #6c7688;
  font-size: 14px;
}

.auth-divider span {
  height: 1px;
  background: #dce1e8;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 650;
}

.input-shell {
  height: 46px;
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1018;
  padding: 0 16px;
}

.input-shell:focus-within {
  border-color: rgba(58, 128, 70, 0.78);
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.12);
}

.input-shell svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 15px;
}

input:focus,
select:focus {
  border-color: rgba(58, 128, 70, 0.75);
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.12);
}

.login-hint {
  font-size: 13px;
}

.login-error {
  color: var(--danger) !important;
  font-size: 14px;
  font-weight: 560;
  margin: 0;
}

.login-error.info {
  color: var(--muted) !important;
}

.primary-button {
  height: 60px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #06130c;
  cursor: pointer;
  font-size: 15px;
  font-weight: 620;
}


.primary-button:disabled {
  opacity: 0.74;
  cursor: progress;
}

.primary-button.is-loading {
  position: relative;
  padding-left: 42px;
}

.primary-button.is-loading::before {
  content: "";
  position: absolute;
  left: 18px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 19, 12, 0.28);
  border-top-color: #06130c;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-footer {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.google-oauth-consent {
  display: none;
  width: min(520px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.google-oauth-consent a {
  color: var(--green);
  font-weight: 650;
  text-decoration: none;
}

.google-oauth-consent a:hover {
  text-decoration: underline;
}
.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(440px, 100%);
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 50% -10%, rgba(58, 128, 70, 0.18), transparent 34%),
    var(--bg);
  color: var(--text);
}

.legal-shell {
  width: min(920px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.legal-theme-logo {
  width: min(300px, 76vw);
}

.legal-card {
  width: 100%;
  max-height: min(74vh, 820px);
  overflow: auto;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(58, 128, 70, 0.32);
  border-radius: 14px;
  background: rgba(16, 23, 32, 0.94);
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(58, 128, 70, 0.08) inset;
}

.legal-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  border: 1px solid rgba(58, 128, 70, 0.72);
  border-radius: 999px;
  background: rgba(58, 128, 70, 0.08);
  color: var(--green);
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
}

.legal-back-button::before {
  content: "\2190";
  font-size: 16px;
  line-height: 1;
}

.legal-document {
  width: min(760px, 100%);
  margin: 0 auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.72;
}

.legal-document h1,
.legal-document h2,
.legal-document h3 {
  color: var(--text);
  line-height: 1.22;
}

.legal-document h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
}

.legal-document h2 {
  margin: 32px 0 10px;
  font-size: clamp(21px, 2.4vw, 28px);
}

.legal-document h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.legal-document p,
.legal-document li {
  color: var(--muted);
}

.legal-document a {
  color: var(--green);
  font-weight: 700;
}

.legal-document ul,
.legal-document ol {
  padding-left: 22px;
}

.legal-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.legal-document table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.legal-document th,
.legal-document td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.legal-document th {
  color: var(--text);
  background: rgba(58, 128, 70, 0.14);
}

.legal-document code {
  color: var(--text);
  background: rgba(58, 128, 70, 0.12);
  border: 1px solid rgba(58, 128, 70, 0.2);
  border-radius: 6px;
  padding: 1px 5px;
}

body.theme-light .legal-card {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 76px rgba(17, 24, 39, 0.12), 0 0 0 1px rgba(58, 128, 70, 0.08) inset;
}

@media (max-width: 620px) {
  .legal-screen {
    padding: 18px 12px;
    align-items: start;
  }

  .legal-card {
    max-height: none;
    padding: 18px;
  }

  .legal-document {
    font-size: 13px;
  }
}
.auth-footer .text-button {
  margin-left: 4px;
}

.auth-reset-link .text-button {
  margin-left: 0;
}

.auth-reset-link {
  margin-top: 10px;
}

.auth-notice {
  width: min(440px, 100%);
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 157, 0, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 157, 0, 0.08);
  color: #ffd79a;
  font-size: 13px;
  line-height: 1.45;
}

[data-auth-only] {
  display: none;
}

body.auth-login [data-auth-only~="login"],
body.auth-create [data-auth-only~="create"],
body.auth-reset [data-auth-only~="reset"] {
  display: grid;
}

body.auth-login .auth-footer[data-auth-only~="login"],
body.auth-create .auth-footer[data-auth-only~="create"],
body.auth-reset .auth-footer[data-auth-only~="reset"],
body.auth-login .auth-divider[data-auth-only~="login"],
body.auth-create .auth-divider[data-auth-only~="create"],
body.auth-login .oauth-button[data-auth-only~="login"],
body.auth-create .oauth-button[data-auth-only~="create"] {
  display: flex;
}

body.auth-login .auth-divider[data-auth-only~="login"],
body.auth-create .auth-divider[data-auth-only~="create"] {
  display: grid;
}

body.auth-login .google-oauth-consent[data-auth-only~="login"],
body.auth-create .google-oauth-consent[data-auth-only~="create"] {
  display: block;
}

body.auth-reset .login-card {
  width: min(560px, 100%);
}

.app-shell {
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.identity-gate {
  min-height: 100vh;
  padding: 42px 24px 64px;
  background: var(--bg);
}

.identity-gate-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.identity-gate-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.identity-loading {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.identity-loading.identity-error {
  border-color: rgba(255, 92, 122, 0.32);
  color: #ffc2cc;
}

.identity-sign-out {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: #080b11;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 9px;
  object-fit: cover;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  width: max-content;
}

.brand-name span:first-child {
  color: var(--text);
}

.brand-name span:last-child {
  color: var(--green);
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--green);
  width: 100%;
  max-width: 142px;
  white-space: nowrap;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
  padding: 16px 12px;
}

.nav-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #a4adbb;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 560;
  transition: background 160ms ease, color 160ms ease, border 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: #10151d;
}

.nav-item.active {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 22px rgba(58, 128, 70, 0.16);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-vs-icon {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-footer {
  margin-top: auto;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 0 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sign-out {
  width: max-content;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-weight: 560;
}

.sign-out:hover {
  color: var(--text);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--orange);
}

.status-dot.connected {
  background: var(--green);
}

.status-dot.error {
  background: var(--danger);
}

.main {
  max-width: 100%;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 12, 18, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 3;
}

.identity-verification {
  max-width: 1280px;
  margin: 24px auto 0;
  padding: 0 36px;
}

.identity-verification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(56, 167, 255, 0.28);
  border-radius: var(--radius);
  background: #101720;
}

.identity-verification-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
}

.identity-verification-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.identity-count {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(56, 167, 255, 0.13);
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}

.identity-group-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.identity-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.identity-platform {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(58, 128, 70, 0.11);
  color: var(--green);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.identity-group h3 {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.identity-warning {
  margin: 8px 0 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 560;
}

.identity-examples {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.identity-examples > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.identity-example {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: #d7dee8;
  font-size: 12px;
}

.identity-example strong {
  font-weight: 600;
}

.identity-example span,
.identity-example small,
.identity-empty {
  color: var(--muted);
}

.identity-example small {
  white-space: nowrap;
}

.identity-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.identity-button {
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.identity-button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.identity-button.confirm {
  border: 0;
  background: var(--green);
  color: white;
}

.identity-button.reject {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}


.avatar.has-photo,
.friend-avatar.has-photo,
.profile-photo-preview.has-photo {
  background-color: var(--surface-2);
  background-position: center;
  background-size: cover;
  color: transparent;
}

.identity-button.danger {
  border: 1px solid rgba(255, 92, 122, 0.62);
  background: rgba(255, 92, 122, 0.08);
  color: var(--danger);
}

.identity-button.danger:hover,
.identity-button.danger:focus-visible {
  border-color: var(--danger);
  background: rgba(255, 92, 122, 0.14);
}

.identity-button.icon-only {
  width: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.identity-button.icon-only svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-photo-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 2px 0 24px;
  text-align: center;
}

.profile-photo-preview {
  width: min(340px, 80vw);
  height: min(340px, 80vw);
  flex: 0 0 min(340px, 80vw);
  font-size: 64px;
  border: 2px solid rgba(58, 128, 70, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-photo-copy {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.profile-photo-copy strong {
  color: var(--text);
  font-size: 14px;
}

.profile-photo-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-photo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-photo-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 132px;
}

.profile-photo-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .profile-photo-preview {
    width: min(260px, 76vw);
    height: min(260px, 76vw);
    flex-basis: min(260px, 76vw);
  }

  .profile-photo-actions {
    width: 100%;
  }
}
.profile-menu {
  position: relative;
}

.profile-trigger {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #c8ced7;
  cursor: pointer;
  font-size: 13px;
  font-weight: 540;
}

.profile-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  display: none;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f141d;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  z-index: 4;
}

.profile-menu.open .profile-dropdown {
  display: grid;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

.profile-field select {
  width: 100%;
  min-width: 0;
}

.profile-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-summary-avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.profile-summary strong,
.profile-summary > div span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
}

.profile-summary > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.profile-menu-links {
  display: grid;
  gap: 4px;
}

.profile-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7dee8;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 590;
  text-align: left;
}

.profile-link:hover,
.profile-link:focus-visible {
  background: rgba(58, 128, 70, 0.1);
  color: var(--green);
  outline: none;
}


.language-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.language-option {
  height: 34px;
  min-width: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 560;
}

.language-option.active {
  background: var(--green);
  color: white;
}

.avatar {
  width: 30px;
  height: 30px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(58, 128, 70, 0.48);
  background: #0d3a26;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

select {
  height: 46px;
  min-width: 220px;
  padding: 0 42px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.dropdown-sign-out {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121923;
  color: var(--text);
  cursor: pointer;
  font-weight: 560;
}

.page {
  display: none;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 36px 64px;
}

.page.active {
  display: block;
}

#statisticsPage {
  overflow-x: hidden;
}

.account-page {
  max-width: 920px;
}

.account-panel {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 20, 29, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}


.entitlement-panel {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
}

.entitlement-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.entitlement-heading > div {
  display: grid;
  gap: 2px;
}

.entitlement-label,
.entitlement-detail {
  color: var(--muted);
  font-size: 12px;
}

.entitlement-detail {
  margin: 0;
}

.entitlement-badge {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.entitlement-badge.is-premium {
  border-color: rgba(58, 128, 70, 0.46);
  background: rgba(58, 128, 70, 0.12);
  color: var(--green);
}
.entitlement-badge.is-vip {
  border-color: rgba(245, 196, 73, 0.52);
  background: rgba(245, 196, 73, 0.12);
  color: #f5c449;
}

.subscription-account-panel {
  max-width: 680px;
}
.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-panel input {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1018;
  color: var(--text);
  outline: none;
  font: inherit;
}

.account-panel input:focus {
  border-color: rgba(58, 128, 70, 0.68);
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.12);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.friends-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.friends-search-bar .filter-search {
  width: min(100%, 360px);
  height: 42px;
  font-size: 14px;
}

.friends-section {
  margin-top: 22px;
}

.friend-search-results {
  margin-top: 14px;
}

.friend-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friend-card-grid .empty-state {
  grid-column: 1 / -1;
}

.friend-card {
  min-height: 118px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.friend-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(58, 128, 70, 0.16);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.friend-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.friend-card-clickable {
  cursor: pointer;
}

.friend-card-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.friend-status-badge {
  min-height: 34px;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 9px;
  background: rgba(58, 128, 70, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}


.leaderboard-filters {
  align-items: end;
}

.leaderboard-filters .filter-search {
  min-width: 220px;
}
.leaderboard-metric-control {
  width: min(100%, 360px);
  display: grid;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.leaderboard-metric-control select {
  width: 100%;
  height: 40px;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(96px, max-content);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.leaderboard-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-rank.gold {
  background: linear-gradient(180deg, #ffd86b, #d89b20);
  color: #241600;
}

.leaderboard-rank.silver {
  background: linear-gradient(180deg, #f1f5f9, #9aa6b2);
  color: #111827;
}

.leaderboard-rank.bronze {
  background: linear-gradient(180deg, #e4a36d, #9b5b2e);
  color: #1f1007;
}

.leaderboard-player {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.leaderboard-player strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-player span {
  color: var(--muted);
  font-size: 12px;
}

.leaderboard-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.leaderboard-value span {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.leaderboard-value small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

@media (max-width: 620px) {
  .leaderboard-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .leaderboard-value {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}
.friend-search-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .friend-card-grid {
    grid-template-columns: 1fr;
  }

  .friend-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .friend-card-actions {
    justify-content: flex-start;
  }
}


.primary-button.compact {
  width: auto;
  min-width: 160px;
  height: 40px;
  padding: 0 16px;
}

.account-status {
  min-height: 18px;
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 620;
}

.account-status.error {
  color: #ff7d7d;
}

.account-placeholder {
  color: #d7dee8;
  font-size: 14px;
  line-height: 1.6;
}


.settings-panel {
  display: grid;
  gap: 18px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-row strong,
.settings-row span {
  display: block;
}

.settings-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.settings-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.settings-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.settings-option {
  height: 34px;
  min-width: 64px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.settings-option.active {
  background: var(--green);
  color: #06120a;
}

@media (max-width: 700px) {
  .settings-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-toggle {
    width: 100%;
  }

  .settings-option {
    flex: 1;
  }
}

.password-panel {
  display: grid;
  max-width: 560px;
  gap: 14px;
}

@media (max-width: 700px) {
  .profile-dropdown {
    right: 0;
    width: min(320px, calc(100vw - 28px));
  }

  .account-form-grid {
    grid-template-columns: 1fr;
  }

  .account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button.compact {
    width: 100%;
  }
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 560;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.page-heading-with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-heading-with-actions .overview-tabs {
  flex: 0 0 auto;
  margin-top: 2px;
}

.stats-overview-tabs {
  margin-left: auto;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.filters select,
.filter-search {
  height: 34px;
  min-width: 148px;
  padding: 0 30px 0 11px;
  font-size: 12px;
}

.filter-search {
  width: 210px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f141d;
  color: var(--text);
  outline: none;
}

.filter-search::placeholder {
  color: #748090;
}

.filter-search:focus {
  border-color: rgba(58, 128, 70, 0.44);
}

.filters select[id*="Type"],
.filters select[id*="Competition"] {
  min-width: 134px;
}


.context-filter {
  position: relative;
  min-width: 148px;
}

.context-filter-button {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 30px 0 11px;
  background: #0f141d;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.context-filter-button::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.context-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f141d;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.context-filter-toggle-all {
  width: 100%;
  min-height: 30px;
  margin-bottom: 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.context-filter-toggle-all:hover,
.context-filter-toggle-all:focus-visible {
  color: #7bf2a0;
  outline: none;
}

.context-filter-branch {
  display: grid;
  gap: 1px;
}

.context-filter-parent-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
}

.context-filter-expand {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.context-filter-expand:hover,
.context-filter-expand:focus-visible {
  background: rgba(58, 128, 70, 0.1);
  color: var(--green);
  outline: none;
}

.context-filter-children {
  display: grid;
  gap: 1px;
}
.context-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.context-filter-option.child {
  padding-left: 42px;
  color: var(--muted);
}

.context-filter-option:hover {
  background: rgba(58, 128, 70, 0.1);
}

.context-filter-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--green);
}

.context-filter-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

body.theme-light .context-filter-button,
body.theme-light .context-filter-menu {
  background: #ffffff;
  color: #111827;
}
.player-link-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 196, 87, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(255, 196, 87, 0.1);
  color: var(--text);
}

.player-link-banner strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
}

.player-link-banner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.overview-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.overview-tab {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 560;
}

.overview-tab.active {
  background: var(--green);
  color: white;
}

.opponent-sort-control {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.opponent-sort-control label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.opponent-sort-control select {
  min-width: 138px;
  height: 32px;
  font-size: 12px;
}

.scoring-view-switch,
.finish-view-switch,
.event-finish-view-switch {
  display: flex;
  width: max-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0d121a;
}

.scoring-view-option,
.finish-view-option,
.event-finish-view-option {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 520;
}

.scoring-view-option.active,
.finish-view-option.active,
.event-finish-view-option.active {
  background: rgba(58, 128, 70, 0.18);
  color: var(--text);
}

.event-finish-view-switch {
  margin-top: 2px;
}

.event-finish-view-option {
  height: 24px;
  padding: 0 9px;
  font-size: 11px;
}

.filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.05em;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.stats-kpi-section {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 10px;
  margin-top: 18px;
}

.stats-kpi-section > .scoring-view-switch,
.stats-kpi-section > .finish-view-switch {
  justify-self: end;
}

.stats-kpi-header > .scoring-view-switch,
.stats-kpi-header > .finish-view-switch {
  margin-left: auto;
}

.stats-kpi-section .kpi-grid {
  margin-top: 0;
}

.stats-kpi-section .kpi-card {
  min-height: 96px;
  padding: 12px 14px;
}

.stats-kpi-section .kpi-value-row {
  margin-top: 8px;
  padding-right: 48px;
}

.stats-kpi-section .kpi-value {
  font-size: 28px;
}

.stats-kpi-section .kpi-badge {
  top: 50%;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  transform: translateY(-50%);
}

.stats-kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
}

.stats-kpi-header h2 {
  margin: 0;
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi-card,
.panel,
.event-card,
.opponent-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi-card {
  min-height: 152px;
  padding: 23px 24px;
  position: relative;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.kpi-card.selectable {
  cursor: pointer;
}

.kpi-card.selectable:hover {
  border-color: rgba(58, 128, 70, 0.34);
  background: rgba(58, 128, 70, 0.035);
}

.kpi-card.selected {
  border-color: rgba(58, 128, 70, 0.58);
  background: linear-gradient(180deg, rgba(58, 128, 70, 0.055), rgba(18, 24, 34, 0.94));
  box-shadow: inset 0 1px 0 rgba(58, 128, 70, 0.14);
}

.kpi-label {
  max-width: 100%;
  display: inline;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.28;
  text-transform: uppercase;
}

.kpi-label-text {
  display: inline;
}

.kpi-label-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.02em;
}

.kpi-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kpi-info {
  position: relative;
  top: -1px;
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  vertical-align: text-top;
  border: 1px solid rgba(137, 146, 163, 0.35);
  border-radius: 50%;
  color: #9aa4b4;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: help;
}

.kpi-info::before,
.kpi-info::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 10;
}

.kpi-info::before {
  content: "";
  top: calc(100% + 5px);
  border: 6px solid transparent;
  border-bottom-color: #202838;
}

.kpi-info::after {
  content: attr(data-tooltip);
  top: calc(100% + 16px);
  width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(137, 146, 163, 0.25);
  border-radius: 7px;
  background: #202838;
  color: #d7dee8;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.kpi-info:hover::before,
.kpi-info:hover::after,
.kpi-info:focus-visible::before,
.kpi-info:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.kpi-card:nth-child(4n) .kpi-info::before,
.kpi-card:nth-child(4n) .kpi-info::after {
  left: auto;
  right: 0;
  transform: translate(0, 6px);
}

.kpi-card:nth-child(4n) .kpi-info:hover::before,
.kpi-card:nth-child(4n) .kpi-info:hover::after,
.kpi-card:nth-child(4n) .kpi-info:focus-visible::before,
.kpi-card:nth-child(4n) .kpi-info:focus-visible::after {
  transform: translate(0, 0);
}

.kpi-value-row {
  margin-top: 18px;
  padding-right: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kpi-value {
  font-size: 38px;
  line-height: 0.95;
  font-weight: 520;
  min-width: 0;
}

.kpi-secondary-value {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.35;
}

.kpi-unit {
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
  margin-left: 5px;
}

.kpi-delta {
  position: relative;
  top: 1px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.kpi-delta.positive {
  color: var(--green);
}

.kpi-delta.negative {
  color: var(--danger);
}

.kpi-badge {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(58, 128, 70, 0.12);
  color: var(--green);
  font-size: 13px;
  font-weight: 560;
}

.panel {
  margin-top: 28px;
  padding: 24px 26px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-meta {
  color: var(--muted);
  font-weight: 500;
}

.trend-panel {
  padding-bottom: 22px;
  width: 100%;
  min-width: 0;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 260px;
}

#trendCanvas {
  width: 100%;
  height: 260px;
  display: block;
}

.chart-tooltip {
  position: absolute;
  display: none;
  min-width: 142px;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 20, 29, 0.96);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 2;
}

.chart-tooltip.visible {
  display: grid;
}

.chart-tooltip strong {
  font-size: 13px;
  font-weight: 560;
}

.chart-tooltip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.chart-tooltip-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}

.chart-tooltip-dot.average {
  background: #3a8046;
}

.chart-tooltip-dot.first9 {
  background: #38a7ff;
}

.chart-tooltip-dot.scoring {
  background: #ff9d00;
}

.chart-tooltip-dot.selected {
  background: #3a8046;
}

.legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 999px;
}

.legend-dot.average {
  background: var(--green);
}

.legend-dot.first9 {
  background: var(--blue);
}

.legend-dot.scoring {
  background: var(--orange);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #141a24;
}

.result-win {
  color: var(--green);
  font-weight: 600;
}

.result-loss {
  color: var(--danger);
  font-weight: 600;
}

.event-list,
.opponent-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.event-card,
.opponent-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.event-summary-card {
  align-content: start;
  gap: 8px;
  min-height: 154px;
}

.opponent-card {
  padding: 0;
  overflow: hidden;
}

.opponent-card-main {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.opponent-card.expanded {
  border-color: rgba(58, 128, 70, 0.38);
}

.clickable {
  cursor: pointer;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.clickable:hover {
  border-color: rgba(58, 128, 70, 0.55);
  background: #141b26;
  transform: translateY(-1px);
}

.event-title-row,
.opponent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.event-title-row {
  align-items: flex-start;
}

.event-name,
.opponent-name {
  font-size: 21px;
  font-weight: 560;
  margin-right: 8px;
}

.event-location {
  color: #8793a3;
  font-size: 13px;
  line-height: 1.35;
  margin-top: -3px;
}

.event-result-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #c2cad6;
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

.event-result-badge.bronze {
  border-color: rgba(199, 129, 76, 0.34);
  background: rgba(199, 129, 76, 0.12);
  color: #d6a274;
}

.event-result-badge.silver {
  border-color: rgba(192, 202, 214, 0.38);
  background: rgba(192, 202, 214, 0.12);
  color: #d7dee8;
}

.event-result-badge.champion {
  border-color: rgba(232, 184, 82, 0.34);
  background: rgba(232, 184, 82, 0.1);
  color: #e0bd70;
}

.medal-mark {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4d57d, #be842f);
  color: #211707;
  font-size: 9px;
  font-weight: 760;
  line-height: 1;
}

.event-result-badge.silver .medal-mark {
  background: linear-gradient(145deg, #f1f5f9, #9aa6b5);
  color: #141923;
}

.event-result-badge.bronze .medal-mark {
  background: linear-gradient(145deg, #d6a274, #8b5632);
  color: #1d1008;
}

.opponent-scoreline {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.opponent-record {
  display: inline-flex;
  gap: 5px;
  font-weight: 560;
}

.opponent-ratio {
  font-size: 14px;
  font-weight: 500;
}

.opponent-ratio.good {
  color: var(--green);
}

.opponent-ratio.bad {
  color: var(--danger);
}

.event-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(58, 128, 70, 0.08);
  color: #84cf9d;
  font-size: 12px;
  font-weight: 560;
}

.pill.blue {
  background: rgba(56, 167, 255, 0.09);
  color: #86b9de;
}

.pill.orange {
  background: rgba(255, 157, 0, 0.1);
  color: #dca85c;
}

.pill.muted {
  background: rgba(148, 163, 184, 0.1);
  color: #9eabb9;
}

.event-meta,
.opponent-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px 16px;
  flex-wrap: wrap;
  color: var(--muted);
}

.event-meta > span,
.opponent-meta > span {
  min-height: 18px;
}

.meta-metric {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.meta-label,
.meta-metric > span:first-child {
  color: var(--muted);
  white-space: nowrap;
}

.meta-label {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.meta-label small,
.event-stat > span small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.15;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #aab4c2;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.event-result {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 560;
}

.event-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
}

.event-match-summary {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.event-stats-row {
  display: grid;
  grid-template-columns: minmax(170px, max-content) auto minmax(170px, max-content) auto minmax(144px, max-content);
  align-items: end;
  gap: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.event-stat {
  display: grid;
  grid-template-columns: minmax(94px, max-content) minmax(52px, max-content);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.event-stat strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
  text-align: right;
  min-width: 0;
}

.event-stat-separator {
  color: rgba(148, 163, 184, 0.48);
  font-size: 13px;
  line-height: 1;
  padding-bottom: 2px;
}

.event-drilldown-header {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-bottom: 12px;
}

.event-drilldown-header h2 {
  margin: 0;
  font-size: 24px;
  text-align: left;
}

.event-drilldown-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.event-detail-heading {
  display: grid;
  gap: 8px;
  width: 100%;
}

.event-detail-heading .event-location {
  margin-top: 0;
}

.event-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.event-detail-title-row .event-result-badge {
  align-self: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 680;
}

.event-detail-title-row .medal-mark {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.event-detail-title-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.event-detail-title-main h2 {
  min-width: 0;
}
.event-perspective-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.event-perspective-select select {
  min-width: 150px;
  max-width: 220px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.event-detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.event-detail-label-row {
  align-items: center;
  width: 100%;
}

.event-detail-label-row .event-detail-tabs {
  margin-left: auto;
}

.event-detail-tabs {
  flex: 0 0 auto;
  width: max-content;
  justify-self: end;
  margin: 0;
  margin-left: auto;
}

.event-detail-tab-panel {
  display: grid;
  gap: 18px;
}

.event-kpi-section {
  display: grid;
  gap: 10px;
}

.event-kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.event-kpi-header h3 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-kpi-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.event-kpi-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0d121a;
}

.event-kpi-tab {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 540;
}

.event-kpi-tab.active {
  background: rgba(58, 128, 70, 0.18);
  color: var(--text);
}

.event-overview-kpis {
  gap: 10px;
  margin-top: 0;
}

.event-overview-kpis .kpi-card {
  min-height: 96px;
  padding: 12px 14px;
}

.event-overview-kpis .kpi-value-row {
  margin-top: 8px;
  padding-right: 48px;
}

.event-overview-kpis .kpi-value {
  font-size: 28px;
}

.event-overview-kpis .kpi-badge {
  top: 50%;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  transform: translateY(-50%);
}

.back-button {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(137, 146, 163, 0.2);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 560;
}

.back-button:hover {
  border-color: rgba(58, 128, 70, 0.38);
  color: var(--text);
}

.event-detail-view > .page-heading,
.event-detail-view > .filters,
.event-detail-view > .event-toolbar {
  display: none;
}

.event-detail-view .event-list {
  margin-top: 0;
}

.match-card-list {
  display: grid;
  gap: 16px;
}

.event-personal-matches {
  padding-top: 2px;
}

.event-structure {
  display: grid;
  gap: 18px;
  margin: 18px 0 24px;
}

.event-structure-loading {
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.event-structure-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 34, 0.74);
  padding: 18px;
}

.event-structure-section h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tournament-dropdown {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 34, 0.74);
  overflow: hidden;
}

.tournament-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  list-style: none;
}

.tournament-dropdown summary::-webkit-details-marker,
.rr-matches-dropdown summary::-webkit-details-marker {
  display: none;
}

.tournament-dropdown summary span::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.tournament-dropdown[open] > summary span::before {
  transform: rotate(225deg) translateY(-2px);
}

.tournament-dropdown-body {
  padding: 0 16px 16px;
}

.rr-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bracket-round h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.rr-group {
  border: 1px solid rgba(137, 146, 163, 0.15);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.18);
  overflow: hidden;
}

.rr-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
}

.rr-group-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.rr-table {
  display: grid;
  gap: 2px;
  padding: 0 12px 10px;
}

.rr-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 32px 32px 68px 48px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(137, 146, 163, 0.12);
  color: var(--text);
  font-size: 12px;
}

.rr-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-head {
  color: var(--muted);
  font-weight: 560;
}

.rr-match-list {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.rr-standings-dropdown,
.rr-matches-dropdown {
  border-top: 1px solid rgba(137, 146, 163, 0.12);
}

.rr-standings-dropdown summary,
.rr-matches-dropdown summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 560;
  list-style: none;
}

.rr-standings-dropdown summary::-webkit-details-marker,
.rr-matches-dropdown summary::-webkit-details-marker {
  display: none;
}

.rr-standings-dropdown summary span,
.rr-matches-dropdown summary span {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.rr-standings-dropdown[open] summary span,
.rr-matches-dropdown[open] summary span {
  transform: rotate(45deg);
}

.rr-standings-dropdown .rr-table {
  padding-top: 0;
}

.rr-matches-dropdown .rr-match-list {
  padding-top: 0;
}

.structure-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 44px 58px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.structure-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-name.home {
  padding-right: 10px;
  text-align: left;
}

.structure-name.away {
  padding-left: 10px;
  text-align: right;
}

.structure-match strong {
  display: grid;
  min-height: 24px;
  place-items: center;
  border-left: 1px solid rgba(137, 146, 163, 0.16);
  border-right: 1px solid rgba(137, 146, 163, 0.16);
  color: var(--text);
  font-weight: 560;
}

.structure-match .bracket-average {
  justify-self: stretch;
  padding: 0 7px;
}

.structure-match .bracket-average:nth-child(2) {
  text-align: right;
}

.structure-match .bracket-average:nth-child(4) {
  text-align: left;
}

.bracket-rounds {
  display: grid;
  grid-auto-columns: minmax(250px, 1fr);
  grid-auto-flow: column;
  gap: 32px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.bracket-round {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.bracket-round-body {
  position: relative;
  min-height: var(--bracket-height, 58px);
}

.bracket-match {
  display: grid;
  position: absolute;
  top: var(--match-top, 0);
  left: 0;
  right: 0;
  box-sizing: border-box;
  height: 42px;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(137, 146, 163, 0.16);
  border-radius: 7px;
  background: rgba(8, 12, 18, 0.22);
}

.bracket-match.has-outgoing::after,
.bracket-match.has-incoming::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 17px;
  border-top: 1px solid rgba(137, 146, 163, 0.28);
}

.bracket-match.has-outgoing::after {
  left: 100%;
}

.bracket-match.has-incoming::before {
  right: 100%;
}

.bracket-elbow {
  position: absolute;
  left: calc(100% + 17px);
  width: 17px;
  border-left: 1px solid rgba(137, 146, 163, 0.28);
}

.bracket-match.upper-branch .bracket-elbow {
  top: 50%;
  height: var(--connector-height, 72px);
}

.bracket-match.lower-branch .bracket-elbow {
  bottom: 50%;
  height: var(--connector-height, 72px);
}

.bracket-match.upper-branch .bracket-elbow::after,
.bracket-match.lower-branch .bracket-elbow::after {
  content: "";
  position: absolute;
  width: 17px;
  border-top: 1px solid rgba(137, 146, 163, 0.28);
  left: 0;
}

.bracket-match.upper-branch .bracket-elbow::after {
  bottom: 0;
}

.bracket-match.lower-branch .bracket-elbow::after {
  top: 0;
}

.bracket-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 30px;
  align-items: center;
  min-height: 20px;
  color: var(--muted);
  font-size: 11px;
}

.bracket-side + .bracket-side {
  border-top: 1px solid rgba(137, 146, 163, 0.1);
}

.bracket-name {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-average {
  justify-self: end;
  padding-right: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 520;
  white-space: nowrap;
}

.bracket-side strong {
  display: grid;
  height: 100%;
  min-width: 28px;
  place-items: center;
  border-left: 1px solid rgba(137, 146, 163, 0.22);
  color: inherit;
  font-weight: 560;
}

.bracket-side.winner {
  color: var(--green);
}

.tiny-average {
  color: var(--muted);
  font-size: 10px;
  font-weight: 520;
}

.pair-metric {
  display: inline-grid;
  gap: 2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  vertical-align: top;
}

.pair-metric small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.15;
  white-space: nowrap;
}

.match-card {
  padding: 0;
  overflow: hidden;
}

.match-card-main {
  display: grid;
  gap: 10px;
  padding: 20px 22px;
}

.match-footer-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.match-footer-row .event-stats-row {
  justify-content: end;
}

.match-label-row {
  align-items: flex-end;
}

.match-inline-stats {
  margin-left: auto;
}

.match-inline-stats .event-stat {
  grid-template-columns: minmax(76px, max-content) minmax(44px, max-content);
  font-size: 12px;
}

.match-inline-stats .event-stat strong {
  font-size: 13px;
}

.match-card.expanded {
  border-color: rgba(58, 128, 70, 0.38);
}

.match-card .event-name {
  margin-right: 8px;
}

.inline-leg-detail {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line-soft);
  background: #0e131c;
}

.opponent-match-detail {
  padding-top: 18px;
}

.opponent-kpi-row {
  justify-content: flex-start;
}

.opponent-kpi-row .event-stats-row {
  justify-content: flex-start;
}

.opponent-meta-row {
  align-items: flex-end;
}

.opponent-inline-stats {
  margin-left: auto;
}

.opponent-inline-stats .event-stat {
  grid-template-columns: minmax(76px, max-content) minmax(44px, max-content);
  font-size: 12px;
}

.opponent-inline-stats .event-stat strong {
  font-size: 13px;
}

.match-context {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.match-context small {
  color: #8793a3;
  font-size: 12px;
  font-weight: 500;
}

.result-badge,
.score-badge {
  min-width: 86px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  font-weight: 560;
}

.score-badge {
  min-width: 62px;
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
}

.result-badge.win,
.score-badge.win {
  background: rgba(58, 128, 70, 0.13);
  color: var(--green);
}

.result-badge.loss,
.score-badge.loss {
  background: rgba(255, 92, 122, 0.13);
  color: var(--danger);
}

.result-badge.draw,
.score-badge.draw {
  background: rgba(255, 157, 0, 0.14);
  color: var(--orange);
}

.segmented {
  display: inline-flex;
  margin-top: 40px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segment {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 560;
}

.segment.active {
  background: var(--green);
  color: white;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 110px 20px;
  color: var(--muted);
  font-size: 20px;
}

.empty-state.compact {
  padding: 30px 20px;
  font-size: 15px;
}

.data-loading-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 92px 20px;
  color: var(--muted);
  text-align: center;
}

.data-loading-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(58, 128, 70, 0.16);
}

.data-loading-copy {
  display: grid;
  gap: 4px;
}

.data-loading-copy strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.data-loading-copy p {
  margin: 0;
  font-size: 15px;
}

.data-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(137, 146, 163, 0.22);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: data-loading-spin 0.9s linear infinite;
}

@keyframes data-loading-spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #202633;
  color: var(--muted);
  font-size: 34px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.45);
}

.drawer-backdrop.open {
  display: block;
}

.match-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(620px, 100vw);
  height: 100vh;
  transform: translateX(100%);
  transition: transform 180ms ease;
  border-left: 1px solid var(--line);
  background: #0c1017;
  overflow-y: auto;
  z-index: 5;
}

.match-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

.drawer-eyebrow {
  color: var(--green);
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.drawer-header h2 {
  margin: 8px 0;
  font-size: 28px;
}

.drawer-header p {
  margin: 0;
  color: var(--muted);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.leg-list {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.leg-list.inline {
  padding: 18px 0 0;
}

.leg-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.leg-summary {
  display: grid;
  grid-template-columns: 1fr repeat(4, auto);
  gap: 12px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
}

.leg-summary strong {
  font-size: 17px;
}

.leg-stat {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.turns {
  display: none;
  padding: 0 16px 16px;
}

.leg-card.open .turns {
  display: block;
}

.turn-grid {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

.turn-grid strong {
  color: var(--text);
}

.side-turns {
  padding-top: 0;
}

.turn-header,
.side-turn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.turn-header {
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  text-align: center;
}

.turn-header span:first-child,
.turn-header span:last-child {
  text-align: left;
}

.turn-header span:last-child {
  text-align: right;
}

.side-turn-row {
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.side-turn-row > strong {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.turn-side {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #0e141d;
}

.turn-side.empty {
  border-color: transparent;
  background: transparent;
}

.side-turn-row .turn-side:first-child {
  text-align: left;
}

.side-turn-row .turn-side:last-child {
  text-align: right;
}

.turn-side strong {
  color: var(--text);
  font-size: 19px;
}

.turn-side span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.turn-side em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 560;
}

.turn-side.checkout {
  border-color: rgba(58, 128, 70, 0.45);
  background: rgba(58, 128, 70, 0.08);
}

.turn-side.bust {
  border-color: rgba(255, 92, 122, 0.35);
  background: rgba(255, 92, 122, 0.08);
}

.checkout-darts {
  color: var(--green) !important;
  font-size: 13px !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand {
    min-height: 72px;
    padding: 16px 20px;
  }

  .nav {
    grid-template-columns: repeat(5, 1fr);
    padding-top: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 0 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .identity-verification {
    padding: 0 20px;
  }

  .identity-group {
    grid-template-columns: 1fr;
  }

  .identity-actions {
    justify-content: flex-start;
  }

  .page {
    padding: 24px 20px 52px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .login-card {
    padding: 26px;
  }

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

  .filters {
    align-items: stretch;
  }

  .page-heading-with-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-overview-tabs {
    margin-left: 0;
  }

  .page-heading-with-actions .overview-tabs {
    margin-top: 0;
  }

  .stats-kpi-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .stats-kpi-header > .scoring-view-switch,
  .stats-kpi-header > .finish-view-switch {
    margin-left: auto;
  }

  .filters select,
  .filter-search,
  .player-picker select {
    width: 100%;
    min-width: 0;
  }

  .identity-verification-header {
    flex-direction: column;
  }

  .identity-example {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .identity-example small {
    white-space: normal;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .event-title-row,
  .event-footer-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .event-detail-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .event-result-badge {
    align-self: flex-start;
    margin-left: 0;
  }

  .rr-groups {
    grid-template-columns: 1fr;
  }

  .event-match-summary {
    text-align: left;
    white-space: normal;
  }

  .event-stats-row {
    width: 100%;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 8px;
  }

  .match-label-row {
    align-items: flex-start;
  }

  .match-inline-stats {
    margin-left: 0;
  }

  .opponent-meta-row {
    align-items: flex-start;
  }

  .opponent-inline-stats {
    margin-left: 0;
  }

  .event-stat {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .event-stat strong {
    text-align: left;
  }

  .leg-summary {
    grid-template-columns: 1fr 1fr;
  }

  .turn-grid {
    grid-template-columns: 54px 1fr 1fr;
  }

  .turn-grid span:nth-child(4),
  .turn-grid span:nth-child(5) {
    display: none;
  }

  .turn-header,
  .side-turn-row {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 6px;
  }

  .turn-side {
    padding: 8px;
  }

  .turn-side strong {
    font-size: 17px;
  }
}

.admin-player-card form {
  display: grid;
  gap: 14px;
}

.admin-player-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-player-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-player-grid input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
  text-transform: none;
}

.admin-player-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-player-meta div {
  display: grid;
  gap: 4px;
}

.admin-player-meta strong {
  color: var(--text);
}

.admin-save-button {
  width: auto;
  min-width: 110px;
}

@media (max-width: 900px) {
  .admin-player-grid,
  .admin-player-meta {
    grid-template-columns: 1fr;
  }
}
.admin-event-card {
  display: grid;
  gap: 14px;
}

.admin-event-meta {
  grid-template-columns: minmax(0, 2fr) minmax(120px, 0.5fr);
}

.admin-event-title-row {
  align-items: center;
  gap: 12px;
}

.admin-context-form {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 auto;
}

.admin-context-form label {
  display: grid;
  gap: 4px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-context-form select {
  min-width: 0;
  max-width: 240px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #0f141d;
  color: #f2f5f9;
  color-scheme: dark;
}

.admin-context-form select option {
  background: #0f141d;
  color: #f2f5f9;
}

body.theme-light .admin-context-form select,
body.theme-light .admin-context-form select option {
  background: #ffffff;
  color: #111827;
  color-scheme: light;
}

.admin-context-auto-status {
  min-width: 52px;
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
@media (max-width: 760px) {
  .admin-event-title-row {
    align-items: stretch;
  }

  .admin-context-form {
    width: 100%;
    margin-left: 0;
  }

  .admin-context-form label {
    min-width: 0;
    flex: 1;
  }
}
.admin-event-link {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.admin-event-link:hover {
  text-decoration: underline;
}
.admin-candidate-card {
  display: grid;
  gap: 14px;
}

.admin-candidate-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-candidate-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-candidate-examples {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.admin-candidate-example {
  grid-template-columns: minmax(160px, 0.8fr) minmax(160px, 1fr) auto;
}

@media (max-width: 900px) {
  .admin-candidate-meta,
  .admin-candidate-example {
    grid-template-columns: 1fr;
  }
}
.admin-user-card {
  display: grid;
  gap: 14px;
}

.admin-audit-section {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.admin-audit-section > strong {
  color: var(--text);
  font-size: 0.82rem;
}

.admin-audit-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-audit-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-audit-row .identity-button {
  width: auto;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .admin-audit-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
.match-detail-shell {
  display: grid;
  gap: 14px;
}

.match-detail-shell > .back-button {
  width: fit-content;
  justify-self: start;
}

.match-detail-hero,
.match-leg-section {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.match-detail-heading {
  display: grid;
  gap: 7px;
}

.match-detail-heading h1 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: 0;
}

.match-detail-location {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.match-detail-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.match-detail-side {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.match-detail-side.right {
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: right;
}

.match-detail-side h2 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 580;
  line-height: 1.18;
}

.match-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(58, 128, 70, 0.35);
  border-radius: 999px;
  background: #0d3a26;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.match-detail-result {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.match-detail-result strong {
  color: var(--text);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 680;
  line-height: 1;
}

.match-detail-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  text-transform: uppercase;
}

.match-stat-matrix {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) minmax(86px, auto) minmax(82px, 1fr);
  gap: 7px 14px;
  align-items: baseline;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

.match-stat-label {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.match-stat-value {
  color: var(--text);
  font-size: 16px;
  font-weight: 620;
}

.match-stat-value.left {
  text-align: left;
}

.match-stat-value.right {
  text-align: right;
}

.match-stat-value .match-pair-metric {
  justify-items: inherit;
  line-height: 1.05;
}

.match-stat-value.left .match-pair-metric {
  justify-items: start;
}

.match-stat-value.right .match-pair-metric {
  justify-items: end;
}

.match-stat-value .match-pair-metric .pair-metric-individual {
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
}

.match-leg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.match-leg-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #0e141d;
  overflow: hidden;
}

.match-leg-title {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line-soft);
}

.match-leg-title strong {
  font-size: 14px;
  font-weight: 620;
}

.match-leg-title span {
  font-size: 12px;
  font-weight: 620;
}

.match-leg-table {
  display: grid;
  gap: 0;
  padding: 10px 12px 12px;
}

.match-leg-names {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.match-leg-names span:first-child,
.match-leg-names span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-leg-names span:last-child {
  text-align: right;
}

.match-leg-row {
  display: grid;
  grid-template-columns: minmax(42px, 0.72fr) minmax(42px, 0.8fr) 34px minmax(42px, 0.8fr) minmax(42px, 0.72fr);
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 4px 0;
  border-top: 1px solid rgba(137, 146, 163, 0.1);
  font-variant-numeric: tabular-nums;
}

.match-leg-row.start {
  color: var(--muted);
  border-top: 0;
}

.match-leg-row span,
.match-leg-row strong,
.match-leg-row em {
  min-width: 0;
  font-style: normal;
  line-height: 1.15;
}

.match-leg-row span:nth-child(1),
.match-leg-row strong:nth-child(2) {
  text-align: right;
}

.match-leg-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.match-leg-row span {
  color: #d7dee8;
  font-size: 13px;
  font-weight: 560;
}

.match-leg-row em {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 650;
}

.checkout-score {
  color: var(--green) !important;
}

.bust-score {
  color: var(--danger) !important;
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
}

.match-top-back {
  height: 34px;
  min-width: 0;
  padding: 0 12px;
  font-size: 13px;
}

.match-stat-panel {
  display: grid;
  gap: 10px;
}

.match-stat-tabs {
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0c1118;
}

.match-stat-tab {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.match-stat-tab.active {
  background: var(--green);
  color: #06130c;
}

.match-thermometer {
  display: grid;
  position: relative;
  gap: 8px;
  min-width: 0;
}

.match-thermometer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.match-thermometer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.match-thermometer-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.match-thermometer-legend i.left,
.thermo-dot.left {
  color: var(--green);
  stroke: var(--green);
  fill: var(--green);
}

.match-thermometer-legend i.right,
.thermo-dot.right {
  color: #38a7ff;
  stroke: #38a7ff;
  fill: #38a7ff;
}

.match-thermometer-legend i.left {
  background: var(--green);
}

.match-thermometer-legend i.right {
  background: #38a7ff;
}

.match-thermometer svg {
  width: 100%;
  min-height: 236px;
  display: block;
  overflow: visible;
}

.thermo-grid line,
.thermo-axis {
  stroke: rgba(137, 146, 163, 0.2);
  stroke-width: 1;
}

.thermo-grid text,
.thermo-x {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 540;
}

.thermo-x {
  text-anchor: end;
}



.thermo-leg-separator {
  stroke: rgba(137, 146, 163, 0.42);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.thermo-tooltip {
  z-index: 4;
  pointer-events: none;
}

.thermo-tooltip .chart-tooltip-dot.average {
  background: var(--green);
}

.thermo-tooltip .chart-tooltip-dot.first9 {
  background: #38a7ff;
}
.thermo-hover {
  fill: transparent;
  pointer-events: all;
}

.thermo-line.left {
  stroke: var(--green);
  fill: none;
}

.thermo-line.right {
  stroke: #38a7ff;
  fill: none;
}
.thermo-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thermo-dot {
  stroke: #0c1118;
  stroke-width: 1.5;
}

@media (max-width: 1180px) {
  .match-leg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .match-detail-scoreboard {
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    gap: 10px;
  }

  .match-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 11px;
  }

  .match-stat-matrix {
    gap: 8px 10px;
  }

  .match-leg-grid {
    grid-template-columns: 1fr;
  }

  .match-leg-row {
    grid-template-columns: minmax(34px, 0.7fr) minmax(38px, 0.8fr) 28px minmax(38px, 0.8fr) minmax(34px, 0.7fr);
    gap: 4px;
  }
}

/* mobile-polish-v1 */
@media (max-width: 980px) {
  body {
    padding-bottom: 74px;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed !important;
    top: auto !important;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    height: 58px;
    max-height: 58px;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(137, 146, 163, 0.22);
    border-radius: 12px;
    background: rgba(8, 11, 17, 0.94);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
  }

  .brand,
  .sidebar-footer,
  .nav-item span:not(.nav-icon) {
    display: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .nav-item {
    position: relative;
    height: 48px;
    justify-content: center;
    padding: 0;
    border-radius: 9px;
  }

  .nav-item + .nav-item::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 15px;
    width: 1px;
    height: 18px;
    background: rgba(137, 146, 163, 0.28);
  }

  .nav-icon,
  .nav-icon svg {
    width: 21px;
    height: 21px;
  }

  .topbar {
    height: 46px;
    padding: 0 14px;
  }

  .page {
    padding: 20px 12px 96px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .page-heading p {
    font-size: 12px;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .filter-label {
    grid-column: 1 / -1;
    font-size: 10px;
  }

  .filters select,
  .filter-search,
  .player-picker select {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding-left: 9px;
    font-size: 11px;
  }

  .stats-overview-tabs,
  .overview-tabs,
  .event-detail-tabs,
  .event-kpi-tabs,
  .match-stat-tabs {
    max-width: 100%;
  }

  .overview-tab,
  .event-kpi-tab,
  .match-stat-tab {
    min-height: 26px;
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .match-stat-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    border-radius: 9px;
  }

  .match-stat-tab {
    min-width: 0;
    padding: 0 4px;
    border-radius: 6px;
    white-space: nowrap;
  }

  .kpi-grid,
  .event-overview-kpis,
  .stats-kpi-section .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .kpi-card,
  .stats-kpi-section .kpi-card,
  .event-overview-kpis .kpi-card {
    min-height: 82px;
    padding: 10px;
  }

  .kpi-label,
  .kpi-label-text {
    font-size: 10px;
    line-height: 1.15;
  }

  .kpi-value-row,
  .stats-kpi-section .kpi-value-row,
  .event-overview-kpis .kpi-value-row {
    margin-top: 7px;
    padding-right: 34px;
  }

  .kpi-value,
  .stats-kpi-section .kpi-value,
  .event-overview-kpis .kpi-value {
    font-size: 22px;
  }

  .kpi-secondary-value,
  .kpi-unit {
    font-size: 12px;
  }

  .kpi-badge,
  .stats-kpi-section .kpi-badge,
  .event-overview-kpis .kpi-badge {
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 10px;
  }

  .event-list,
  .opponent-list,
  .match-card-list {
    gap: 9px;
    margin-top: 14px;
  }

  .event-card,
  .opponent-card-main,
  .match-card-main,
  .match-detail-hero,
  .match-leg-section {
    padding: 12px;
  }

  .event-summary-card {
    min-height: 0;
  }

  .event-title-row,
  .opponent-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 8px;
  }

  .event-title-row,
  .event-footer-row {
    flex-direction: row;
  }

  .event-name,
  .opponent-name,
  .match-card .event-name {
    min-width: 0;
    margin-right: 0;
    font-size: 14px;
    line-height: 1.18;
  }

  .event-location,
  .match-context,
  .match-context small,
  .event-detail-heading .event-location {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.25;
  }

  .event-result-badge,
  .result-badge,
  .score-badge {
    align-self: start;
    justify-self: end;
    min-width: 0;
    height: 22px;
    margin-left: 0;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    white-space: nowrap;
  }

  .medal-mark {
    width: 12px;
    height: 12px;
    font-size: 7px;
  }

  .event-label-row,
  .event-detail-label-row,
  .match-label-row,
  .opponent-meta-row {
    display: flex;
    width: 100%;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .pill,
  .date-badge {
    flex: 0 1 auto;
    min-width: 0;
    height: 19px;
    padding: 0 6px;
    font-size: 9px;
    line-height: 19px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .event-match-summary {
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }

  .event-footer-row {
    align-items: flex-start;
    margin-top: 0;
    padding-top: 0;
  }

  .event-detail-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: start;
  }

  .event-detail-title-main {
    min-width: 0;
    display: block;
  }

  .event-detail-title-main h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.18;
  }
  .event-perspective-select {
    margin-top: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .event-perspective-select select {
    min-width: 0;
    width: min(190px, 62vw);
  }

  .event-detail-title-row .event-result-badge {
    height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .event-detail-meta-row {
    display: grid;
    gap: 7px;
  }

  .event-detail-label-row .event-detail-tabs,
  .event-detail-tabs {
    margin-left: 0;
    justify-self: start;
  }

  .event-kpi-header {
    align-items: stretch;
    gap: 8px;
  }

  .event-kpi-header h3 {
    font-size: 10px;
  }

  .event-kpi-actions {
    justify-items: start;
  }

  .match-card .event-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .match-inline-stats,
  .opponent-inline-stats {
    margin-left: 0;
  }

  .event-stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    font-size: 10px;
  }

  .event-stat {
    grid-template-columns: 1fr;
    gap: 1px;
    font-size: 9px;
  }

  .event-stat strong {
    font-size: 11px;
    text-align: left;
  }

  .event-stat-separator {
    display: none;
  }

  .match-detail-heading h1 {
    font-size: 16px;
  }

  .match-detail-scoreboard {
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
    gap: 6px;
  }

  .match-detail-side {
    gap: 6px;
  }

  .match-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 9px;
  }

  .match-detail-side h2 {
    font-size: 11px;
    line-height: 1.15;
  }

  .match-detail-result strong {
    font-size: 25px;
  }

  .match-detail-result span {
    font-size: 9px;
  }

  .match-stat-matrix {
    grid-template-columns: minmax(0, 1fr) minmax(58px, auto) minmax(0, 1fr);
    gap: 5px 8px;
  }

  .match-stat-label {
    font-size: 10px;
  }

  .match-stat-value {
    font-size: 13px;
  }
}

/* mobile-polish-v2 */
@media (max-width: 980px) {
  .page-heading-with-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .page-heading-with-actions .stats-overview-tabs,
  .page-heading-with-actions .overview-tabs {
    margin: 2px 0 0 auto;
    justify-self: end;
  }

  .stats-kpi-header,
  .event-kpi-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .event-kpi-actions,
  .stats-kpi-header > .scoring-view-switch,
  .stats-kpi-header > .finish-view-switch {
    justify-self: end;
    margin-left: 0;
  }

  .kpi-card,
  .stats-kpi-section .kpi-card,
  .event-overview-kpis .kpi-card {
    min-height: 68px;
    padding: 8px 9px;
  }

  .kpi-value-row,
  .stats-kpi-section .kpi-value-row,
  .event-overview-kpis .kpi-value-row {
    margin-top: 4px;
    padding-right: 30px;
  }

  .kpi-value,
  .stats-kpi-section .kpi-value,
  .event-overview-kpis .kpi-value {
    font-size: 20px;
    line-height: 1.05;
  }

  .kpi-badge,
  .stats-kpi-section .kpi-badge,
  .event-overview-kpis .kpi-badge {
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    font-size: 9px;
  }

  .event-detail-heading {
    gap: 5px;
  }

  .event-detail-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .event-detail-meta-row p {
    margin: 2px 0 0;
    font-size: 10px;
    line-height: 1.2;
  }

  .event-detail-meta-row .event-detail-tabs {
    justify-self: end;
    margin: 0;
  }

  .event-detail-tabs .overview-tab {
    min-height: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }

  .event-detail-label-row {
    max-width: 100%;
  }

  .match-card-main {
    gap: 7px;
  }

  .match-card .event-title-row {
    align-items: start;
  }

  .match-card .event-name {
    font-size: 12px;
    line-height: 1.15;
  }

  .match-label-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
  }

  .match-label-row .event-stats-row,
  .match-inline-stats {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
    grid-column: 1 / -1;
  }

  .match-card-main > .match-label-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
  }

  .match-inline-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .match-inline-stats .event-stat {
    font-size: 8px;
  }

  .match-inline-stats .event-stat strong {
    font-size: 10px;
  }
}


/* kpi-nav-polish */
.stats-kpi-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.stats-kpi-header-actions .overview-tabs {
  margin: 0;
}

.stats-kpi-header-actions .overview-tab {
  min-width: 0;
}

.scoring-view-switch,
.finish-view-switch,
.event-finish-view-switch,
.match-view-switch.scoring-view-switch {
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
}

.scoring-view-option,
.finish-view-option,
.event-finish-view-option,
.match-view-switch.scoring-view-switch .scoring-view-option {
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
}

.opponent-meta-row .opponent-inline-stats {
  margin-left: 0;
}

@media (max-width: 980px) {
  .stats-kpi-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .stats-kpi-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    width: auto;
  }

  .stats-kpi-header-actions .overview-tabs {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .stats-kpi-header-actions .overview-tab {
    height: 23px;
    min-height: 23px;
    padding: 0 5px;
    font-size: 9px;
  }


  .scoring-view-switch,
  .finish-view-switch,
  .event-finish-view-switch,
  .match-view-switch.scoring-view-switch {
    gap: 2px;
    padding: 2px;
  }

  .scoring-view-option,
  .finish-view-option,
  .event-finish-view-option,
  .match-view-switch.scoring-view-switch .scoring-view-option {
    height: 20px;
    padding: 0 6px;
    font-size: 8.5px;
  }

  .match-view-switch.scoring-view-switch,
  .match-view-switch.event-finish-view-switch {
    width: max-content;
    max-width: 100%;
  }

  .match-card-main > .match-label-row {
    grid-template-columns: repeat(4, minmax(0, max-content));
  }

  .match-inline-stats,
  .opponent-inline-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .match-inline-stats .event-stat,
  .opponent-inline-stats .event-stat {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    min-width: 0;
    text-align: center;
  }

  .match-inline-stats .event-stat span,
  .opponent-inline-stats .event-stat span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px;
    order: 2;
  }

  .match-inline-stats .event-stat strong,
  .opponent-inline-stats .event-stat strong {
    min-width: 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.05;
    order: 1;
  }

  .opponent-meta-row {
    display: block;
  }

  .opponent-inline-stats {
    width: 100%;
    margin-top: 6px;
  }
}


/* switch-info-polish */
.switch-with-info {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: max-content;
  max-width: 100%;
}

.switch-with-info.is-hidden {
  display: none !important;
}

.switch-info.kpi-info {
  flex: 0 0 auto;
  margin-left: 0;
}

.event-kpi-actions {
  justify-items: end;
  align-items: end;
}

.event-kpi-actions .switch-with-info {
  justify-self: end;
}

.event-scoring-view-switch {
  margin-top: 2px;
}

@media (max-width: 980px) {
  .event-kpi-actions {
    justify-items: end;
    width: 100%;
  }

  .event-kpi-actions .switch-with-info {
    justify-self: end;
  }

  .kpi-card,
  .stats-kpi-section .kpi-card,
  .event-overview-kpis .kpi-card {
    position: relative;
    overflow: visible;
  }

  .kpi-badge,
  .stats-kpi-section .kpi-badge,
  .event-overview-kpis .kpi-badge {
    top: 6px;
    right: 6px;
    transform: none;
  }

  .switch-info.kpi-info::after {
    width: min(220px, calc(100vw - 42px));
  }
}


/* match-card-polish */
.match-card .event-name.long-title {
  font-size: 12px;
  line-height: 1.15;
}

.match-card .event-name.very-long-title {
  font-size: 11px;
  line-height: 1.12;
}

@media (max-width: 980px) {
  .match-card .event-name.long-title {
    font-size: 10.5px;
  }

  .match-card .event-name.very-long-title {
    font-size: 9.5px;
  }

  .match-inline-stats .event-stat span,
  .opponent-inline-stats .event-stat span {
    order: 1;
  }

  .match-inline-stats .event-stat strong,
  .opponent-inline-stats .event-stat strong {
    order: 2;
  }
}


/* match-scoring-polish */
.match-stat-label .inline-info {
  top: 0;
  margin-left: 4px;
  vertical-align: middle;
}

/* mobile-bracket-density */
@media (max-width: 700px) {
  .bracket-rounds {
    grid-auto-columns: minmax(178px, 190px);
    gap: 14px;
    padding: 2px 0 6px;
  }

  .bracket-round {
    gap: 5px;
  }

  .bracket-round h4 {
    margin-bottom: 0;
    font-size: 11px;
  }

  .bracket-match {
    height: 34px;
    border-radius: 5px;
  }

  .bracket-match.has-outgoing::after,
  .bracket-match.has-incoming::before {
    width: 7px;
  }

  .bracket-elbow {
    left: calc(100% + 7px);
    width: 7px;
  }

  .bracket-match.upper-branch .bracket-elbow,
  .bracket-match.lower-branch .bracket-elbow {
    height: calc(var(--connector-height, 34px) - 4px);
  }

  .bracket-match.upper-branch .bracket-elbow::after,
  .bracket-match.lower-branch .bracket-elbow::after {
    width: 7px;
  }

  .bracket-side {
    grid-template-columns: minmax(0, 1fr) 42px 24px;
    min-height: 16px;
    font-size: 9px;
  }

  .bracket-name {
    padding: 0 5px;
  }

  .bracket-average {
    padding-right: 5px;
    font-size: 7.5px;
  }

  .bracket-side strong {
    min-width: 24px;
    font-size: 10px;
  }
}

/* opponents-pair-stat-order */
.pair-metric-overall {
  order: 1;
}

.pair-metric-individual {
  order: 2;
}

.opponent-inline-stats .pair-metric {
  justify-items: center;
}

@media (max-width: 980px) {
  .opponent-inline-stats .event-stat span {
    order: 1;
  }

  .opponent-inline-stats .event-stat strong {
    order: 2;
  }

  .opponent-inline-stats .pair-metric-overall {
    order: 1;
  }

  .opponent-inline-stats .pair-metric-individual {
    order: 2;
  }
}
.compare-filters {
  align-items: end;
}

.compare-player-select {
  min-width: 220px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.compare-player-select select {
  width: 100%;
  height: 40px;
}

.compare-board {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) minmax(0, 1fr);
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.compare-row.headline {
  border-color: rgba(58, 128, 70, 0.3);
  background: linear-gradient(180deg, rgba(58, 128, 70, 0.09), rgba(255, 255, 255, 0.018));
}

.compare-value {
  min-width: 0;
  color: var(--text);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

.compare-left {
  text-align: left;
}

.compare-right {
  text-align: right;
}

.compare-value.is-leading {
  color: var(--green);
}

.compare-metric {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.compare-metric strong {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.compare-metric span {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 620px) {
  .compare-filters {
    grid-template-columns: 1fr;
  }

  .compare-player-select {
    min-width: 0;
  }

  .compare-row {
    grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
    min-height: 62px;
    padding: 12px;
  }

  .compare-value {
    font-size: 22px;
  }

  .compare-metric strong {
    font-size: 11px;
  }
}
.event-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.event-search-input {
  width: min(100%, 360px);
  height: 38px;
}

.event-view-switch {
  margin-left: auto;
}

.event-match-list {
  margin-top: 0;
}

@media (max-width: 620px) {
  .event-toolbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    margin-top: 10px;
  }

  .event-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .event-view-switch {
    align-self: center;
    flex: 0 0 auto;
    margin-left: auto;
  }
}
.compare-filters {
  gap: 12px;
}

.compare-player-duel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto minmax(180px, 240px);
  align-items: end;
  gap: 10px;
  margin-left: auto;
}

.compare-player-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.compare-player-trigger {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f141d;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.compare-player-trigger::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.compare-player-picker.open .compare-player-trigger {
  border-color: rgba(58, 128, 70, 0.44);
}

.compare-player-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1018;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

.compare-player-picker.open .compare-player-menu {
  display: grid;
}

.compare-player-search {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #111720;
  color: var(--text);
  font-size: 11px;
  outline: none;
}

.compare-player-options {
  display: grid;
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.compare-player-option {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-player-option:hover,
.compare-player-option.active {
  background: rgba(58, 128, 70, 0.12);
  color: var(--green);
}

.compare-player-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: none;
}

.compare-vs {
  align-self: end;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-board {
  gap: 5px;
  margin-top: 12px;
}

.compare-row {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 130px) minmax(0, 1fr);
  min-height: 42px;
  padding: 7px 10px;
}

.compare-value {
  font-size: 18px;
}

.compare-metric {
  gap: 1px;
  font-size: 9px;
  letter-spacing: 0.025em;
}

.compare-metric strong {
  font-size: 10px;
}

.compare-metric span {
  font-size: 9px;
}

@media (max-width: 620px) {
  .compare-player-duel {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    width: 100%;
    margin-left: 0;
  }

  .compare-row {
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    min-height: 40px;
    padding: 7px 8px;
  }

  .compare-value {
    font-size: 16px;
  }
}
/* Compact page headings so page content starts higher. */
.page-heading {
  margin-bottom: 14px;
}

.page-heading h1 {
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.08;
}

.page-heading p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 620px) {
  .page-heading {
    margin-bottom: 10px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .page-heading p {
    font-size: 11px;
  }
}
/* Compact leaderboard layout */
.leaderboard-filters {
  display: grid;
  grid-template-columns: max-content minmax(160px, 220px) minmax(190px, 280px);
  align-items: start;
  gap: 8px 10px;
}

.leaderboard-filters .filter-label {
  align-self: center;
  grid-column: 1;
  grid-row: 1;
}

.leaderboard-filter-stack {
  grid-column: 1 / 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 8px 10px;
  width: max-content;
}

#leaderboardRangeSelect {
  grid-column: 1;
  grid-row: 1;
  width: fit-content;
  min-width: 0;
}

#leaderboardContextFilter {
  grid-column: 2;
  grid-row: 1;
  width: fit-content;
  min-width: 0;
}

#leaderboardContextFilter .context-filter-button {
  width: fit-content;
  min-width: 0;
  white-space: nowrap;
}

.leaderboard-metric-control {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  width: min(100%, 280px);
  gap: 5px;
  margin-top: 0;
  font-size: 10px;
  text-align: left;
}

.leaderboard-metric-control select {
  height: 34px;
}

.leaderboard-filters .leaderboard-search-input {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 34px;
}

.leaderboard-list {
  gap: 6px;
  margin-top: 12px;
}

.leaderboard-row {
  grid-template-columns: 36px minmax(0, 1fr) minmax(74px, max-content);
  gap: 9px;
  min-height: 46px;
  padding: 8px 10px;
  border-color: var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.026);
}

.leaderboard-rank {
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-player {
  gap: 1px;
}

.leaderboard-player strong {
  font-size: 13px;
  font-weight: 720;
}

.leaderboard-player span {
  font-size: 10px;
}

.leaderboard-value {
  gap: 0;
}

.leaderboard-value span {
  font-size: 17px;
  line-height: 1.05;
}

.leaderboard-value small {
  font-size: 9px;
  line-height: 1.15;
}

@media (max-width: 620px) {
  .leaderboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .leaderboard-filters .filter-label {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .leaderboard-filter-stack {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #leaderboardRangeSelect,
  #leaderboardContextFilter,
  #leaderboardContextFilter .context-filter-button {
    width: 100%;
    min-width: 0;
  }

  .leaderboard-metric-control {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }

  .leaderboard-filters .leaderboard-search-input {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .leaderboard-row {
    grid-template-columns: 30px minmax(0, 1fr) minmax(66px, max-content);
    gap: 7px;
    min-height: 42px;
    padding: 7px 8px;
  }

  .leaderboard-rank {
    width: 23px;
    height: 23px;
    font-size: 11px;
  }

  .leaderboard-player strong {
    font-size: 12px;
  }

  .leaderboard-player span {
    font-size: 9px;
  }

  .leaderboard-value {
    grid-column: auto;
    justify-items: end;
    text-align: right;
  }

  .leaderboard-value span {
    font-size: 15px;
  }

  .leaderboard-value small {
    font-size: 8px;
  }
}
/* Compare spacing polish */
.compare-player-picker {
  gap: 0;
}

.compare-player-duel {
  align-items: center;
}

.compare-vs {
  align-self: center;
  padding-bottom: 0;
}

.compare-row {
  grid-template-columns: minmax(0, 1fr) minmax(106px, 146px) minmax(0, 1fr);
}

.compare-value {
  font-size: 16px;
}

.compare-metric strong {
  font-size: 11px;
}

@media (max-width: 620px) {
  .compare-row {
    grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  }

  .compare-value {
    font-size: 15px;
  }

  .compare-metric strong {
    font-size: 10px;
  }
}
/* Opponents desktop alignment */
@media (min-width: 621px) {
  #opponentsPage > .filters {
    display: grid;
    grid-template-columns: auto repeat(4, minmax(130px, max-content)) minmax(0, 1fr);
    align-items: end;
    gap: 8px 10px;
  }

  #opponentSearchInput {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: start;
    width: min(100%, 320px);
  }

  #opponentsPage .opponent-sort-control {
    justify-content: flex-end;
    margin-top: -34px;
    margin-bottom: 12px;
  }

  #opponentsPage .opponent-sort-control label,
  #opponentsPage .opponent-sort-control select {
    font-size: 12px;
  }

  #opponentsPage .opponent-sort-control select {
    min-height: 30px;
    padding: 6px 28px 6px 10px;
  }

  .opponent-meta-row {
    justify-content: flex-end;
    text-align: right;
  }

  .opponent-inline-stats {
    justify-content: flex-end;
  }
}
.admin-ingestion {
  display: grid;
  gap: 18px;
}

.admin-ingestion-form {
  display: grid;
  gap: 8px;
  max-width: 920px;
}

.admin-ingestion-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-ingestion-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-ingestion-controls input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.admin-ingestion-job p,
.admin-ingestion-error {
  overflow-wrap: anywhere;
}

.admin-ingestion-error {
  color: var(--orange);
  margin-top: 8px;
}

@media (max-width: 720px) {
  .admin-ingestion-controls {
    grid-template-columns: 1fr;
  }
}

.stats-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stats-own-back {
  flex: 0 0 auto;
  margin-top: 1px;
}

.structure-match.clickable,
.bracket-match.clickable {
  cursor: pointer;
}

.structure-match.clickable:hover,
.bracket-match.clickable:hover {
  border-color: rgba(58, 128, 70, 0.42);
  background: rgba(58, 128, 70, 0.08);
}

@media (max-width: 620px) {
  .stats-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .stats-own-back {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }
}

body.admin-mode .player-only {
  display: none !important;
}

.admin-kpi-card {
  cursor: pointer;
}

.admin-kpi-card.active {
  border-color: #3a8046;
}

.admin-event-detail-back {
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  body.admin-mode .sidebar .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
body.admin-mode #statisticsPage > .filters,
body.admin-mode #statisticsPage .stats-kpi-header-actions {
  display: none !important;
}

.admin-statistics-tabs {
  margin-left: auto;
}

@media (max-width: 620px) {
  .compare-player-search {
    font-size: 16px;
  }
}
/* Friends notifications and balanced two-sided match cards. */
.profile-trigger {
  position: relative;
}

.notification-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px #111722, 0 0 9px rgba(58, 128, 70, 0.72);
}

.profile-trigger > .notification-dot {
  position: absolute;
  top: 0;
  right: 0;
}

.profile-link .notification-dot {
  margin-left: auto;
}

.match-versus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.match-player-side {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.match-player-side.right {
  text-align: right;
}

.match-player-side .event-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-player-stats {
  display: flex;
  gap: 14px;
}

.match-player-side.right .match-player-stats {
  justify-content: flex-end;
}

.match-player-stats > span {
  display: grid;
  gap: 2px;
  min-width: 34px;
}

.match-player-stats small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-player-stats strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.match-center-score {
  align-self: center;
  justify-self: center;
  margin: 0;
}

@media (max-width: 620px) {
  .match-versus-grid {
    gap: 7px;
  }

  .match-player-side {
    gap: 6px;
  }

  .match-player-stats {
    gap: 5px;
  }

  .match-player-stats > span {
    min-width: 25px;
  }

  .match-player-stats small {
    font-size: 7px;
  }

  .match-player-stats strong {
    font-size: 10px;
  }

  .match-player-side .event-name {
    font-size: 12px;
  }

  .match-center-score {
    min-width: 38px;
    padding: 5px 7px;
    font-size: 11px;
  }
}
/* Match cards: date, players/KPIs, then event context. */
.match-card-main {
  gap: 14px;
}

.match-date-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: -6px 0 -4px -5px;
}

.match-date-row .date-badge {
  min-height: 20px;
  padding: 0 7px;
  border-color: rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.06);
  color: #8793a3;
  font-size: 10px;
  font-weight: 500;
}

.match-versus-grid {
  align-items: stretch;
}

.match-player-side {
  grid-template-rows: minmax(0, 1fr) auto;
  align-self: stretch;
  gap: 11px;
}

.match-player-side .event-name {
  margin: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.2;
}

.match-player-stats {
  gap: 18px;
}

.match-player-stats > span {
  align-items: center;
  min-width: 40px;
  text-align: center;
}

.match-player-stats small {
  font-size: 9px;
}

.match-player-stats strong {
  font-size: 14px;
}

.match-event-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .match-card-main {
    gap: 10px;
  }

  .match-player-side {
    gap: 8px;
  }

  .match-player-side .event-name {
    font-size: 14px;
  }

  .match-player-stats {
    gap: 7px;
  }

  .match-player-stats > span {
    min-width: 29px;
  }

  .match-player-stats small {
    font-size: 7px;
  }

  .match-player-stats strong {
    font-size: 11px;
  }

  .match-date-row {
    gap: 6px;
  }

  .match-event-name {
    font-size: 10px;
  }
}
/* Compact nested opponent and match-card spacing. */
@media (min-width: 621px) {
  .page {
    padding-right: 24px;
    padding-left: 24px;
  }

  .event-list,
  .opponent-list {
    gap: 8px;
    margin-top: 20px;
  }

  .opponent-card-main {
    gap: 9px;
    padding: 16px;
  }

  .opponent-card .inline-leg-detail {
    padding: 0 12px 12px;
  }

  .opponent-card .opponent-match-detail {
    padding-top: 12px;
  }

  .opponent-card .match-card-list {
    gap: 8px;
  }

  .opponent-card .match-card-main {
    padding: 14px 16px;
  }
}

@media (max-width: 620px) {
  .page {
    padding-right: 6px;
    padding-left: 6px;
  }

  #opponentsPage .opponent-list {
    gap: 6px;
    margin-top: 10px;
  }

  .opponent-card-main {
    gap: 8px;
    padding: 8px;
  }

  .opponent-card .match-card-main {
    gap: 7px;
    padding: 6px 8px 5px;
  }

  .opponent-card .match-date-row {
    margin: -3px 0 -3px -3px;
  }

  .opponent-card .inline-leg-detail {
    padding: 0 5px 5px;
  }

  .opponent-card .opponent-match-detail {
    padding-top: 5px;
  }

  .opponent-card .match-card-list {
    gap: 4px;
  }
}
/* Mobile event detail cards: remove stacked horizontal and vertical padding. */
@media (max-width: 620px) {
  .tournament-dropdown summary {
    min-height: 40px;
    padding: 0 10px;
  }

  .tournament-dropdown-body {
    padding: 0 5px 5px;
  }

  .event-personal-matches {
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
  }

  .match-card-main {
    gap: 7px;
    padding: 6px 8px 5px;
  }

  .match-date-row {
    margin: -3px 0 -3px -3px;
  }
}
/* Loading, friend return navigation, and compact mobile match metadata. */
.kpi-grid > .data-loading-state {
  grid-column: 1 / -1;
  min-height: 220px;
  padding: 40px 20px;
}

.compare-board > .data-loading-state {
  min-height: 220px;
  padding: 44px 20px;
}

.stats-page-heading {
  justify-content: flex-start;
}

.stats-own-back {
  order: -1;
}

.match-event-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.2;
}

@media (max-width: 620px) {
  .stats-page-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .match-card-main {
    gap: 6px;
    padding: 4px 6px;
  }

  .match-date-row {
    margin: -2px 0 -2px -1px;
  }

  .match-event-name {
    font-size: 9px;
  }

  .kpi-grid > .data-loading-state,
  .compare-board > .data-loading-state {
    min-height: 160px;
    padding: 28px 12px;
  }
}
/* Statistics filter-aligned tabs and denser KPI cards. */
.stats-filter-tabs {
  height: 34px;
  margin-left: auto;
}

.stats-filter-tabs .overview-tabs {
  box-sizing: border-box;
  display: flex;
  height: 34px;
  margin: 0;
  padding: 2px;
  border-radius: 7px;
}

.stats-filter-tabs .overview-tab {
  height: 28px;
  min-width: 0;
  padding: 0 10px;
}

.stats-kpi-header {
  align-items: center;
  min-height: 34px;
}

.stats-kpi-header h2 {
  padding-top: 0;
}

.stats-kpi-header-actions {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.stats-kpi-section .kpi-card {
  min-height: 82px;
  padding: 9px 14px;
}

.stats-kpi-section .kpi-value-row {
  margin-top: 4px;
}

@media (max-width: 620px) {
  .stats-filter-tabs {
    width: 100%;
    margin-left: 0;
  }

  .stats-filter-tabs .overview-tabs {
    width: 100%;
    height: 32px;
  }

  .stats-filter-tabs .overview-tab {
    flex: 1 1 0;
    height: 28px;
    padding: 0 3px;
    font-size: 9px;
  }

  .stats-kpi-header-actions {
    gap: 5px;
  }

  .stats-kpi-section .kpi-card {
    min-height: 60px;
    padding: 6px 8px;
  }

  .stats-kpi-section .kpi-value-row {
    margin-top: 2px;
  }

}

/* Compare keeps player identity and the selected scope visible above KPIs. */
.compare-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.compare-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.compare-profile-right {
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: right;
}
.compare-profile-right .compare-profile-avatar { grid-column: 2; }
.compare-profile-right > div { grid-column: 1; grid-row: 1; }
.compare-profile strong,
.compare-profile span:not(.avatar) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-profile strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.compare-profile span:not(.avatar) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.compare-profile-avatar { width: 32px; height: 32px; }
@media (max-width: 620px) {
  .compare-profiles { gap: 6px; margin-bottom: 6px; }
  .compare-profile { gap: 6px; padding: 7px; }
  .compare-profile strong { font-size: 11px; }
}

/* Keep desktop navigation available while long dashboard pages scroll. */
@media (min-width: 981px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    z-index: 20;
  }
}
.consistency-view {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}
.consistency-chart { padding: 14px; }
.consistency-chart svg {
  width: 100%;
  height: 240px;
  overflow: visible;
}
.consistency-grid { fill: none; stroke: var(--line-soft); stroke-width: .45; vector-effect: non-scaling-stroke; }
.consistency-curve-line,
.consistency-p50-line,
.consistency-p90-line { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.consistency-curve-line { stroke: var(--green); stroke-width: 2.5; }
.consistency-p50-line { stroke: var(--green); stroke-width: 2.5; }
.consistency-p90-line { stroke: #8b97aa; stroke-width: 2; stroke-dasharray: 4 3; }
.consistency-axis,
.consistency-legend { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.consistency-legend { justify-content: flex-start; }
.consistency-legend .p50 { color: var(--green); }
.consistency-legend .p90 { color: #aab4c4; }
@media (max-width: 620px) {
  .consistency-chart { padding: 10px 8px; }
  .consistency-chart svg { height: 190px; }
}
.consistency-plot-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 2px;
  scrollbar-width: thin;
}
.consistency-plot { min-width: 100%; }
.consistency-plot svg { display: block; }
.consistency-x-axis {
  display: grid;
  align-items: start;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}
.consistency-vertical-grid line,
.consistency-time-grid,
.consistency-horizontal-grid {
  fill: none;
  stroke: var(--line-soft);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
}
.consistency-band { fill: rgba(58, 128, 70, .1); stroke: none; }
.consistency-curve-points circle,
.consistency-p50-point { fill: var(--green); stroke: #07110b; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: help; }
.consistency-p90-point { fill: #aab4c4; stroke: #090c12; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: help; }
.consistency-curve-points circle:focus,
.consistency-p50-point:focus,
.consistency-p90-point:focus { outline: none; stroke: white; stroke-width: 2; }
.consistency-explanation,
.consistency-comparison { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.consistency-comparison { margin: 9px 0 0; color: #c4ccd8; }
@media (max-width: 620px) {
  .consistency-x-axis { font-size: 8px; }
  .consistency-explanation,
  .consistency-comparison { font-size: 10px; }
}
/* Desktop grid placement and mobile chart containment. */
@media (min-width: 981px) {
  .main { grid-column: 2; }
}
.consistency-view,
.consistency-chart,
.consistency-plot-scroll {
  min-width: 0;
  max-width: 100%;
}
.consistency-chart { position: relative; overflow: hidden; }
.consistency-point-tooltip {
  z-index: 12;
  max-width: min(240px, calc(100% - 16px));
  white-space: normal;
}
@media (max-width: 620px) {
  .consistency-view { width: 100%; overflow: hidden; }
  .consistency-chart { width: 100%; }
  .consistency-plot-scroll { overscroll-behavior-x: contain; }
}
.consistency-chart-grid {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.consistency-y-axis {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}
.consistency-y-axis strong {
  display: block;
  height: 18px;
  color: #aeb7c5;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
}
.consistency-y-axis > div {
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 1px;
}
@media (max-width: 620px) {
  .consistency-chart-grid { grid-template-columns: 34px minmax(0, 1fr); gap: 4px; }
  .consistency-y-axis { font-size: 8px; }
  .consistency-y-axis strong { font-size: 7px; }
  .consistency-y-axis > div { height: 190px; }
}
/* Rolling Consistency P10/P50/P90 presentation. */
.consistency-p10-line,
.consistency-p10-point {
  fill: none;
  stroke: #ff9d00;
  vector-effect: non-scaling-stroke;
}
.consistency-p10-line { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.consistency-p10-point { fill: #ff9d00; stroke: #090c12; stroke-width: 1; cursor: help; }
.consistency-p10-point:focus { outline: none; stroke: white; stroke-width: 2; }
.consistency-legend .p10 { color: #ff9d00; }
.consistency-line-hover-target {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}
.consistency-ribbon-tooltip {
  width: 250px;
  max-width: min(250px, calc(100% - 16px));
}
.consistency-ribbon-tooltip .chart-tooltip-row { white-space: nowrap; }
.consistency-exact-x-axis {
  position: relative;
  display: block;
  height: 14px;
}
.consistency-exact-x-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
}
/* Seven unfilled finish-probability lines. */
.consistency-ribbon-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.consistency-ribbon-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}
.consistency-ribbon-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.consistency-ribbon-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

/* Consistency charts share the responsive, quarter-ticked Statistics timeline. */
.consistency-time-plot,
.consistency-cumulative-plot { width: 100%; }
.consistency-time-x-axis {
  position: relative;
  display: block;
  height: 14px;
}
.consistency-time-x-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.consistency-window-label {
  flex: 0 0 auto;
  align-self: flex-start;
  text-align: right;
  white-space: nowrap;
}
.consistency-chart .panel-header > div > .panel-meta {
  display: block;
  max-width: 720px;
  margin-top: 4px;
  line-height: 1.35;
}
@media (max-width: 620px) {
  .consistency-chart .panel-header { align-items: flex-start; gap: 8px; }
  .consistency-window-label { font-size: 9px; }
  .consistency-time-plot,
  .consistency-cumulative-plot { min-width: 0; }
  .consistency-plot-scroll { overflow-x: hidden; }
}

/* Four Statistics tabs live beside the KPI heading; mobile chart headers stay compact. */
.stats-kpi-header-actions { min-width: 0; flex: 1 1 auto; }
.stats-kpi-header-actions .stats-filter-tabs { flex: 1 1 auto; min-width: 0; }
@media (max-width: 620px) {
  .stats-kpi-header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
  .stats-kpi-header-actions { width: 100%; min-width: 0; }
  .stats-kpi-header-actions .stats-filter-tabs { width: auto; margin: 0; }
  .stats-kpi-header-actions .stats-overview-tabs { width: 100%; }
  .stats-kpi-header-actions .overview-tab {
    min-width: 0;
    padding-right: 2px;
    padding-left: 2px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: clip;
    white-space: nowrap;
  }
  .consistency-ribbon-chart .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 6px;
    row-gap: 2px;
  }
  .consistency-ribbon-chart .panel-header > div { display: contents; }
  .consistency-ribbon-chart .panel-header h2 { grid-column: 1; grid-row: 1; }
  .consistency-ribbon-chart .consistency-window-label { grid-column: 2; grid-row: 1; }
  .consistency-ribbon-chart .panel-header > div > .panel-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin-top: 0;
    font-size: 7px;
    line-height: 1.15;
  }
}

/* Keep Statistics tabs compact and right-aligned, including the fourth tab. */
.stats-kpi-header-actions { justify-content: flex-end; }
.stats-kpi-header-actions .stats-filter-tabs { flex: 0 0 auto; width: auto; }
.stats-kpi-header-actions .stats-filter-tabs .overview-tabs { width: auto; }
.stats-kpi-header-actions .stats-filter-tabs .overview-tab { flex: 0 0 auto; padding-right: 9px; padding-left: 9px; }
@media (max-width: 620px) {
  .stats-kpi-header { display: flex; }
  .stats-kpi-header-actions { width: auto; flex: 0 1 auto; justify-content: flex-end; }
  .stats-kpi-header-actions .stats-filter-tabs { width: auto; flex: 0 0 auto; }
  .stats-kpi-header-actions .stats-overview-tabs { width: auto; }
  .stats-kpi-header-actions .overview-tab { flex: 0 0 auto; padding-right: 6px; padding-left: 6px; font-size: 8px; }
}

/* Rolling match-percentile markers for average trend tooltips. */
.chart-tooltip-dot.p10 { background: #8ff0b0; }
.chart-tooltip-dot.p90 { background: #168a47; }

/* Desktop tabs stay with filters; mobile tabs remain above the switches. */
.stats-filter-tabs-mobile { display: none; }
.stats-filter-tabs-desktop { display: block; }
@media (max-width: 620px) {
  .stats-filter-tabs-desktop { display: none; }
  .stats-filter-tabs-mobile { display: block; }
  .stats-kpi-header { align-items: flex-start; }
  .stats-kpi-header-actions { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: flex-start; min-width: 0; }
  .stats-kpi-header-actions .stats-filter-tabs-mobile { order: 1; }
  .stats-kpi-header-actions > .switch-with-info { order: 2; flex: 0 0 100%; margin-left: auto; }
  .consistency-chart:not(.consistency-ribbon-chart) .panel-header > div > .panel-meta,
  #statisticsPage .trend-panel .panel-meta {
    font-size: 7px;
    line-height: 1.15;
  }
}

/* Percentile context is supporting copy below the trend chart. */
.trend-panel-header { align-items: flex-start; }
.trend-title-group { min-width: 0; }
.trend-percentile-explanation {
  display: grid;
  gap: 1px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
}
@media (max-width: 620px) {
  .trend-percentile-explanation { margin-top: 7px; font-size: 7px; line-height: 1.15; }
  .chart-tooltip { min-width: 185px; }
  .chart-tooltip-row { white-space: nowrap; }
}

/* Mobile tab row is structurally separate from optional Scoring/Finishing switches. */
@media (max-width: 620px) {
  .stats-kpi-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: end;
  }
  .stats-kpi-header-actions .stats-filter-tabs-mobile { grid-column: 1; grid-row: 1; }
  .stats-kpi-header-actions > .switch-with-info { grid-column: 1; grid-row: 2; }
}

/* Give mobile charts more room without crowding their axes or touch targets. */
@media (max-width: 620px) {
  #statisticsPage .trend-panel { padding: 10px 9px; }
  #statisticsPage .consistency-chart { padding: 8px 6px; }
  #statisticsPage .trend-panel .panel-header,
  #statisticsPage .consistency-chart .panel-header { margin-bottom: 12px; }
}

.compare-profile .compare-profile-legs { margin-top: 0; font-size: 9px; opacity: .78; }


/* Five Statistics tabs stay compact on narrow mobile screens. */
@media (max-width: 620px) {
  .stats-kpi-header-actions .stats-filter-tabs-mobile {
    max-width: calc(100vw - 84px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .stats-kpi-header-actions .stats-filter-tabs-mobile::-webkit-scrollbar { display: none; }
  .stats-kpi-header-actions .overview-tab {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 7.5px;
  }
}


/* Dense Compare result rows keep the full comparison visible on mobile. */
.compare-board { gap: 4px; }
.compare-row { min-height: 38px; padding: 5px 9px; }
.compare-value { font-size: 16px; }
@media (max-width: 620px) {
  .compare-board { grid-template-columns: minmax(0, 1fr); gap: 2px; margin-top: 8px; }
  .compare-row { grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); min-height: 25px; padding: 1px 5px; }
  .compare-value { font-size: 13px; line-height: .95; }
  .compare-metric { gap: 0; font-size: 7px; line-height: 1; }
  .compare-metric strong { font-size: 8px; line-height: 1; }
  .compare-metric span { font-size: 7px; }
  .compare-profiles { margin-bottom: 4px; }
}


/* Highlights and collision-safe KPI headers */
.kpi-card { padding-right: 76px; }
.kpi-label-row { min-width: 0; }
.kpi-label { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px 4px; min-width: 0; overflow-wrap: anywhere; }
.kpi-label-text { min-width: 0; }
.kpi-info { flex: 0 0 14px; margin-left: 0; }
.highlights-list { display: grid; gap: 22px; margin-top: 22px; }
.highlight-section { border: 1px solid var(--border); border-radius: 14px; background: var(--card); overflow: hidden; }
.highlight-section-heading { padding: 18px 20px 12px; }
.highlight-section-heading h2 { margin: 0; font-size: 18px; }
.highlight-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.highlight-records { display: grid; }
.highlight-row { width: 100%; display: grid; grid-template-columns: 28px 82px minmax(0, 1fr) 50px 20px; align-items: center; gap: 12px; padding: 13px 20px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.highlight-row:hover { background: rgba(58, 128, 70, .045); }
.highlight-position { color: var(--muted-2); font-size: 12px; }
.highlight-value { display: flex; align-items: baseline; gap: 5px; color: var(--green); }
.highlight-value strong { font-size: 23px; }
.highlight-value small, .highlight-context small { color: var(--muted); font-size: 11px; }
.highlight-context { min-width: 0; display: grid; gap: 4px; }
.highlight-context strong, .highlight-context small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highlight-result { justify-self: end; padding: 5px 8px; border-radius: 8px; font-weight: 650; }
.highlight-result.win { color: var(--green); background: rgba(53,208,111,.1); }
.highlight-result.loss { color: var(--danger); background: rgba(224,91,103,.1); }
.highlight-open { color: var(--muted); }
.match-leg-card.is-highlighted { border-color: var(--green); box-shadow: 0 0 0 2px rgba(53,208,111,.15); animation: highlight-pulse 1.4s ease-out; }
@keyframes highlight-pulse { from { background: rgba(53,208,111,.16); } to { background: var(--card); } }
@media (max-width: 720px) {
  .highlight-section-heading { padding: 14px 12px 9px; }
  .highlight-row { grid-template-columns: 18px 62px minmax(0, 1fr) 42px 14px; gap: 7px; padding: 11px 10px; }
  .highlight-value strong { font-size: 19px; }
  .highlight-value small { font-size: 9px; }
  .highlight-context strong { font-size: 12px; }
  .highlight-context small { font-size: 9px; }
  .highlight-result { padding: 4px 5px; font-size: 11px; }
  .kpi-card { padding-right: 60px; }
}


/* Highlights tabs stay compact and right-aligned beside the filters. */
.highlights-tabs { margin-left: auto; }
.compare-empty-sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.compare-empty-side { min-height: 76px; display: grid; align-content: center; gap: 5px; padding: 12px; border: 1px dashed rgba(137, 146, 163, .38); border-radius: 9px; background: rgba(137, 146, 163, .05); }
.compare-empty-side-right { text-align: right; }
.compare-empty-side strong { font-size: 12px; }
.compare-empty-side span, .compare-profile .compare-profile-empty { color: var(--muted); font-size: 10px; line-height: 1.35; white-space: normal; overflow: visible; text-overflow: clip; }
@media (max-width: 620px) {
  #highlightsPage > .highlights-filters .highlights-tabs { grid-column: 1 / -1; justify-self: end; margin-left: 0; max-width: 100%; }
  #highlightsPage > .highlights-filters .overview-tab { min-width: 0; padding: 0 6px; font-size: 9px; white-space: nowrap; }
  .compare-empty-sides { gap: 6px; }
  .compare-empty-side { min-height: 58px; padding: 8px; }
  .compare-empty-side strong { font-size: 10px; }
  .compare-empty-side span { font-size: 9px; }
}

.highlight-pagination { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid var(--border); }
.highlight-pagination span { color:var(--muted); font-size:11px; }
.highlight-pagination .overview-tab:disabled { cursor:default; opacity:.4; }

.compare-empty-side-cards { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.compare-empty-side-card { min-height:76px; display:grid; place-items:center; padding:12px; border:1px dashed rgba(137,146,163,.42); border-radius:8px; background:rgba(137,146,163,.055); color:var(--muted); text-align:center; }
.compare-empty-side-card strong { font-size:12px; font-weight:600; line-height:1.35; }
@media (max-width:620px) { .compare-empty-side-cards { gap:6px; } .compare-empty-side-card { min-height:54px; padding:8px; } .compare-empty-side-card strong { font-size:9px; } }


.premium-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(5px);
}

.premium-dialog {
  position: fixed;
  z-index: 1401;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 28px;
  border: 1px solid rgba(58, 128, 70, 0.3);
  border-radius: 16px;
  background: #111823;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.premium-dialog-kicker { color: #3a8046; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.premium-dialog h2 { margin: 9px 28px 8px 0; font-size: 1.2rem; }
.premium-dialog p { margin: 0; color: var(--muted, #9ca8ba); line-height: 1.55; }
.premium-dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: inherit; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.subscription-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.subscription-option {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 12, 19, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.subscription-option:hover,
.subscription-option:focus-visible {
  border-color: rgba(58, 128, 70, 0.58);
  background: rgba(58, 128, 70, 0.08);
  outline: none;
}

.subscription-option.is-recommended {
  border-color: rgba(58, 128, 70, 0.4);
}

.subscription-option strong {
  font-size: 14px;
}

.subscription-option > span:not(.subscription-saving) {
  color: var(--muted);
  font-size: 11px;
}

.subscription-saving {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green);
  color: #06110a;
  font-size: 9px;
  font-weight: 800;
}

.subscription-option:disabled {
  cursor: wait;
  opacity: 0.58;
}

.secondary-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: rgba(58, 128, 70, 0.52);
  color: var(--green);
  outline: none;
}
#billingPortalButton {
  border-color: #286f43;
  background: #10161b;
  color: #3e9b5e;
  box-shadow: none;
}

#billingPortalButton:hover,
#billingPortalButton:focus-visible {
  border-color: #328c51;
  background: rgba(35, 104, 61, 0.14);
  color: #4eac6c;
  box-shadow: 0 0 0 3px rgba(40, 111, 67, 0.1);
}


.entitlement-panel > #billingPortalButton,
.entitlement-panel > #subscriptionUpgradeButton {
  justify-self: start;
  margin-top: 5px;
}

.billing-status {
  min-height: 0;
  margin: 0;
}

.premium-dialog-options {
  margin: 18px 0 12px;
}

.premium-renewal-note {
  font-size: 10px;
}

.premium-dialog .billing-status {
  margin-top: 9px;
  font-size: 11px;
}

@media (max-width: 520px) {
  .premium-dialog {
    padding: 22px 18px;
  }

  .subscription-options {
    gap: 7px;
  }

  .subscription-option {
    padding: 11px 10px;
  }

  .subscription-option strong {
    font-size: 12px;
  }

  .subscription-option > span:not(.subscription-saving) {
    font-size: 9px;
  }
}

/* Premium feature discovery */
.premium-lock-marker {
  display: inline-flex;
  margin-left: 5px;
  font-size: 0.68em;
  line-height: 1;
  opacity: 0.78;
  filter: grayscale(0.15);
}
.premium-nav-lock {
  margin-left: auto;
  font-size: 11px;
  line-height: 1;
  opacity: 0.82;
}
.premium-lock-card {
  position: relative;
  isolation: isolate;
  width: min(680px, 100%);
  min-height: 190px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(58, 128, 70, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(58, 128, 70, 0.18), transparent 52%),
    linear-gradient(145deg, rgba(19, 29, 39, 0.98), rgba(10, 15, 22, 0.98));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.035);
}
.premium-lock-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  top: -115px;
  border-radius: 50%;
  background: rgba(58, 128, 70, 0.18);
  filter: blur(32px);
}
.premium-lock-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(58, 128, 70, 0.42);
  border-radius: 13px;
  color: #3a8046;
  background: rgba(58, 128, 70, 0.12);
  font-size: 19px;
  box-shadow: 0 9px 26px rgba(58, 128, 70, 0.12);
}
.premium-lock-copy { display: grid; gap: 6px; max-width: 510px; }
.premium-lock-copy strong { font-size: 1.05rem; color: var(--text); }
.premium-lock-copy p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.premium-lock-cta {
  min-height: 38px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  color: #06120a;
  background: #3a8046;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(58, 128, 70, 0.2);
}
.premium-lock-cta:hover { background: #43a563; transform: translateY(-1px); }
.trend-panel.premium-content-locked { min-height: 255px; display: grid; place-items: center; padding: 22px; }
.trend-panel.premium-content-locked > :not(.trend-premium-lock) { display: none !important; }
.trend-premium-lock { width: 100%; }
.match-leg-section .premium-lock-card { min-height: 170px; }
@media (max-width: 620px) {
  .premium-lock-marker { margin-left: 3px; font-size: 0.58em; }
  .premium-nav-lock { position: absolute; top: 5px; right: 5px; font-size: 9px; }
  .premium-lock-card { min-height: 168px; padding: 21px 16px; border-radius: 14px; gap: 9px; }
  .premium-lock-card-icon { width: 37px; height: 37px; font-size: 16px; }
  .premium-lock-copy strong { font-size: 0.94rem; }
  .premium-lock-copy p { font-size: 0.75rem; }
  .premium-lock-cta { min-height: 35px; font-size: 0.75rem; }
  .trend-panel.premium-content-locked { min-height: 220px; padding: 12px; }
}


/* Subscription pricing page */
.subscription-layout {
  width: min(900px, 100%);
  display: grid;
  gap: 18px;
}
.subscription-plan-stack { display: grid; gap: 12px; }
.subscription-plan-card {
  position: relative;
  display: grid;
  gap: 15px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f151e;
  overflow: visible;
}
.subscription-plan-card.is-current { box-shadow: inset 3px 0 0 rgba(151, 162, 179, 0.72); }
.subscription-current-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}
.subscription-current-copy { min-width: 0; }
.subscription-current-state .entitlement-detail { margin: 2px 0 0; font-size: 10px; }
.subscription-current-state .billing-status { grid-column: 1 / -1; }
.subscription-plan-change {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-top: 5px;
}
.subscription-plan-change > p { margin: 0; color: var(--muted); font-size: 10px; }
.subscription-plan-change > #subscriptionPlanSummary { flex: 1 1 220px; }
.subscription-plan-change > #subscriptionPlanStatus { flex: 1 0 100%; }
.subscription-plan-change .secondary-button {
  border: 1px solid #286f43;
  color: #3e9b5e;
  background: #10161b;
}
.subscription-plan-change .secondary-button:hover,
.subscription-plan-change .secondary-button:focus-visible {
  border-color: #328c51;
  color: #4eac6c;
  background: rgba(35, 104, 61, 0.14);
}
.subscription-plan-premium {
  border-color: rgba(58, 128, 70, 0.46);
  background:
    linear-gradient(105deg, rgba(58, 128, 70, 0.085), transparent 42%),
    #0f171c;
  box-shadow: inset 3px 0 0 #3a8046;
}
.subscription-plan-premium.is-current { box-shadow: inset 3px 0 0 #3a8046; }
.subscription-plan-labels {
  position: absolute;
  top: -9px;
  left: 18px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.subscription-plan-label {
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0.025em;
}
.subscription-value-label { color: #051109; background: #3a8046; }
.subscription-active-label { color: #d8e8ff; background: #2563a9; }
.subscription-plan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.subscription-plan-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -0.025em; }
.subscription-plan-eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.subscription-plan-eyebrow.premium { color: #4fa86d; }
.subscription-plan-price { display: grid; flex: 0 0 auto; justify-items: end; }
.subscription-plan-price strong { font-size: 25px; line-height: 1; letter-spacing: -0.04em; }
.subscription-plan-price span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.subscription-plan-card > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.subscription-plan-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}
.subscription-plan-points > span { display: flex; align-items: flex-start; gap: 7px; color: #bac3d0; font-size: 11px; line-height: 1.4; }
.subscription-plan-points i { color: #7f8a99; font-style: normal; font-weight: 900; }
.subscription-plan-points.premium i { color: #3a8046; }
.subscription-premium-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  max-width: 610px;
}
.subscription-checkout-choice {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid #2b3542;
  border-radius: 6px;
  color: var(--text);
  background: rgba(7, 12, 18, 0.68);
  text-align: left;
  cursor: pointer;
}
.subscription-checkout-choice:hover,
.subscription-checkout-choice:focus-visible { border-color: #3a8046; background: rgba(58, 128, 70, 0.08); outline: none; }
.subscription-checkout-choice strong { font-size: 12px; }
.subscription-checkout-choice > span:not(.subscription-saving) { color: var(--muted); font-size: 9px; }
.subscription-checkout-choice.recommended { border-color: rgba(58, 128, 70, 0.48); }
.subscription-main-cta { grid-column: 1 / -1; justify-self: start; min-width: 190px; }
.subscription-tax-note { font-size: 9px !important; }
.subscription-comparison {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}
.subscription-comparison-heading span { color: #3a8046; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.subscription-comparison-heading h2 { margin: 4px 0 0; font-size: 17px; }
.subscription-matrix { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(12, 18, 26, 0.72); }
.subscription-matrix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 88px;
  min-height: 43px;
  border-top: 1px solid var(--line);
}
.subscription-matrix-row:first-child { border-top: 0; }
.subscription-matrix-row > span { display: flex; align-items: center; padding: 9px 13px; font-size: 11px; }
.subscription-matrix-row > span + span { justify-content: center; border-left: 1px solid var(--line); }
.subscription-matrix-row.header { min-height: 36px; color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.subscription-matrix-row.header > span { font-size: 9px; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
.matrix-check { color: #7d8999; font-size: 15px !important; font-weight: 900; }
.matrix-check.premium { color: #3a8046; background: rgba(58, 128, 70, 0.025); }
.matrix-empty { color: #46515f; }
@media (max-width: 620px) {
  .subscription-layout { gap: 14px; }
  .subscription-plan-card { gap: 12px; padding: 18px 14px 15px; }
  .subscription-current-state { grid-template-columns: 1fr; }
  .subscription-current-state .secondary-button { justify-self: start; }
  .subscription-plan-labels { left: 12px; }
  .subscription-plan-heading { gap: 9px; }
  .subscription-plan-heading h2 { font-size: 17px; }
  .subscription-plan-price strong { font-size: 21px; }
  .subscription-plan-points { grid-template-columns: 1fr; gap: 6px; }
  .subscription-premium-actions { grid-template-columns: 1fr; }
  .subscription-main-cta { grid-column: auto; width: 100%; }
  .subscription-matrix-row { grid-template-columns: minmax(0, 1fr) 54px 66px; }
  .subscription-matrix-row > span { padding: 8px; font-size: 9px; }
  .subscription-matrix-row.header > span { font-size: 8px; }
}


/* Prevent premium chart flash and keep upgrade actions understated. */
.trend-panel.premium-access-pending { visibility: hidden; min-height: 255px; }
.premium-lock-cta,
.subscription-main-cta {
  border: 1px solid rgba(58, 128, 70, 0.72);
  color: #4fa86d;
  background: #111820;
  box-shadow: none;
}
.premium-lock-cta:hover,
.premium-lock-cta:focus-visible,
.subscription-main-cta:hover,
.subscription-main-cta:focus-visible {
  border-color: #3a8046;
  color: #61b77b;
  background: rgba(58, 128, 70, 0.075);
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.08);
  outline: none;
}
@media (max-width: 620px) { .trend-panel.premium-access-pending { min-height: 220px; } }


/* Deeper green plan selection and upgrade action. */
.subscription-checkout-choice.selected {
  border-color: #2d7e49;
  background: rgba(35, 104, 61, 0.24);
  box-shadow: inset 0 0 0 1px rgba(45, 126, 73, 0.22);
}
.subscription-checkout-choice.selected::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a8046;
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.15);
}
.premium-lock-cta,
.subscription-main-cta {
  border-color: #286f43;
  color: #3e9b5e;
  background: #10161b;
}
.premium-lock-cta:hover,
.premium-lock-cta:focus-visible,
.subscription-main-cta:hover,
.subscription-main-cta:focus-visible {
  border-color: #328c51;
  color: #4eac6c;
  background: rgba(35, 104, 61, 0.14);
  box-shadow: 0 0 0 3px rgba(40, 111, 67, 0.1);
}

/* Keep Statistics KPI headings clear of controls and decorative metric icons. */
.kpi-info {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  font-size: 10px;
}
.stats-kpi-section .kpi-badge {
  top: auto;
  right: 10px;
  bottom: 9px;
  transform: none;
}
@media (max-width: 620px) {
  .stats-kpi-section .kpi-badge {
    top: auto;
    right: 6px;
    bottom: 6px;
    transform: none;
  }
}
/* Complete light theme for recently added interactive and Premium surfaces. */


body.theme-light {
  color: #0b1220;
}
body.theme-light .topbar { background: rgba(255, 255, 255, 0.9); }
body.theme-light .page-heading h1,
body.theme-light .page-heading h2,
body.theme-light .account-page h1,
body.theme-light .account-page h2,
body.theme-light .profile-trigger,
body.theme-light .profile-link,
body.theme-light .profile-summary strong,
body.theme-light .subscription-plan-heading h2,
body.theme-light .account-page .page-heading p,
body.theme-light .account-panel label,
body.theme-light .profile-summary > div span,
body.theme-light .subscription-plan-price strong,
body.theme-light .subscription-comparison-heading h2,
body.theme-light .subscription-matrix-row,
body.theme-light .subscription-checkout-choice strong,
body.theme-light .compare-player-trigger,
body.theme-light .compare-player-search,
body.theme-light .compare-player-option {
  color: #0b1220;
}
body.theme-light .account-page .page-heading p,
body.theme-light .account-panel label,
body.theme-light .profile-summary > div span { color: #354052; }
body.theme-light .nav-item { color: #354052; }
body.theme-light .nav-item:hover,
body.theme-light .nav-item:focus-visible {
  color: #176238;
  background: rgba(58, 128, 70, 0.1);
}
body.theme-light .nav-item.active { color: #ffffff; background: #3a8046; }
body.theme-light .filter-search::placeholder,
body.theme-light .compare-player-search::placeholder { color: #667085; }
body.theme-light .filter-search,
body.theme-light .compare-player-trigger,
body.theme-light .compare-player-menu,
body.theme-light .compare-player-search,
body.theme-light .context-filter-button,
body.theme-light .context-filter-menu,
body.theme-light .subscription-plan-card,
body.theme-light .subscription-checkout-choice,
body.theme-light .subscription-matrix,
body.theme-light .premium-dialog,
body.theme-light .subscription-option {
  background: #ffffff;
}
body.theme-light .compare-player-menu,
body.theme-light .profile-dropdown,
body.theme-light .premium-dialog {
  box-shadow: 0 18px 48px rgba(16, 55, 34, 0.15);
}
body.theme-light .subscription-plan-card {
  border-color: #ccd7e3;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.055);
}
body.theme-light .subscription-plan-premium {
  border-color: rgba(58, 128, 70, 0.42);
  background: linear-gradient(105deg, rgba(58, 128, 70, 0.095), transparent 48%), #ffffff;
}
body.theme-light .subscription-plan-points > span,
body.theme-light .subscription-current-state,
body.theme-light .subscription-checkout-choice > span:not(.subscription-saving) {
  color: #465365;
}
body.theme-light .subscription-plan-change .secondary-button {
  color: #176238;
  background: #ffffff;
}
body.theme-light .subscription-matrix-row.header { background: #f1f5f9; }
body.theme-light .matrix-check.premium { background: rgba(58, 128, 70, 0.065); }
body.theme-light .subscription-checkout-choice:hover,
body.theme-light .subscription-checkout-choice:focus-visible,
body.theme-light .subscription-checkout-choice.selected,
body.theme-light .kpi-card.selected {
  border-color: rgba(58, 128, 70, 0.68);
  background: linear-gradient(180deg, rgba(58, 128, 70, 0.12), rgba(58, 128, 70, 0.045));
  box-shadow: 0 0 0 2px rgba(58, 128, 70, 0.13), 0 10px 28px rgba(58, 128, 70, 0.12);
}
body.theme-light .overview-tab.active,
body.theme-light .language-option.active,
body.theme-light .settings-option.active,
body.theme-light .scoring-view-option.active,
body.theme-light .finish-view-option.active,
body.theme-light .event-finish-view-option.active {
  color: #ffffff;
  background: #3a8046;
  box-shadow: 0 0 0 2px rgba(58, 128, 70, 0.13), 0 6px 18px rgba(58, 128, 70, 0.2);
}
body.theme-light .premium-dialog-backdrop { background: rgba(18, 54, 34, 0.28); }
body.theme-light .premium-dialog {
  border-color: rgba(58, 128, 70, 0.48);
  box-shadow: 0 0 0 3px rgba(58, 128, 70, 0.1), 0 26px 70px rgba(28, 74, 47, 0.24);
}
body.theme-light .premium-lock-card {
  border-color: rgba(58, 128, 70, 0.4);
  background: radial-gradient(circle at 50% 0%, rgba(58, 128, 70, 0.14), transparent 54%), #ffffff;
  box-shadow: 0 0 0 2px rgba(58, 128, 70, 0.08), 0 18px 46px rgba(28, 74, 47, 0.13);
}
body.theme-light .premium-lock-cta,
body.theme-light .subscription-main-cta {
  color: #176238;
  background: #ffffff;
}
body.theme-light .premium-lock-cta:hover,
body.theme-light .premium-lock-cta:focus-visible,
body.theme-light .subscription-main-cta:hover,
body.theme-light .subscription-main-cta:focus-visible {
  color: #0e542e;
  background: rgba(58, 128, 70, 0.09);
}

/* One compact mobile Statistics header: tabs first, KPI heading directly below. */
@media (max-width: 620px) {
  #statisticsPage .stats-kpi-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px;
    width: 100%;
  }
  #statisticsPage .stats-kpi-header > h2 {
    grid-row: 2;
    justify-self: start;
    margin: 0;
    padding: 2px 0 0;
  }
  #statisticsPage .stats-kpi-header-actions {
    grid-row: 1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 3px;
  }
  #statisticsPage .stats-kpi-header-actions .stats-filter-tabs-mobile {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: visible;
  }
  #statisticsPage .stats-kpi-header-actions .stats-overview-tabs {
    width: 100%;
    gap: 1px;
    padding: 2px;
  }
  #statisticsPage .stats-kpi-header-actions .overview-tab {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    padding: 0 2px;
    font-size: 7.5px;
    overflow: visible;
  }
  #statisticsPage .stats-kpi-header-actions > .switch-with-info {
    width: auto;
    justify-self: end;
    margin: 0;
  }
  #statisticsPage .stats-overview-tabs .premium-nav-lock {
    position: static;
    flex: 0 0 auto;
    margin-left: 1px;
    font-size: 7px;
  }
}
/* Light-theme event and tournament surfaces use native light hierarchy throughout. */
body.theme-light .event-card,
body.theme-light .event-summary-card,
body.theme-light .opponent-card,
body.theme-light .opponent-card-main,
body.theme-light .match-card,
body.theme-light .match-card-main,
body.theme-light .match-page-card,
body.theme-light .event-structure-section,
body.theme-light .tournament-dropdown,
body.theme-light .rr-group,
body.theme-light .bracket-match,
body.theme-light .inline-leg-detail,
body.theme-light .highlight-section,
body.theme-light .chart-tooltip {
  color: #0b1220;
  background: #ffffff;
}
body.theme-light .event-card,
body.theme-light .opponent-card,
body.theme-light .match-card,
body.theme-light .event-structure-section,
body.theme-light .tournament-dropdown,
body.theme-light .rr-group,
body.theme-light .bracket-match,
body.theme-light .highlight-section {
  border-color: #d5dee9;
  box-shadow: 0 7px 22px rgba(17, 24, 39, 0.045);
}
body.theme-light .inline-leg-detail { border-top-color: #dfe6ee; }
body.theme-light .event-card.clickable:hover,
body.theme-light .opponent-card.clickable:hover,
body.theme-light .match-card.clickable:hover,
body.theme-light .clickable:hover,
body.theme-light .structure-match.clickable:hover,
body.theme-light .bracket-match.clickable:hover,
body.theme-light .highlight-row:hover,
body.theme-light tbody tr:hover {
  border-color: rgba(58, 128, 70, 0.48);
  background: rgba(58, 128, 70, 0.075);
  box-shadow: 0 8px 24px rgba(58, 128, 70, 0.1);
}
body.theme-light .event-card.expanded,
body.theme-light .opponent-card.expanded,
body.theme-light .match-card.expanded,
body.theme-light .tournament-dropdown[open] {
  border-color: rgba(58, 128, 70, 0.46);
  background: linear-gradient(180deg, rgba(58, 128, 70, 0.055), #ffffff 35%);
}
body.theme-light .event-structure-section,
body.theme-light .tournament-dropdown { background: #f8fafc; }
body.theme-light .rr-group,
body.theme-light .bracket-match { background: #ffffff; }
body.theme-light .structure-match,
body.theme-light .bracket-side,
body.theme-light .rr-row,
body.theme-light .rr-group-heading,
body.theme-light .tournament-dropdown summary { color: #273244; }
body.theme-light .structure-match strong,
body.theme-light .event-name,
body.theme-light .opponent-name,
body.theme-light .match-player-name { color: #0b1220; }
body.theme-light .chart-tooltip {
  border-color: #ced8e4;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.14);
}
body.theme-light .kpi-info::before { border-bottom-color: #ffffff; }
body.theme-light .kpi-info::after {
  border-color: #ced8e4;
  color: #1f2937;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.16);
}
body.theme-light #billingPortalButton {
  color: #176238;
  background: #ffffff;
}

body.theme-light #billingPortalButton:hover,
body.theme-light #billingPortalButton:focus-visible {
  color: #0e542e;
  background: rgba(58, 128, 70, 0.09);
}

.app-shell[hidden] {
  display: none !important;
}

@media (max-height: 760px) {
  .auth-screen {
    padding-bottom: 20px;
  }

  .auth-heading {
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .auth-theme-logo {
    width: min(230px, 68vw);
    margin-bottom: 4px;
  }

  .auth-icon {
    width: 54px;
    height: 54px;
  }

  .auth-icon svg {
    width: 27px;
    height: 27px;
  }

  .auth-heading h1 {
    margin: 10px 0 5px;
    font-size: 30px;
  }

  .login-card {
    gap: 12px;
    padding: 20px 24px;
  }

  .auth-footer {
    margin-top: 12px;
  }
}

@media (max-width: 980px) {
  html,
  body,
  .app-shell,
  .main,
  .topbar,
  .page {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  html,
  body,
  .app-shell,
  .main {
    overflow-x: clip;
  }
}

/* Demo polish: compact Highlights and readable Consistency endpoints. */
.highlight-value strong { font-size: 20px; }
.consistency-time-plot { position: relative; }
.consistency-hover-guide { opacity: 0; stroke: rgba(151, 162, 179, .58); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.consistency-hover-guide.visible { opacity: 1; }
.consistency-end-labels { position: absolute; inset: 0 2px 20px auto; width: 44px; pointer-events: none; }
.consistency-end-labels span { position: absolute; right: 0; transform: translateY(-50%); font-size: 8px; font-weight: 750; line-height: 1; text-shadow: 0 1px 3px var(--bg); white-space: nowrap; }
.consistency-chart:not(.consistency-ribbon-chart) .consistency-y-axis strong { height: 28px; }
.consistency-chart:not(.consistency-ribbon-chart) .consistency-y-axis > div { height: 260px; }
.consistency-cumulative-plot svg { height: 260px; }
@media (max-width: 620px) {
  .highlight-row { grid-template-columns: 18px 54px minmax(0, 1fr) 42px 14px; gap: 6px; }
  .highlight-value { transform: translateX(-3px); gap: 3px; }
  .highlight-value strong { font-size: 17px; }
  .consistency-chart:not(.consistency-ribbon-chart) .consistency-y-axis strong { height: 25px; font-size: 6px; }
  .consistency-chart:not(.consistency-ribbon-chart) .consistency-y-axis > div { height: 215px; }
  .consistency-cumulative-plot svg { height: 215px; }
  .consistency-end-labels { width: 48px; }
  .consistency-end-labels span { font-size: 7px; }
}


/* Tournament statistics mirror the main Statistics tabs; Consistency uses KPI cards. */
.event-consistency-loading { min-height: 180px; display: grid; place-items: center; gap: 8px; color: var(--muted); }
.event-consistency-loading img { width: 42px; height: 42px; object-fit: contain; }
.event-consistency-cumulative { grid-column: 1 / -1; min-width: 0; }
.event-consistency-cumulative .consistency-ribbon-chart { display: none; }
.event-consistency-cumulative .consistency-view { width: 100%; }
@media (max-width: 620px) {
  .event-kpi-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(100%, 320px); }
  .event-kpi-tab { min-width: 0; padding: 0 4px; overflow: hidden; font-size: 8px; text-overflow: clip; white-space: nowrap; }
}

.admin-name-clusters {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-cluster-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-cluster-heading h2,
.admin-cluster-heading p {
  margin: 0;
}

.admin-cluster-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-cluster-card {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
}

.admin-cluster-options {
  display: grid;
  gap: 6px;
}

.admin-cluster-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--primary));
  cursor: pointer;
}

.admin-identity-view-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.admin-identity-view-tabs .overview-tab {
  width: auto;
}

.admin-identity-view-tabs .overview-tab span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-cluster-option:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.admin-cluster-option:has(input:checked) {
  outline: 1px solid color-mix(in srgb, var(--primary) 68%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.admin-cluster-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--primary);
}

.admin-cluster-player-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.admin-cluster-player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-cluster-choice {
  display: none;
  color: var(--primary-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-cluster-option:has(input:checked) .admin-cluster-choice {
  display: inline;
}

.admin-cluster-option small {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
}

.danger-button {
  border: 1px solid #b84242;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e46a6a;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover:not(:disabled) {
  background: rgba(184, 66, 66, 0.12);
}
.support-form {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.support-form label,
.admin-issue-card label {
  display: grid;
  gap: 7px;
}

.support-form textarea,
.admin-issue-card textarea {
  min-height: 120px;
  resize: vertical;
}

.support-context-preview,
.support-context-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.support-context-preview {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--primary));
}

.support-history {
  margin-top: 24px;
}

.support-issue-card p,
.admin-issue-card p {
  margin: 8px 0;
  white-space: pre-wrap;
}

.admin-issue-card {
  display: grid;
  gap: 12px;
}

.admin-issue-card .event-title-row > div {
  display: grid;
  gap: 3px;
}

.admin-issue-card .event-title-row > div span {
  color: var(--muted);
  font-size: 0.82rem;
}

.support-status-new { color: #7ca7ff; }
.support-status-in_progress { color: #e0a744; }
.support-status-resolved { color: var(--primary-soft); }
.support-status-rejected { color: #e46a6a; }

@media (max-width: 620px) {
  .support-form {
    padding: 14px;
  }

  .admin-issue-card .event-title-row {
    align-items: stretch;
    flex-direction: column;
  }
}
.tournament-url-feedback {
  min-height: 42px;
  align-items: center;
  font-weight: 600;
  line-height: 1.35;
}

.tournament-url-feedback.valid {
  border-color: color-mix(in srgb, var(--primary) 75%, var(--border));
  border-left: 4px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  color: var(--primary-soft);
}

.tournament-url-feedback.error {
  border-color: #b94a48;
  border-left: 4px solid #e45e5e;
  background: color-mix(in srgb, #a92f2f 22%, var(--surface));
  color: #ff8585;
}

.tournament-request-link {
  color: var(--text-secondary);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-ingestion-requests {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.admin-ingestion-requests .stats-kpi-header {
  margin-bottom: 0;
}
.tournament-request-examples {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.tournament-request-examples dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.tournament-request-examples dl > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.tournament-request-examples dt {
  color: var(--text-primary);
  font-weight: 700;
}

.tournament-request-examples dd {
  min-width: 0;
  margin: 0;
}

.tournament-request-examples code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .tournament-request-examples dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
.admin-user-rows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.admin-user-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) minmax(100px, 0.5fr) minmax(90px, auto) minmax(140px, auto) minmax(145px, auto) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-user-row:hover,
.admin-user-row:focus-visible {
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  outline: none;
}

.admin-user-row-avatar,
.admin-user-profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--line));
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--primary) 18%, var(--surface));
  background-position: center;
  background-size: cover;
  color: var(--primary-soft);
  font-weight: 800;
}

.admin-user-row-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
}

.admin-user-row-main,
.admin-user-row-login {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.admin-user-row-main strong,
.admin-user-row-main small,
.admin-user-row-city,
.admin-user-row-login span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row-main small,
.admin-user-row-login small,
.admin-user-row-city {
  color: var(--muted);
  font-size: 0.76rem;
.admin-user-row-stage,
.admin-user-row-next {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-user-row-stage small,
.admin-user-row-next small {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-onboarding-users-panel {
  display: grid;
  gap: 14px;
}

.admin-onboarding-user-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-onboarding-table-head,
.admin-onboarding-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 90px minmax(150px, 1fr) minmax(140px, auto);
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
}

.admin-onboarding-table-head {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-onboarding-table-row {
  width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer;
}

.admin-onboarding-table-row > span:first-child { display: grid; gap: 2px; }
.admin-onboarding-table-row small { color: var(--muted); }
.admin-onboarding-table-row:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
}

.admin-user-row-login {
  text-align: right;
}

.admin-user-row-login span {
  font-size: 0.78rem;
}

.admin-user-row-arrow {
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.admin-user-detail {
  display: grid;
  gap: 18px;
}
.admin-onboarding-timeline > div { display: grid; gap: 7px; }
.admin-onboarding-timeline > p { margin: 0; color: var(--muted); }
.admin-onboarding-timeline-row { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.admin-onboarding-timeline-row > span:last-child { display: grid; gap: 1px; }
.admin-onboarding-timeline-row small { color: var(--muted); }
.admin-onboarding-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.admin-onboarding-timeline-row.complete .admin-onboarding-step { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-soft); }

.admin-detail-back {
  width: fit-content;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--primary-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-user-profile-header {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.admin-user-profile-avatar {
  width: 128px;
  height: 128px;
  font-size: 2rem;
}

.admin-user-profile-header > div {
  display: grid;
  gap: 4px;
}

.admin-user-profile-header h2,
.admin-user-profile-header p {
  margin: 0;
}

.admin-user-profile-header h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.admin-user-profile-header p,
.admin-user-profile-header > div > span:last-child {
  color: var(--muted);
}

.admin-profile-eyebrow {
  color: var(--primary-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-user-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.admin-user-detail-card,
.admin-user-detail-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.admin-user-detail-card h3,
.admin-user-detail-section h3 {
  margin: 0 0 3px;
  font-size: 0.94rem;
}

.admin-detail-field {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.admin-detail-field span {
  color: var(--muted);
}

.admin-detail-field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 760px) {
  .admin-user-row {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
  }
    .admin-user-row-stage,
    .admin-user-row-next { display: none; }
    .admin-onboarding-table-head { display: none; }
    .admin-onboarding-table-row { grid-template-columns: 1fr auto; }
    .admin-onboarding-table-row > span:nth-child(3), .admin-onboarding-table-row > span:nth-child(4) { grid-column: 1 / -1; }

  .admin-user-row-city,
  .admin-user-row-login {
    display: none;
  }

  .admin-user-profile-header {
    align-items: flex-start;
    padding: 15px;
  }

  .admin-user-profile-avatar {
    width: 88px;
    height: 88px;
    font-size: 1.4rem;
  }

  .admin-user-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-user-profile-header {
    flex-direction: column;
  }

  .admin-user-profile-avatar {
    width: 112px;
    height: 112px;
  }

  .admin-detail-field {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .admin-detail-field strong {
    text-align: left;
  }
}
.admin-ingestion-force {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-ingestion-force input {
  accent-color: var(--primary);
}

.admin-ingestion-job {
  display: grid;
  gap: 0.55rem;
}

.admin-ingestion-warnings {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-ingestion-job .compact-button {
  justify-self: start;
}

.page.personal-data-unavailable > :not(.page-heading):not(.personal-data-state) {
  display: none !important;
}

.personal-data-state {
  width: min(760px, 100%);
  margin: clamp(24px, 5vw, 64px) auto 0;
}

.personal-data-state .data-loading-state {
  min-height: 220px;
}

.personal-no-data-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 94%, var(--green) 6%), var(--panel));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.personal-no-data-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--green);
  color: #07110a;
  font-size: 28px;
  font-weight: 900;
}

.personal-no-data-copy h2 {
  margin: 0 0 10px;
}

.personal-no-data-copy p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.personal-no-data-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
}

.personal-no-data-actions a {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 640px) {
  .personal-no-data-card {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .personal-no-data-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.development-panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.development-content { display: grid; gap: 18px; }
.development-profile-hero { display: grid; grid-template-columns: minmax(260px, 350px) minmax(0, 1fr); gap: 20px; align-items: center; }
.development-player-card { --card-deep: #4a2a1d; --card-mid: #9a5a36; --card-light: #d49361; --card-accent: #f6c49d; --card-text: #fff8f2; position: relative; isolation: isolate; width: min(100%, 330px); justify-self: center; padding: 18px; border: 1px solid color-mix(in srgb, var(--card-accent) 65%, transparent); border-radius: 22px; background: linear-gradient(145deg, var(--card-light), var(--card-mid) 48%, var(--card-deep)); box-shadow: inset 0 1px 0 color-mix(in srgb, white 35%, transparent), 0 14px 30px rgba(0,0,0,.24); color: var(--card-text); }
.development-player-card.tier-silver { --card-deep: #39434c; --card-mid: #89959e; --card-light: #dde4e8; --card-accent: #fff; --card-text: #111a21; }
.development-player-card.tier-gold { --card-deep: #74500f; --card-mid: #c59020; --card-light: #f0d36d; --card-accent: #fff0a5; --card-text: #302207; }
.development-player-card.tier-diamond { --card-deep: #102f4a; --card-mid: #277a8f; --card-light: #a9edf4; --card-accent: #e9fdff; --card-text: #071b2a; }
.development-card-geometry { position: absolute; z-index: -1; inset: 0; overflow: hidden; border-radius: inherit; opacity: .34; background: radial-gradient(circle at 84% 6%, transparent 0 24px, var(--card-accent) 25px 26px, transparent 27px 42px, var(--card-accent) 43px 44px, transparent 45px), linear-gradient(125deg, transparent 0 38%, color-mix(in srgb, var(--card-accent) 30%, transparent) 38% 39%, transparent 39% 58%, color-mix(in srgb, var(--card-accent) 22%, transparent) 58% 59%, transparent 59%); }
.development-player-card header { position: relative; z-index: 1; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.development-card-avatar { width: 64px; height: 64px; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--card-accent) 75%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--card-deep) 72%, transparent) center/cover no-repeat; color: var(--card-text); font-size: 20px; font-weight: 850; box-shadow: inset 0 0 0 3px color-mix(in srgb, white 12%, transparent); }
.development-card-identity { min-width: 0; }
.development-card-identity small { color: var(--card-text); opacity: .72; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.development-player-card h3 { overflow: hidden; margin: 3px 0; color: var(--card-text); font-size: 16px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.development-card-identity > span { display: block; color: var(--card-text); opacity: .76; font-size: 8px; line-height: 1.25; }
.development-overall-rating { display: grid; justify-items: center; min-width: 52px; }
.development-overall-rating strong { color: var(--card-text); font-size: 34px; line-height: .9; }
.development-overall-rating span { margin-top: 4px; color: var(--card-text); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.development-player-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 14px; }
.development-player-stat { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; padding: 7px 8px; border: 1px solid color-mix(in srgb, var(--card-accent) 18%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--card-deep) 27%, transparent); }
.development-player-stat span { min-width: 0; overflow-wrap: anywhere; color: var(--card-text); opacity: .78; font-size: 8px; font-weight: 700; line-height: 1.1; }
.development-player-stat span .kpi-info { color: inherit; border-color: currentColor; }
.development-player-stat strong { flex: 0 0 auto; color: var(--card-text); font-size: 17px; line-height: 1; }
.development-player-card footer { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.development-player-card footer span { padding: 4px 6px; border-radius: 999px; background: color-mix(in srgb, var(--card-deep) 28%, transparent); color: var(--card-text); font-size: 7px; font-weight: 650; }
.development-radar-column { min-width: 0; }
.development-radar { display: block; width: min(100%, 420px); margin: 0 auto; overflow: visible; }
.development-radar-grid, .development-radar-axis { fill: none; stroke: color-mix(in srgb, var(--muted) 25%, transparent); stroke-width: 1; }
.development-radar-score { fill: rgba(58, 128, 70, .28); stroke: #3a8046; stroke-width: 2.5; }
.development-radar-dot { fill: #7de39a; stroke: var(--panel); stroke-width: 2; }
.development-radar-label { fill: var(--text); font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.development-dimension-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.development-dimension-card { min-width: 0; padding: 14px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.development-dimension-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.development-dimension-card h3 { margin: 0; color: var(--text); font-size: 13px; line-height: 1.2; }
.development-dimension-card h3 .kpi-info, .development-kpi-row strong .kpi-info { flex: 0 0 auto; }
.development-dimension-card header small, .development-dimension-card > p, .development-kpi-row small { color: var(--muted); font-size: 9px; line-height: 1.25; }
.development-dimension-card header > div { display: grid; gap: 4px; min-width: 0; }
.development-dimension-card header > strong { color: #66c87a; font-size: 28px; line-height: 1; }
.development-dimension-card > p { margin: 8px 0 0; }
.development-kpi-list { display: grid; margin-top: 9px; }
.development-kpi-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
.development-kpi-row:last-child { border-bottom: 0; }
.development-kpi-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.development-kpi-row > div:first-child > strong { overflow-wrap: anywhere; color: var(--text); font-size: 10px; font-weight: 600; line-height: 1.25; }
.development-kpi-row small { display: block; }
.development-kpi-value { display: grid; flex: 0 0 auto; justify-items: end; }
.development-kpi-value > strong { color: #66c87a; font-size: 15px; line-height: 1.1; }
.development-benchmark-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(224, 166, 52, .1); color: #e0a634; font-size: 11px; }
@media (max-width: 1100px) and (min-width: 701px) { .development-dimension-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .development-profile-hero { grid-template-columns: 1fr; gap: 12px; }
  .development-player-card { width: min(100%, 320px); padding: 16px; }
  .development-card-avatar { width: 58px; height: 58px; }
  .development-player-card header { grid-template-columns: 58px minmax(0,1fr) auto; }
  .development-panel-header { align-items: flex-start; }
  .development-panel-header .panel-meta { max-width: 52%; text-align: right; }
  .development-radar { width: min(100%, 330px); }
  .development-dimension-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .development-dimension-card { padding: 11px 9px; }
  .development-dimension-card h3 { font-size: 11px; }
  .development-dimension-card header > strong { font-size: 23px; }
  .development-dimension-card header small, .development-dimension-card > p, .development-kpi-row small { font-size: 8px; }
  .development-kpi-row > div:first-child > strong { font-size: 9px; }
  .development-kpi-value > strong { font-size: 14px; }
}
/* Google OAuth sign-in polish */
.oauth-button {
  position: relative;
  width: min(440px, 100%);
  min-height: 54px;
  height: auto;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid #cfd5df;
  border-radius: 10px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.oauth-button:hover {
  border-color: #aeb7c5;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.oauth-button:focus-visible {
  outline: 0;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.22);
}

.oauth-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.oauth-button:disabled {
  transform: none;
}

.google-mark {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.auth-divider {
  width: min(440px, 100%);
  margin: 20px 0 14px;
  gap: 12px;
  color: var(--muted-2);
}

.auth-divider em {
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider span {
  background: var(--line);
}

.google-oauth-consent {
  width: min(420px, calc(100% - 24px));
  margin: 9px 0 0;
  color: var(--muted-2);
  line-height: 1.55;
}

.google-oauth-consent a {
  color: var(--muted);
  font-weight: 600;
  text-underline-offset: 2px;
}

@media (max-width: 520px) {
  .oauth-button {
    min-height: 52px;
  }

  .auth-divider {
    margin-top: 16px;
  }
}
