:root {
  --ink: #111b18;
  --ink-soft: #53615c;
  --paper: #f4f6f1;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(25, 49, 41, 0.12);
  --line-strong: rgba(25, 49, 41, 0.2);
  --forest: #0c3d31;
  --forest-deep: #071b16;
  --jade: #1d7a60;
  --mint: #b7e8cf;
  --mint-soft: #e7f5ec;
  --lime: #c9f277;
  --gold: #c59b50;
  --gold-soft: #f4ead5;
  --danger: #a84236;
  --danger-soft: #f8e9e5;
  --blue-soft: #e8eff7;
  --shadow: 0 24px 70px rgba(16, 47, 37, 0.1);
  --shadow-small: 0 12px 34px rgba(16, 47, 37, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  --font-display: "Bahnschrift", "Aptos Display", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(29, 122, 96, 0.24);
  outline-offset: 2px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 77% 8%, rgba(183, 232, 207, 0.5), transparent 25%),
    linear-gradient(180deg, #edf4ed 0, #f6f7f2 46%, #f2f4ef 100%);
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
}

.glow-one {
  top: -30vw;
  right: -22vw;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(201, 242, 119, 0.18), transparent 64%);
}

.glow-two {
  top: 36rem;
  left: -30vw;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(90, 161, 134, 0.13), transparent 65%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(21, 62, 50, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 62, 50, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black 0, transparent 40%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1400px, calc(100% - 48px));
  height: 78px;
  margin: 18px auto 0;
  padding: 0 16px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: rgba(249, 251, 247, 0.77);
  box-shadow: 0 12px 34px rgba(20, 62, 50, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: end center;
  width: 38px;
  height: 38px;
  padding: 8px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--forest);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark span {
  position: absolute;
  bottom: 7px;
  width: 4px;
  border-radius: 8px 8px 2px 2px;
  background: var(--lime);
}

.brand-mark span:nth-child(1) {
  left: 9px;
  height: 10px;
  opacity: 0.55;
}

.brand-mark span:nth-child(2) {
  left: 17px;
  height: 17px;
  opacity: 0.78;
}

.brand-mark span:nth-child(3) {
  left: 25px;
  height: 24px;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 24px;
}

.nav-link {
  position: relative;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover {
  color: var(--forest);
  background: rgba(12, 61, 49, 0.06);
}

.nav-link.is-active {
  color: var(--forest);
  background: rgba(12, 61, 49, 0.08);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 4px;
  left: 14px;
  height: 2px;
  border-radius: 99px;
  background: var(--jade);
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 99px;
  color: var(--forest);
  background: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.sync-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48a57c;
  box-shadow: 0 0 0 4px rgba(72, 165, 124, 0.13);
}

.sync-state.is-loading i {
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

main {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.page {
  display: none;
  padding: 56px 0 84px;
  animation: page-in 280ms ease both;
}

.page.is-active {
  display: block;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(470px, 0.95fr);
  gap: 58px;
  align-items: center;
  min-height: 510px;
}

.hero-copy {
  padding: 24px 0 34px 14px;
}

.eyebrow,
.section-kicker {
  color: var(--jade);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 5px rgba(29, 122, 96, 0.1);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(52px, 5.2vw, 82px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 .hero-line-two {
  color: var(--jade);
}

.hero-lead {
  max-width: 620px;
  margin: 26px 0 0;
  color: #4d5d57;
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #f7fff9;
  background: var(--forest);
  box-shadow: 0 12px 24px rgba(12, 61, 49, 0.18);
}

.button-primary:hover {
  background: #0f4d3e;
  box-shadow: 0 16px 30px rgba(12, 61, 49, 0.22);
}

.button-secondary,
.button-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
}

.button-secondary:hover,
.button-ghost:hover {
  background: white;
  border-color: rgba(12, 61, 49, 0.28);
}

.button-ghost {
  min-height: 40px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  cursor: pointer;
}

.user-chip:hover {
  border-color: rgba(12, 61, 49, 0.28);
  background: white;
}

.user-chip .avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
}

.user-chip strong,
.user-chip small {
  display: block;
}

.user-chip strong {
  max-width: 100px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.logout-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #89948f;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.logout-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.button-full {
  width: 100%;
}

.button-danger {
  color: var(--danger);
  border-color: rgba(168, 66, 54, 0.25);
  background: var(--danger-soft);
}

.button-qq {
  width: 100%;
  color: white;
  background: #1597e5;
  box-shadow: 0 14px 28px rgba(21, 151, 229, 0.2);
}

.formula-note {
  max-width: 690px;
  margin: 23px 0 0;
  color: #68756f;
  font-size: 11px;
  line-height: 1.65;
}

.hero-rule-link {
  margin-top: 10px;
  padding-left: 0;
}

.ladder-card {
  position: relative;
  min-height: 480px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(232, 242, 234, 0.88)),
    var(--panel);
  box-shadow: var(--shadow);
}

.ladder-card::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -130px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(29, 122, 96, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(29, 122, 96, 0.025),
    0 0 0 72px rgba(29, 122, 96, 0.02);
}

.ladder-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ladder-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.last-update {
  max-width: 150px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.tier-chart {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  height: 150px;
  margin-top: 34px;
  padding: 20px 14px 0;
  border-bottom: 1px solid var(--line);
}

.tier-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.tier-column strong {
  display: block;
  color: var(--forest);
  font-size: 10px;
}

.tier-column span {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.tier-bar {
  width: min(32px, 80%);
  min-height: 4px;
  margin: 0 auto;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, var(--lime) 0, #5dbb8e 100%);
  box-shadow: inset 0 0 0 1px rgba(12, 61, 49, 0.05);
}

.tier-bar.level-1 {
  height: 10%;
}

.tier-bar.level-2 {
  height: 25%;
}

.tier-bar.level-3 {
  height: 42%;
}

.tier-bar.level-4 {
  height: 60%;
}

.tier-bar.level-5 {
  height: 78%;
}

.tier-bar.level-6 {
  height: 96%;
}

.tier-column:nth-child(-n + 2) .tier-bar {
  background: linear-gradient(180deg, #d6a958 0, #a57932 100%);
}

.podium {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.podium-card {
  position: relative;
  min-width: 0;
  padding: 16px 14px 15px;
  border: 1px solid rgba(22, 74, 57, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.podium-card:hover {
  transform: translateY(-3px);
  background: white;
}

.podium-card:first-child {
  background: var(--forest);
  color: white;
}

.podium-number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 20px;
  border-radius: 8px;
  color: var(--forest);
  background: var(--lime);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.podium-card:not(:first-child) .podium-number {
  color: var(--ink-soft);
  background: #e8eee9;
}

.podium-name {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.podium-card:first-child .podium-meta {
  color: rgba(255, 255, 255, 0.66);
}

.podium-score {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.podium-card:first-child .podium-score {
  color: white;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 22px;
}

.metric-card {
  padding: 22px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 10px 30px rgba(21, 62, 50, 0.04);
}

.metric-card-accent {
  color: white;
  background: var(--forest);
}

.metric-label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.metric-card-accent .metric-label,
.metric-card-accent small {
  color: rgba(255, 255, 255, 0.65);
}

.metric-card strong {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: #7b8782;
  font-size: 10px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px);
}

.ranking-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 30px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.history-guide h2,
.audit-panel h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.035em;
}

.panel-heading p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.compact-heading {
  align-items: center;
  padding: 24px 26px 20px;
}

.compact-heading h2 {
  font-size: 22px;
}

.table-tools {
  display: flex;
  gap: 8px;
}

.tier-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 30px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 247, 0.66);
}

.tier-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.tier-tab:hover {
  border-color: var(--line);
  background: white;
}

.tier-tab.is-active {
  color: white;
  background: var(--forest);
  box-shadow: 0 7px 16px rgba(12, 61, 49, 0.16);
}

.tier-summary {
  margin-left: auto;
  color: #7c8984;
  font-size: 9px;
  white-space: nowrap;
}

.search-field,
.select-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input,
.select-field select,
.match-form input,
.match-form select,
.match-form textarea,
.login-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.search-field input,
.select-field select,
.login-form input,
.match-form input,
.match-form select {
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.select-field.compact select {
  min-width: 138px;
  padding-right: 30px;
}

.search-field input {
  min-width: 210px;
  padding-left: 34px;
  background-image:
    linear-gradient(45deg, transparent 46%, #83908b 47% 53%, transparent 54%),
    radial-gradient(circle at 35% 35%, transparent 49%, #83908b 50% 59%, transparent 60%);
  background-repeat: no-repeat;
  background-position: 17px 22px, 11px 13px;
  background-size: 7px 7px, 12px 12px;
}

.search-field input::placeholder,
.match-form input::placeholder,
.match-form textarea::placeholder,
.login-form input::placeholder {
  color: #98a29d;
}

.search-field input:focus,
.select-field select:focus,
.match-form input:focus,
.match-form select:focus,
.match-form textarea:focus,
.login-form input:focus {
  border-color: rgba(29, 122, 96, 0.55);
  box-shadow: 0 0 0 4px rgba(29, 122, 96, 0.08);
  outline: 0;
}

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

.ranking-table,
.score-grid,
.match-history-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(25, 49, 41, 0.075);
  text-align: left;
  white-space: nowrap;
}

.ranking-table th {
  color: #7c8984;
  background: rgba(245, 248, 244, 0.72);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.ranking-table th:first-child,
.ranking-table td:first-child {
  padding-left: 30px;
}

.ranking-table th:last-child,
.ranking-table td:last-child {
  padding-right: 30px;
}

.ranking-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.ranking-table tbody tr:hover {
  background: rgba(231, 245, 236, 0.55);
}

.ranking-table tbody tr.is-dimmed {
  opacity: 0.62;
}

.ranking-table td {
  font-size: 13px;
}

.ranking-table .numeric {
  text-align: right;
}

.rank-number {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 750;
}

.rank-number.top-rank {
  color: var(--forest);
  font-size: 16px;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(29, 122, 96, 0.12);
  border-radius: 11px;
  color: var(--forest);
  background: var(--mint-soft);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.player-name {
  max-width: 240px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
}

.player-subline {
  margin-top: 3px;
  color: #8b9691;
  font-size: 9px;
}

.tier-badge,
.stage-badge,
.status-badge,
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.tier-T0 {
  color: #6c4915;
  border-color: rgba(197, 155, 80, 0.25);
  background: var(--gold-soft);
}

.tier-T0\.5 {
  color: #735425;
  border-color: rgba(197, 155, 80, 0.2);
  background: #f5ecd9;
}

.tier-T1,
.tier-T2 {
  color: var(--forest);
  border-color: rgba(29, 122, 96, 0.12);
  background: var(--mint-soft);
}

.tier-T3,
.tier-T4,
.tier-T5 {
  color: #52615c;
  border-color: var(--line);
  background: #f0f3f0;
}

.stage-badge {
  color: #56645f;
  border-color: var(--line);
  background: transparent;
}

.status-badge {
  color: #735425;
  border-color: rgba(197, 155, 80, 0.17);
  background: var(--gold-soft);
}

.status-badge.pending {
  color: #1e5e85;
  border-color: rgba(30, 94, 133, 0.15);
  background: var(--blue-soft);
}

.status-badge.rejected {
  color: var(--danger);
  border-color: rgba(168, 66, 54, 0.13);
  background: var(--danger-soft);
}

.result-badge.win {
  color: #12614a;
  background: var(--mint-soft);
}

.result-badge.loss {
  color: var(--danger);
  background: var(--danger-soft);
}

.result-badge.draw {
  color: #57645f;
  background: #eef1ee;
}

.promotion-badge,
.deduction-note {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.promotion-badge {
  color: #6c4915;
  background: var(--gold-soft);
}

.deduction-note {
  color: #1e5e85;
  background: var(--blue-soft);
}

.score-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.record-value {
  color: var(--ink-soft);
  font-size: 11px;
}

.delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 5px 8px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.delta.positive {
  color: #12614a;
  background: #e8f6ee;
}

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

.table-empty,
.empty-state {
  padding: 52px 24px;
  color: #84908b;
  font-size: 12px;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 30px;
  color: var(--ink-soft);
  font-size: 11px;
}

.pager-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  border-color: rgba(12, 61, 49, 0.3);
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.rules-heading {
  align-items: center;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.rule-card {
  padding: 28px;
}

.rule-card-wide {
  grid-column: span 2;
}

.rule-card h2 {
  margin: 7px 0 18px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.035em;
}

.formula-block {
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(29, 122, 96, 0.14);
  border-radius: 14px;
  color: var(--forest);
  background:
    linear-gradient(135deg, rgba(231, 245, 236, 0.95), rgba(255, 255, 255, 0.9));
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.7;
}

.rule-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-list li {
  position: relative;
  padding-left: 17px;
  color: #56645f;
  font-size: 11px;
  line-height: 1.7;
}

.rule-list li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jade);
}

.rule-list strong {
  color: var(--ink);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
}

.rules-table th,
.rules-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
}

.rules-table th {
  color: var(--ink-soft);
  background: rgba(245, 248, 244, 0.72);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.rule-footnote {
  margin: 15px 0 0;
  color: #7c8984;
  font-size: 10px;
  line-height: 1.65;
}

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

.mechanic-grid article {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.mechanic-grid strong {
  display: block;
  margin-bottom: 7px;
  color: var(--forest);
  font-size: 12px;
}

.mechanic-grid p {
  margin: 0;
  color: #66736d;
  font-size: 10px;
  line-height: 1.65;
}

.page-heading h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.05em;
}

.page-heading p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.history-search input {
  min-width: 290px;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.history-panel {
  min-height: 460px;
  overflow: hidden;
}

.history-list {
  display: grid;
}

.history-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.history-no {
  color: #8c9893;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.history-matchup {
  display: grid;
  gap: 10px;
}

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

.history-side-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
}

.history-side-name span:first-child {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-score-change {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 11px;
}

.history-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  color: var(--ink-soft);
  font-size: 10px;
}

.evidence-link {
  color: var(--jade);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.evidence-link:hover {
  text-decoration: underline;
}

.history-guide {
  position: sticky;
  top: 118px;
  padding: 26px;
}

.history-guide h2 {
  font-size: 24px;
}

.history-guide > p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.guide-rule {
  display: flex;
  gap: 11px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.guide-rule > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--forest);
  background: var(--mint-soft);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
}

.guide-rule p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

.admin-grid > div {
  display: grid;
  gap: 20px;
}

.admin-panel {
  overflow: hidden;
}

.review-list {
  display: grid;
}

.review-card {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.review-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.review-id {
  color: #8b9691;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.review-card h3 {
  margin: 5px 0 0;
  font-size: 16px;
}

.score-grid {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.score-grid th,
.score-grid td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
}

.score-grid tr:last-child td {
  border-bottom: 0;
}

.score-grid th {
  color: var(--ink-soft);
  background: rgba(245, 248, 244, 0.7);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.review-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6f8f5;
  color: var(--ink-soft);
  font-size: 10px;
}

.review-warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(168, 66, 54, 0.14);
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 10px;
  line-height: 1.6;
}

.review-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

.claim-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.claim-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.claim-person p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.admin-player-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-player-tools .search-field {
  flex: 1;
}

.admin-player-tools .search-field input {
  width: 100%;
  min-width: 0;
}

.admin-player-tools > span {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-player-results {
  max-height: 470px;
  overflow-y: auto;
}

.admin-player-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto auto;
  gap: 13px;
  align-items: center;
  padding: 13px 26px;
  border-bottom: 1px solid var(--line);
}

.admin-player-row:last-child {
  border-bottom: 0;
}

.admin-player-row.is-deleted {
  opacity: 0.62;
  background: #faf6f4;
}

.admin-player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-player-identity {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.admin-player-identity:hover strong {
  color: var(--jade);
}

.admin-player-identity:disabled {
  cursor: default;
}

.admin-profile-account {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.admin-profile-account > div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--mint-soft);
}

.admin-profile-account span,
.admin-profile-account strong {
  display: block;
}

.admin-profile-account span {
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-profile-account strong {
  margin-top: 5px;
  font-size: 12px;
  word-break: break-all;
}

.drawer-note {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.admin-player-main strong,
.admin-player-main small {
  display: block;
}

.admin-player-main strong {
  max-width: 250px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-player-main small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-player-score {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  text-align: right;
}

.admin-player-actions {
  display: flex;
  gap: 6px;
}

.admin-player-actions .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 9px;
}

.security-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
}

.security-panel strong,
.security-panel p {
  display: block;
}

.manager-key-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.manager-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 15px 26px;
  border-bottom: 1px solid var(--line);
}

.manager-key-row:last-child {
  border-bottom: 0;
}

.manager-key-row strong,
.manager-key-row small {
  display: block;
}

.manager-key-row strong {
  font-size: 12px;
}

.manager-key-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.manager-key-row.is-inactive {
  opacity: 0.58;
}

.manager-key-row .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 9px;
}

.checkbox-label {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.checkbox-label input {
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
}

.data-tool-panel {
  display: grid;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.data-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-import-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.data-import-upload label {
  display: grid;
  gap: 7px;
  color: #59655f;
  font-size: 10px;
  font-weight: 700;
}

.data-import-upload input {
  width: 100%;
  padding: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: white;
  font-size: 10px;
}

.data-import-status {
  margin: 0;
  color: #7c8984;
  font-size: 10px;
  line-height: 1.65;
}

.import-card-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.import-card-summary span {
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: #f5f7f4;
  font-size: 9px;
}

.security-panel strong {
  margin-top: 6px;
  font-size: 15px;
}

.security-panel p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.audit-panel {
  position: sticky;
  top: 118px;
  padding: 26px;
}

.admin-side {
  position: sticky;
  top: 118px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 138px);
  overflow-y: auto;
  padding-right: 4px;
  align-self: start;
}

.admin-side .audit-panel {
  position: static;
}

.history-side-panel {
  padding: 22px;
}

.history-side-panel h2 {
  font-size: 22px;
}

.side-panel-note {
  margin: 6px 0 16px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.side-history-list {
  display: grid;
  max-height: 420px;
  overflow-y: auto;
}

.side-record {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.side-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.side-record-head strong {
  min-width: 0;
  font-size: 10px;
  line-height: 1.5;
}

.side-record p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.side-record p b {
  color: var(--ink);
}

.side-record small {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 8px;
}

.member-account-row {
  grid-template-columns: minmax(170px, 1fr) minmax(130px, auto) auto;
}

.member-player-ref {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-log {
  display: grid;
  margin-top: 20px;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding-right: 4px;
}

.audit-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.audit-item strong {
  display: block;
  font-size: 11px;
}

.audit-item span {
  display: block;
  margin-top: 4px;
  color: #8a9691;
  font-size: 9px;
}

.audit-details {
  max-height: 180px;
  margin: 8px 0 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--theme-soft, rgba(245, 248, 244, 0.72));
  font-family: "Cascadia Mono", "Microsoft YaHei UI", monospace;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto 28px;
  padding: 22px 4px 0;
  border-top: 1px solid var(--line);
  color: #7b8782;
  font-size: 9px;
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer strong {
  color: var(--ink);
  font-size: 10px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 22, 17, 0.42);
  backdrop-filter: blur(5px);
}

dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: #fbfcf9;
  box-shadow: 0 35px 100px rgba(6, 27, 20, 0.28);
}

dialog::backdrop {
  background: rgba(6, 22, 17, 0.45);
  backdrop-filter: blur(6px);
}

dialog[open] {
  animation: dialog-in 190ms ease both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.modal {
  width: min(620px, calc(100% - 30px));
  border-radius: 26px;
}

.modal-close,
.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.login-modal {
  padding: 38px;
  text-align: center;
}

.login-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin: 0 auto 24px;
}

.qq-glyph {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  color: white;
  background: #1597e5;
  box-shadow: 0 18px 34px rgba(21, 151, 229, 0.25);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(21, 151, 229, 0.17);
  border-radius: 50%;
}

.orbit-one {
  inset: 10px;
}

.orbit-two {
  inset: -4px;
  border-style: dashed;
}

.login-modal h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.04em;
}

.login-modal > p {
  max-width: 460px;
  margin: 12px auto 24px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.login-area {
  margin-bottom: 16px;
}

.login-form {
  display: grid;
  gap: 13px;
  text-align: left;
}

.login-form label,
.match-form label {
  display: grid;
  gap: 7px;
  color: #59655f;
  font-size: 11px;
  font-weight: 700;
}

.login-form label em {
  color: #98a29d;
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
}

.demo-hint {
  padding: 10px 12px;
  border-radius: 10px;
  color: #6f7c76;
  background: #f0f4f0;
  font-size: 10px;
  line-height: 1.6;
}

.quick-login {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.text-button {
  padding: 2px;
  border: 0;
  color: var(--jade);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.submit-modal {
  width: min(790px, calc(100% - 30px));
  padding: 34px;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 42px;
}

.modal-heading h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.04em;
}

.modal-heading p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.own-player-chip {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--forest);
  color: white;
  font-size: 11px;
  line-height: 1.45;
}

.own-player-chip strong,
.own-player-chip span {
  display: block;
}

.own-player-chip span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
}

.match-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.opponent-picker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.opponent-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9px;
}

.opponent-picker-head strong {
  color: var(--jade);
  font-size: 10px;
}

.opponent-results {
  display: grid;
  max-height: 265px;
  overflow-y: auto;
}

.opponent-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.opponent-result:last-child {
  border-bottom: 0;
}

.opponent-result:hover,
.opponent-result.is-selected {
  background: var(--mint-soft);
}

.opponent-result-main {
  min-width: 0;
}

.opponent-result-main strong,
.opponent-result-main small {
  display: block;
}

.opponent-result-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opponent-result-main small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.opponent-result-score {
  color: var(--jade);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.opponent-result-action {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--ink-soft);
  background: var(--theme-surface, #eef2ed);
  font-size: 8px;
  text-align: center;
}

.opponent-result.is-selected .opponent-result-action {
  color: var(--theme-button-ink, white);
  background: var(--forest);
}

.match-form textarea {
  min-height: 82px;
  padding: 12px 13px;
  border-radius: 10px;
  resize: vertical;
}

.match-form label em {
  color: #9ca6a1;
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
}

.calculation-preview {
  min-height: 72px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: #f5f8f4;
  font-size: 11px;
  line-height: 1.7;
}

.match-form-hint {
  margin: -4px 0 0;
  color: #7c8984;
  font-size: 10px;
  line-height: 1.65;
}

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

.preview-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.preview-player {
  padding: 10px 12px;
  border-radius: 10px;
  background: white;
}

.preview-player strong,
.preview-player span {
  display: block;
}

.preview-player span {
  margin-top: 3px;
  color: #7c8984;
  font-size: 9px;
}

.preview-player:last-child {
  text-align: right;
}

.preview-warning {
  color: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.drawer {
  width: min(490px, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-radius: 28px 0 0 28px;
  overflow-y: auto;
}

.drawer[open] {
  animation: drawer-in 230ms ease both;
}

@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.drawer-close {
  position: fixed;
  right: calc(min(490px, 100vw) - 52px);
}

.drawer-profile {
  position: relative;
  padding: 36px 30px 28px;
  color: white;
  background:
    radial-gradient(circle at 85% 5%, rgba(201, 242, 119, 0.22), transparent 34%),
    var(--forest);
}

.drawer-profile .section-kicker {
  color: var(--mint);
}

.drawer-name-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.drawer-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: var(--forest);
  background: var(--lime);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.drawer-name-row h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.drawer-name-row p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.drawer-score {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
}

.drawer-score strong {
  display: block;
  font-family: var(--font-display);
  font-size: 52px;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.drawer-score small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.drawer-score .tier-badge {
  min-height: 32px;
  padding: 0 12px;
  color: var(--forest);
  background: var(--lime);
  font-size: 12px;
}

.drawer-body {
  padding: 25px 28px 34px;
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.drawer-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.drawer-stat span,
.drawer-stat strong {
  display: block;
}

.drawer-stat span {
  color: var(--ink-soft);
  font-size: 9px;
}

.drawer-stat strong {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 18px;
}

.drawer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 12px;
}

.drawer-section-title h3 {
  margin: 0;
  font-size: 14px;
}

.drawer-section-title span {
  color: var(--ink-soft);
  font-size: 9px;
}

.drawer-match {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.drawer-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.drawer-match-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-match-detail {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  color: #8a9691;
  font-size: 9px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.account-modal {
  width: min(560px, calc(100% - 30px));
  padding: 33px;
}

.account-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 32px;
}

.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--forest);
  background: var(--lime);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.account-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 29px;
  letter-spacing: -0.045em;
}

.account-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.account-id-display {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(29, 122, 96, 0.14);
  border-radius: 14px;
  background: var(--mint-soft);
}

.account-id-display span,
.account-id-display strong {
  display: block;
}

.account-id-display span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.account-id-display strong {
  margin-top: 7px;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
}

.account-id-display small {
  display: block;
  margin-top: 6px;
  color: #64726c;
  font-size: 9px;
}

.account-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.account-info {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.account-info span,
.account-info strong {
  display: block;
}

.account-info span {
  color: var(--ink-soft);
  font-size: 9px;
}

.account-info strong {
  margin-top: 6px;
  font-size: 12px;
}

.pending-box {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(30, 94, 133, 0.13);
  border-radius: 12px;
  color: #245d7c;
  background: var(--blue-soft);
  font-size: 10px;
  line-height: 1.65;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.id-modal {
  width: min(520px, calc(100% - 30px));
  padding: 34px;
}

.admin-player-modal {
  width: min(570px, calc(100% - 30px));
  padding: 34px;
}

.hero-edit-modal {
  width: min(570px, calc(100% - 30px));
  padding: 34px;
}

.hero-edit-modal h2 {
  margin: 7px 0 0;
  padding-right: 42px;
  font-family: var(--font-display);
  font-size: 29px;
  letter-spacing: -0.04em;
}

.hero-edit-modal > p {
  margin: 9px 0 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.hero-edit-modal textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 12px;
  resize: vertical;
}

.admin-player-modal h2 {
  margin: 7px 0 0;
  padding-right: 42px;
  font-family: var(--font-display);
  font-size: 29px;
  letter-spacing: -0.04em;
}

.admin-player-modal p {
  margin: 9px 0 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.admin-player-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--mint-soft);
}

.admin-player-summary strong,
.admin-player-summary span {
  display: block;
}

.admin-player-summary span {
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-player-summary b {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 24px;
}

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

.admin-player-form label {
  display: grid;
  gap: 7px;
  color: #59655f;
  font-size: 11px;
  font-weight: 700;
}

.admin-player-form input,
.admin-player-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 12px;
}

.admin-player-form input {
  height: 42px;
  padding: 0 13px;
}

.admin-player-form textarea {
  min-height: 82px;
  padding: 12px 13px;
  resize: vertical;
}

.admin-player-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
}

.id-modal h2 {
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.id-modal > p {
  margin: 10px 0 22px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.id-modal textarea {
  width: 100%;
  min-height: 82px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  resize: vertical;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  gap: 9px;
  width: min(340px, calc(100% - 44px));
}

.toast {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: white;
  background: #123c30;
  box-shadow: 0 18px 42px rgba(6, 27, 20, 0.22);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: #7b3028;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(410px, 0.9fr);
    gap: 30px;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero h1 {
    font-size: clamp(48px, 5.8vw, 68px);
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
  }

  .search-field {
    flex: 1;
  }

  .search-field input {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    width: calc(100% - 24px);
    margin-top: 10px;
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand-copy small,
  .sync-state {
    display: none;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }

  .nav-link {
    flex: 1;
    white-space: nowrap;
  }

  .auth-area {
    gap: 8px;
  }

  main {
    width: calc(100% - 24px);
  }

  .page {
    padding-top: 38px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding-top: 10px;
  }

  .ladder-card {
    min-height: auto;
  }

  .history-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .rule-card-wide {
    grid-column: span 1;
  }

  .mechanic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-guide,
  .audit-panel,
  .admin-side {
    position: static;
  }

  .admin-side {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

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

  .history-search,
  .history-search input {
    width: 100%;
    min-width: 0;
  }

  .site-footer {
    width: calc(100% - 24px);
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer div {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 620px) {
  .topbar {
    border-radius: 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .hero h1 {
    font-size: 45px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button {
    padding: 0 13px;
  }

  .ladder-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .tier-chart {
    gap: 4px;
    padding-right: 0;
    padding-left: 0;
  }

  .podium {
    gap: 6px;
  }

  .podium-card {
    padding: 13px 10px;
  }

  .podium-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .metrics {
    gap: 8px;
  }

  .metric-card {
    padding: 17px 16px;
  }

  .metric-card strong {
    font-size: 28px;
  }

  .panel-heading {
    padding: 22px 18px 18px;
  }

  .table-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tier-tabs {
    padding-right: 18px;
    padding-left: 18px;
  }

  .tier-summary {
    display: none;
  }

  .table-tools .search-field {
    grid-column: span 2;
  }

  .select-field.compact select {
    min-width: 0;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 13px 12px;
  }

  .ranking-table th:first-child,
  .ranking-table td:first-child {
    padding-left: 18px;
  }

  .ranking-table th:last-child,
  .ranking-table td:last-child {
    padding-right: 18px;
  }

  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4),
  .ranking-table th:nth-child(6),
  .ranking-table td:nth-child(6),
  .ranking-table th:nth-child(7),
  .ranking-table td:nth-child(7) {
    display: none;
  }

  .player-cell {
    min-width: 150px;
  }

  .player-name {
    max-width: 150px;
  }

  .pagination {
    padding: 15px 18px;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 18px;
  }

  .history-no {
    display: none;
  }

  .history-meta {
    justify-items: start;
    grid-template-columns: 1fr auto;
  }

  .review-card {
    padding: 20px 18px;
  }

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

  .security-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-panel .button {
    width: 100%;
  }

  .manager-key-row {
    grid-template-columns: 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

  .manager-key-row .button {
    width: 100%;
  }

  .data-import-upload {
    grid-template-columns: 1fr;
  }

  .data-import-upload .button {
    width: 100%;
  }

  .import-card-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .login-modal,
  .submit-modal {
    padding: 28px 20px;
  }

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

  .rules-heading .button {
    width: 100%;
  }

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

  .account-modal,
  .id-modal,
  .admin-player-modal,
  .hero-edit-modal {
    padding: 28px 20px;
  }

  .admin-player-row {
    grid-template-columns: 1fr auto;
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .admin-player-row .tier-badge {
    display: none;
  }

  .admin-player-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .opponent-result {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .opponent-result-action {
    display: none;
  }

  .modal-heading {
    flex-direction: column;
  }

  .own-player-chip {
    width: 100%;
  }

  .preview-versus {
    grid-template-columns: 1fr;
  }

  .preview-player:last-child {
    text-align: left;
  }

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

  .drawer {
    border-radius: 22px 0 0 22px;
  }

  .drawer-close {
    right: 18px;
  }

  .drawer-profile {
    padding-right: 22px;
    padding-left: 22px;
  }

  .drawer-body {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Role-based themes. Layout and typography remain fixed. */
body.theme-admin {
  color-scheme: dark;
  --ink: #f7ecea;
  --ink-soft: #e2c6c3;
  --paper: #100607;
  --panel: rgba(34, 13, 16, 0.9);
  --panel-solid: #231013;
  --line: rgba(255, 145, 145, 0.14);
  --line-strong: rgba(255, 165, 165, 0.25);
  --forest: #541018;
  --forest-deep: #190609;
  --jade: #ff5d68;
  --mint: #ffc7c2;
  --mint-soft: rgba(173, 37, 47, 0.2);
  --lime: #f3aaa5;
  --gold: #d7ad67;
  --gold-soft: rgba(123, 88, 36, 0.28);
  --danger: #ff837d;
  --danger-soft: rgba(151, 41, 46, 0.24);
  --blue-soft: rgba(83, 125, 161, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --shadow-small: 0 12px 34px rgba(0, 0, 0, 0.3);
  --theme-backdrop:
    radial-gradient(circle at 78% 7%, rgba(190, 43, 54, 0.3), transparent 28%),
    radial-gradient(circle at 15% 72%, rgba(101, 19, 29, 0.34), transparent 40%),
    linear-gradient(180deg, #160708 0, #100607 52%, #090405 100%);
  --theme-glass: rgba(19, 8, 10, 0.86);
  --theme-card: rgba(33, 13, 16, 0.93);
  --theme-card-gradient: linear-gradient(145deg, rgba(54, 18, 23, 0.96), rgba(24, 9, 12, 0.96));
  --theme-surface: rgba(66, 22, 27, 0.75);
  --theme-input: #1b0b0d;
  --theme-dialog: #18090c;
  --theme-soft: rgba(154, 35, 45, 0.18);
  --theme-table-head: rgba(77, 24, 31, 0.55);
  --theme-hover: rgba(181, 44, 55, 0.16);
  --theme-button: #64141d;
  --theme-button-hover: #7b1c27;
  --theme-button-ink: #fff1ef;
  --theme-accent-card: #541018;
  --theme-accent-ink: #fff4f2;
  --theme-accent-muted: rgba(255, 238, 236, 0.65);
}

body.theme-superadmin {
  color-scheme: dark;
  --ink: #f7edcf;
  --ink-soft: #e4d6ab;
  --paper: #0a0803;
  --panel: rgba(29, 24, 12, 0.92);
  --panel-solid: #1d180c;
  --line: rgba(229, 195, 102, 0.16);
  --line-strong: rgba(229, 195, 102, 0.3);
  --forest: #30250f;
  --forest-deep: #110d04;
  --jade: #f0cb70;
  --mint: #f1d78f;
  --mint-soft: rgba(192, 150, 53, 0.16);
  --lime: #f2cb68;
  --gold: #e2bb5e;
  --gold-soft: rgba(125, 91, 23, 0.25);
  --danger: #ff8a75;
  --danger-soft: rgba(153, 50, 35, 0.22);
  --blue-soft: rgba(92, 117, 139, 0.15);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --shadow-small: 0 12px 34px rgba(0, 0, 0, 0.36);
  --theme-backdrop:
    radial-gradient(circle at 78% 5%, rgba(230, 187, 73, 0.2), transparent 30%),
    radial-gradient(circle at 12% 72%, rgba(105, 78, 21, 0.25), transparent 42%),
    linear-gradient(180deg, #100d05 0, #0a0803 50%, #060501 100%);
  --theme-glass: rgba(15, 13, 6, 0.9);
  --theme-card: rgba(28, 23, 11, 0.94);
  --theme-card-gradient: linear-gradient(145deg, rgba(44, 36, 16, 0.98), rgba(20, 17, 8, 0.98));
  --theme-surface: rgba(60, 49, 21, 0.72);
  --theme-input: #171208;
  --theme-dialog: #121006;
  --theme-soft: rgba(190, 148, 47, 0.15);
  --theme-table-head: rgba(72, 59, 25, 0.5);
  --theme-hover: rgba(214, 174, 71, 0.12);
  --theme-button: #c39b42;
  --theme-button-hover: #d6ae55;
  --theme-button-ink: #171006;
  --theme-accent-card: #2b210e;
  --theme-accent-ink: #f7dc88;
  --theme-accent-muted: rgba(246, 221, 150, 0.62);
}

body:is(.theme-admin, .theme-superadmin) {
  background: var(--paper);
}

body:is(.theme-admin, .theme-superadmin) .site-backdrop {
  background: var(--theme-backdrop);
}

body:is(.theme-admin, .theme-superadmin) .grid-lines {
  opacity: 0.22;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
}

body:is(.theme-admin, .theme-superadmin) .topbar {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--theme-glass);
  box-shadow: var(--shadow-small);
}

body:is(.theme-admin, .theme-superadmin) .brand-copy strong,
body:is(.theme-admin, .theme-superadmin) .brand-copy small,
body:is(.theme-admin, .theme-superadmin) .nav-link,
body:is(.theme-admin, .theme-superadmin) .sync-state,
body:is(.theme-admin, .theme-superadmin) .logout-button {
  color: var(--ink);
}

body:is(.theme-admin, .theme-superadmin) .brand-copy small,
body:is(.theme-admin, .theme-superadmin) .nav-link,
body:is(.theme-admin, .theme-superadmin) .sync-state {
  color: var(--ink-soft);
}

body:is(.theme-admin, .theme-superadmin) .nav-link:hover,
body:is(.theme-admin, .theme-superadmin) .nav-link.is-active {
  color: var(--jade);
  background: var(--theme-hover);
}

body:is(.theme-admin, .theme-superadmin) .nav-count {
  color: var(--theme-button-ink);
  background: var(--jade);
}

body:is(.theme-admin, .theme-superadmin) .button-primary {
  color: var(--theme-button-ink);
  background: var(--theme-button);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

body:is(.theme-admin, .theme-superadmin) .button-primary:hover {
  background: var(--theme-button-hover);
}

body:is(.theme-admin, .theme-superadmin) .button-secondary,
body:is(.theme-admin, .theme-superadmin) .button-ghost,
body:is(.theme-admin, .theme-superadmin) .user-chip,
body:is(.theme-admin, .theme-superadmin) .icon-button {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .button-secondary:hover,
body:is(.theme-admin, .theme-superadmin) .button-ghost:hover,
body:is(.theme-admin, .theme-superadmin) .user-chip:hover,
body:is(.theme-admin, .theme-superadmin) .icon-button:hover:not(:disabled) {
  border-color: var(--jade);
  background: var(--theme-hover);
}

body:is(.theme-admin, .theme-superadmin) .hero-lead,
body:is(.theme-admin, .theme-superadmin) .formula-note,
body:is(.theme-admin, .theme-superadmin) .last-update,
body:is(.theme-admin, .theme-superadmin) .panel-heading p,
body:is(.theme-admin, .theme-superadmin) .page-heading p,
body:is(.theme-admin, .theme-superadmin) .player-subline,
body:is(.theme-admin, .theme-superadmin) .record-value,
body:is(.theme-admin, .theme-superadmin) .history-meta,
body:is(.theme-admin, .theme-superadmin) .history-guide > p,
body:is(.theme-admin, .theme-superadmin) .guide-rule p,
body:is(.theme-admin, .theme-superadmin) .rule-list li,
body:is(.theme-admin, .theme-superadmin) .mechanic-grid p,
body:is(.theme-admin, .theme-superadmin) .rule-footnote,
body:is(.theme-admin, .theme-superadmin) .site-footer,
body:is(.theme-admin, .theme-superadmin) .site-footer div > span,
body:is(.theme-admin, .theme-superadmin) .data-import-status,
body:is(.theme-admin, .theme-superadmin) .security-panel p {
  color: var(--ink-soft);
}

body:is(.theme-admin, .theme-superadmin) .metric-label,
body:is(.theme-admin, .theme-superadmin) .metric-card small,
body:is(.theme-admin, .theme-superadmin) .tier-column span,
body:is(.theme-admin, .theme-superadmin) .tier-summary,
body:is(.theme-admin, .theme-superadmin) .review-id,
body:is(.theme-admin, .theme-superadmin) .history-no,
body:is(.theme-admin, .theme-superadmin) .podium-meta,
body:is(.theme-admin, .theme-superadmin) .admin-player-main small,
body:is(.theme-admin, .theme-superadmin) .drawer-stat span,
body:is(.theme-admin, .theme-superadmin) .audit-item span,
body:is(.theme-admin, .theme-superadmin) .guide-rule > span {
  color: var(--ink-soft);
}

body:is(.theme-admin, .theme-superadmin) input::placeholder,
body:is(.theme-admin, .theme-superadmin) textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}

body:is(.theme-admin, .theme-superadmin) select option {
  color: var(--ink);
  background: var(--theme-input);
}

body:is(.theme-admin, .theme-superadmin) .status-badge {
  color: #f4dfad;
  border-color: rgba(226, 190, 100, 0.3);
  background: rgba(129, 91, 25, 0.3);
}

body:is(.theme-admin, .theme-superadmin) .status-badge.pending {
  color: #cae7ff;
  border-color: rgba(108, 177, 232, 0.3);
  background: rgba(46, 98, 142, 0.32);
}

body:is(.theme-admin, .theme-superadmin) .status-badge.rejected {
  color: #ffc0ba;
  border-color: rgba(255, 130, 120, 0.28);
  background: rgba(145, 42, 40, 0.32);
}

body:is(.theme-admin, .theme-superadmin) .delta.positive,
body:is(.theme-admin, .theme-superadmin) .result-badge.win {
  color: #a8f4cf;
  background: rgba(36, 113, 80, 0.3);
}

body:is(.theme-admin, .theme-superadmin) .delta.negative,
body:is(.theme-admin, .theme-superadmin) .result-badge.loss {
  color: #ffc0ba;
  background: rgba(152, 43, 42, 0.3);
}

body:is(.theme-admin, .theme-superadmin) .result-badge.draw {
  color: var(--ink-soft);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .promotion-badge {
  color: #ffe1a4;
  background: rgba(132, 92, 23, 0.32);
}

body:is(.theme-admin, .theme-superadmin) .deduction-note {
  color: #cae7ff;
  background: rgba(46, 98, 142, 0.3);
}

body:is(.theme-admin, .theme-superadmin) .ladder-card {
  border-color: var(--line);
  background: var(--theme-card-gradient);
}

body:is(.theme-admin, .theme-superadmin) .metric-card {
  border-color: var(--line);
  background: var(--theme-card);
}

body:is(.theme-admin, .theme-superadmin) .metric-card-accent {
  color: var(--theme-accent-ink);
  background: var(--theme-accent-card);
}

body:is(.theme-admin, .theme-superadmin) .metric-card-accent .metric-label,
body:is(.theme-admin, .theme-superadmin) .metric-card-accent small {
  color: var(--theme-accent-muted);
}

body:is(.theme-admin, .theme-superadmin) .panel,
body:is(.theme-admin, .theme-superadmin) dialog {
  border-color: var(--line);
  background: var(--theme-card);
}

body:is(.theme-admin, .theme-superadmin) dialog {
  color: var(--ink);
  background: var(--theme-dialog);
}

body:is(.theme-admin, .theme-superadmin) .ranking-table th,
body:is(.theme-admin, .theme-superadmin) .rules-table th,
body:is(.theme-admin, .theme-superadmin) .score-grid th {
  color: var(--ink-soft);
  background: var(--theme-table-head);
}

body:is(.theme-admin, .theme-superadmin) .ranking-table tbody tr:hover {
  background: var(--theme-hover);
}

body:is(.theme-admin, .theme-superadmin) .avatar,
body:is(.theme-admin, .theme-superadmin) .account-id-display,
body:is(.theme-admin, .theme-superadmin) .admin-player-summary {
  color: var(--ink);
  background: var(--theme-soft);
}

body:is(.theme-admin, .theme-superadmin) .stage-badge,
body:is(.theme-admin, .theme-superadmin) .tier-T3,
body:is(.theme-admin, .theme-superadmin) .tier-T4,
body:is(.theme-admin, .theme-superadmin) .tier-T5 {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .tier-T0,
body:is(.theme-admin, .theme-superadmin) .tier-T0\.5 {
  color: var(--theme-accent-ink);
  border-color: rgba(214, 177, 103, 0.28);
  background: var(--gold-soft);
}

body:is(.theme-admin, .theme-superadmin) .tier-T1,
body:is(.theme-admin, .theme-superadmin) .tier-T2 {
  color: var(--jade);
  border-color: var(--line);
  background: var(--mint-soft);
}

body:is(.theme-admin, .theme-superadmin) .podium-card,
body:is(.theme-admin, .theme-superadmin) .podium-card:not(:first-child) {
  border-color: var(--line);
  color: var(--ink);
  background: var(--theme-card);
}

body:is(.theme-admin, .theme-superadmin) .podium-card:first-child {
  color: var(--theme-accent-ink);
  background: var(--theme-accent-card);
}

body:is(.theme-admin, .theme-superadmin) .podium-card:not(:first-child) .podium-number {
  color: var(--ink-soft);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .search-field input,
body:is(.theme-admin, .theme-superadmin) .select-field select,
body:is(.theme-admin, .theme-superadmin) .match-form input,
body:is(.theme-admin, .theme-superadmin) .match-form select,
body:is(.theme-admin, .theme-superadmin) .match-form textarea,
body:is(.theme-admin, .theme-superadmin) .login-form input,
body:is(.theme-admin, .theme-superadmin) .id-modal textarea,
body:is(.theme-admin, .theme-superadmin) .admin-player-form input,
body:is(.theme-admin, .theme-superadmin) .admin-player-form textarea,
body:is(.theme-admin, .theme-superadmin) .hero-edit-modal textarea {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--theme-input);
}

body:is(.theme-admin, .theme-superadmin) .calculation-preview,
body:is(.theme-admin, .theme-superadmin) .review-evidence,
body:is(.theme-admin, .theme-superadmin) .demo-hint,
body:is(.theme-admin, .theme-superadmin) .opponent-picker,
body:is(.theme-admin, .theme-superadmin) .account-info,
body:is(.theme-admin, .theme-superadmin) .drawer-stat,
body:is(.theme-admin, .theme-superadmin) .preview-player,
body:is(.theme-admin, .theme-superadmin) .mechanic-grid article,
body:is(.theme-admin, .theme-superadmin) .import-card-summary span {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .formula-block {
  color: var(--jade);
  border-color: var(--line);
  background: var(--theme-soft);
}

body:is(.theme-admin, .theme-superadmin) .rule-list strong,
body:is(.theme-admin, .theme-superadmin) .tier-column strong {
  color: var(--ink);
}

body:is(.theme-admin, .theme-superadmin) .drawer-profile {
  background:
    radial-gradient(circle at 85% 5%, var(--theme-soft), transparent 34%),
    var(--forest-deep);
}

body:is(.theme-admin, .theme-superadmin) .drawer-profile .section-kicker {
  color: var(--jade);
}

body:is(.theme-admin, .theme-superadmin) .drawer-avatar {
  color: var(--theme-button-ink);
  background: var(--jade);
}

body:is(.theme-admin, .theme-superadmin) .modal-close,
body:is(.theme-admin, .theme-superadmin) .drawer-close {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--theme-surface);
}

body:is(.theme-admin, .theme-superadmin) .data-import-upload input,
body:is(.theme-admin, .theme-superadmin) .data-tool-panel {
  border-color: var(--line);
  color: var(--ink-soft);
  background: transparent;
}

body:is(.theme-admin, .theme-superadmin) .security-panel strong,
body:is(.theme-admin, .theme-superadmin) .account-info strong,
body:is(.theme-admin, .theme-superadmin) .admin-player-main strong {
  color: var(--ink);
}

body:is(.theme-admin, .theme-superadmin) .empty-state,
body:is(.theme-admin, .theme-superadmin) .table-empty,
body:is(.theme-admin, .theme-superadmin) .page-heading,
body:is(.theme-admin, .theme-superadmin) .panel-heading,
body:is(.theme-admin, .theme-superadmin) .history-guide,
body:is(.theme-admin, .theme-superadmin) .audit-panel {
  color: var(--ink-soft);
}

body:is(.theme-admin, .theme-superadmin) .toast {
  border-color: var(--line-strong);
  background: var(--theme-surface);
}

body.theme-superadmin .brand-mark {
  background: #171207;
}

body.theme-superadmin .hero h1 .hero-line-two,
body.theme-superadmin .section-kicker,
body.theme-superadmin .eyebrow {
  color: var(--gold);
}

body.theme-superadmin .tier-tab.is-active {
  color: #171006;
  background: var(--gold);
}

body.theme-superadmin .status-badge,
body.theme-superadmin .tier-badge {
  font-weight: 800;
}

body.theme-superadmin .metric-card-accent small,
body.theme-superadmin .metric-card-accent .metric-label {
  color: #ebd28f;
}

body.theme-superadmin .result-badge.win {
  color: #171006;
  background: var(--gold);
}

body.theme-superadmin .toast {
  color: #f7edcf;
  background: #221b0b;
}
