/* Auth, stats, leaderboard, modals — Step 4 split from index.html */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.auth-overlay[hidden] {
  display: none !important;
}
.btn--stats-panel {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #3d4a5c 0%, #2a3340 100%);
  color: #e8e0d0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.stats-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
}
.stats-panel-overlay[hidden] {
  display: none !important;
}
.stats-panel-card {
  position: relative;
  width: min(100%, 680px);
  height: min(88vh, 780px);
  max-height: min(88vh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  --stats-fs-body: clamp(14px, 3.5vw, 16px);
  --stats-fs-value: clamp(15px, 3.8vw, 18px);
  --stats-fs-sub: clamp(12px, 3vw, 14px);
  --stats-fs-meta: clamp(12px, 2.8vw, 13px);
  --stats-fs-section: clamp(13px, 3.1vw, 15px);
  --stats-muted: rgba(236, 230, 218, 0.68);
  --stats-muted-soft: rgba(236, 230, 218, 0.55);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(143, 212, 255, 0.1) 0%, transparent 55%),
    linear-gradient(168deg, #252f3f 0%, #141b26 48%, #0e131c 100%);
  border: 1px solid rgba(143, 212, 255, 0.22);
  border-radius: 18px;
  padding: 0;
  color: #ece6da;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.stats-panel-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(143, 212, 255, 0.12);
  flex: 0 0 auto;
}
.stats-panel-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.stats-panel-card__head h2 {
  margin: 0;
  font-size: clamp(20px, 4.2vw, 24px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #b8e4ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.stats-panel-card__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(236, 230, 218, 0.85);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.stats-panel-card__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.stats-help-wrap {
  position: relative;
  flex: 0 0 auto;
}
.stats-help-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(143, 212, 255, 0.35);
  background: rgba(143, 212, 255, 0.1);
  color: #b8e4ff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.stats-help-btn:hover,
.stats-help-btn:focus-visible,
.stats-help-btn.is-open {
  background: rgba(143, 212, 255, 0.18);
  color: #dff4ff;
}
.stats-help-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 12;
  width: min(92vw, 340px);
  padding: 12px 14px;
  background: rgba(12, 18, 28, 0.97);
  border: 1px solid rgba(143, 212, 255, 0.28);
  border-radius: 10px;
  font-size: var(--stats-fs-meta);
  line-height: 1.55;
  color: rgba(236, 230, 218, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.stats-help-bubble[hidden] {
  display: none !important;
}
.stats-help-bubble p {
  margin: 0 0 8px;
}
.stats-help-bubble p:last-child {
  margin-bottom: 0;
}
.stats-help-bubble strong {
  color: #b8e4ff;
}
.stats-panel-card__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
}
.stats-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 4px 10px;
  flex: 0 0 auto;
}
.stats-tabs__btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(236, 230, 218, 0.82);
  font-size: var(--stats-fs-body);
  font-weight: 600;
  cursor: pointer;
}
.stats-tabs__btn.is-active {
  border-color: rgba(143, 212, 255, 0.35);
  background: rgba(143, 212, 255, 0.12);
  color: #dff4ff;
}
.stats-tab-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 4px 4px;
}
#statsPanelOverview {
  overflow-y: auto;
}
#statsPanelCurves {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stats-tab-panel[hidden] {
  display: none !important;
}
.stats-section-title {
  margin: 12px 0 8px;
  font-size: var(--stats-fs-section);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(184, 228, 255, 0.88);
}
.stats-section-title:first-child {
  margin-top: 4px;
}
.stats-section-title__hint {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--stats-muted-soft);
  margin-left: 6px;
  font-size: 0.92em;
}
.stats-grid {
  display: grid;
  gap: 10px;
}
.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 14px;
  font-size: var(--stats-fs-body);
  line-height: 1.5;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-row__k {
  color: rgba(236, 230, 218, 0.9);
}
.stats-row__k-sub {
  display: block;
  margin-top: 4px;
  font-size: var(--stats-fs-sub);
  color: var(--stats-muted);
  font-weight: 400;
  line-height: 1.45;
}
.stats-row__v-wrap {
  text-align: right;
}
.stats-row__v {
  font-weight: 700;
  font-size: var(--stats-fs-value);
  color: #f5ead8;
}
.stats-row__ref {
  display: block;
  margin-top: 4px;
  font-size: var(--stats-fs-meta);
  font-weight: 500;
  color: var(--stats-muted);
  line-height: 1.4;
}
.stats-row__extra-ref {
  display: block;
  margin-top: 4px;
  font-size: var(--stats-fs-meta);
  font-weight: 600;
  color: rgba(143, 212, 255, 0.82);
  line-height: 1.4;
}
.stats-row__pending {
  display: block;
  margin-top: 4px;
  font-size: var(--stats-fs-meta);
  font-weight: 500;
  color: var(--stats-muted-soft);
  line-height: 1.45;
}
.stats-row--pending .stats-row__v {
  color: rgba(236, 230, 218, 0.55);
}
.stats-ref--ok {
  color: rgba(125, 206, 160, 0.92);
}
.stats-ref--warn {
  color: rgba(255, 215, 140, 0.88);
}
.stats-ref--bad {
  color: rgba(255, 140, 130, 0.92);
}
.stats-image-block {
  padding: 12px 11px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(143, 212, 255, 0.12);
}
.stats-image-block__label {
  margin: 0 0 6px;
  font-size: var(--stats-fs-section);
  font-weight: 700;
  color: rgba(184, 228, 255, 0.88);
  letter-spacing: 0.06em;
}
.stats-image-block__title {
  margin: 0 0 6px;
  font-size: clamp(17px, 4.2vw, 20px);
  font-weight: 800;
  color: #f5ead8;
}
.stats-image-block__title.is-unstable {
  font-size: clamp(16px, 3.8vw, 18px);
  color: rgba(236, 230, 218, 0.92);
}
.stats-image-block__def,
.stats-image-block__insight {
  margin: 0 0 6px;
  font-size: var(--stats-fs-body);
  line-height: 1.55;
  color: rgba(236, 230, 218, 0.82);
}
.stats-image-top3 {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.stats-image-top3 li {
  font-size: var(--stats-fs-body);
  line-height: 1.55;
  color: rgba(236, 230, 218, 0.86);
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-image-top3 li:first-child {
  border-top: none;
  padding-top: 0;
}
.stats-image-top3__match {
  color: rgba(184, 228, 255, 0.85);
  font-weight: 600;
}
.stats-position-block {
  margin-top: 12px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.stats-position-block__summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 13px;
  font-size: var(--stats-fs-section);
  font-weight: 700;
  color: rgba(184, 228, 255, 0.88);
  letter-spacing: 0.04em;
}
.stats-position-block__summary::-webkit-details-marker {
  display: none;
}
.stats-position-block__summary::before {
  content: "▸ ";
  color: rgba(143, 212, 255, 0.7);
}
.stats-position-block[open] .stats-position-block__summary::before {
  content: "▾ ";
}
.stats-position-block__body {
  padding: 0 13px 12px;
  font-size: var(--stats-fs-body);
  line-height: 1.55;
  color: rgba(236, 230, 218, 0.82);
}
.stats-position-block__body p {
  margin: 0 0 8px;
}
.stats-position-block__body strong {
  color: rgba(236, 230, 218, 0.95);
  font-weight: 700;
}
.stats-position-block__soon {
  margin: 4px 0 0 !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(143, 212, 255, 0.75);
}
#statsPanelCheatsheet {
  overflow-y: auto;
}
.stats-cheatsheet__intro,
.stats-cheatsheet__foot {
  margin: 0 0 12px;
  font-size: var(--stats-fs-body);
  line-height: 1.55;
  color: rgba(236, 230, 218, 0.86);
}
.stats-cheatsheet__foot {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: var(--stats-fs-meta);
  color: var(--stats-muted);
}
.stats-cheatsheet__table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stats-cheatsheet__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--stats-fs-meta);
  line-height: 1.45;
}
.stats-cheatsheet__table th,
.stats-cheatsheet__table td {
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-cheatsheet__table th {
  background: rgba(143, 212, 255, 0.1);
  color: rgba(184, 228, 255, 0.92);
  font-weight: 700;
  white-space: nowrap;
}
.stats-cheatsheet__table td {
  color: rgba(236, 230, 218, 0.88);
}
.stats-cheatsheet__table tr:last-child td {
  border-bottom: none;
}
.stats-cheatsheet__table td:first-child {
  font-weight: 700;
  color: #f5ead8;
  white-space: nowrap;
}
.stats-radar-block {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-radar-block__head {
  margin-bottom: 8px;
}
.stats-radar-block__title {
  margin: 0 0 4px;
  font-size: var(--stats-fs-body);
  font-weight: 700;
  color: rgba(236, 230, 218, 0.92);
}
.stats-radar-block__intro {
  margin: 0;
  font-size: var(--stats-fs-meta);
  line-height: 1.5;
  color: var(--stats-muted);
}
.stats-radar-block__canvas {
  margin: 0 auto;
  max-width: 280px;
}
.stats-diagnostic {
  margin: 12px 0 0;
  padding: 12px 14px;
  font-size: var(--stats-fs-body);
  line-height: 1.55;
  color: rgba(255, 228, 180, 0.96);
  background: rgba(255, 215, 140, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 140, 0.22);
}
.stats-diagnostic[hidden] {
  display: none !important;
}
.stats-panel-note {
  margin: 12px 0 0;
  font-size: var(--stats-fs-meta);
  color: var(--stats-muted);
  line-height: 1.5;
}
.stats-charts {
  display: grid;
  gap: 12px;
}
#statsPanelCurves .stats-charts {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#statsPanelCurves .stats-chart-box {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
}
#statsPanelCurves .stats-chart-title {
  margin: 0 0 2px;
  font-size: var(--stats-fs-meta);
}
#statsPanelCurves .stats-chart-desc {
  margin: 0 0 4px;
  font-size: var(--stats-fs-meta);
  line-height: 1.4;
  color: var(--stats-muted);
}
#statsPanelCurves .stats-chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 72px;
  height: auto;
}
.stats-charts.is-muted .stats-chart-box canvas {
  opacity: 0.38;
}
.stats-charts-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 215, 140, 0.85);
  background: rgba(255, 215, 140, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 140, 0.16);
}
.stats-charts-hint[hidden] {
  display: none !important;
}
.stats-chart-box {
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-chart-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(236, 230, 218, 0.88);
}
.stats-chart-desc {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(236, 230, 218, 0.42);
}
.stats-chart-sub {
  margin: 8px 0 0;
  font-size: var(--stats-fs-meta);
  color: var(--stats-muted);
  line-height: 1.45;
  text-align: center;
}
.stats-chart-canvas-wrap {
  position: relative;
  height: 140px;
}
.stats-chart-canvas-wrap--radar {
  height: 200px;
}
.stats-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.btn--leaderboard {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a3d2c 0%, #2a2418 100%);
  color: #ffd78c;
  border: 1px solid rgba(255, 215, 140, 0.22);
}
.leaderboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
}
.leaderboard-overlay[hidden] {
  display: none !important;
}
.leaderboard-card {
  position: relative;
  width: min(100%, 680px);
  height: min(88vh, 780px);
  min-height: min(88vh, 780px);
  max-height: min(88vh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 215, 140, 0.12) 0%, transparent 55%),
    linear-gradient(168deg, #252f3f 0%, #141b26 48%, #0e131c 100%);
  border: 1px solid rgba(255, 215, 140, 0.28);
  border-radius: 18px;
  padding: 0;
  color: #ece6da;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.leaderboard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255, 215, 140, 0.12);
  flex: 0 0 auto;
}
.leaderboard-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.leaderboard-card__head h2 {
  margin: 0;
  font-size: clamp(20px, 4.2vw, 24px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffe4a8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.leaderboard-card__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(236, 230, 218, 0.85);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.leaderboard-card__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.leaderboard-help-wrap {
  position: relative;
  flex: 0 0 auto;
}
.leaderboard-help-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 140, 0.35);
  background: rgba(255, 215, 140, 0.1);
  color: #ffe4a8;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}
.leaderboard-help-btn:hover,
.leaderboard-help-btn:focus-visible {
  background: rgba(255, 215, 140, 0.2);
  border-color: rgba(255, 215, 140, 0.55);
  outline: none;
}
.leaderboard-help-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 5;
  width: min(92vw, 320px);
  padding: 12px 14px;
  background: rgba(14, 18, 26, 0.98);
  border: 1px solid rgba(255, 215, 140, 0.28);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(236, 230, 218, 0.9);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.leaderboard-help-bubble p {
  margin: 0 0 8px;
}
.leaderboard-help-bubble p:last-child {
  margin-bottom: 0;
}
.leaderboard-help-bubble strong {
  color: #ffe4a8;
  font-weight: 800;
}
.leaderboard-help-wrap:hover .leaderboard-help-bubble,
.leaderboard-help-wrap:focus-within .leaderboard-help-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.leaderboard-card__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 0;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.leaderboard-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  font-size: clamp(14px, 3.2vw, 16px);
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(236, 230, 218, 0.72);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.leaderboard-tabs button.is-active {
  background: linear-gradient(180deg, #5c4a32 0%, #3a2f1f 100%);
  border-color: rgba(255, 215, 140, 0.45);
  color: #ffe4a8;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.leaderboard-intro[hidden] {
  display: none !important;
}
.leaderboard-me {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 215, 140, 0.14) 0%, rgba(255, 215, 140, 0.05) 100%);
  border: 1px solid rgba(255, 215, 140, 0.28);
  flex: 0 0 auto;
}
.leaderboard-me[hidden] {
  display: none !important;
}
.leaderboard-me__label {
  font-size: clamp(13px, 2.8vw, 15px);
  font-weight: 700;
  color: #ffe4a8;
  margin-bottom: 8px;
}
.leaderboard-list {
  display: grid;
  gap: 8px;
  align-content: start;
  margin: 14px 18px 0;
  padding: 0 4px 8px 0;
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
}
.leaderboard-row {
  display: grid;
  grid-template-columns:
    42px minmax(72px, 1.25fr) minmax(56px, 0.85fr) minmax(64px, 1fr) minmax(48px, 0.65fr)
    minmax(76px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: clamp(13px, 3vw, 15px);
  line-height: 1.35;
}
.leaderboard-row--head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(20, 27, 38, 0.96);
  padding: 6px 12px 8px;
  border: none;
  border-radius: 8px;
  font-size: clamp(12px, 2.6vw, 14px);
  color: rgba(236, 230, 218, 0.55);
  font-weight: 700;
}
.leaderboard-row--head .leaderboard-row__rank {
  color: rgba(236, 230, 218, 0.55);
}
.leaderboard-row--top1 {
  background: linear-gradient(90deg, rgba(255, 215, 100, 0.18) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 215, 140, 0.35);
}
.leaderboard-row--top2 {
  background: linear-gradient(90deg, rgba(192, 200, 212, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(192, 200, 212, 0.28);
}
.leaderboard-row--top3 {
  background: linear-gradient(90deg, rgba(205, 140, 90, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(205, 140, 90, 0.28);
}
.leaderboard-row--me {
  box-shadow: 0 0 0 1px rgba(255, 215, 140, 0.35) inset;
}
.leaderboard-row__rank {
  font-weight: 800;
  font-size: clamp(15px, 3.4vw, 18px);
  color: #ffe4a8;
  text-align: center;
}
.leaderboard-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #f7f2ea;
}
.leaderboard-row__cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(245, 238, 226, 0.92);
}
.leaderboard-row__cell--tier {
  text-align: center;
  font-weight: 700;
  color: #ffd78c;
}
.leaderboard-row__cell--metric {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.leaderboard-row__cell--region {
  text-align: center;
  color: rgba(236, 230, 218, 0.78);
}
.leaderboard-row__cell--time {
  text-align: right;
  font-size: clamp(12px, 2.6vw, 13px);
  color: rgba(236, 230, 218, 0.68);
  font-variant-numeric: tabular-nums;
}
.leaderboard-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: clamp(14px, 3.2vw, 16px);
  color: rgba(236, 230, 218, 0.55);
}
.leaderboard-note {
  margin: 0;
  padding: 12px 18px 16px;
  text-align: center;
  font-size: clamp(12px, 2.6vw, 13px);
  color: rgba(236, 230, 218, 0.42);
  flex: 0 0 auto;
}
.tier-promote-overlay {
  position: fixed;
  inset: 0;
  z-index: 10004;
  background: radial-gradient(ellipse at center, rgba(30, 50, 90, 0.88) 0%, rgba(0, 0, 0, 0.9) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tier-promote-overlay[hidden] {
  display: none !important;
}
.tier-promote-card {
  width: min(100%, 400px);
  text-align: center;
  background: linear-gradient(165deg, #243048 0%, #141c28 100%);
  border: 2px solid rgba(120, 180, 255, 0.45);
  border-radius: 16px;
  padding: 28px 22px 24px;
  color: #e8f0ff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.tier-promote-card__icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.tier-promote-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: #a8d4ff;
}
.tier-promote-card p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(232, 240, 255, 0.9);
}
.bankrupt-bubble-anchor {
  position: fixed;
  z-index: 10001;
  width: max-content;
  max-width: min(248px, 88vw);
  pointer-events: auto;
  margin: 0;
  transform: none;
}
.bankrupt-bubble-anchor[hidden] {
  display: none !important;
}
.bankrupt-card {
  background: linear-gradient(165deg, rgba(30, 36, 51, 0.97) 0%, rgba(21, 26, 38, 0.98) 100%);
  border: 1px solid rgba(255, 180, 100, 0.45);
  border-radius: 12px;
  padding: 12px 14px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(0, 0, 0, 0.2);
  color: #f0e6d8;
  backdrop-filter: blur(6px);
}
.bankrupt-card h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd89a;
  line-height: 1.35;
}
.bankrupt-card p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(240, 230, 216, 0.88);
}
.bankrupt-card__hand {
  display: block;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  color: #e8f4ff;
  line-height: 1.45;
}
.bankrupt-card__chips {
  font-weight: 700;
  color: #ff6b6b;
}
.bankrupt-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bankrupt-card__actions .btn {
  width: 100%;
  font-size: 12px;
  padding: 7px 10px;
  min-height: 36px;
}
.btn--bankrupt-leave {
  background: linear-gradient(180deg, #4a4f5c 0%, #2e3340 100%);
  border-color: rgba(255, 255, 255, 0.15);
}
.clear-table-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: radial-gradient(ellipse at center, rgba(40, 28, 8, 0.92) 0%, rgba(0, 0, 0, 0.88) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.clear-table-overlay[hidden] {
  display: none !important;
}
.clear-table-card {
  width: min(100%, 420px);
  text-align: center;
  background: linear-gradient(165deg, #2a2218 0%, #141820 55%, #0f141c 100%);
  border: 2px solid rgba(255, 215, 120, 0.45);
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 200, 80, 0.12);
  color: #f5e8d0;
}
.clear-table-card__icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}
.clear-table-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffd56a;
  text-shadow: 0 2px 12px rgba(255, 200, 60, 0.35);
}
.clear-table-card p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(245, 232, 208, 0.9);
}
.clear-table-card .btn--clear-continue {
  min-width: 200px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
}
.auth-card {
  width: min(100%, 380px);
  max-width: min(100%, 380px);
  flex: 0 0 auto;
  margin: auto;
  background: linear-gradient(165deg, #1e2433 0%, #151a26 100%);
  border: 1px solid rgba(255, 215, 140, 0.25);
  border-radius: 14px;
  padding: 20px 22px 22px;
  color: #e8e4dc;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  position: relative;
  box-sizing: border-box;
}
.auth-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #ffd78c;
}
.auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.auth-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 140, 0.2);
  background: transparent;
  color: #b8b4a8;
  cursor: pointer;
  font-size: 13px;
}
.auth-tab.is-active {
  background: rgba(255, 215, 140, 0.12);
  color: #ffd78c;
  border-color: rgba(255, 215, 140, 0.45);
}
.auth-pane label {
  display: block;
  font-size: 12px;
  color: #9a9688;
  margin-bottom: 10px;
}
.auth-pane input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #f5f1e6;
  font-size: 14px;
  box-sizing: border-box;
}
.auth-pane select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #f5f1e6;
  font-size: 14px;
  box-sizing: border-box;
}
form.auth-pane {
  margin: 0;
}
.auth-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: #9ec5ff;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
}
.auth-link:hover {
  color: #c8ddff;
}
.auth-forgot-q {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 215, 140, 0.08);
  border: 1px solid rgba(255, 215, 140, 0.2);
  font-size: 13px;
  line-height: 1.45;
  color: #f0ead8;
}
.auth-pane .btn {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, #c9a227 0%, #8a6d18 100%);
  color: #1a1204;
}
.auth-pane .btn:hover {
  filter: brightness(1.06);
}
.auth-error {
  color: #ff8a80;
  font-size: 12px;
  margin: 8px 0 0;
}
.auth-guest-hint {
  font-size: 12px;
  color: #9a9688;
  margin-top: 12px;
  line-height: 1.45;
}
.auth-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 12px;
  color: rgba(255, 245, 220, 0.88);
  margin-right: 8px;
}
.auth-status-line .btn--ghost {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 140, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #ffd78c;
  cursor: pointer;
}
.auth-status-line .btn--ghost:hover {
  background: rgba(255, 215, 140, 0.1);
}
.auth-status-line .btn--ghost-danger {
  color: #ffb4a8;
  border-color: rgba(255, 120, 100, 0.45);
}
.auth-status-line .btn--ghost-danger:hover {
  background: rgba(180, 40, 40, 0.25);
  color: #ffe0dc;
}
.auth-btn--guest {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 140, 0.35);
  background: transparent;
  color: #ffd78c;
  cursor: pointer;
  font-size: 13px;
}
.auth-btn--guest:hover {
  background: rgba(255, 215, 140, 0.08);
}
  
